@defra/interactive-map 0.0.3-alpha → 0.0.4-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/README.md +16 -57
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/button-definition.md +176 -0
- package/docs/api/context.md +124 -0
- package/docs/api/control-definition.md +72 -0
- package/docs/api/icon-definition.md +28 -0
- package/docs/api/map-style-config.md +76 -0
- package/docs/api/marker-config.md +51 -0
- package/docs/api/panel-definition.md +117 -0
- package/docs/api/slots.md +25 -0
- package/docs/api.md +713 -0
- package/docs/architecture.md +139 -0
- package/docs/building-a-plugin.md +149 -0
- package/docs/getting-started.md +46 -0
- package/docs/govuk-prototype.md +0 -0
- package/docs/plugins/interact.md +205 -0
- package/docs/plugins/map-styles.md +84 -0
- package/docs/plugins/plugin-context.md +67 -0
- package/docs/plugins/plugin-descriptor.md +71 -0
- package/docs/plugins/plugin-manifest.md +118 -0
- package/docs/plugins/scale-bar.md +62 -0
- package/docs/plugins/search.md +162 -0
- package/docs/plugins.md +116 -0
- package/govuk-prototype-kit.config.json +7 -7
- package/package.json +14 -1
- package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +1 -0
- package/plugins/beta/datasets/dist/esm/index.js +2 -0
- package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +1 -0
- package/plugins/beta/datasets/dist/umd/index.js +2 -0
- package/plugins/{datasets → beta/datasets}/src/manifest.js +1 -1
- package/plugins/{datasets → beta/datasets}/src/mapLayers.js +1 -1
- package/plugins/{datasets → beta/datasets}/src/panels/Key.jsx +1 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -0
- package/plugins/beta/draw-ml/dist/esm/index.js +2 -0
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -0
- package/plugins/beta/draw-ml/dist/umd/index.js +2 -0
- package/plugins/{draw-ml → beta/draw-ml}/src/api/editFeature.js +1 -1
- package/plugins/beta/draw-ml/src/api/merge.js +9 -0
- package/plugins/beta/draw-ml/src/api/newLine.js +43 -0
- package/plugins/{draw-ml → beta/draw-ml}/src/api/newPolygon.js +5 -5
- package/plugins/beta/draw-ml/src/api/split.js +81 -0
- package/plugins/{draw-ml → beta/draw-ml}/src/defaults.js +2 -0
- package/plugins/{draw-ml → beta/draw-ml}/src/events.js +105 -3
- package/plugins/{draw-ml → beta/draw-ml}/src/manifest.js +17 -11
- package/plugins/{draw-ml → beta/draw-ml}/src/mapboxDraw.js +51 -2
- package/plugins/{draw-ml → beta/draw-ml}/src/mapboxSnap.js +2 -0
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +496 -0
- package/plugins/beta/draw-ml/src/modes/drawLineMode.js +18 -0
- package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +16 -0
- package/plugins/beta/draw-ml/src/modes/editVertexMode.js +792 -0
- package/plugins/{draw-ml → beta/draw-ml}/src/reducer.js +30 -2
- package/plugins/{draw-ml → beta/draw-ml}/src/styles.js +66 -36
- package/plugins/beta/draw-ml/src/undoStack.js +50 -0
- package/plugins/beta/draw-ml/src/utils/debounce.js +16 -0
- package/plugins/beta/draw-ml/src/utils/spatial.js +258 -0
- package/plugins/beta/frame/dist/esm/im-frame-plugin.js +1 -0
- package/plugins/beta/frame/dist/esm/index.js +2 -0
- package/plugins/beta/frame/dist/umd/im-frame-plugin.js +1 -0
- package/plugins/beta/frame/dist/umd/index.js +2 -0
- package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +1 -0
- package/plugins/beta/map-styles/dist/esm/index.js +2 -0
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -0
- package/plugins/beta/map-styles/dist/umd/index.js +2 -0
- package/plugins/{map-styles → beta/map-styles}/src/MapStyles.jsx +1 -1
- package/plugins/{map-styles → beta/map-styles}/src/manifest.js +8 -10
- package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +1 -0
- package/plugins/beta/scale-bar/dist/esm/index.js +2 -0
- package/plugins/beta/scale-bar/dist/umd/im-scale-bar-plugin.js +1 -0
- package/plugins/beta/scale-bar/dist/umd/index.js +2 -0
- package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +1 -0
- package/plugins/beta/use-location/dist/esm/index.js +2 -0
- package/plugins/beta/use-location/dist/umd/im-use-location-plugin.js +1 -0
- package/plugins/beta/use-location/dist/umd/index.js +2 -0
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/esm/index.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/index.js +1 -1
- package/plugins/interact/src/InteractInit.test.js +97 -0
- package/plugins/interact/src/api/clear.test.js +18 -0
- package/plugins/interact/src/api/disable.test.js +12 -0
- package/plugins/interact/src/api/enable.test.js +48 -0
- package/plugins/interact/src/api/selectFeature.test.js +33 -0
- package/plugins/interact/src/api/unselectFeature.test.js +33 -0
- package/plugins/interact/src/defaults.js +1 -0
- package/plugins/interact/src/events.test.js +151 -0
- package/plugins/interact/src/hooks/useHighlightSync.test.js +212 -0
- package/plugins/interact/src/hooks/useInteractionHandlers.js +14 -7
- package/plugins/interact/src/hooks/useInteractionHandlers.test.js +260 -0
- package/plugins/interact/src/index.test.js +22 -0
- package/plugins/interact/src/manifest.js +1 -1
- package/plugins/interact/src/manifest.test.js +94 -0
- package/plugins/interact/src/reducer.js +10 -1
- package/plugins/interact/src/reducer.test.js +142 -0
- package/plugins/interact/src/utils/buildStylesMap.test.js +57 -0
- package/plugins/interact/src/utils/featureQueries.test.js +56 -0
- package/plugins/interact/src/utils/turfHelpers.js +30 -0
- package/plugins/interact/src/utils/turfHelpers.test.js +30 -0
- 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/utils/parseOsNamesResults.js +3 -7
- package/providers/{esri → beta/esri}/src/mapEvents.js +2 -2
- package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +2 -0
- package/providers/beta/open-names/dist/esm/index.js +2 -0
- package/providers/beta/open-names/dist/umd/im-reverse-geocode.js +2 -0
- package/providers/beta/open-names/dist/umd/index.js +2 -0
- package/providers/maplibre/dist/esm/im-maplibre-framework.js +1 -1
- package/providers/maplibre/dist/esm/im-maplibre-framework.js.LICENSE.txt +1 -1
- package/providers/maplibre/dist/esm/im-maplibre-legacy-framework.js +1 -1
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-framework.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-framework.js.LICENSE.txt +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-legacy-framework.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/index.js +14 -1
- package/providers/maplibre/src/maplibreProvider.js +127 -0
- package/sonar-project.properties +1 -1
- package/src/App/hooks/useInterfaceAPI.js +24 -1
- package/src/App/renderer/mapButtons.js +1 -1
- package/src/App/store/appActionsMap.js +22 -1
- package/src/InteractiveMap/InteractiveMap.js +114 -6
- package/src/config/defaults.js +29 -20
- package/src/config/events.js +110 -4
- package/src/index.js +5 -2
- package/src/scss/tools/_border-focus.scss +20 -4
- package/src/types.js +585 -0
- package/webpack.esm.mjs +8 -8
- package/webpack.umd.mjs +8 -8
- package/plugins/datasets/dist/esm/im-datasets-plugin.js +0 -1
- package/plugins/datasets/dist/esm/index.js +0 -2
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +0 -1
- package/plugins/datasets/dist/umd/index.js +0 -2
- package/plugins/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
- package/plugins/draw-ml/dist/esm/index.js +0 -2
- package/plugins/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
- package/plugins/draw-ml/dist/umd/index.js +0 -2
- package/plugins/draw-ml/src/modes/drawVertexMode.js +0 -275
- package/plugins/draw-ml/src/modes/editVertexMode.js +0 -426
- package/plugins/draw-ml/src/utils.js +0 -102
- package/plugins/frame/dist/esm/im-frame-plugin.js +0 -1
- package/plugins/frame/dist/esm/index.js +0 -2
- package/plugins/frame/dist/umd/im-frame-plugin.js +0 -1
- package/plugins/frame/dist/umd/index.js +0 -2
- package/plugins/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
- package/plugins/map-styles/dist/esm/index.js +0 -2
- package/plugins/map-styles/dist/umd/im-map-styles-plugin.js +0 -1
- package/plugins/map-styles/dist/umd/index.js +0 -2
- package/plugins/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
- package/plugins/scale-bar/dist/esm/index.js +0 -2
- package/plugins/scale-bar/dist/umd/im-scale-bar-plugin.js +0 -1
- package/plugins/scale-bar/dist/umd/index.js +0 -2
- package/plugins/use-location/dist/esm/im-use-location-plugin.js +0 -1
- package/plugins/use-location/dist/esm/index.js +0 -2
- package/plugins/use-location/dist/umd/im-use-location-plugin.js +0 -1
- package/plugins/use-location/dist/umd/index.js +0 -2
- package/providers/open-names/dist/esm/im-reverse-geocode.js +0 -2
- package/providers/open-names/dist/esm/index.js +0 -2
- package/providers/open-names/dist/umd/im-reverse-geocode.js +0 -2
- package/providers/open-names/dist/umd/index.js +0 -2
- /package/docs/architecture/{ARCHITECTURE_DIAGRAMS.md → architecture-diagrams.md} +0 -0
- /package/plugins/{datasets → beta/datasets}/dist/css/index.css +0 -0
- /package/plugins/{datasets → beta/datasets}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{datasets → beta/datasets}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{datasets → beta/datasets}/src/DatasetsInit.jsx +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/addDataset.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/hideDataset.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/hideFeatures.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/removeDataset.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/showDataset.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/api/showFeatures.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/datasets.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/datasets.scss +0 -0
- /package/plugins/{datasets → beta/datasets}/src/defaults.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/handleSetMapStyle.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/index.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/panels/Key.module.scss +0 -0
- /package/plugins/{datasets → beta/datasets}/src/panels/Layers.jsx +0 -0
- /package/plugins/{datasets → beta/datasets}/src/panels/Layers.module.scss +0 -0
- /package/plugins/{datasets → beta/datasets}/src/reducer.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/utils/bbox.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/utils/debounce.js +0 -0
- /package/plugins/{datasets → beta/datasets}/src/utils/filters.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/DrawInit.jsx +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/api/addFeature.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/api/deleteFeature.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/api/editFeature.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/api/newPolygon.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/events.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/graphic.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/index.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/manifest.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/reducer.js +0 -0
- /package/plugins/{draw-es → beta/draw-es}/src/sketchViewModel.js +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/dist/css/index.css +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/DrawInit.jsx +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/api/addFeature.js +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/api/deleteFeature.js +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/draw.scss +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/index.js +0 -0
- /package/plugins/{draw-ml → beta/draw-ml}/src/modes/disabledMode.js +0 -0
- /package/plugins/{draw-ml/src → beta/draw-ml/src/utils}/snapHelpers.js +0 -0
- /package/plugins/{frame → beta/frame}/dist/css/index.css +0 -0
- /package/plugins/{frame → beta/frame}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{frame → beta/frame}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{frame → beta/frame}/package.json +0 -0
- /package/plugins/{frame → beta/frame}/src/Frame.jsx +0 -0
- /package/plugins/{frame → beta/frame}/src/FrameInit.jsx +0 -0
- /package/plugins/{frame → beta/frame}/src/api/addFrame.js +0 -0
- /package/plugins/{frame → beta/frame}/src/api/editFeature.js +0 -0
- /package/plugins/{frame → beta/frame}/src/config.js +0 -0
- /package/plugins/{frame → beta/frame}/src/frame.scss +0 -0
- /package/plugins/{frame → beta/frame}/src/index.js +0 -0
- /package/plugins/{frame → beta/frame}/src/manifest.js +0 -0
- /package/plugins/{frame → beta/frame}/src/reducer.js +0 -0
- /package/plugins/{frame → beta/frame}/src/utils.js +0 -0
- /package/plugins/{map-styles → beta/map-styles}/dist/css/index.css +0 -0
- /package/plugins/{map-styles → beta/map-styles}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{map-styles → beta/map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{map-styles → beta/map-styles}/src/MapStylesInit.jsx +0 -0
- /package/plugins/{map-styles → beta/map-styles}/src/config.js +0 -0
- /package/plugins/{map-styles → beta/map-styles}/src/index.js +0 -0
- /package/plugins/{map-styles → beta/map-styles}/src/mapStyles.scss +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/dist/css/index.css +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/package.json +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/ScaleBar.jsx +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/ScaleBar.test.jsx +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/index.js +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/index.test.js +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/manifest.js +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/scaleBar.scss +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/utils.js +0 -0
- /package/plugins/{scale-bar → beta/scale-bar}/src/utils.test.js +0 -0
- /package/plugins/{use-location → beta/use-location}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/plugins/{use-location → beta/use-location}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{use-location → beta/use-location}/src/UseLocation.jsx +0 -0
- /package/plugins/{use-location → beta/use-location}/src/UseLocationInit.jsx +0 -0
- /package/plugins/{use-location → beta/use-location}/src/defaults.js +0 -0
- /package/plugins/{use-location → beta/use-location}/src/events.js +0 -0
- /package/plugins/{use-location → beta/use-location}/src/index.js +0 -0
- /package/plugins/{use-location → beta/use-location}/src/manifest.js +0 -0
- /package/plugins/{use-location → beta/use-location}/src/reducer.js +0 -0
- /package/providers/{esri → beta/esri}/src/appEvents.js +0 -0
- /package/providers/{esri → beta/esri}/src/defaults.js +0 -0
- /package/providers/{esri → beta/esri}/src/esriProvider.js +0 -0
- /package/providers/{esri → beta/esri}/src/esriProvider.scss +0 -0
- /package/providers/{esri → beta/esri}/src/index.js +0 -0
- /package/providers/{esri → beta/esri}/src/utils/coords.js +0 -0
- /package/providers/{esri → beta/esri}/src/utils/detectWebGL.js +0 -0
- /package/providers/{esri → beta/esri}/src/utils/esriFixes.js +0 -0
- /package/providers/{esri → beta/esri}/src/utils/query.js +0 -0
- /package/providers/{esri → beta/esri}/src/utils/spatial.js +0 -0
- /package/providers/{open-names → beta/open-names}/dist/esm/im-reverse-geocode.js.LICENSE.txt +0 -0
- /package/providers/{open-names → beta/open-names}/dist/esm/index.js.LICENSE.txt +0 -0
- /package/providers/{open-names → beta/open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
- /package/providers/{open-names → beta/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/providers/{open-names → beta/open-names}/src/index.js +0 -0
- /package/providers/{open-names → beta/open-names}/src/reverseGeocode.js +0 -0
- /package/providers/{open-names → beta/open-names}/src/utils/mapToLocationModel.js +0 -0
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import booleanValid from '@turf/boolean-valid'
|
|
2
|
-
import area from '@turf/area'
|
|
3
|
-
import { polygon } from '@turf/helpers'
|
|
4
|
-
|
|
5
|
-
const haversine = ([lon1, lat1], [lon2, lat2]) => {
|
|
6
|
-
const toRad = deg => deg * Math.PI / 180
|
|
7
|
-
const R = 6371000 // meters
|
|
8
|
-
const dLat = toRad(lat2 - lat1)
|
|
9
|
-
const dLon = toRad(lon2 - lon1)
|
|
10
|
-
const a = Math.sin(dLat / 2) ** 2 + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) ** 2
|
|
11
|
-
return 2 * R * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const isNewCoordinate = (coords, tolerance = 0.01) => {
|
|
15
|
-
// First coord
|
|
16
|
-
if (coords[0].length <= 1) {
|
|
17
|
-
return true
|
|
18
|
-
}
|
|
19
|
-
// Subsequent coordsmust be different
|
|
20
|
-
if (coords[0].length <= 3) {
|
|
21
|
-
for (let i = 0; i < coords[0].length; i++) {
|
|
22
|
-
for (let j = i + 1; j < coords[0].length; j++) {
|
|
23
|
-
if (haversine(coords[0][i], coords[0][j]) < tolerance) {
|
|
24
|
-
return false
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return true
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const isValidClick = (coords) => {
|
|
33
|
-
// Less than 4 and new coordinates
|
|
34
|
-
if (coords[0].length <= 1 || isNewCoordinate(coords)) {
|
|
35
|
-
return true
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Basic checks
|
|
39
|
-
if (!Array.isArray(coords) || coords.length < 4) {
|
|
40
|
-
return false
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Check if ring is closed
|
|
44
|
-
const first = coords[0]
|
|
45
|
-
const last = coords[coords.length - 1]
|
|
46
|
-
const isClosed = first[0] === last[0] && first[1] === last[1]
|
|
47
|
-
if (!isClosed) {
|
|
48
|
-
return false
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Create a turf polygon
|
|
52
|
-
const turfPoly = polygon([coords])
|
|
53
|
-
|
|
54
|
-
// Check if geometry is valid (non-self-intersecting)
|
|
55
|
-
const valid = booleanValid(turfPoly)
|
|
56
|
-
if (!valid) {
|
|
57
|
-
return false
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Check if area is positive
|
|
61
|
-
const polyArea = area(turfPoly)
|
|
62
|
-
if (polyArea <= 0) {
|
|
63
|
-
return false
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return true
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const spatialNavigate = (start, pixels, direction) => {
|
|
70
|
-
const quadrant = pixels.filter((p, i) => {
|
|
71
|
-
const offsetX = Math.abs(p[0] - start[0])
|
|
72
|
-
const offsetY = Math.abs(p[1] - start[1])
|
|
73
|
-
let isQuadrant = false
|
|
74
|
-
if (direction === 'ArrowUp') {
|
|
75
|
-
isQuadrant = p[1] <= start[1] && offsetY >= offsetX
|
|
76
|
-
} else if (direction === 'ArrowDown') {
|
|
77
|
-
isQuadrant = p[1] > start[1] && offsetY >= offsetX
|
|
78
|
-
} else if (direction === 'ArrowLeft') {
|
|
79
|
-
isQuadrant = p[0] <= start[0] && offsetY < offsetX
|
|
80
|
-
} else if (direction === 'ArrowRight') {
|
|
81
|
-
isQuadrant = p[0] > start[0] && offsetY < offsetX
|
|
82
|
-
} else {
|
|
83
|
-
isQuadrant = true
|
|
84
|
-
}
|
|
85
|
-
return isQuadrant && (JSON.stringify(p) !== JSON.stringify(start))
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
if (!quadrant.length) {
|
|
89
|
-
quadrant.push(start)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const pythagorean = (a, b) => Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2))
|
|
93
|
-
const distances = quadrant.map(p => pythagorean(Math.abs(start[0] - p[0]), Math.abs(start[1] - p[1])))
|
|
94
|
-
const closest = quadrant[distances.indexOf(Math.min(...distances))]
|
|
95
|
-
return pixels.findIndex(i => JSON.stringify(i) === JSON.stringify(closest))
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export {
|
|
99
|
-
isNewCoordinate,
|
|
100
|
-
isValidClick,
|
|
101
|
-
spatialNavigate
|
|
102
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__="im-frame-plugin";export const __webpack_ids__=["im-frame-plugin"];export const __webpack_modules__={"./plugins/frame/src/manifest.js":(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(t),r.d(t,{manifest:()=>k});var a={SET_FRAME:function(e,t){return i(i({},e),{},{frame:t})},SET_FRAME_REFS:function(e,t){return i(i({},e),{},{frameRefs:t})}},c=r("react");function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(e,t)||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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e){var t;if(null==e||null===(t=e.geometry)||void 0===t||null===(t=t.coordinates)||void 0===t||!t[0])return null;var r=e.geometry.coordinates[0],n=1/0,o=1/0,i=-1/0,u=-1/0;return r.forEach(function(e){var t=l(e,2),r=t[0],a=t[1];r<n&&(n=r),r>i&&(i=r),a<o&&(o=a),a>u&&(u=a)}),[n,o,i,u]}var s=r("react/jsx-runtime");function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function b(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(e,t,r){return(t=function(e){var t=function(e){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var O={aspectRatio:1,mobileWidth:"300px",tabletWidth:"360px",desktopWidth:"400px"};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function j(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 S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach(function(t){w(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function w(e,t,r){return(t=function(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function E(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 R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){x(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function x(e,t,r){return(t=function(e){var t=function(e){if("object"!=P(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function _(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 D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach(function(t){M(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}function M(e,t,r){return(t=function(e){var t=function(e){if("object"!=T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A={mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}},k={reducer:{initialState:{frame:null,frameRefs:null},actions:a},InitComponent:function(e){var t,r,n,o,i=e.appState,u=e.mapState,a=e.mapProvider,l=e.pluginConfig,f=e.pluginState,p=e.services,s=e.buttonConfig,y=i.mode,b=i.breakpoint,m=i.layoutRefs,d=p.eventBus,v=s.frameDone,g=s.frameCancel,O=f.dispatch,h=f.frameRefs,j=f.frame,S=null===(t=null===(r=l.includeModes)||void 0===r?void 0:r.includes(y))||void 0===t||t,w=null!==(n=null===(o=l.excludeModes)||void 0===o?void 0:o.includes(y))&&void 0!==n&&n,P=u.isMapReady&&S&&!w;(0,c.useEffect)(function(){if(P)return v.onClick=function(){var e=function(e){var t=e.viewportEl,r=e.mapProvider,n=e.featureId,o=e.scale,i=e.frameEl.getBoundingClientRect(),u=t.getBoundingClientRect(),a={x:(i.left-u.left)/o,y:(i.top-u.top)/o},c={x:(i.right-u.left)/o,y:(i.top-u.top)/o},l={x:(i.right-u.left)/o,y:(i.bottom-u.top)/o},f={x:(i.left-u.left)/o,y:(i.bottom-u.top)/o},p={type:"Feature",geometry:{type:"Polygon",coordinates:[[r.screenToMap(a),r.screenToMap(c),r.screenToMap(l),r.screenToMap(f),r.screenToMap(a)]]},properties:{}};return n&&(p.id=n),p}({frameEl:h.displayRef.current,viewportEl:m.viewportRef.current,featureId:null==j?void 0:j.featureId,scale:{small:1,medium:1.5,large:2}[u.mapSize],mapProvider:a});O({type:"SET_FRAME",payload:null}),d.emit("frame:done",e)},g.onClick=function(){O({type:"SET_FRAME",payload:null}),d.emit("frame:cancel")},function(){v.onClick=null,g.onClick=null}},[u.isMapReady,y,b,j,h,m,a,O,d,v,g])},controls:[{id:"frame",label:"Frame",mobile:{slot:"middle"},tablet:{slot:"middle"},desktop:{slot:"middle"},render:function(e){var t,r=e.appState,n=e.mapState,o=e.pluginState,i=e.mapProvider,u=r.layoutRefs,a=u.actionsRef,l=u.mainRef,f=u.footerRef,p=u.viewportRef,y=o.dispatch,b=(0,c.useRef)(null),d=(0,c.useRef)(null),g=(0,c.useRef)(null),O=v((0,c.useState)("65px"),2),h=O[0],j=O[1],S=v((0,c.useState)(null),2),w=S[0],P=S[1];return(0,c.useEffect)(function(){y({type:"SET_FRAME_REFS",payload:{displayRef:d}})},[]),(0,c.useEffect)(function(){if(o.frame&&b.current){var e=b.current,t=function(){if(a.current&&l.current&&f.current){var t=l.current.offsetHeight,n=f.current.offsetTop,i=a.current.offsetTop,u=t-Math.min(i,n)+10;j("65px 65px ".concat(u,"px 65px"));var c=e.offsetWidth,p=e.offsetHeight;if(t-u-e.offsetTop===e.offsetHeight){var s=function(e,t,r,n){var o=Number.parseInt(r["".concat(n,"Width")]||e,10),i=Math.min(o,e),u=i/r.aspectRatio;return u>t&&(i=(u=t)*r.aspectRatio),{top:(t-u)/2,left:(e-i)/2,width:i,height:u}}(c,p,o.frame,r.breakpoint),y=s.top,b=s.left,m=s.width,d=s.height,v=y+e.offsetTop,g=b+e.offsetLeft;P({top:"".concat(v,"px"),left:"".concat(g,"px"),width:"".concat(m,"px"),height:"".concat(d,"px")})}}},n=new ResizeObserver(t);return n.observe(e),t(),function(){return n.disconnect()}}g.current=null},[o.frame,r.breakpoint,a,l,f]),(0,c.useEffect)(function(){var e;if(null!==(e=o.frame)&&void 0!==e&&e.bounds&&d.current&&p.current&&w){var t=d.current,r=p.current,u=t.getBoundingClientRect(),a=r.getBoundingClientRect(),c={small:1,medium:1.5,large:2}[n.mapSize],l={top:(u.top-a.top)/c,right:(a.right-u.right)/c,bottom:(a.bottom-u.bottom)/c,left:(u.left-a.left)/c};i.setPadding(l),i.fitToBounds(o.frame.bounds,!0)}},[null===(t=o.frame)||void 0===t?void 0:t.bounds,w,i,d,p]),o.frame?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"im-c-frame-spacer",style:{inset:h},ref:b}),w&&(0,s.jsx)("div",{ref:d,className:"im-c-frame-display",style:m({},w)})]}):null}}],buttons:[D({id:"frameDone",label:"Done",variant:"primary",hiddenWhen:function(e){return!e.pluginState.frame}},A),D({id:"frameCancel",label:"Cancel",variant:"tertiary",hiddenWhen:function(e){return!e.pluginState.frame}},A)],api:{addFrame:function(e,t){var r=e.pluginConfig,n=e.pluginState,o=e.services,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=n.dispatch,a=o.eventBus;u({type:"SET_FRAME",payload:S(S(S(S({},O),r),i),{},{featureId:t})}),a.emit("frame:add")},editFeature:function(e,t){var r=e.pluginConfig,n=e.pluginState,o=e.mapProvider,i=e.services,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.dispatch,c=i.eventBus,f=p(t),s=function(e,t){var r=p(e);if(!r)return null;var n=l(r,4),o=n[0],i=n[1],u=n[2],a=n[3],c=t.mapToScreen([o,a]),f=t.mapToScreen([u,i]),s=Math.abs(f.x-c.x),y=Math.abs(f.y-c.y);return 0===y?null:Math.round(s/y*1e6)/1e6}(t,o),y=R(R(R(R({},O),r),u),{},{aspectRatio:s,featureId:(null==t?void 0:t.id)||t.properties.id});a({type:"SET_FRAME",payload:R(R({},y),{},{bounds:f})}),c.emit("frame:edit")}}}}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as e from"react";import*as t from"react/jsx-runtime";var r,n,o={react:(t,r,n)=>{var o,i;t.exports=(o={useEffect:()=>e.useEffect,useRef:()=>e.useRef,useState:()=>e.useState},i={},n.d(i,o),i)},"react/jsx-runtime":(e,r,n)=>{var o,i;e.exports=(o={Fragment:()=>t.Fragment,jsx:()=>t.jsx,jsxs:()=>t.jsxs},i={},n.d(i,o),i)}},i={};function u(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,u),r.exports}u.m=o,u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.f={},u.e=e=>Promise.all(Object.keys(u.f).reduce((t,r)=>(u.f[r](e,t),t),[])),u.u=e=>"../esm/"+e+".js",u.miniCssF=e=>{},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u.p=e+"../css/"})(),r={index:0},n=e=>{var t,n,{__webpack_ids__:o,__webpack_modules__:i,__webpack_runtime__:c}=e,a=0;for(t in i)u.o(i,t)&&(u.m[t]=i[t]);for(c&&c(u);a<o.length;a++)n=o[a],u.o(r,n)&&r[n]&&r[n][0](),r[o[a]]=0},u.f.j=(e,t)=>{var o=u.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[1]);else{var i=import("../css/"+u.u(e)).then(n,t=>{throw 0!==r[e]&&(r[e]=void 0),t});i=Promise.race([i,new Promise(t=>o=r[e]=[t])]),t.push(o[1]=i)}};var c={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function f(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof c?n:c,f=Object.create(a.prototype);return s(f,"_invoke",function(r,n,o){var i,c,a,f=0,s=o||[],p=!1,l={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function(t,r){return i=t,c=0,a=e,l.n=r,u}};function y(r,n){for(c=r,a=n,t=0;!p&&f&&!o&&t<s.length;t++){var o,i=s[t],y=l.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=y&&((o=r<2&&y<i[1])?(c=0,l.v=n,l.n=i[1]):y<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,l.n=b,c=0))}if(o||r>1)return u;throw p=!0,n}return function(o,s,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&y(s,b),c=s,a=b;(t=c<2?e:a)||!p;){i||(c?c<3?(c>1&&(l.n=-1),y(c,a)):l.n=a:l.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(p=l.n<0)?a:r.call(n,l))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:p}}}(r,o,i),!0),f}var u={};function c(){}function a(){}function p(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(s(t={},n,function(){return this}),t),y=p.prototype=c.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e}return a.prototype=p,s(y,"constructor",p),s(p,"constructor",a),a.displayName="GeneratorFunction",s(p,o,"GeneratorFunction"),s(y),s(y,o,"Generator"),s(y,n,function(){return this}),s(y,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:b}})()}function s(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){s(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},s(e,t,r,n)}function p(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}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 y(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){b(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}function b(e,t,r){return(t=function(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(){var e,t;return y(y({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"frame",load:(e=f().m(function e(){var t;return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.e("im-frame-plugin").then(u.bind(u,"./plugins/frame/src/manifest.js"));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){p(i,n,o,u,c,"next",e)}function c(e){p(i,n,o,u,c,"throw",e)}u(void 0)})},function(){return t.apply(this,arguments)})})}u.d(c,{A:()=>m});const v=c.A;export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[191],{227:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(e),r.d(e,{manifest:()=>A});var a={SET_FRAME:function(t,e){return i(i({},t),{},{frame:e})},SET_FRAME_REFS:function(t,e){return i(i({},t),{},{frameRefs:e})}},c=r(738);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t){var e;if(null==t||null===(e=t.geometry)||void 0===e||null===(e=e.coordinates)||void 0===e||!e[0])return null;var r=t.geometry.coordinates[0],n=1/0,o=1/0,i=-1/0,u=-1/0;return r.forEach(function(t){var e=l(t,2),r=e[0],a=e[1];r<n&&(n=r),r>i&&(i=r),a<o&&(o=a),a>u&&(u=a)}),[n,o,i,u]}var s=r(287);function y(t){return y="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},y(t)}function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach(function(e){d(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function d(t,e,r){return(e=function(t){var e=function(t){if("object"!=y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==y(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return g(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var O={aspectRatio:1,mobileWidth:"300px",tabletWidth:"360px",desktopWidth:"400px"};function h(t){return h="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},h(t)}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach(function(e){w(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function w(t,e,r){return(e=function(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){return P="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},P(t)}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(e){T(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function T(t,e,r){return(e=function(t){var e=function(t){if("object"!=P(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==P(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}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)}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach(function(e){C(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function C(t,e,r){return(e=function(t){var e=function(t){if("object"!=D(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==D(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var k={mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}},A={reducer:{initialState:{frame:null,frameRefs:null},actions:a},InitComponent:function(t){var e,r,n,o,i=t.appState,u=t.mapState,a=t.mapProvider,l=t.pluginConfig,f=t.pluginState,p=t.services,s=t.buttonConfig,y=i.mode,b=i.breakpoint,m=i.layoutRefs,d=p.eventBus,v=s.frameDone,g=s.frameCancel,O=f.dispatch,h=f.frameRefs,j=f.frame,S=null===(e=null===(r=l.includeModes)||void 0===r?void 0:r.includes(y))||void 0===e||e,w=null!==(n=null===(o=l.excludeModes)||void 0===o?void 0:o.includes(y))&&void 0!==n&&n,P=u.isMapReady&&S&&!w;(0,c.useEffect)(function(){if(P)return v.onClick=function(){var t=function(t){var e=t.viewportEl,r=t.mapProvider,n=t.featureId,o=t.scale,i=t.frameEl.getBoundingClientRect(),u=e.getBoundingClientRect(),a={x:(i.left-u.left)/o,y:(i.top-u.top)/o},c={x:(i.right-u.left)/o,y:(i.top-u.top)/o},l={x:(i.right-u.left)/o,y:(i.bottom-u.top)/o},f={x:(i.left-u.left)/o,y:(i.bottom-u.top)/o},p={type:"Feature",geometry:{type:"Polygon",coordinates:[[r.screenToMap(a),r.screenToMap(c),r.screenToMap(l),r.screenToMap(f),r.screenToMap(a)]]},properties:{}};return n&&(p.id=n),p}({frameEl:h.displayRef.current,viewportEl:m.viewportRef.current,featureId:null==j?void 0:j.featureId,scale:{small:1,medium:1.5,large:2}[u.mapSize],mapProvider:a});O({type:"SET_FRAME",payload:null}),d.emit("frame:done",t)},g.onClick=function(){O({type:"SET_FRAME",payload:null}),d.emit("frame:cancel")},function(){v.onClick=null,g.onClick=null}},[u.isMapReady,y,b,j,h,m,a,O,d,v,g])},controls:[{id:"frame",label:"Frame",mobile:{slot:"middle"},tablet:{slot:"middle"},desktop:{slot:"middle"},render:function(t){var e,r=t.appState,n=t.mapState,o=t.pluginState,i=t.mapProvider,u=r.layoutRefs,a=u.actionsRef,l=u.mainRef,f=u.footerRef,p=u.viewportRef,y=o.dispatch,b=(0,c.useRef)(null),d=(0,c.useRef)(null),g=(0,c.useRef)(null),O=v((0,c.useState)("65px"),2),h=O[0],j=O[1],S=v((0,c.useState)(null),2),w=S[0],P=S[1];return(0,c.useEffect)(function(){y({type:"SET_FRAME_REFS",payload:{displayRef:d}})},[]),(0,c.useEffect)(function(){if(o.frame&&b.current){var t=b.current,e=function(){if(a.current&&l.current&&f.current){var e=l.current.offsetHeight,n=f.current.offsetTop,i=a.current.offsetTop,u=e-Math.min(i,n)+10;j("65px 65px ".concat(u,"px 65px"));var c=t.offsetWidth,p=t.offsetHeight;if(e-u-t.offsetTop===t.offsetHeight){var s=function(t,e,r,n){var o=Number.parseInt(r["".concat(n,"Width")]||t,10),i=Math.min(o,t),u=i/r.aspectRatio;return u>e&&(i=(u=e)*r.aspectRatio),{top:(e-u)/2,left:(t-i)/2,width:i,height:u}}(c,p,o.frame,r.breakpoint),y=s.top,b=s.left,m=s.width,d=s.height,v=y+t.offsetTop,g=b+t.offsetLeft;P({top:"".concat(v,"px"),left:"".concat(g,"px"),width:"".concat(m,"px"),height:"".concat(d,"px")})}}},n=new ResizeObserver(e);return n.observe(t),e(),function(){return n.disconnect()}}g.current=null},[o.frame,r.breakpoint,a,l,f]),(0,c.useEffect)(function(){var t;if(null!==(t=o.frame)&&void 0!==t&&t.bounds&&d.current&&p.current&&w){var e=d.current,r=p.current,u=e.getBoundingClientRect(),a=r.getBoundingClientRect(),c={small:1,medium:1.5,large:2}[n.mapSize],l={top:(u.top-a.top)/c,right:(a.right-u.right)/c,bottom:(a.bottom-u.bottom)/c,left:(u.left-a.left)/c};i.setPadding(l),i.fitToBounds(o.frame.bounds,!0)}},[null===(e=o.frame)||void 0===e?void 0:e.bounds,w,i,d,p]),o.frame?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"im-c-frame-spacer",style:{inset:h},ref:b}),w&&(0,s.jsx)("div",{ref:d,className:"im-c-frame-display",style:m({},w)})]}):null}}],buttons:[x({id:"frameDone",label:"Done",variant:"primary",hiddenWhen:function(t){return!t.pluginState.frame}},k),x({id:"frameCancel",label:"Cancel",variant:"tertiary",hiddenWhen:function(t){return!t.pluginState.frame}},k)],api:{addFrame:function(t,e){var r=t.pluginConfig,n=t.pluginState,o=t.services,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=n.dispatch,a=o.eventBus;u({type:"SET_FRAME",payload:S(S(S(S({},O),r),i),{},{featureId:e})}),a.emit("frame:add")},editFeature:function(t,e){var r=t.pluginConfig,n=t.pluginState,o=t.mapProvider,i=t.services,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.dispatch,c=i.eventBus,f=p(e),s=function(t,e){var r=p(t);if(!r)return null;var n=l(r,4),o=n[0],i=n[1],u=n[2],a=n[3],c=e.mapToScreen([o,a]),f=e.mapToScreen([u,i]),s=Math.abs(f.x-c.x),y=Math.abs(f.y-c.y);return 0===y?null:Math.round(s/y*1e6)/1e6}(e,o),y=R(R(R(R({},O),r),u),{},{aspectRatio:s,featureId:(null==e?void 0:e.id)||e.properties.id});a({type:"SET_FRAME",payload:R(R({},y),{},{bounds:f})}),c.emit("frame:edit")}}}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.framePlugin=t())}(this,()=>(()=>{"use strict";var e,t,r={287:e=>{e.exports=preactJsxRuntime},738:e=>{e.exports=preactCompat}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,r)=>(o.f[r](e,t),t),[])),o.u=e=>"im-frame-plugin.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="defra.framePlugin:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",t+i),u.src=r),e[r]=[n];var s=(t,n)=>{u.onerror=u.onload=null,clearTimeout(b);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),t)return t(n)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={57:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,f=0;if(a.some(t=>0!==e[t])){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);f<a.length;f++)i=a[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof f?n:f,p=Object.create(u.prototype);return c(p,"_invoke",function(r,n,o){var i,u,c,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:b,f:b.bind(e,4),d:function(t,r){return i=t,u=0,c=e,s.n=r,a}};function b(r,n){for(u=r,c=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],b=s.p,d=i[2];r>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=b&&((o=r<2&&b<i[1])?(u=0,s.v=n,s.n=i[1]):b<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,s.n=d,u=0))}if(o||r>1)return a;throw l=!0,n}return function(o,p,d){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&b(p,d),u=p,c=d;(t=u<2?e:c)||!l;){i||(u?u<3?(u>1&&(s.n=-1),b(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=s.n<0)?c:r.call(n,s))!==a)break}catch(t){i=e,u=1,c=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var a={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),b=l.prototype=f.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,c(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e}return p.prototype=l,c(b,"constructor",l),c(l,"constructor",p),p.displayName="GeneratorFunction",c(l,o,"GeneratorFunction"),c(b),c(b,o,"Generator"),c(b,n,function(){return this}),c(b,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:d}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},c(e,t,r,n)}function f(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}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 l(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){s(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}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){var e,t;return l(l({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"frame",load:(e=u().m(function e(){var t;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(191).then(o.bind(o,227));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){f(i,n,o,a,u,"next",e)}function u(e){f(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return t.apply(this,arguments)})})}return o.d(i,{default:()=>b}),i.default})());
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__="im-map-styles-plugin";export const __webpack_ids__=["im-map-styles-plugin"];export const __webpack_modules__={"./plugins/map-styles/src/manifest.js":(e,t,i)=>{i.r(t),i.d(t,{manifest:()=>p});var s=i("react"),r=i("react/jsx-runtime");new Set,new Set;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach(function(t){o(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function o(e,t,i){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var c={slot:"middle",initiallyOpen:!1,dismissable:!0,modal:!0},m=(l({},c),l(l({},c),{},{width:"500px"}),l(l({},c),{},{width:"500px"}),{small:1,medium:1.5,large:2}),p={InitComponent:function(e){var t=e.pluginConfig,i=e.services,n=i.events,a=i.eventBus,l=function(){a.emit(n.MAP_INIT_MAP_STYLES,t.mapStyles)};return(0,s.useEffect)(function(){return a.on(n.APP_READY,l),function(){return a.off(n.APP_READY,l)}},[]),(0,r.jsx)(r.Fragment,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"bottom",modal:!0,dismissable:!0},tablet:{slot:"map-styles-button",modal:!0,width:"400px",dismissable:!0},desktop:{slot:"map-styles-button",modal:!0,width:"400px",dismissable:!0},render:function(e){var t=e.mapState,i=e.pluginConfig,s=e.services,n=e.mapProvider,a=t.mapStyle,l=t.mapSize,o=i.mapStyles,c=s.events,p=s.eventBus,d=n.capabilities.supportsMapSizes;return(0,r.jsxs)("div",{className:"im-c-map-styles",children:[(0,r.jsx)("div",{className:"im-c-map-styles__group",children:(0,r.jsx)("div",{className:"im-c-map-styles__inner",children:o.filter(function(e){return e.url}).map(function(e){return(0,r.jsx)("div",{className:"im-c-map-styles__item",children:(0,r.jsxs)("button",{className:"im-c-map-styles__button","aria-pressed":e.id===a.id,onClick:function(){return t=e,void p.emit(c.MAP_SET_STYLE,t);var t},children:[(0,r.jsx)("div",{className:"im-c-map-styles__image",children:(0,r.jsx)("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id)})})}),d&&(0,r.jsxs)("div",{className:"im-c-map-styles__group",children:[(0,r.jsx)("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),(0,r.jsx)("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(function(e){return(0,r.jsx)("div",{className:"im-c-map-styles__item",children:(0,r.jsxs)("button",{className:"im-c-map-styles__button",onClick:function(){return t=e,p.emit(c.MAP_SET_SIZE,t),void p.emit(c.MAP_SET_PIXEL_RATIO,window.devicePixelRatio*m[t]);var t},"aria-pressed":e===l,children:[(0,r.jsx)("div",{className:"im-c-map-styles__image",children:(0,r.jsxs)("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[(0,r.jsx)("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),(0,r.jsx)("g",{style:{transform:"scale(".concat(m[e],")"),transformOrigin:"8px 52px"},children:(0,r.jsx)("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e)})})]})]})}}],buttons:[{id:"mapStyles",label:"Map styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"right-top",showLabel:!1},tablet:{slot:"right-top",showLabel:!1,order:1},desktop:{slot:"right-top",showLabel:!1,order:1}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]}}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as t from"react";import*as e from"react/jsx-runtime";var r,n,o={react:(e,r,n)=>{var o,i;e.exports=(o={useEffect:()=>t.useEffect},i={},n.d(i,o),i)},"react/jsx-runtime":(t,r,n)=>{var o,i;t.exports=(o={Fragment:()=>e.Fragment,jsx:()=>e.jsx,jsxs:()=>e.jsxs},i={},n.d(i,o),i)}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.m=o,a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce((e,r)=>(a.f[r](t,e),e),[])),a.u=t=>"../esm/"+t+".js",a.miniCssF=t=>{},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t+"../css/"})(),r={index:0},n=t=>{var e,n,{__webpack_ids__:o,__webpack_modules__:i,__webpack_runtime__:u}=t,c=0;for(e in i)a.o(i,e)&&(a.m[e]=i[e]);for(u&&u(a);c<o.length;c++)n=o[c],a.o(r,n)&&r[n]&&r[n][0](),r[o[c]]=0},a.f.j=(t,e)=>{var o=a.o(r,t)?r[t]:void 0;if(0!==o)if(o)e.push(o[1]);else{var i=import("../css/"+a.u(t)).then(n,e=>{throw 0!==r[t]&&(r[t]=void 0),e});i=Promise.race([i,new Promise(e=>o=r[t]=[e])]),e.push(o[1]=i)}};var u={};function c(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(r,n,o){var i,u,c,s=0,f=o||[],p=!1,l={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function m(r,n){for(u=r,c=n,e=0;!p&&s&&!o&&e<f.length;e++){var o,i=f[e],m=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=m&&((o=r<2&&m<i[1])?(u=0,l.v=n,l.n=i[1]):m<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(p&&1===f&&m(f,v),u=f,c=v;(e=u<2?t:c)||!p;){i||(u?u<3?(u>1&&(l.n=-1),m(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(p=l.n<0)?c:r.call(n,l))!==a)break}catch(e){i=t,u=1,c=e}finally{s=1}}return{value:e,done:p}}}(r,o,i),!0),f}var a={};function u(){}function f(){}function p(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),m=p.prototype=u.prototype=Object.create(l);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t}return f.prototype=p,s(m,"constructor",p),s(p,"constructor",f),f.displayName="GeneratorFunction",s(p,o,"GeneratorFunction"),s(m),s(m,o,"Generator"),s(m,n,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:v}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}i("next",0),i("throw",1),i("return",2)}},s(t,e,r,n)}function f(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function p(){var t,e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:r.manifest,mapStyles:r.mapStyles,load:(t=c().m(function t(){var e;return c().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,a.e("im-map-styles-plugin").then(a.bind(a,"./plugins/map-styles/src/manifest.js"));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,u,"next",t)}function u(t){f(i,n,o,a,u,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}a.d(u,{A:()=>p});const l=u.A;export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[657],{128:(e,t,i)=>{i.r(t),i.d(t,{manifest:()=>p});var s=i(738),r=i(287);new Set,new Set;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach(function(t){o(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function o(e,t,i){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var c={slot:"middle",initiallyOpen:!1,dismissable:!0,modal:!0},m=(l({},c),l(l({},c),{},{width:"500px"}),l(l({},c),{},{width:"500px"}),{small:1,medium:1.5,large:2}),p={InitComponent:function(e){var t=e.pluginConfig,i=e.services,n=i.events,a=i.eventBus,l=function(){a.emit(n.MAP_INIT_MAP_STYLES,t.mapStyles)};return(0,s.useEffect)(function(){return a.on(n.APP_READY,l),function(){return a.off(n.APP_READY,l)}},[]),(0,r.jsx)(r.Fragment,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"bottom",modal:!0,dismissable:!0},tablet:{slot:"map-styles-button",modal:!0,width:"400px",dismissable:!0},desktop:{slot:"map-styles-button",modal:!0,width:"400px",dismissable:!0},render:function(e){var t=e.mapState,i=e.pluginConfig,s=e.services,n=e.mapProvider,a=t.mapStyle,l=t.mapSize,o=i.mapStyles,c=s.events,p=s.eventBus,d=n.capabilities.supportsMapSizes;return(0,r.jsxs)("div",{className:"im-c-map-styles",children:[(0,r.jsx)("div",{className:"im-c-map-styles__group",children:(0,r.jsx)("div",{className:"im-c-map-styles__inner",children:o.filter(function(e){return e.url}).map(function(e){return(0,r.jsx)("div",{className:"im-c-map-styles__item",children:(0,r.jsxs)("button",{className:"im-c-map-styles__button","aria-pressed":e.id===a.id,onClick:function(){return t=e,void p.emit(c.MAP_SET_STYLE,t);var t},children:[(0,r.jsx)("div",{className:"im-c-map-styles__image",children:(0,r.jsx)("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id)})})}),d&&(0,r.jsxs)("div",{className:"im-c-map-styles__group",children:[(0,r.jsx)("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),(0,r.jsx)("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(function(e){return(0,r.jsx)("div",{className:"im-c-map-styles__item",children:(0,r.jsxs)("button",{className:"im-c-map-styles__button",onClick:function(){return t=e,p.emit(c.MAP_SET_SIZE,t),void p.emit(c.MAP_SET_PIXEL_RATIO,window.devicePixelRatio*m[t]);var t},"aria-pressed":e===l,children:[(0,r.jsx)("div",{className:"im-c-map-styles__image",children:(0,r.jsxs)("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[(0,r.jsx)("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),(0,r.jsx)("g",{style:{transform:"scale(".concat(m[e],")"),transformOrigin:"8px 52px"},children:(0,r.jsx)("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e)})})]})]})}}],buttons:[{id:"mapStyles",label:"Map styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"right-top",showLabel:!1},tablet:{slot:"right-top",showLabel:!1,order:1},desktop:{slot:"right-top",showLabel:!1,order:1}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.mapStylesPlugin=t())}(this,()=>(()=>{"use strict";var e,t,r={287:e=>{e.exports=preactJsxRuntime},738:e=>{e.exports=preactCompat}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,r)=>(o.f[r](e,t),t),[])),o.u=e=>"im-map-styles-plugin.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="defra.mapStylesPlugin:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",t+i),u.src=r),e[r]=[n];var s=(t,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={57:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,f=0;if(a.some(t=>0!==e[t])){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);f<a.length;f++)i=a[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof f?n:f,p=Object.create(a.prototype);return u(p,"_invoke",function(r,n,o){var i,a,u,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,u=e,s.n=r,c}};function d(r,n){for(a=r,u=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,v=i[2];r>3?(o=v===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,s.v=n,s.n=i[1]):d<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,s.n=v,a=0))}if(o||r>1)return c;throw l=!0,n}return function(o,p,v){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,v),a=p,u=v;(t=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(s.n=-1),d(a,u)):s.n=u:s.v=u);try{if(f=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(l=s.n<0)?u:r.call(n,s))!==c)break}catch(t){i=e,a=1,u=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var c={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,u(d,"constructor",l),u(l,"constructor",p),p.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:v}})()}function u(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){u(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},u(e,t,r,n)}function c(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function f(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:r.manifest,mapStyles:r.mapStyles,load:(e=a().m(function e(){var t;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(657).then(o.bind(o,128));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return t.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}return o.d(i,{default:()=>f}),i.default})());
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__="im-scale-bar-plugin";export const __webpack_ids__=["im-scale-bar-plugin"];export const __webpack_modules__={"./plugins/scale-bar/src/manifest.js":(r,t,a)=>{a.r(t),a.d(t,{manifest:()=>s});var e=a("react");function n(r,t){(null==t||t>r.length)&&(t=r.length);for(var a=0,e=Array(t);a<t;a++)e[a]=r[a];return e}var l={small:1,medium:1.5,large:2},i={metric:[{threshold:1,abbr:"m",abbrPlural:"m",unit:"metre",unitPlural:"metres",factor:1},{threshold:1e3,abbr:"km",abbrPlural:"km",unit:"kilometre",unitPlural:"kilometres",factor:.001}],imperial:[{threshold:1609.344,abbr:"mi",abbrPlural:"mi",unit:"mile",unitPlural:"miles",factor:1/1609.344},{threshold:.9144,abbr:"yd",abbrPlural:"yds",unit:"yard",unitPlural:"yards",factor:1/.9144},{threshold:.3048,abbr:"ft",abbrPlural:"ft",unit:"foot",unitPlural:"feet",factor:1/.3048}]},o=function(r){var t=Math.pow(10,Math.floor(Math.log10(r))),a=r/t;return(a>=10?10:a>=5?5:a>=3?3:a>=2?2:1)*t},u=a("react/jsx-runtime"),s={controls:[{id:"scaleBar",label:"Scale bar",mobile:{slot:"footer-right"},tablet:{slot:"footer-right"},desktop:{slot:"footer-right"},render:function(r){var t=r.mapState,a=r.pluginConfig,s=t.resolution,b=t.mapSize,c=(0,e.useRef)(null),f=(0,e.useMemo)(function(){return s?function(r,t,a,e){var u,s=r/l[e],b=120*s,c=i[a],f=function(r,t){var a="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!a){if(Array.isArray(r)||(a=function(r,t){if(r){if("string"==typeof r)return n(r,t);var a={}.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(r):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(r,t):void 0}}(r))||t&&r&&"number"==typeof r.length){a&&(r=a);var e=0,l=function(){};return{s:l,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:l}}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,o=!0,u=!1;return{s:function(){a=a.call(r)},n:function(){var r=a.next();return o=r.done,r},e:function(r){u=!0,i=r},f:function(){try{o||null==a.return||a.return()}finally{if(u)throw i}}}}(c);try{for(f.s();!(u=f.n()).done;){var m=u.value,d=m.abbr,h=m.abbrPlural,p=m.unit,y=m.unitPlural,v=m.factor,g=o(b*v);if(g>=1&&g<1e3){var _=g/v/s;if(_<=120)return{label:g,abbr:g>1?h:d,width:_,unit:g>1?y:p}}}}catch(r){f.e(r)}finally{f.f()}var P=c[c.length-1],w=b*P.factor,x=o(w),j=x>1?P.abbrPlural:P.abbr,S=x>1?P.abbrPlural:P.abbr;return{label:x,abbr:j,width:x/P.factor/s,unit:S}}(s/1,0,a.units,b):{width:0,label:"",abbr:"",unit:""}},[s,b,a.units]);return(0,u.jsx)("div",{className:"im-c-scale-bar",ref:c,style:{width:"".concat(f.width,"px")},children:(0,u.jsxs)("span",{className:"im-c-scale-bar__label",children:[(0,u.jsx)("span",{className:"im-u-visually-hidden",children:"Scale bar: "}),f.label,(0,u.jsx)("span",{"aria-hidden":"true",children:f.abbr}),(0,u.jsx)("span",{className:"im-u-visually-hidden",children:f.unit})]})})}}]}}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as e from"react";import*as r from"react/jsx-runtime";var t,n,o={react:(r,t,n)=>{var o,i;r.exports=(o={useMemo:()=>e.useMemo,useRef:()=>e.useRef},i={},n.d(i,o),i)},"react/jsx-runtime":(e,t,n)=>{var o,i;e.exports=(o={jsx:()=>r.jsx,jsxs:()=>r.jsxs},i={},n.d(i,o),i)}},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,a),t.exports}a.m=o,a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>"../esm/"+e+".js",a.miniCssF=e=>{},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../css/"})(),t={index:0},n=e=>{var r,n,{__webpack_ids__:o,__webpack_modules__:i,__webpack_runtime__:u}=e,c=0;for(r in i)a.o(i,r)&&(a.m[r]=i[r]);for(u&&u(a);c<o.length;c++)n=o[c],a.o(t,n)&&t[n]&&t[n][0](),t[o[c]]=0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[1]);else{var i=import("../css/"+a.u(e)).then(n,r=>{throw 0!==t[e]&&(t[e]=void 0),r});i=Promise.race([i,new Promise(r=>o=t[e]=[r])]),r.push(o[1]=i)}};var u={};function c(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(t,n,o){var i,u,c,s=0,f=o||[],p=!1,l={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(r,t){return i=r,u=0,c=e,l.n=t,a}};function v(t,n){for(u=t,c=n,r=0;!p&&s&&!o&&r<f.length;r++){var o,i=f[r],v=l.p,m=i[2];t>3?(o=m===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=t<2&&v<i[1])?(u=0,l.v=n,l.n=i[1]):v<m&&(o=t<3||i[0]>n||n>m)&&(i[4]=t,i[5]=n,l.n=m,u=0))}if(o||t>1)return a;throw p=!0,n}return function(o,f,m){if(s>1)throw TypeError("Generator is already running");for(p&&1===f&&v(f,m),u=f,c=m;(r=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(l.n=-1),v(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=l.n<0)?c:t.call(n,l))!==a)break}catch(r){i=e,u=1,c=r}finally{s=1}}return{value:r,done:p}}}(t,o,i),!0),f}var a={};function u(){}function f(){}function p(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),v=p.prototype=u.prototype=Object.create(l);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,o,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=p,s(v,"constructor",p),s(p,"constructor",f),f.displayName="GeneratorFunction",s(p,o,"GeneratorFunction"),s(v),s(v,o,"Generator"),s(v,n,function(){return this}),s(v,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m}})()}function s(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,r,t,n){if(r)o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t;else{function i(r,t){s(e,r,function(e){return this._invoke(r,t,e)})}i("next",0),i("throw",1),i("return",2)}},s(e,r,t,n)}function f(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function p(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.manifest,o=t.units;return{id:"scaleBar",manifest:n,units:void 0===o?"metric":o,load:(e=c().m(function e(){var r;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e("im-scale-bar-plugin").then(a.bind(a,"./plugins/scale-bar/src/manifest.js"));case 1:return r=e.v.manifest,e.a(2,r)}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(n,o){var i=e.apply(r,t);function a(e){f(i,n,o,a,u,"next",e)}function u(e){f(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})}}a.d(u,{A:()=>p});const l=u.A;export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[996],{437:(r,t,a)=>{a.r(t),a.d(t,{manifest:()=>s});var e=a(738);function n(r,t){(null==t||t>r.length)&&(t=r.length);for(var a=0,e=Array(t);a<t;a++)e[a]=r[a];return e}var l={small:1,medium:1.5,large:2},i={metric:[{threshold:1,abbr:"m",abbrPlural:"m",unit:"metre",unitPlural:"metres",factor:1},{threshold:1e3,abbr:"km",abbrPlural:"km",unit:"kilometre",unitPlural:"kilometres",factor:.001}],imperial:[{threshold:1609.344,abbr:"mi",abbrPlural:"mi",unit:"mile",unitPlural:"miles",factor:1/1609.344},{threshold:.9144,abbr:"yd",abbrPlural:"yds",unit:"yard",unitPlural:"yards",factor:1/.9144},{threshold:.3048,abbr:"ft",abbrPlural:"ft",unit:"foot",unitPlural:"feet",factor:1/.3048}]},o=function(r){var t=Math.pow(10,Math.floor(Math.log10(r))),a=r/t;return(a>=10?10:a>=5?5:a>=3?3:a>=2?2:1)*t},u=a(287),s={controls:[{id:"scaleBar",label:"Scale bar",mobile:{slot:"footer-right"},tablet:{slot:"footer-right"},desktop:{slot:"footer-right"},render:function(r){var t=r.mapState,a=r.pluginConfig,s=t.resolution,b=t.mapSize,c=(0,e.useRef)(null),f=(0,e.useMemo)(function(){return s?function(r,t,a,e){var u,s=r/l[e],b=120*s,c=i[a],f=function(r,t){var a="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!a){if(Array.isArray(r)||(a=function(r,t){if(r){if("string"==typeof r)return n(r,t);var a={}.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(r):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(r,t):void 0}}(r))||t&&r&&"number"==typeof r.length){a&&(r=a);var e=0,l=function(){};return{s:l,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:l}}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,o=!0,u=!1;return{s:function(){a=a.call(r)},n:function(){var r=a.next();return o=r.done,r},e:function(r){u=!0,i=r},f:function(){try{o||null==a.return||a.return()}finally{if(u)throw i}}}}(c);try{for(f.s();!(u=f.n()).done;){var h=u.value,d=h.abbr,m=h.abbrPlural,y=h.unit,p=h.unitPlural,v=h.factor,g=o(b*v);if(g>=1&&g<1e3){var P=g/v/s;if(P<=120)return{label:g,abbr:g>1?m:d,width:P,unit:g>1?p:y}}}}catch(r){f.e(r)}finally{f.f()}var w=c[c.length-1],k=b*w.factor,S=o(k),j=S>1?w.abbrPlural:w.abbr,x=S>1?w.abbrPlural:w.abbr;return{label:S,abbr:j,width:S/w.factor/s,unit:x}}(s/1,0,a.units,b):{width:0,label:"",abbr:"",unit:""}},[s,b,a.units]);return(0,u.jsx)("div",{className:"im-c-scale-bar",ref:c,style:{width:"".concat(f.width,"px")},children:(0,u.jsxs)("span",{className:"im-c-scale-bar__label",children:[(0,u.jsx)("span",{className:"im-u-visually-hidden",children:"Scale bar: "}),f.label,(0,u.jsx)("span",{"aria-hidden":"true",children:f.abbr}),(0,u.jsx)("span",{className:"im-u-visually-hidden",children:f.unit})]})})}}]}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.scaleBarPlugin=t())}(this,()=>(()=>{"use strict";var e,t,r={287:e=>{e.exports=preactJsxRuntime},738:e=>{e.exports=preactCompat}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,r)=>(o.f[r](e,t),t),[])),o.u=e=>"im-scale-bar-plugin.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="defra.scaleBarPlugin:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),s=0;s<f.length;s++){var l=f[s];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",t+i),u.src=r),e[r]=[n];var p=(t,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={57:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,f=0;if(a.some(t=>0!==e[t])){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);f<a.length;f++)i=a[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof f?n:f,s=Object.create(a.prototype);return u(s,"_invoke",function(r,n,o){var i,a,u,f=0,s=o||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,u=e,p.n=r,c}};function d(r,n){for(a=r,u=n,t=0;!l&&f&&!o&&t<s.length;t++){var o,i=s[t],d=p.p,v=i[2];r>3?(o=v===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,p.n=v,a=0))}if(o||r>1)return c;throw l=!0,n}return function(o,s,v){if(f>1)throw TypeError("Generator is already running");for(l&&1===s&&d(s,v),a=s,u=v;(t=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(f=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==c)break}catch(t){i=e,a=1,u=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),s}var c={};function f(){}function s(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,u(d,"constructor",l),u(l,"constructor",s),s.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:v}})()}function u(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){u(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},u(e,t,r,n)}function c(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function f(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.manifest,i=r.units;return{id:"scaleBar",manifest:n,units:void 0===i?"metric":i,load:(e=a().m(function e(){var t;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(996).then(o.bind(o,437));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return t.apply(this,arguments)})}}return o.d(i,{default:()=>f}),i.default})());
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__="im-use-location-plugin";export const __webpack_ids__=["im-use-location-plugin"];export const __webpack_modules__={"./plugins/use-location/src/manifest.js":(e,t,n)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,{manifest:()=>b});var c={SET_ERROR_MESSAGE:function(e,t){return r(r({},e),{},{errorMessage:t})}},l=n("react"),u={PERMISSION_DENIED:"Location permission denied. Please enable it in your browser settings.",POSITION_UNAVAILABLE:"Location information is unavailable.",TIMEOUT:"The location request timed out. Please try again.",FALLBACK:"Unable to get your location."},s=n("react/jsx-runtime"),p={slot:"right-top",showLabel:!1},b={InitComponent:function(e){e.appConfig;var t=e.appState,n=e.pluginState,o=e.mapState,i=e.mapProvider,r=e.buttonConfig.useLocation;return(0,l.useEffect)(function(){if(o.isMapReady)return function(e){var t=e.appState,n=e.pluginState,o=e.mapProvider,i=e.useLocationButton,r=t.dispatch,a=t.buttonRefs,c=n.dispatch;i.onClick=function(){navigator.geolocation.getCurrentPosition(function(e){var t=e.coords,n=t.latitude,i=t.longitude;try{o.setView({center:[i,n],zoom:12})}catch(e){console.log("Map provider failed to pan:",e)}},function(e){var t=function(e){return e&&"number"==typeof e.code&&u[e.code]||u.FALLBACK}(e),n=a.current[i.id];c({type:"SET_ERROR_MESSAGE",payload:t}),r({type:"OPEN_PANEL",payload:{panelId:"useLocation",props:{triggeringElement:n}}})},{enableHighAccuracy:!0,maximumAge:0,timeout:1e4})}}({appState:t,pluginState:n,mapProvider:i,useLocationButton:r}),function(){r.onClick=null}},[o.isMapReady]),null},reducer:{initialState:{errorMessage:null},actions:c},buttons:[{id:"useLocation",group:"location",label:"Use your location",iconId:"locateFixed",hiddenWhen:function(){return!navigator.geolocation},mobile:p,tablet:p,desktop:p}],panels:[{id:"useLocation",label:"Problem getting your location",mobile:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},tablet:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},desktop:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},render:function(e){var t=e.pluginState.errorMessage;return(0,s.jsx)("div",{className:"im-c-use-location",children:(0,s.jsx)("p",{children:t})})}}],icons:[{id:"locateFixed",svgContent:'<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'}]}}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as t from"react";import*as e from"react/jsx-runtime";var r,n,o={react:(e,r,n)=>{var o,i;e.exports=(o={useEffect:()=>t.useEffect},i={},n.d(i,o),i)},"react/jsx-runtime":(t,r,n)=>{var o,i;t.exports=(o={jsx:()=>e.jsx},i={},n.d(i,o),i)}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.m=o,a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce((e,r)=>(a.f[r](t,e),e),[])),a.u=t=>"../esm/"+t+".js",a.miniCssF=t=>{},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t+"../css/"})(),r={index:0},n=t=>{var e,n,{__webpack_ids__:o,__webpack_modules__:i,__webpack_runtime__:u}=t,c=0;for(e in i)a.o(i,e)&&(a.m[e]=i[e]);for(u&&u(a);c<o.length;c++)n=o[c],a.o(r,n)&&r[n]&&r[n][0](),r[o[c]]=0},a.f.j=(t,e)=>{var o=a.o(r,t)?r[t]:void 0;if(0!==o)if(o)e.push(o[1]);else{var i=import("../css/"+a.u(t)).then(n,e=>{throw 0!==r[t]&&(r[t]=void 0),e});i=Promise.race([i,new Promise(e=>o=r[t]=[e])]),e.push(o[1]=i)}};var u={};function c(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return f(s,"_invoke",function(r,n,o){var i,u,c,f=0,s=o||[],p=!1,l={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function v(r,n){for(u=r,c=n,e=0;!p&&f&&!o&&e<s.length;e++){var o,i=s[e],v=l.p,m=i[2];r>3?(o=m===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=r<2&&v<i[1])?(u=0,l.v=n,l.n=i[1]):v<m&&(o=r<3||i[0]>n||n>m)&&(i[4]=r,i[5]=n,l.n=m,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,s,m){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&v(s,m),u=s,c=m;(e=u<2?t:c)||!p;){i||(u?u<3?(u>1&&(l.n=-1),v(u,c)):l.n=c:l.v=c);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(p=l.n<0)?c:r.call(n,l))!==a)break}catch(e){i=t,u=1,c=e}finally{f=1}}return{value:e,done:p}}}(r,o,i),!0),s}var a={};function u(){}function s(){}function p(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(f(e={},n,function(){return this}),e),v=p.prototype=u.prototype=Object.create(l);function m(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t}return s.prototype=p,f(v,"constructor",p),f(p,"constructor",s),s.displayName="GeneratorFunction",f(p,o,"GeneratorFunction"),f(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m}})()}function f(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}f=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{function i(e,r){f(t,e,function(t){return this._invoke(e,r,t)})}i("next",0),i("throw",1),i("return",2)}},f(t,e,r,n)}function s(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function p(){return{id:"useLocation",load:(t=c().m(function t(){var e;return c().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,a.e("im-use-location-plugin").then(a.bind(a,"./plugins/use-location/src/manifest.js"));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,u,"next",t)}function u(t){s(i,n,o,a,u,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)})};var t,e}a.d(u,{A:()=>p});const l=u.A;export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[419],{157:(e,t,n)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,{manifest:()=>f});var c={SET_ERROR_MESSAGE:function(e,t){return i(i({},e),{},{errorMessage:t})}},l=n(738),u={PERMISSION_DENIED:"Location permission denied. Please enable it in your browser settings.",POSITION_UNAVAILABLE:"Location information is unavailable.",TIMEOUT:"The location request timed out. Please try again.",FALLBACK:"Unable to get your location."},s=n(287),p={slot:"right-top",showLabel:!1},f={InitComponent:function(e){e.appConfig;var t=e.appState,n=e.pluginState,o=e.mapState,r=e.mapProvider,i=e.buttonConfig.useLocation;return(0,l.useEffect)(function(){if(o.isMapReady)return function(e){var t=e.appState,n=e.pluginState,o=e.mapProvider,r=e.useLocationButton,i=t.dispatch,a=t.buttonRefs,c=n.dispatch;r.onClick=function(){navigator.geolocation.getCurrentPosition(function(e){var t=e.coords,n=t.latitude,r=t.longitude;try{o.setView({center:[r,n],zoom:12})}catch(e){console.log("Map provider failed to pan:",e)}},function(e){var t=function(e){return e&&"number"==typeof e.code&&u[e.code]||u.FALLBACK}(e),n=a.current[r.id];c({type:"SET_ERROR_MESSAGE",payload:t}),i({type:"OPEN_PANEL",payload:{panelId:"useLocation",props:{triggeringElement:n}}})},{enableHighAccuracy:!0,maximumAge:0,timeout:1e4})}}({appState:t,pluginState:n,mapProvider:r,useLocationButton:i}),function(){i.onClick=null}},[o.isMapReady]),null},reducer:{initialState:{errorMessage:null},actions:c},buttons:[{id:"useLocation",group:"location",label:"Use your location",iconId:"locateFixed",hiddenWhen:function(){return!navigator.geolocation},mobile:p,tablet:p,desktop:p}],panels:[{id:"useLocation",label:"Problem getting your location",mobile:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},tablet:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},desktop:{slot:"banner",initiallyOpen:!1,dismissable:!0,modal:!0},render:function(e){var t=e.pluginState.errorMessage;return(0,s.jsx)("div",{className:"im-c-use-location",children:(0,s.jsx)("p",{children:t})})}}],icons:[{id:"locateFixed",svgContent:'<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'}]}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.drawPolygonMLPlugin=t())}(this,()=>(()=>{"use strict";var e,t,r={287:e=>{e.exports=preactJsxRuntime},738:e=>{e.exports=preactCompat}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,r)=>(o.f[r](e,t),t),[])),o.u=e=>"im-use-location-plugin.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="defra.drawPolygonMLPlugin:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",t+i),u.src=r),e[r]=[n];var s=(t,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={57:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,f=0;if(a.some(t=>0!==e[t])){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);f<a.length;f++)i=a[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof f?n:f,p=Object.create(a.prototype);return u(p,"_invoke",function(r,n,o){var i,a,u,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,u=e,s.n=r,c}};function d(r,n){for(a=r,u=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,v=i[2];r>3?(o=v===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,s.v=n,s.n=i[1]):d<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,s.n=v,a=0))}if(o||r>1)return c;throw l=!0,n}return function(o,p,v){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,v),a=p,u=v;(t=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(s.n=-1),d(a,u)):s.n=u:s.v=u);try{if(f=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(l=s.n<0)?u:r.call(n,s))!==c)break}catch(t){i=e,a=1,u=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var c={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,u(d,"constructor",l),u(l,"constructor",p),p.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:v}})()}function u(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){u(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},u(e,t,r,n)}function c(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function f(){return{id:"useLocation",load:(e=a().m(function e(){var t;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(419).then(o.bind(o,157));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return t.apply(this,arguments)})};var e,t}return o.d(i,{default:()=>f}),i.default})());
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see im-reverse-geocode.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_id__="im-reverse-geocode";export const __webpack_ids__=["im-reverse-geocode"];export const __webpack_modules__={"./providers/open-names/src/reverseGeocode.js":(t,e,r)=>{r.r(e),r.d(e,{reverseGeocode:()=>E});let n=" ";class i{static get separator(){return n}static set separator(t){n=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,s=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+i.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),n=o+"°"+i.separator+a+"′"+i.separator+s+"″"}return n}static toLat(t,e,r){const n=i.toDms(i.wrap90(t),e,r);return null===n?"–":n.slice(1)+i.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=i.toDms(i.wrap180(t),e,r);return null===n?"–":n+i.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=i.toDms(i.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=i.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const o=i;class a{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new a(e,r,n)}negate(){return new a(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new a(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");if(!(e instanceof a||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,i=this.dot(t);return Math.atan2(n,i)}rotateAround(t,e){if(!(t instanceof a))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),i=t.unit(),o=Math.sin(r),s=Math.cos(r),l=1-s,c=i.x,u=i.y,h=i.z,d=[[l*c*c+s,l*c*u-o*h,l*c*h+o*u],[l*c*u+o*h,l*u*u+s,l*u*h-o*c],[l*c*h-o*u,l*u*h+o*c,l*h*h+s]],p=[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 a(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const s=a,l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=o.wrap90(Number(t)),this._lon=o.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?o.wrap90(o.parse(t)):o.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?o.wrap90(o.parse(t)):o.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?o.wrap180(o.parse(t)):o.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?o.wrap180(o.parse(t)):o.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?o.wrap180(o.parse(t)):o.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?([r,e,n]=i.coordinates,n=n||0):(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(r=i.longitude),null!=i.lng&&(r=i.lng),null!=i.lon&&(r=i.lon),null!=i.height&&(n=i.height),e=o.wrap90(o.parse(e)),r=o.wrap180(o.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=o.wrap90(o.parse(e)),r=o.wrap180(o.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=o.wrap90(o.parse(e)),r=o.wrap180(o.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:i,f:o}=t,a=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),d=2*o-o*o,p=i/Math.sqrt(1-d*a*a);return new h((p+n)*s*u,(p+n)*s*c,(p*(1-d)+n)*a)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${o.toLat(this.lat,t,e)}, ${o.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:i,b:o,f:a}=t,s=2*a-a*a,c=s/(1-s),h=Math.sqrt(e*e+r*r),d=o*n/(i*h)*(1+c*o/Math.sqrt(h*h+n*n)),p=d/Math.sqrt(1+d*d),f=p/d,m=isNaN(f)?0:Math.atan2(n+c*o*p*p*p,h-s*i*f*f*f),g=Math.atan2(r,e),y=Math.sin(m),w=h*Math.cos(m)+n*y-i*i/(i/Math.sqrt(1-s*y*y));return new u(m.toDegrees(),g.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const d={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}},p={ED50:{ellipsoid:d.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:d.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:d.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:d.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:d.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:d.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:d.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:d.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:d.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:d.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:d.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(d).forEach(t=>Object.freeze(d[t])),Object.keys(p).forEach(t=>{Object.freeze(p[t]),Object.freeze(p[t].transform)});class f extends u{constructor(t,e,r=0,n=p.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return d}static get datums(){return p}static parse(...t){let e=p.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new m(t.x,t.y,t.z,this.datum)}}class m extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||p.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=p.WGS84||(e=this,r=t.transform),t==p.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(p.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,i=t[0],o=t[1],a=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new m(i+e*s-r*u+n*c,o+e*u+r*s-n*l,a-e*c+r*l+n*s)}}const g={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class y{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:i}=g.ellipsoid,o=g.trueOrigin.lat.toRadians(),a=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h;let m=o,y=0;do{m=(r-l-y)/(n*c)+m,y=i*c*((1+h+5/4*d+5/4*p)*(m-o)-(3*h+3*h*h+21/8*p)*Math.sin(m-o)*Math.cos(m+o)+(15/8*d+15/8*p)*Math.sin(2*(m-o))*Math.cos(2*(m+o))-35/24*p*Math.sin(3*(m-o))*Math.cos(3*(m+o)))}while(Math.abs(r-l-y)>=1e-5);const _=Math.cos(m),N=Math.sin(m),b=n*c/Math.sqrt(1-u*N*N),v=n*c*(1-u)/Math.pow(1-u*N*N,1.5),E=b/v-1,S=Math.tan(m),M=S*S,T=M*M,$=1/_,x=b*b*b,G=x*b*b,O=e-s,F=O*O,R=F*O,W=F*F,L=R*F;m=m-S/(2*v*b)*F+S/(24*v*x)*(5+3*M+E-9*M*E)*W-S/(720*v*G)*(61+90*M+45*T)*(W*F);const z=a+$/b*O-$/(6*x)*(b/v+2*M)*R+$/(120*G)*(5+28*M+24*T)*L-$/(G*b*b*5040)*(61+662*M+1320*T+T*M*720)*(L*F);let A=new w(m.toDegrees(),z.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(A=A.convertDatum(t),A=new w(A.lat,A.lon,A.height,A.datum)),A}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new y(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const i=(r-2)%5*5+n%5,o=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=i+a[0],l=o+a[1];return new y(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),i=Math.floor(r/1e5);let o=19-i-(19-i)%5+Math.floor((n+10)/5),a=5*(19-i)%25+n%5;o>7&&o++,a>7&&a++;const s=String.fromCharCode(o+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:i}=g.ellipsoid,o=g.trueOrigin.lat.toRadians(),a=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h,m=Math.cos(e),w=Math.sin(e),_=n*c/Math.sqrt(1-u*w*w),N=n*c*(1-u)/Math.pow(1-u*w*w,1.5),b=_/N-1,v=i*c*((1+h+5/4*d+5/4*p)*(e-o)-(3*h+3*h*h+21/8*p)*Math.sin(e-o)*Math.cos(e+o)+(15/8*d+15/8*p)*Math.sin(2*(e-o))*Math.cos(2*(e+o))-35/24*p*Math.sin(3*(e-o))*Math.cos(3*(e+o))),E=m*m*m,S=E*m*m,M=Math.tan(e)*Math.tan(e),T=M*M,$=r-a,x=$*$,G=x*$,O=G*$,F=O*$;let R=v+l+_/2*w*m*x+_/24*w*E*(5-M+9*b)*O+_/720*w*S*(61-58*M+T)*(F*$),W=s+_*m*$+_/6*E*(_/N-M)*G+_/120*S*(5-18*M+T+14*b-58*M*b)*F;R=Number(R.toFixed(3)),W=Number(W.toFixed(3));try{return new y(W,R)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function _(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,i=t.COUNTY_UNITARY,o=t.REGION,a=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(i?", "+i:"",", ").concat(o),county:i||"",coordinates:[a,s]}}function N(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return b(c,"_invoke",function(r,n,i){var o,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return o=e,s=0,l=t,d.n=r,a}};function p(r,n){for(s=r,l=n,e=0;!h&&c&&!i&&e<u.length;e++){var i,o=u[e],p=d.p,f=o[2];r>3?(i=f===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=r<2&&p<o[1])?(s=0,d.v=n,d.n=o[1]):p<f&&(i=r<3||o[0]>n||n>f)&&(o[4]=r,o[5]=n,d.n=f,s=0))}if(i||r>1)return a;throw h=!0,n}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(e=s<2?t:l)||!h;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(h=d.n<0)?l:r.call(n,d))!==a)break}catch(e){o=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,i,o),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(b(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,b(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,b(h,"constructor",c),b(c,"constructor",l),l.displayName="GeneratorFunction",b(c,i,"GeneratorFunction"),b(h),b(h,i,"Generator"),b(h,n,function(){return this}),b(h,"toString",function(){return"[object Generator]"}),(N=function(){return{w:o,m:d}})()}function b(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}b=function(t,e,r,n){if(e)i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{function o(e,r){b(t,e,function(t){return this._invoke(e,r,t)})}o("next",0),o("throw",1),o("return",2)}},b(t,e,r,n)}function v(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var E=function(){var t,e=(t=N().m(function t(){var e,r,n,i,o,a,s,l,c,u,h,d,p,f,m=arguments;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=m.length>1?m[1]:void 0,o=i=m.length>4?m[4]:void 0,"EPSG:4326"!==(n=m.length>2?m[2]:void 0)){t.n=3;break}t.p=1,o=[(o=new w(i[1],i[0]).toOsGrid()).easting,o.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,p=t.v,console.log(p),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(o[0])).replace("{northing}",Math.round(o[1])),a=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(a);case 5:a=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(a);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=_(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new y(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),d="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?d:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){v(o,n,i,a,s,"next",t)}function s(t){v(o,n,i,a,s,"throw",t)}a(void 0)})});return function(){return e.apply(this,arguments)}}()}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>"../esm/"+e+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../css/"})(),e={index:0},r=r=>{var t,o,{__webpack_ids__:i,__webpack_modules__:c,__webpack_runtime__:u}=r,a=0;for(t in c)n.o(c,t)&&(n.m[t]=c[t]);for(u&&u(n);a<i.length;a++)o=i[a],n.o(e,o)&&e[o]&&e[o][0](),e[i[a]]=0},n.f.j=(t,o)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)o.push(i[1]);else{var c=import("../css/"+n.u(t)).then(r,r=>{throw 0!==e[t]&&(e[t]=void 0),r});c=Promise.race([c,new Promise(r=>i=e[t]=[r])]),o.push(i[1]=c)}};var i={};function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(){var e,r,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function i(t,o,n,i){var u=o&&o.prototype instanceof f?o:f,p=Object.create(u.prototype);return a(p,"_invoke",function(t,o,n){var i,u,a,f=0,p=n||[],s=!1,l={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function(r,t){return i=r,u=0,a=e,l.n=t,c}};function y(t,o){for(u=t,a=o,r=0;!s&&f&&!n&&r<p.length;r++){var n,i=p[r],y=l.p,b=i[2];t>3?(n=b===o)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=y&&((n=t<2&&y<i[1])?(u=0,l.v=o,l.n=i[1]):y<b&&(n=t<3||i[0]>o||o>b)&&(i[4]=t,i[5]=o,l.n=b,u=0))}if(n||t>1)return c;throw s=!0,o}return function(n,p,b){if(f>1)throw TypeError("Generator is already running");for(s&&1===p&&y(p,b),u=p,a=b;(r=u<2?e:a)||!s;){i||(u?u<3?(u>1&&(l.n=-1),y(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(n="next"),r=i[n]){if(!(r=r.call(i,a)))throw TypeError("iterator result is not an object");if(!r.done)return r;a=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),u=1);i=e}else if((r=(s=l.n<0)?a:t.call(o,l))!==c)break}catch(r){i=e,u=1,a=r}finally{f=1}}return{value:r,done:s}}}(t,n,i),!0),p}var c={};function f(){}function p(){}function s(){}r=Object.getPrototypeOf;var l=[][o]?r(r([][o]())):(a(r={},o,function(){return this}),r),y=s.prototype=f.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,a(e,n,"GeneratorFunction")),e.prototype=Object.create(y),e}return p.prototype=s,a(y,"constructor",s),a(s,"constructor",p),p.displayName="GeneratorFunction",a(s,n,"GeneratorFunction"),a(y),a(y,n,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:b}})()}function a(e,r,t,o){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}a=function(e,r,t,o){if(r)n?n(e,r,{value:t,enumerable:!o,configurable:!o,writable:!o}):e[r]=t;else{function i(r,t){a(e,r,function(e){return this._invoke(r,t,e)})}i("next",0),i("throw",1),i("return",2)}},a(e,r,t,o)}function f(e,r,t,o,n,i,c){try{var u=e[i](c),a=u.value}catch(e){return void t(e)}u.done?r(a):Promise.resolve(a).then(o,n)}function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach(function(r){l(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function l(e,r,t){return(r=function(e){var r=function(e){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=c(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function y(){var e,r;return s(s({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=u().m(function e(){var r;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e("im-reverse-geocode").then(n.bind(n,"./providers/open-names/src/reverseGeocode.js"));case 1:return r=e.v,e.a(2,r.reverseGeocode)}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(o,n){var i=e.apply(r,t);function c(e){f(i,o,n,c,u,"next",e)}function u(e){f(i,o,n,c,u,"throw",e)}c(void 0)})},function(){return r.apply(this,arguments)})})}n.d(i,{A:()=>y});const b=i.A;export{b as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see im-reverse-geocode.js.LICENSE.txt */
|
|
2
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[627],{246:(t,e,r)=>{r.r(e),r.d(e,{reverseGeocode:()=>v});let n=" ";class i{static get separator(){return n}static set separator(t){n=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,a=null,o=null,s=null;switch(e){default:case"d":case"deg":a=t.toFixed(r),a<100&&(a="0"+a),a<10&&(a="0"+a),n=a+"°";break;case"dm":case"deg+min":a=Math.floor(t),o=(60*t%60).toFixed(r),60==o&&(o=(0).toFixed(r),a++),a=("000"+a).slice(-3),o<10&&(o="0"+o),n=a+"°"+i.separator+o+"′";break;case"dms":case"deg+min+sec":a=Math.floor(t),o=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),o++),60==o&&(o=0,a++),a=("000"+a).slice(-3),o=("00"+o).slice(-2),s<10&&(s="0"+s),n=a+"°"+i.separator+o+"′"+i.separator+s+"″"}return n}static toLat(t,e,r){const n=i.toDms(i.wrap90(t),e,r);return null===n?"–":n.slice(1)+i.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=i.toDms(i.wrap180(t),e,r);return null===n?"–":n+i.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=i.toDms(i.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=i.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const a=i;class o{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new o(e,r,n)}negate(){return new o(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new o(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");if(!(e instanceof o||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,i=this.dot(t);return Math.atan2(n,i)}rotateAround(t,e){if(!(t instanceof o))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),i=t.unit(),a=Math.sin(r),s=Math.cos(r),l=1-s,c=i.x,u=i.y,h=i.z,d=[[l*c*c+s,l*c*u-a*h,l*c*h+a*u],[l*c*u+a*h,l*u*u+s,l*u*h-a*c],[l*c*h-a*u,l*u*h+a*c,l*h*h+s]],p=[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 o(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const s=o,l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=a.wrap90(Number(t)),this._lon=a.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?([r,e,n]=i.coordinates,n=n||0):(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(r=i.longitude),null!=i.lng&&(r=i.lng),null!=i.lon&&(r=i.lon),null!=i.height&&(n=i.height),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:i,f:a}=t,o=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),d=2*a-a*a,p=i/Math.sqrt(1-d*o*o);return new h((p+n)*s*u,(p+n)*s*c,(p*(1-d)+n)*o)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${a.toLat(this.lat,t,e)}, ${a.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:i,b:a,f:o}=t,s=2*o-o*o,c=s/(1-s),h=Math.sqrt(e*e+r*r),d=a*n/(i*h)*(1+c*a/Math.sqrt(h*h+n*n)),p=d/Math.sqrt(1+d*d),f=p/d,m=isNaN(f)?0:Math.atan2(n+c*a*p*p*p,h-s*i*f*f*f),g=Math.atan2(r,e),y=Math.sin(m),w=h*Math.cos(m)+n*y-i*i/(i/Math.sqrt(1-s*y*y));return new u(m.toDegrees(),g.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const d={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}},p={ED50:{ellipsoid:d.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:d.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:d.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:d.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:d.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:d.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:d.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:d.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:d.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:d.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:d.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(d).forEach(t=>Object.freeze(d[t])),Object.keys(p).forEach(t=>{Object.freeze(p[t]),Object.freeze(p[t].transform)});class f extends u{constructor(t,e,r=0,n=p.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return d}static get datums(){return p}static parse(...t){let e=p.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new m(t.x,t.y,t.z,this.datum)}}class m extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||p.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=p.WGS84||(e=this,r=t.transform),t==p.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(p.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,i=t[0],a=t[1],o=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new m(i+e*s-r*u+n*c,a+e*u+r*s-n*l,o-e*c+r*l+n*s)}}const g={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class y{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h;let m=a,y=0;do{m=(r-l-y)/(n*c)+m,y=i*c*((1+h+5/4*d+5/4*p)*(m-a)-(3*h+3*h*h+21/8*p)*Math.sin(m-a)*Math.cos(m+a)+(15/8*d+15/8*p)*Math.sin(2*(m-a))*Math.cos(2*(m+a))-35/24*p*Math.sin(3*(m-a))*Math.cos(3*(m+a)))}while(Math.abs(r-l-y)>=1e-5);const _=Math.cos(m),N=Math.sin(m),b=n*c/Math.sqrt(1-u*N*N),E=n*c*(1-u)/Math.pow(1-u*N*N,1.5),v=b/E-1,S=Math.tan(m),M=S*S,T=M*M,$=1/_,x=b*b*b,G=x*b*b,O=e-s,F=O*O,R=F*O,W=F*F,D=R*F;m=m-S/(2*E*b)*F+S/(24*E*x)*(5+3*M+v-9*M*v)*W-S/(720*E*G)*(61+90*M+45*T)*(W*F);const L=o+$/b*O-$/(6*x)*(b/E+2*M)*R+$/(120*G)*(5+28*M+24*T)*D-$/(G*b*b*5040)*(61+662*M+1320*T+T*M*720)*(D*F);let z=new w(m.toDegrees(),L.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(z=z.convertDatum(t),z=new w(z.lat,z.lon,z.height,z.datum)),z}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new y(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const i=(r-2)%5*5+n%5,a=19-5*Math.floor(r/5)-Math.floor(n/5);let o=t.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 ‘${t}’`);o[0]=o[0].padEnd(5,"0"),o[1]=o[1].padEnd(5,"0");const s=i+o[0],l=a+o[1];return new y(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),i=Math.floor(r/1e5);let a=19-i-(19-i)%5+Math.floor((n+10)/5),o=5*(19-i)%25+n%5;a>7&&a++,o>7&&o++;const s=String.fromCharCode(a+"A".charCodeAt(0),o+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h,m=Math.cos(e),w=Math.sin(e),_=n*c/Math.sqrt(1-u*w*w),N=n*c*(1-u)/Math.pow(1-u*w*w,1.5),b=_/N-1,E=i*c*((1+h+5/4*d+5/4*p)*(e-a)-(3*h+3*h*h+21/8*p)*Math.sin(e-a)*Math.cos(e+a)+(15/8*d+15/8*p)*Math.sin(2*(e-a))*Math.cos(2*(e+a))-35/24*p*Math.sin(3*(e-a))*Math.cos(3*(e+a))),v=m*m*m,S=v*m*m,M=Math.tan(e)*Math.tan(e),T=M*M,$=r-o,x=$*$,G=x*$,O=G*$,F=O*$;let R=E+l+_/2*w*m*x+_/24*w*v*(5-M+9*b)*O+_/720*w*S*(61-58*M+T)*(F*$),W=s+_*m*$+_/6*v*(_/N-M)*G+_/120*S*(5-18*M+T+14*b-58*M*b)*F;R=Number(R.toFixed(3)),W=Number(W.toFixed(3));try{return new y(W,R)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function _(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,i=t.COUNTY_UNITARY,a=t.REGION,o=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(i?", "+i:"",", ").concat(a),county:i||"",coordinates:[o,s]}}function N(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return b(c,"_invoke",function(r,n,i){var a,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,s=0,l=t,d.n=r,o}};function p(r,n){for(s=r,l=n,e=0;!h&&c&&!i&&e<u.length;e++){var i,a=u[e],p=d.p,f=a[2];r>3?(i=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=p&&((i=r<2&&p<a[1])?(s=0,d.v=n,d.n=a[1]):p<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,d.n=f,s=0))}if(i||r>1)return o;throw h=!0,n}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(e=s<2?t:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(h=d.n<0)?l:r.call(n,d))!==o)break}catch(e){a=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,i,a),!0),c}var o={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(b(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,b(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,b(h,"constructor",c),b(c,"constructor",l),l.displayName="GeneratorFunction",b(c,i,"GeneratorFunction"),b(h),b(h,i,"Generator"),b(h,n,function(){return this}),b(h,"toString",function(){return"[object Generator]"}),(N=function(){return{w:a,m:d}})()}function b(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}b=function(t,e,r,n){if(e)i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{function a(e,r){b(t,e,function(t){return this._invoke(e,r,t)})}a("next",0),a("throw",1),a("return",2)}},b(t,e,r,n)}function E(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var v=function(){var t,e=(t=N().m(function t(){var e,r,n,i,a,o,s,l,c,u,h,d,p,f,m=arguments;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=m.length>1?m[1]:void 0,a=i=m.length>4?m[4]:void 0,"EPSG:4326"!==(n=m.length>2?m[2]:void 0)){t.n=3;break}t.p=1,a=[(a=new w(i[1],i[0]).toOsGrid()).easting,a.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,p=t.v,console.log(p),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(a[0])).replace("{northing}",Math.round(a[1])),o=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(o);case 5:o=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(o);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=_(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new y(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),d="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?d:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){E(a,n,i,o,s,"next",t)}function s(t){E(a,n,i,o,s,"throw",t)}o(void 0)})});return function(){return e.apply(this,arguments)}}()}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.openNamesProvider=t())}(this,()=>(()=>{"use strict";var e,t,r={},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,r)=>(o.f[r](e,t),t),[])),o.u=e=>"im-reverse-geocode.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="defra.openNamesProvider:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var c,u;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(u=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var s=(t,n)=>{c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),u&&document.head.appendChild(c)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={57:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=i);var a=o.p+o.u(t),c=new Error;o.l(a,r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,n[1](c)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,c,u]=r,f=0;if(a.some(t=>0!==e[t])){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);u&&u(o)}for(t&&t(r);f<a.length;f++)i=a[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof f?n:f,p=Object.create(c.prototype);return u(p,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,u=e,s.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,b=i[2];r>3?(o=b===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,s.v=n,s.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,s.n=b,c=0))}if(o||r>1)return a;throw l=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,b),c=p,u=b;(t=c<2?e:u)||!l;){i||(c?c<3?(c>1&&(s.n=-1),d(c,u)):s.n=u:s.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=s.n<0)?u:r.call(n,s))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var a={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,u(d,"constructor",l),u(l,"constructor",p),p.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:b}})()}function u(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{function i(t,r){u(e,t,function(e){return this._invoke(t,r,e)})}i("next",0),i("throw",1),i("return",2)}},u(e,t,r,n)}function f(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}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 l(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){s(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}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e,t;return l(l({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(627).then(o.bind(o,246));case 1:return t=e.v,e.a(2,t.reverseGeocode)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){f(i,n,o,a,c,"next",e)}function c(e){f(i,n,o,a,c,"throw",e)}a(void 0)})},function(){return t.apply(this,arguments)})})}return o.d(i,{default:()=>d}),i.default})());
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|