@opengeoweb/core 4.19.0 → 4.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/index.esm.js +1984 -964
  2. package/index.umd.js +2092 -1047
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -1
  4. package/lib/components/LayerManager/DockedLayerManagerConnect.d.ts +2 -1
  5. package/lib/components/LayerManager/LayerContainerRow/LayerContainerRow.d.ts +2 -0
  6. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayerConnect.d.ts +2 -0
  7. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DragHandle/DragHandle.d.ts +3 -1
  8. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayerConnect.d.ts +2 -0
  9. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  10. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRowConnect.d.ts +2 -0
  11. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts +2 -0
  12. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButtonConnect.d.ts +2 -0
  13. package/lib/components/LayerManager/LayerContainerRow/LayerRow/OpacitySelect/OpacitySelect.d.ts +1 -0
  14. package/lib/components/LayerManager/LayerContainerRow/LayerRow/OpacitySelect/OpacitySelectConnect.d.ts +1 -0
  15. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderLayers/RenderLayers.d.ts +1 -0
  16. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderLayers/RenderLayersConnect.d.ts +1 -0
  17. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderStyles/RenderStyles.d.ts +2 -0
  18. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderStyles/RenderStylesConnect.d.ts +2 -0
  19. package/lib/components/LayerManager/LayerManager.d.ts +1 -1
  20. package/lib/components/LayerManager/LayerManagerConnect.d.ts +2 -1
  21. package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +21 -0
  22. package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +2 -1
  23. package/lib/components/LayerManager/LayerManagerUtils.d.ts +50 -1
  24. package/lib/components/LayerManager/index.d.ts +1 -0
  25. package/lib/components/MapControls/MapControlButton.d.ts +2 -3
  26. package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -2
  27. package/lib/components/TimeSliderLite/TimeSliderLite.d.ts +35 -0
  28. package/lib/components/TimeSliderLite/TimeSliderLite.spec.d.ts +1 -0
  29. package/lib/components/TimeSliderLite/TimeSliderLite.stories.d.ts +9 -0
  30. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.d.ts +20 -0
  31. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.spec.d.ts +1 -0
  32. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackground.d.ts +17 -0
  33. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.d.ts +12 -0
  34. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.spec.d.ts +1 -0
  35. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/ControlButtonGroup/ControlButtonGroup.d.ts +8 -0
  36. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/HideButton/HideButton.d.ts +9 -0
  37. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/MenuButton/MenuButton.d.ts +9 -0
  38. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/PlayButton/PlayButton.d.ts +10 -0
  39. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/StepButton/StepButton.d.ts +10 -0
  40. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/TimeSliderLiteButtonUtils.d.ts +3 -0
  41. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.d.ts +12 -0
  42. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.spec.d.ts +1 -0
  43. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.stories.d.ts +9 -0
  44. package/lib/components/TimeSliderLite/index.d.ts +3 -0
  45. package/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +47 -0
  46. package/lib/components/TimeSliderLite/timeSliderLiteUtils.spec.d.ts +1 -0
  47. package/lib/index.d.ts +5 -4
  48. package/lib/store/generic/index.d.ts +2 -0
  49. package/lib/store/generic/synchronizationGroups/index.d.ts +1 -0
  50. package/lib/store/generic/synchronizationGroups/selectors.d.ts +3 -1
  51. package/lib/store/generic/synchronizationGroups/types.d.ts +9 -5
  52. package/lib/store/mapStore/layers/reducer.d.ts +2 -2
  53. package/lib/store/mapStore/layers/types.d.ts +0 -2
  54. package/lib/store/mapStore/map/index.d.ts +1 -1
  55. package/lib/store/mapStore/utils/helpers.d.ts +1 -0
  56. package/lib/store/ui/index.d.ts +1 -1
  57. package/lib/utils/sanitizeHTML.d.ts +3 -0
  58. package/lib/utils/sanitizeHTML.spec.d.ts +1 -0
  59. package/package.json +10 -9
package/index.esm.js CHANGED
@@ -1,14 +1,14 @@
1
- import { createAction, createSlice, createSelector, createEntityAdapter } from '@reduxjs/toolkit';
1
+ import { createSlice, createSelector, createAction, createEntityAdapter } from '@reduxjs/toolkit';
2
+ import _, { isEqual, debounce, compact, escapeRegExp, groupBy, throttle, range } from 'lodash';
2
3
  import produce$1, { current, produce } from 'immer';
3
4
  import moment from 'moment';
4
5
  import * as React from 'react';
5
- import React__default, { Component, useRef, useState, useEffect, useCallback } from 'react';
6
- import _, { debounce, isEqual, compact, escapeRegExp, groupBy, throttle, range } from 'lodash';
6
+ import React__default, { Component, useRef, useState, useEffect, useCallback, useLayoutEffect } from 'react';
7
7
  import { takeLatest, put, select, call, takeEvery, all, delay } from 'redux-saga/effects';
8
8
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
9
- import { CustomTooltip, ToolButton, ToolContainerDraggable, CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
9
+ import { CustomIconButton, CustomTooltip, ToolContainerDraggable, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
10
10
  import { Pause, Play, CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, Add, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Home, Minus, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
11
- import { Paper, Box, Typography, Grid, MenuItem, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled, Slider, Menu, useTheme, Snackbar } from '@mui/material';
11
+ import { Paper, Box, Typography, Grid, MenuItem, useTheme, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled, Slider, Menu, Tooltip, IconButton, ButtonGroup, Divider, Snackbar } from '@mui/material';
12
12
  import { legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WMGetServiceFromStore, LayerType as LayerType$1, clearImageCache, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer } from '@opengeoweb/webmap';
13
13
  import { ReactSortable } from 'react-sortablejs';
14
14
  import Sortable from 'sortablejs';
@@ -28,10 +28,224 @@ import Draggable from 'react-draggable';
28
28
  import { Resizable } from 're-resizable';
29
29
  import axios from 'axios';
30
30
  import { useDebounce } from '@opengeoweb/api';
31
+ import * as DOMPurify from 'dompurify';
31
32
  import { createStore } from '@redux-eggs/redux-toolkit';
32
33
  import { getSagaExtension } from '@redux-eggs/saga-extension';
33
34
  import { useNavigate } from 'react-router-dom';
34
35
 
36
+ /* *
37
+ * Licensed under the Apache License, Version 2.0 (the "License");
38
+ * you may not use this file except in compliance with the License.
39
+ * You may obtain a copy of the License at
40
+ *
41
+ * http://www.apache.org/licenses/LICENSE-2.0
42
+ *
43
+ * Unless required by applicable law or agreed to in writing, software
44
+ * distributed under the License is distributed on an "AS IS" BASIS,
45
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46
+ * See the License for the specific language governing permissions and
47
+ * limitations under the License.
48
+ *
49
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
50
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
51
+ * */
52
+ var initialState$8 = {
53
+ byId: {},
54
+ allIds: []
55
+ };
56
+ var slice$8 = createSlice({
57
+ initialState: initialState$8,
58
+ name: 'serviceReducer',
59
+ reducers: {
60
+ serviceSetLayers: function serviceSetLayers(draft, action) {
61
+ var id = action.payload.id;
62
+ draft.byId[id] = Object.assign({}, action.payload);
63
+
64
+ if (!draft.allIds.includes(id)) {
65
+ draft.allIds.push(id);
66
+ }
67
+ },
68
+ mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
69
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
70
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
71
+ });
72
+
73
+ if (foundServiceIndex !== -1) {
74
+ var serviceId = draft.allIds[foundServiceIndex];
75
+ draft.allIds = draft.allIds.filter(function (id) {
76
+ return id !== serviceId;
77
+ });
78
+ delete draft.byId[serviceId];
79
+ }
80
+ },
81
+ fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
82
+ draft, // eslint-disable-next-line no-unused-vars
83
+ action) {}
84
+ }
85
+ });
86
+ var reducer$8 = slice$8.reducer;
87
+ var serviceActions = slice$8.actions;
88
+
89
+ /* *
90
+ * Licensed under the Apache License, Version 2.0 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * http://www.apache.org/licenses/LICENSE-2.0
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" BASIS,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ *
102
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
103
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
104
+ * */
105
+ var selectorMemoizationOptions = {
106
+ memoizeOptions: {
107
+ maxSize: 1000,
108
+ resultEqualityCheck: isEqual
109
+ }
110
+ };
111
+ var isUserAddedService = function isUserAddedService(scope) {
112
+ return scope === 'user';
113
+ };
114
+
115
+ /* *
116
+ * Licensed under the Apache License, Version 2.0 (the "License");
117
+ * you may not use this file except in compliance with the License.
118
+ * You may obtain a copy of the License at
119
+ *
120
+ * http://www.apache.org/licenses/LICENSE-2.0
121
+ *
122
+ * Unless required by applicable law or agreed to in writing, software
123
+ * distributed under the License is distributed on an "AS IS" BASIS,
124
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125
+ * See the License for the specific language governing permissions and
126
+ * limitations under the License.
127
+ *
128
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
129
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
130
+ * */
131
+
132
+ var servicesStore = function servicesStore(store) {
133
+ return store && store.services ? store.services : null;
134
+ };
135
+ /**
136
+ * Retrieves all serviceIds
137
+ *
138
+ * Example: serviceIds = getServiceIds(store)
139
+ * @param {object} store store: object - object from which the service state will be extracted
140
+ * @returns {array} returnType: array - an array of all serviceIds
141
+ */
142
+
143
+
144
+ var getServiceIds = createSelector(servicesStore, function (serviceState) {
145
+ return serviceState ? serviceState.allIds : [];
146
+ }, selectorMemoizationOptions);
147
+ /**
148
+ * Gets map services
149
+ *
150
+ * Example: services = getServices(store)
151
+ * @param {object} store store: object - Store object
152
+ * @returns {object} returnType: ServiceState
153
+ */
154
+
155
+ var getServices = createSelector(servicesStore, function (store) {
156
+ return store ? store.byId : {};
157
+ }, selectorMemoizationOptions);
158
+ /**
159
+ * Gets the service object by its url
160
+ *
161
+ * Example: service = getServiceByName(store, 'serviceName')
162
+ * @param {object} store store: object - Store object
163
+ * @returns {ReduxService} returnType: Service
164
+ */
165
+
166
+ var getServiceByName = createSelector([servicesStore, function (state, serviceUrl) {
167
+ return serviceUrl;
168
+ }], function (serviceState, serviceUrl) {
169
+ var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
170
+ return serviceState.byId[id].serviceUrl === serviceUrl;
171
+ });
172
+ /* Add the service based on a url */
173
+
174
+ var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
175
+
176
+ if (serviceState && serviceState.byId && serviceState.byId[id]) {
177
+ return serviceState.byId[id];
178
+ }
179
+
180
+ return null;
181
+ }, selectorMemoizationOptions);
182
+ /**
183
+ * Gets the layer from the store using the serviceUrl and layerName
184
+ *
185
+ * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
186
+ * @param {object} store store: object - object from which the layers state will be extracted
187
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
188
+ * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
189
+ */
190
+
191
+ var getLayersFromService$1 = createSelector(getServiceByName, function (service) {
192
+ return service && service.layers || null;
193
+ }, selectorMemoizationOptions);
194
+ /**
195
+ * Gets the layer from the store using the serviceUrl and layerName
196
+ *
197
+ * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
198
+ * @param {object} store store: object - The application store
199
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
200
+ * @param {string} layerName layerName: string - Name of the layer in the service
201
+ * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
202
+ */
203
+
204
+ var getLayerFromService = createSelector(function (store, serviceUrl) {
205
+ return getLayersFromService$1(store, serviceUrl);
206
+ }, function (store, serviceUrl) {
207
+ return serviceUrl;
208
+ }, function (store, serviceUrl, layerName) {
209
+ return layerName;
210
+ }, function (layers, serviceUrl, layerName) {
211
+ if (!layers) {
212
+ return null;
213
+ }
214
+
215
+ var index = layers.findIndex(function (serviceLayer) {
216
+ return serviceLayer.name === layerName;
217
+ });
218
+
219
+ if (index === -1) {
220
+ return null;
221
+ }
222
+
223
+ return layers[index];
224
+ }, selectorMemoizationOptions);
225
+ /**
226
+ * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
227
+ *
228
+ * Example: layerStyles = getLayerStyles(store, layerService, layerName);
229
+ * @param {object} store store: object - store from which the layers state will be extracted
230
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
231
+ * @param {string} layerName layerName: string - Name of the layer in the service
232
+ * @returns {array} returnType: Style[] - array containing layer styles
233
+ */
234
+
235
+ var getLayerStyles$1 = createSelector(getLayerFromService, function (layer) {
236
+ return layer && layer.styles ? layer.styles : [];
237
+ }, selectorMemoizationOptions);
238
+
239
+ var selectors$5 = /*#__PURE__*/Object.freeze({
240
+ __proto__: null,
241
+ getServiceIds: getServiceIds,
242
+ getServices: getServices,
243
+ getServiceByName: getServiceByName,
244
+ getLayersFromService: getLayersFromService$1,
245
+ getLayerFromService: getLayerFromService,
246
+ getLayerStyles: getLayerStyles$1
247
+ });
248
+
35
249
  function _typeof(obj) {
36
250
  "@babel/helpers - typeof";
37
251
 
@@ -293,141 +507,6 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
293
507
  };
294
508
  }
295
509
 
296
- /*! *****************************************************************************
297
- Copyright (c) Microsoft Corporation.
298
-
299
- Permission to use, copy, modify, and/or distribute this software for any
300
- purpose with or without fee is hereby granted.
301
-
302
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
303
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
304
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
305
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
306
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
307
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
308
- PERFORMANCE OF THIS SOFTWARE.
309
- ***************************************************************************** */
310
-
311
- function __rest(s, e) {
312
- var t = {};
313
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
314
- t[p] = s[p];
315
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
316
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
317
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
318
- t[p[i]] = s[p[i]];
319
- }
320
- return t;
321
- }
322
-
323
- function __awaiter(thisArg, _arguments, P, generator) {
324
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
325
- return new (P || (P = Promise))(function (resolve, reject) {
326
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
327
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
328
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
329
- step((generator = generator.apply(thisArg, _arguments || [])).next());
330
- });
331
- }
332
-
333
- /* *
334
- * Licensed under the Apache License, Version 2.0 (the "License");
335
- * you may not use this file except in compliance with the License.
336
- * You may obtain a copy of the License at
337
- *
338
- * http://www.apache.org/licenses/LICENSE-2.0
339
- *
340
- * Unless required by applicable law or agreed to in writing, software
341
- * distributed under the License is distributed on an "AS IS" BASIS,
342
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343
- * See the License for the specific language governing permissions and
344
- * limitations under the License.
345
- *
346
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
347
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
348
- * */
349
- var LayerType;
350
-
351
- (function (LayerType) {
352
- LayerType["mapLayer"] = "mapLayer";
353
- LayerType["baseLayer"] = "baseLayer";
354
- LayerType["overLayer"] = "overLayer";
355
- })(LayerType || (LayerType = {}));
356
-
357
- var LayerStatus;
358
-
359
- (function (LayerStatus) {
360
- LayerStatus["default"] = "default";
361
- LayerStatus["error"] = "error";
362
- })(LayerStatus || (LayerStatus = {}));
363
-
364
- var LayerActionOrigin;
365
-
366
- (function (LayerActionOrigin) {
367
- LayerActionOrigin["layerManager"] = "layerManager";
368
- LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
369
- LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
370
- LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
371
- LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
372
- LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
373
- })(LayerActionOrigin || (LayerActionOrigin = {}));
374
-
375
- var types$3 = /*#__PURE__*/Object.freeze({
376
- __proto__: null,
377
- get LayerType () { return LayerType; },
378
- get LayerStatus () { return LayerStatus; },
379
- get LayerActionOrigin () { return LayerActionOrigin; }
380
- });
381
-
382
- /* *
383
- * Licensed under the Apache License, Version 2.0 (the "License");
384
- * you may not use this file except in compliance with the License.
385
- * You may obtain a copy of the License at
386
- *
387
- * http://www.apache.org/licenses/LICENSE-2.0
388
- *
389
- * Unless required by applicable law or agreed to in writing, software
390
- * distributed under the License is distributed on an "AS IS" BASIS,
391
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
392
- * See the License for the specific language governing permissions and
393
- * limitations under the License.
394
- *
395
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
396
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
397
- * */
398
- var Scale;
399
-
400
- (function (Scale) {
401
- Scale[Scale["Minutes5"] = 0] = "Minutes5";
402
- Scale[Scale["Hour"] = 1] = "Hour";
403
- Scale[Scale["Hours3"] = 2] = "Hours3";
404
- Scale[Scale["Hours6"] = 3] = "Hours6";
405
- Scale[Scale["Day"] = 4] = "Day";
406
- Scale[Scale["Week"] = 5] = "Week";
407
- Scale[Scale["Month"] = 6] = "Month";
408
- Scale[Scale["Year"] = 7] = "Year";
409
- Scale[Scale["DataScale"] = 8] = "DataScale";
410
- })(Scale || (Scale = {}));
411
-
412
- var AnimationLength;
413
-
414
- (function (AnimationLength) {
415
- AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
416
- AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
417
- AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
418
- AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
419
- AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
420
- AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
421
- AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
422
- AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
423
- })(AnimationLength || (AnimationLength = {}));
424
-
425
- var MapActionOrigin;
426
-
427
- (function (MapActionOrigin) {
428
- MapActionOrigin["map"] = "map";
429
- })(MapActionOrigin || (MapActionOrigin = {}));
430
-
431
510
  /* *
432
511
  * Licensed under the Apache License, Version 2.0 (the "License");
433
512
  * you may not use this file except in compliance with the License.
@@ -489,6 +568,16 @@ var unRegisterWMJSLayer = function unRegisterWMJSLayer(layerId) {
489
568
  delete registeredWMLayersForReactLayerId[layerId];
490
569
  }
491
570
  };
571
+ var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
572
+ var allLayerIds = Object.values(registeredWMLayersForReactLayerId);
573
+ allLayerIds.forEach(function (layerId) {
574
+ unRegisterWMJSLayer(layerId);
575
+ });
576
+ var allMapIds = Object.values(registeredWMMapForReactMapId);
577
+ allMapIds.forEach(function (mapId) {
578
+ unRegisterWMJSMap(mapId);
579
+ });
580
+ };
492
581
  /**
493
582
  * Map for registering wmlayers with their id's
494
583
  */
@@ -653,6 +742,104 @@ var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
653
742
  return wmjsTimeDim.getLastValue();
654
743
  };
655
744
 
745
+ /* *
746
+ * Licensed under the Apache License, Version 2.0 (the "License");
747
+ * you may not use this file except in compliance with the License.
748
+ * You may obtain a copy of the License at
749
+ *
750
+ * http://www.apache.org/licenses/LICENSE-2.0
751
+ *
752
+ * Unless required by applicable law or agreed to in writing, software
753
+ * distributed under the License is distributed on an "AS IS" BASIS,
754
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755
+ * See the License for the specific language governing permissions and
756
+ * limitations under the License.
757
+ *
758
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
759
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
760
+ * */
761
+ var Scale;
762
+
763
+ (function (Scale) {
764
+ Scale[Scale["Minutes5"] = 0] = "Minutes5";
765
+ Scale[Scale["Hour"] = 1] = "Hour";
766
+ Scale[Scale["Hours3"] = 2] = "Hours3";
767
+ Scale[Scale["Hours6"] = 3] = "Hours6";
768
+ Scale[Scale["Day"] = 4] = "Day";
769
+ Scale[Scale["Week"] = 5] = "Week";
770
+ Scale[Scale["Month"] = 6] = "Month";
771
+ Scale[Scale["Year"] = 7] = "Year";
772
+ Scale[Scale["DataScale"] = 8] = "DataScale";
773
+ })(Scale || (Scale = {}));
774
+
775
+ var AnimationLength;
776
+
777
+ (function (AnimationLength) {
778
+ AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
779
+ AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
780
+ AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
781
+ AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
782
+ AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
783
+ AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
784
+ AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
785
+ AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
786
+ })(AnimationLength || (AnimationLength = {}));
787
+
788
+ var MapActionOrigin;
789
+
790
+ (function (MapActionOrigin) {
791
+ MapActionOrigin["map"] = "map";
792
+ })(MapActionOrigin || (MapActionOrigin = {}));
793
+
794
+ /* *
795
+ * Licensed under the Apache License, Version 2.0 (the "License");
796
+ * you may not use this file except in compliance with the License.
797
+ * You may obtain a copy of the License at
798
+ *
799
+ * http://www.apache.org/licenses/LICENSE-2.0
800
+ *
801
+ * Unless required by applicable law or agreed to in writing, software
802
+ * distributed under the License is distributed on an "AS IS" BASIS,
803
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
804
+ * See the License for the specific language governing permissions and
805
+ * limitations under the License.
806
+ *
807
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
808
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
809
+ * */
810
+ var LayerType;
811
+
812
+ (function (LayerType) {
813
+ LayerType["mapLayer"] = "mapLayer";
814
+ LayerType["baseLayer"] = "baseLayer";
815
+ LayerType["overLayer"] = "overLayer";
816
+ })(LayerType || (LayerType = {}));
817
+
818
+ var LayerStatus;
819
+
820
+ (function (LayerStatus) {
821
+ LayerStatus["default"] = "default";
822
+ LayerStatus["error"] = "error";
823
+ })(LayerStatus || (LayerStatus = {}));
824
+
825
+ var LayerActionOrigin;
826
+
827
+ (function (LayerActionOrigin) {
828
+ LayerActionOrigin["layerManager"] = "layerManager";
829
+ LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
830
+ LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
831
+ LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
832
+ LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
833
+ LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
834
+ })(LayerActionOrigin || (LayerActionOrigin = {}));
835
+
836
+ var types$3 = /*#__PURE__*/Object.freeze({
837
+ __proto__: null,
838
+ get LayerType () { return LayerType; },
839
+ get LayerStatus () { return LayerStatus; },
840
+ get LayerActionOrigin () { return LayerActionOrigin; }
841
+ });
842
+
656
843
  /* *
657
844
  * Licensed under the Apache License, Version 2.0 (the "License");
658
845
  * you may not use this file except in compliance with the License.
@@ -1422,32 +1609,192 @@ var utils = /*#__PURE__*/Object.freeze({
1422
1609
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1423
1610
  * */
1424
1611
  /**
1425
- * Sets a dimension value for a layer in the state. If the dimension does not exist it is added to the layer.
1426
- * @param draft The draft layerstate
1427
- * @param layerId The layerId
1428
- * @param dimensionValueToUpdate The dimension with values to update in the layer.
1612
+ * Generic action to set the time.
1613
+ *
1614
+ * @param payload: SetTimePayload;
1615
+ * {
1616
+ * sourceId: string; // Source where the new time value originates from
1617
+ * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1618
+ * }
1429
1619
  */
1430
1620
 
1431
- var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
1432
- if (!draft.byId[layerId].dimensions) {
1433
- draft.byId[layerId].dimensions = [];
1434
- }
1621
+ var setTime = createAction('GENERIC_SETTIME');
1622
+ /**
1623
+ * Generic action to set the bounding box.
1624
+ *
1625
+ * @param payload: SetBboxPayload;
1626
+ *
1627
+ * {
1628
+ * sourceId: string; // Source where the new time value originates from
1629
+ * bbox: { // Bbbox object
1630
+ * left: number;
1631
+ * bottom: number;
1632
+ * right: number;
1633
+ * top: number;
1634
+ * };
1635
+ * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1636
+ * }
1637
+ */
1435
1638
 
1436
- var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
1437
- return layerDim.name === dimensionValueToUpdate.name;
1438
- });
1639
+ var setBbox = createAction('GENERIC_SETBBOX');
1439
1640
 
1440
- if (existingLayerDimIndex < 0) {
1441
- draft.byId[layerId].dimensions.push(Object.assign({}, dimensionValueToUpdate));
1442
- } else {
1443
- if (dimensionValueToUpdate.currentValue) {
1444
- draft.byId[layerId].dimensions[existingLayerDimIndex].currentValue = dimensionValueToUpdate.currentValue;
1445
- }
1641
+ /* *
1642
+ * Licensed under the Apache License, Version 2.0 (the "License");
1643
+ * you may not use this file except in compliance with the License.
1644
+ * You may obtain a copy of the License at
1645
+ *
1646
+ * http://www.apache.org/licenses/LICENSE-2.0
1647
+ *
1648
+ * Unless required by applicable law or agreed to in writing, software
1649
+ * distributed under the License is distributed on an "AS IS" BASIS,
1650
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1651
+ * See the License for the specific language governing permissions and
1652
+ * limitations under the License.
1653
+ *
1654
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1655
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1656
+ * */
1657
+ /**
1658
+ * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1659
+ *
1660
+ * These actions should not be used by components directly. Components should only use the generic actions.
1661
+ */
1446
1662
 
1447
- if (dimensionValueToUpdate.synced !== undefined) {
1448
- draft.byId[layerId].dimensions[existingLayerDimIndex].synced = dimensionValueToUpdate.synced;
1663
+ var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1664
+ return {
1665
+ payload: {
1666
+ source: setTime(payload),
1667
+ groups: groups,
1668
+ targets: targets
1449
1669
  }
1450
-
1670
+ };
1671
+ });
1672
+ var setBboxSync = createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1673
+ return {
1674
+ payload: {
1675
+ source: setBbox(payload),
1676
+ groups: groups,
1677
+ targets: targets
1678
+ }
1679
+ };
1680
+ });
1681
+ var setLayerActionSync = createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1682
+ return {
1683
+ payload: {
1684
+ source: {
1685
+ type: type,
1686
+ payload: payload
1687
+ },
1688
+ targets: targets
1689
+ }
1690
+ };
1691
+ });
1692
+
1693
+ /* *
1694
+ * Licensed under the Apache License, Version 2.0 (the "License");
1695
+ * you may not use this file except in compliance with the License.
1696
+ * You may obtain a copy of the License at
1697
+ *
1698
+ * http://www.apache.org/licenses/LICENSE-2.0
1699
+ *
1700
+ * Unless required by applicable law or agreed to in writing, software
1701
+ * distributed under the License is distributed on an "AS IS" BASIS,
1702
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1703
+ * See the License for the specific language governing permissions and
1704
+ * limitations under the License.
1705
+ *
1706
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1707
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1708
+ * */
1709
+ /**
1710
+ * These actions causes circular dependency if they are defined in the reducer.ts file.
1711
+ * Therefor they are instead added to this file
1712
+ * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1713
+ */
1714
+
1715
+ var mapChangeDimension = createAction('MAP_CHANGE_DIMENSION');
1716
+ var setMapPreset = createAction('SET_MAP_PRESET');
1717
+
1718
+ /*! *****************************************************************************
1719
+ Copyright (c) Microsoft Corporation.
1720
+
1721
+ Permission to use, copy, modify, and/or distribute this software for any
1722
+ purpose with or without fee is hereby granted.
1723
+
1724
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1725
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1726
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1727
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1728
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1729
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1730
+ PERFORMANCE OF THIS SOFTWARE.
1731
+ ***************************************************************************** */
1732
+
1733
+ function __rest(s, e) {
1734
+ var t = {};
1735
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1736
+ t[p] = s[p];
1737
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1738
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1739
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1740
+ t[p[i]] = s[p[i]];
1741
+ }
1742
+ return t;
1743
+ }
1744
+
1745
+ function __awaiter(thisArg, _arguments, P, generator) {
1746
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1747
+ return new (P || (P = Promise))(function (resolve, reject) {
1748
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1749
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1750
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1751
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1752
+ });
1753
+ }
1754
+
1755
+ /* *
1756
+ * Licensed under the Apache License, Version 2.0 (the "License");
1757
+ * you may not use this file except in compliance with the License.
1758
+ * You may obtain a copy of the License at
1759
+ *
1760
+ * http://www.apache.org/licenses/LICENSE-2.0
1761
+ *
1762
+ * Unless required by applicable law or agreed to in writing, software
1763
+ * distributed under the License is distributed on an "AS IS" BASIS,
1764
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1765
+ * See the License for the specific language governing permissions and
1766
+ * limitations under the License.
1767
+ *
1768
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1769
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1770
+ * */
1771
+ /**
1772
+ * Sets a dimension value for a layer in the state. If the dimension does not exist it is added to the layer.
1773
+ * @param draft The draft layerstate
1774
+ * @param layerId The layerId
1775
+ * @param dimensionValueToUpdate The dimension with values to update in the layer.
1776
+ */
1777
+
1778
+ var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
1779
+ if (!draft.byId[layerId].dimensions) {
1780
+ draft.byId[layerId].dimensions = [];
1781
+ }
1782
+
1783
+ var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
1784
+ return layerDim.name === dimensionValueToUpdate.name;
1785
+ });
1786
+
1787
+ if (existingLayerDimIndex < 0) {
1788
+ draft.byId[layerId].dimensions.push(Object.assign({}, dimensionValueToUpdate));
1789
+ } else {
1790
+ if (dimensionValueToUpdate.currentValue) {
1791
+ draft.byId[layerId].dimensions[existingLayerDimIndex].currentValue = dimensionValueToUpdate.currentValue;
1792
+ }
1793
+
1794
+ if (dimensionValueToUpdate.synced !== undefined) {
1795
+ draft.byId[layerId].dimensions[existingLayerDimIndex].synced = dimensionValueToUpdate.synced;
1796
+ }
1797
+
1451
1798
  if (dimensionValueToUpdate.validSyncSelection !== undefined) {
1452
1799
  draft.byId[layerId].dimensions[existingLayerDimIndex].validSyncSelection = dimensionValueToUpdate.validSyncSelection;
1453
1800
  }
@@ -1556,129 +1903,6 @@ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftSt
1556
1903
  }
1557
1904
  };
1558
1905
 
1559
- /* *
1560
- * Licensed under the Apache License, Version 2.0 (the "License");
1561
- * you may not use this file except in compliance with the License.
1562
- * You may obtain a copy of the License at
1563
- *
1564
- * http://www.apache.org/licenses/LICENSE-2.0
1565
- *
1566
- * Unless required by applicable law or agreed to in writing, software
1567
- * distributed under the License is distributed on an "AS IS" BASIS,
1568
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1569
- * See the License for the specific language governing permissions and
1570
- * limitations under the License.
1571
- *
1572
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1573
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
1574
- * */
1575
- /**
1576
- * These actions causes circular dependency if they are defined in the reducer.ts file.
1577
- * Therefor they are instead added to this file
1578
- * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1579
- */
1580
-
1581
- var mapChangeDimension = createAction('MAP_CHANGE_DIMENSION');
1582
- var setMapPreset = createAction('SET_MAP_PRESET');
1583
-
1584
- /* *
1585
- * Licensed under the Apache License, Version 2.0 (the "License");
1586
- * you may not use this file except in compliance with the License.
1587
- * You may obtain a copy of the License at
1588
- *
1589
- * http://www.apache.org/licenses/LICENSE-2.0
1590
- *
1591
- * Unless required by applicable law or agreed to in writing, software
1592
- * distributed under the License is distributed on an "AS IS" BASIS,
1593
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1594
- * See the License for the specific language governing permissions and
1595
- * limitations under the License.
1596
- *
1597
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1598
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1599
- * */
1600
- /**
1601
- * Generic action to set the time.
1602
- *
1603
- * @param payload: SetTimePayload;
1604
- * {
1605
- * sourceId: string; // Source where the new time value originates from
1606
- * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1607
- * }
1608
- */
1609
-
1610
- var setTime = createAction('GENERIC_SETTIME');
1611
- /**
1612
- * Generic action to set the bounding box.
1613
- *
1614
- * @param payload: SetBboxPayload;
1615
- *
1616
- * {
1617
- * sourceId: string; // Source where the new time value originates from
1618
- * bbox: { // Bbbox object
1619
- * left: number;
1620
- * bottom: number;
1621
- * right: number;
1622
- * top: number;
1623
- * };
1624
- * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1625
- * }
1626
- */
1627
-
1628
- var setBbox = createAction('GENERIC_SETBBOX');
1629
-
1630
- /* *
1631
- * Licensed under the Apache License, Version 2.0 (the "License");
1632
- * you may not use this file except in compliance with the License.
1633
- * You may obtain a copy of the License at
1634
- *
1635
- * http://www.apache.org/licenses/LICENSE-2.0
1636
- *
1637
- * Unless required by applicable law or agreed to in writing, software
1638
- * distributed under the License is distributed on an "AS IS" BASIS,
1639
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1640
- * See the License for the specific language governing permissions and
1641
- * limitations under the License.
1642
- *
1643
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1644
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1645
- * */
1646
- /**
1647
- * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1648
- *
1649
- * These actions should not be used by components directly. Components should only use the generic actions.
1650
- */
1651
-
1652
- var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1653
- return {
1654
- payload: {
1655
- source: setTime(payload),
1656
- groups: groups,
1657
- targets: targets
1658
- }
1659
- };
1660
- });
1661
- var setBboxSync = createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1662
- return {
1663
- payload: {
1664
- source: setBbox(payload),
1665
- groups: groups,
1666
- targets: targets
1667
- }
1668
- };
1669
- });
1670
- var setLayerActionSync = createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1671
- return {
1672
- payload: {
1673
- source: {
1674
- type: type,
1675
- payload: payload
1676
- },
1677
- targets: targets
1678
- }
1679
- };
1680
- });
1681
-
1682
1906
  var createLayer = function createLayer(_a) {
1683
1907
  var id = _a.id,
1684
1908
  _a$opacity = _a.opacity,
@@ -1708,7 +1932,7 @@ var createLayer = function createLayer(_a) {
1708
1932
  status: status
1709
1933
  });
1710
1934
  };
1711
- var initialState$8 = {
1935
+ var initialState$7 = {
1712
1936
  byId: {},
1713
1937
  allIds: [],
1714
1938
  availableBaseLayers: {
@@ -1716,9 +1940,9 @@ var initialState$8 = {
1716
1940
  allIds: []
1717
1941
  }
1718
1942
  };
1719
- var slice$8 = createSlice({
1720
- initialState: initialState$8,
1721
- name: 'layerReducer',
1943
+ var slice$7 = createSlice({
1944
+ initialState: initialState$7,
1945
+ name: 'layerReducer',
1722
1946
  reducers: {
1723
1947
  addLayer: function addLayer(draft, action) {
1724
1948
  var _action$payload = action.payload,
@@ -1983,12 +2207,68 @@ var slice$8 = createSlice({
1983
2207
  var _action$payload12 = action.payload,
1984
2208
  layerStyle = _action$payload12.layerStyle,
1985
2209
  layerDimensions = _action$payload12.layerDimensions;
1986
- var layerStyleAction = layerActions.layerChangeStyle(layerStyle);
1987
- var state = current(draft);
1988
- var intermediateState = layerStyle === null ? state : reducer$8(state, layerStyleAction);
1989
- var dimensionsAction = layerActions.layerSetDimensions(layerDimensions);
1990
- var newState = layerDimensions === null ? intermediateState : reducer$8(intermediateState, dimensionsAction);
1991
- return newState;
2210
+ /* Set style */
2211
+
2212
+ if (layerStyle && draft.byId[layerStyle.layerId]) {
2213
+ draft.byId[layerStyle.layerId].style = layerStyle === null || layerStyle === void 0 ? void 0 : layerStyle.style;
2214
+ }
2215
+ /* Set layer dimensions */
2216
+
2217
+
2218
+ if (layerDimensions) {
2219
+ /* Find the corresponding layer we want to update */
2220
+ var currentLayer = draft.byId[layerDimensions.layerId];
2221
+ /* Find all other layers with the same name and service, and update these at once (atomic update) */
2222
+
2223
+ Object.values(draft.byId).filter(function (draftLayer) {
2224
+ return draftLayer.name === currentLayer.name && draftLayer.service === currentLayer.service;
2225
+ }).forEach(function (draftLayer) {
2226
+ var layerId = draftLayer.id;
2227
+
2228
+ if (layerId && draft.byId[layerId]) {
2229
+ if (!draft.byId[layerId].dimensions) {
2230
+ draft.byId[layerId].dimensions = [];
2231
+ }
2232
+
2233
+ var draftLayerDimensions = draft.byId[layerId].dimensions;
2234
+ /* Now update the dimension for each layer */
2235
+
2236
+ layerDimensions.dimensions.forEach(function (newLayerDimension) {
2237
+ /* Find the wmLayer */
2238
+ var wmLayer = getWMLayerById(layerId);
2239
+ /* Find the wmDimension */
2240
+
2241
+ var wmDimension = wmLayer && wmLayer.getDimension(newLayerDimension.name);
2242
+ /* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
2243
+
2244
+ wmDimension && wmDimension.reInitializeValues(newLayerDimension.values);
2245
+ /* Find corresponding draftLayerDimensions */
2246
+
2247
+ var draftLayerDimension = draftLayerDimensions === null || draftLayerDimensions === void 0 ? void 0 : draftLayerDimensions.find(function (d) {
2248
+ return d.name === newLayerDimension.name && d.units === newLayerDimension.units;
2249
+ });
2250
+
2251
+ if (draftLayerDimension) {
2252
+ /* If found update only minValue, maxValue and values */
2253
+ draftLayerDimension.maxValue = newLayerDimension.maxValue;
2254
+ draftLayerDimension.minValue = newLayerDimension.minValue;
2255
+ draftLayerDimension.values = newLayerDimension.values;
2256
+ } else if (layerId === layerDimensions.layerId) {
2257
+ /* Otherwise add a new one, but only for this layer. */
2258
+ draftLayerDimensions.push({
2259
+ name: newLayerDimension.name,
2260
+ units: newLayerDimension.units,
2261
+ currentValue: newLayerDimension.currentValue,
2262
+ minValue: newLayerDimension.minValue,
2263
+ maxValue: newLayerDimension.maxValue,
2264
+ validSyncSelection: newLayerDimension.validSyncSelection,
2265
+ values: newLayerDimension.values
2266
+ });
2267
+ }
2268
+ });
2269
+ }
2270
+ });
2271
+ }
1992
2272
  },
1993
2273
  setSelectedFeature: function setSelectedFeature(draft, action) {
1994
2274
  var _action$payload13 = action.payload,
@@ -2043,7 +2323,7 @@ var slice$8 = createSlice({
2043
2323
  };
2044
2324
  /* Handle the Layer action with the same logic, using the same reducer */
2045
2325
 
2046
- return reducer$8(prevState, action);
2326
+ return reducer$7(prevState, action);
2047
2327
  }, state);
2048
2328
  }).addCase(setMapPreset, function (draft, action) {
2049
2329
  var mapId = action.payload.mapId;
@@ -2063,224 +2343,8 @@ var slice$8 = createSlice({
2063
2343
  });
2064
2344
  }
2065
2345
  });
2066
- var reducer$8 = slice$8.reducer;
2067
- var layerActions = slice$8.actions;
2068
-
2069
- /* *
2070
- * Licensed under the Apache License, Version 2.0 (the "License");
2071
- * you may not use this file except in compliance with the License.
2072
- * You may obtain a copy of the License at
2073
- *
2074
- * http://www.apache.org/licenses/LICENSE-2.0
2075
- *
2076
- * Unless required by applicable law or agreed to in writing, software
2077
- * distributed under the License is distributed on an "AS IS" BASIS,
2078
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2079
- * See the License for the specific language governing permissions and
2080
- * limitations under the License.
2081
- *
2082
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2083
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2084
- * */
2085
- var initialState$7 = {
2086
- byId: {},
2087
- allIds: []
2088
- };
2089
- var slice$7 = createSlice({
2090
- initialState: initialState$7,
2091
- name: 'serviceReducer',
2092
- reducers: {
2093
- serviceSetLayers: function serviceSetLayers(draft, action) {
2094
- var id = action.payload.id;
2095
- draft.byId[id] = Object.assign({}, action.payload);
2096
-
2097
- if (!draft.allIds.includes(id)) {
2098
- draft.allIds.push(id);
2099
- }
2100
- },
2101
- mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
2102
- var foundServiceIndex = draft.allIds.findIndex(function (id) {
2103
- return draft.byId[id].serviceUrl === action.payload.serviceUrl;
2104
- });
2105
-
2106
- if (foundServiceIndex !== -1) {
2107
- var serviceId = draft.allIds[foundServiceIndex];
2108
- draft.allIds = draft.allIds.filter(function (id) {
2109
- return id !== serviceId;
2110
- });
2111
- delete draft.byId[serviceId];
2112
- }
2113
- },
2114
- fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
2115
- draft, // eslint-disable-next-line no-unused-vars
2116
- action) {}
2117
- },
2118
- extraReducers: function extraReducers(builder) {
2119
- return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
2120
- var serviceLayers = action.payload.serviceLayers;
2121
-
2122
- if (serviceLayers === null) {
2123
- return draft;
2124
- }
2125
-
2126
- var mapAction = serviceActions.serviceSetLayers(serviceLayers);
2127
- var newState = reducer$7(draft, mapAction);
2128
- return newState;
2129
- });
2130
- }
2131
- });
2132
2346
  var reducer$7 = slice$7.reducer;
2133
- var serviceActions = slice$7.actions;
2134
-
2135
- /* *
2136
- * Licensed under the Apache License, Version 2.0 (the "License");
2137
- * you may not use this file except in compliance with the License.
2138
- * You may obtain a copy of the License at
2139
- *
2140
- * http://www.apache.org/licenses/LICENSE-2.0
2141
- *
2142
- * Unless required by applicable law or agreed to in writing, software
2143
- * distributed under the License is distributed on an "AS IS" BASIS,
2144
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2145
- * See the License for the specific language governing permissions and
2146
- * limitations under the License.
2147
- *
2148
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2149
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
2150
- * */
2151
- var selectorMemoizationOptions = {
2152
- memoizeOptions: {
2153
- maxSize: 1000,
2154
- resultEqualityCheck: isEqual
2155
- }
2156
- };
2157
- var isUserAddedService = function isUserAddedService(scope) {
2158
- return scope === 'user';
2159
- };
2160
-
2161
- /* *
2162
- * Licensed under the Apache License, Version 2.0 (the "License");
2163
- * you may not use this file except in compliance with the License.
2164
- * You may obtain a copy of the License at
2165
- *
2166
- * http://www.apache.org/licenses/LICENSE-2.0
2167
- *
2168
- * Unless required by applicable law or agreed to in writing, software
2169
- * distributed under the License is distributed on an "AS IS" BASIS,
2170
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2171
- * See the License for the specific language governing permissions and
2172
- * limitations under the License.
2173
- *
2174
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2175
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2176
- * */
2177
-
2178
- var servicesStore = function servicesStore(store) {
2179
- return store && store.services ? store.services : null;
2180
- };
2181
- /**
2182
- * Retrieves all serviceIds
2183
- *
2184
- * Example: serviceIds = getServiceIds(store)
2185
- * @param {object} store store: object - object from which the service state will be extracted
2186
- * @returns {array} returnType: array - an array of all serviceIds
2187
- */
2188
-
2189
-
2190
- createSelector(servicesStore, function (serviceState) {
2191
- return serviceState ? serviceState.allIds : [];
2192
- }, selectorMemoizationOptions);
2193
- /**
2194
- * Gets map services
2195
- *
2196
- * Example: services = getServices(store)
2197
- * @param {object} store store: object - Store object
2198
- * @returns {object} returnType: ServiceState
2199
- */
2200
-
2201
- var getServices = createSelector(servicesStore, function (store) {
2202
- return store ? store.byId : {};
2203
- }, selectorMemoizationOptions);
2204
- /**
2205
- * Gets the service object by its url
2206
- *
2207
- * Example: service = getServiceByName(store, 'serviceName')
2208
- * @param {object} store store: object - Store object
2209
- * @returns {ReduxService} returnType: Service
2210
- */
2211
-
2212
- var getServiceByName = createSelector([servicesStore, function (state, serviceUrl) {
2213
- return serviceUrl;
2214
- }], function (serviceState, serviceUrl) {
2215
- var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
2216
- return serviceState.byId[id].serviceUrl === serviceUrl;
2217
- });
2218
- /* Add the service based on a url */
2219
-
2220
- var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
2221
-
2222
- if (serviceState && serviceState.byId && serviceState.byId[id]) {
2223
- return serviceState.byId[id];
2224
- }
2225
-
2226
- return null;
2227
- }, selectorMemoizationOptions);
2228
- /**
2229
- * Gets the layer from the store using the serviceUrl and layerName
2230
- *
2231
- * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
2232
- * @param {object} store store: object - object from which the layers state will be extracted
2233
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2234
- * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
2235
- */
2236
-
2237
- var getLayersFromService$1 = createSelector(getServiceByName, function (service) {
2238
- return service && service.layers || null;
2239
- }, selectorMemoizationOptions);
2240
- /**
2241
- * Gets the layer from the store using the serviceUrl and layerName
2242
- *
2243
- * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
2244
- * @param {object} store store: object - The application store
2245
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2246
- * @param {string} layerName layerName: string - Name of the layer in the service
2247
- * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
2248
- */
2249
-
2250
- var getLayerFromService = createSelector(function (store, serviceUrl) {
2251
- return getLayersFromService$1(store, serviceUrl);
2252
- }, function (store, serviceUrl) {
2253
- return serviceUrl;
2254
- }, function (store, serviceUrl, layerName) {
2255
- return layerName;
2256
- }, function (layers, serviceUrl, layerName) {
2257
- if (!layers) {
2258
- return null;
2259
- }
2260
-
2261
- var index = layers.findIndex(function (serviceLayer) {
2262
- return serviceLayer.name === layerName;
2263
- });
2264
-
2265
- if (index === -1) {
2266
- return null;
2267
- }
2268
-
2269
- return layers[index];
2270
- }, selectorMemoizationOptions);
2271
- /**
2272
- * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
2273
- *
2274
- * Example: layerStyles = getLayerStyles(store, layerService, layerName);
2275
- * @param {object} store store: object - store from which the layers state will be extracted
2276
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2277
- * @param {string} layerName layerName: string - Name of the layer in the service
2278
- * @returns {array} returnType: Style[] - array containing layer styles
2279
- */
2280
-
2281
- var getLayerStyles$1 = createSelector(getLayerFromService, function (layer) {
2282
- return layer && layer.styles ? layer.styles : [];
2283
- }, selectorMemoizationOptions);
2347
+ var layerActions = slice$7.actions;
2284
2348
 
2285
2349
  var moveToTop = function moveToTop(list, element) {
2286
2350
  var filteredList = list.filter(function (item) {
@@ -2423,9 +2487,9 @@ var addBaseLayer = layerActions.addBaseLayer,
2423
2487
  baseLayerDelete = layerActions.baseLayerDelete,
2424
2488
  layerChangeDimension$1 = layerActions.layerChangeDimension,
2425
2489
  layerDelete$1 = layerActions.layerDelete,
2426
- onUpdateLayerInformation = layerActions.onUpdateLayerInformation,
2427
2490
  setBaseLayers$1 = layerActions.setBaseLayers,
2428
- setLayers = layerActions.setLayers;
2491
+ setLayers = layerActions.setLayers,
2492
+ onUpdateLayerInformation = layerActions.onUpdateLayerInformation;
2429
2493
  /**
2430
2494
  * Checks if the layer id is already taken in one of the maps.
2431
2495
  * @param state The WebMapState
@@ -3083,12 +3147,16 @@ var slice$5 = createSlice({
3083
3147
  }).addCase(onUpdateLayerInformation, function (draft, action) {
3084
3148
  var mapDimensions = action.payload.mapDimensions;
3085
3149
 
3086
- if (mapDimensions === null) {
3150
+ if (!mapDimensions) {
3087
3151
  return draft;
3088
3152
  }
3089
3153
 
3090
- var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
3091
- return reducer$5(draft, mapAction);
3154
+ var dimensions = mapDimensions.dimensions,
3155
+ mapId = mapDimensions.mapId;
3156
+ dimensions.forEach(function (dimension) {
3157
+ return produceDraftStateSetWebMapDimension(draft, mapId, dimension, false);
3158
+ });
3159
+ return draft;
3092
3160
  }).addCase(mapChangeDimension, function (draft, action) {
3093
3161
  var _action$payload35 = action.payload,
3094
3162
  mapId = _action$payload35.mapId,
@@ -3451,7 +3519,7 @@ var getDimensionLayerIds = createSelector(getLayersIds, getLayersById, function
3451
3519
  }, []);
3452
3520
  }, selectorMemoizationOptions);
3453
3521
 
3454
- var selectors$3 = /*#__PURE__*/Object.freeze({
3522
+ var selectors$4 = /*#__PURE__*/Object.freeze({
3455
3523
  __proto__: null,
3456
3524
  getLayerById: getLayerById,
3457
3525
  getLayersById: getLayersById,
@@ -3557,7 +3625,9 @@ var getDialogOrder = createSelector(function (store, dialogType) {
3557
3625
  if (store && store.ui && store.ui.order) {
3558
3626
  var order = store.ui.order;
3559
3627
  var visibleOrder = order.filter(function (orderedDialogType) {
3560
- return store.ui.dialogs[orderedDialogType].isOpen;
3628
+ var _a;
3629
+
3630
+ return (_a = store.ui.dialogs[orderedDialogType]) === null || _a === void 0 ? void 0 : _a.isOpen;
3561
3631
  });
3562
3632
 
3563
3633
  if (!visibleOrder.includes(dialogType)) {
@@ -3619,7 +3689,7 @@ var getDialogFocused = createSelector(getDialogDetailsByType, function (details)
3619
3689
  return details && details.focused || false;
3620
3690
  });
3621
3691
 
3622
- var selectors$2 = /*#__PURE__*/Object.freeze({
3692
+ var selectors$3 = /*#__PURE__*/Object.freeze({
3623
3693
  __proto__: null,
3624
3694
  getUiStore: getUiStore,
3625
3695
  getDialogDetailsByType: getDialogDetailsByType,
@@ -4029,16 +4099,184 @@ var types$1 = /*#__PURE__*/Object.freeze({
4029
4099
  * See the License for the specific language governing permissions and
4030
4100
  * limitations under the License.
4031
4101
  *
4032
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4033
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
4102
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4103
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
4034
4104
  * */
4105
+ var syncGroupStore = function syncGroupStore(store) {
4106
+ return store.syncronizationGroupStore || null;
4107
+ };
4108
+ /**
4109
+ * Gets synchronization group state
4110
+ *
4111
+ * Example: synchronizationGroupState = getSynchronizationGroupState(store)
4112
+ * @param {object} store store: object - Store object
4113
+ * @returns {object} returnType: SynchronizationGroupState
4114
+ */
4035
4115
 
4036
- var index = /*#__PURE__*/Object.freeze({
4037
- __proto__: null,
4038
- actions: actions,
4116
+ var getSynchronizationGroupState = createSelector(syncGroupStore, function (store) {
4117
+ return store || null;
4118
+ });
4119
+ var getSynchronizationGroup = function getSynchronizationGroup(state, id) {
4120
+ return syncGroupStore(state).groups.byId[id];
4121
+ };
4122
+ var getSynchronizationGroupSource = function getSynchronizationGroupSource(state, id) {
4123
+ return syncGroupStore(state).sources.byId[id];
4124
+ };
4125
+ var getTargets = function getTargets(state, payload, actionType) {
4126
+ var actionPayloads = [];
4127
+ var targetsInActionPayload = {};
4128
+ var syncronizationGroupStore = syncGroupStore(state);
4129
+ /* All the groups the source is member of */
4130
+
4131
+ if (syncronizationGroupStore && payload) {
4132
+ /* Backwards compatibility, if there are no groups, connect everything */
4133
+ if (syncronizationGroupStore.groups.allIds.length === 0) {
4134
+ syncronizationGroupStore.sources.allIds.forEach(function (targetId) {
4135
+ // Only add if should react to this action
4136
+ if (syncronizationGroupStore.sources.byId[targetId].types.includes(actionType)) {
4137
+ /* Remember that we have already added this target in the action payloads, prevents adding it twice */
4138
+ targetsInActionPayload[targetId] = true;
4139
+ /* Compose the payload */
4140
+
4141
+ var newPayload = Object.assign({
4142
+ targetId: targetId
4143
+ }, payload);
4144
+ actionPayloads.push(newPayload);
4145
+ }
4146
+ });
4147
+ }
4148
+
4149
+ syncronizationGroupStore.groups.allIds.forEach(function (id) {
4150
+ var syncronizationGroup = syncronizationGroupStore.groups.byId[id];
4151
+
4152
+ if (actionType === syncronizationGroup.type) {
4153
+ /* Check if the source is in the target list of the synchonizationGroup */
4154
+ var source = syncronizationGroup.targets.byId[payload.sourceId];
4155
+ /* If the source is part of the target list, and is linked, continue syncing the other targets */
4156
+
4157
+ if (source && source.linked) {
4158
+ syncronizationGroup.targets.allIds.forEach(function (targetId) {
4159
+ var target = syncronizationGroup.targets.byId[targetId];
4160
+
4161
+ if (target.linked && !targetsInActionPayload[targetId]) {
4162
+ /* Remember that we have already added this target in the action payloads, prevents adding it twice */
4163
+ targetsInActionPayload[targetId] = true;
4164
+ /* Compose the payload */
4165
+
4166
+ var newPayload = Object.assign({
4167
+ targetId: targetId
4168
+ }, payload);
4169
+ actionPayloads.push(newPayload);
4170
+ }
4171
+ });
4172
+ }
4173
+ }
4174
+ });
4175
+ }
4176
+
4177
+ return actionPayloads;
4178
+ };
4179
+ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
4180
+ var syncronizationGroupStore = syncGroupStore(state);
4181
+ var groups = syncronizationGroupStore.groups.allIds.reduce(function (list, groupId) {
4182
+ var syncronizationGroup = syncronizationGroupStore.groups.byId[groupId];
4183
+
4184
+ if (actionType === syncronizationGroup.type) {
4185
+ /* Check if the source is in the target list of the synchronizationGroup */
4186
+ var source = syncronizationGroup.targets.byId[payload.sourceId];
4187
+ /* If the source is part of the target list, and is linked, continue syncin the other targets */
4188
+
4189
+ if (source && source.linked) {
4190
+ return list.concat(groupId);
4191
+ }
4192
+ }
4193
+
4194
+ return list;
4195
+ }, []);
4196
+ return groups;
4197
+ };
4198
+ var getAllTargetGroupsForSource = function getAllTargetGroupsForSource(state, sourceId) {
4199
+ var syncronizationGroupStore = syncGroupStore(state);
4200
+
4201
+ if (syncronizationGroupStore === null || syncronizationGroupStore === void 0 ? void 0 : syncronizationGroupStore.groups) {
4202
+ return syncronizationGroupStore.groups.allIds.reduce(function (linkedSyncGroupIds, groupId) {
4203
+ var syncronizationGroup = syncronizationGroupStore.groups.byId[groupId];
4204
+ var source = syncronizationGroup.targets.byId[sourceId];
4205
+ /* If the source is part of the target list, and is linked, continue syncin the other targets */
4206
+
4207
+ if (source && source.linked) {
4208
+ return linkedSyncGroupIds.concat(groupId);
4209
+ }
4210
+
4211
+ return linkedSyncGroupIds;
4212
+ }, []);
4213
+ }
4214
+
4215
+ return [];
4216
+ };
4217
+ var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
4218
+ return store.viewState;
4219
+ });
4220
+ var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
4221
+ return store.viewState.timeslider.groups[0].selected;
4222
+ }, selectorMemoizationOptions);
4223
+ var getSyncGroupTargets = function getSyncGroupTargets(state) {
4224
+ var syncStore = syncGroupStore(state);
4225
+
4226
+ if (!syncStore || !syncStore.groups) {
4227
+ return [];
4228
+ }
4229
+
4230
+ return syncStore.groups.allIds.reduce(function (targets, groupId) {
4231
+ var group = syncStore.groups.byId[groupId];
4232
+ return targets.concat(group.targets.allIds.map(function (targetId) {
4233
+ return {
4234
+ groupId: groupId,
4235
+ targetId: targetId,
4236
+ linked: group.targets.byId[targetId].linked
4237
+ };
4238
+ }));
4239
+ }, []);
4240
+ };
4241
+
4242
+ var selectors$2 = /*#__PURE__*/Object.freeze({
4243
+ __proto__: null,
4244
+ syncGroupStore: syncGroupStore,
4245
+ getSynchronizationGroupState: getSynchronizationGroupState,
4246
+ getSynchronizationGroup: getSynchronizationGroup,
4247
+ getSynchronizationGroupSource: getSynchronizationGroupSource,
4248
+ getTargets: getTargets,
4249
+ getTargetGroups: getTargetGroups,
4250
+ getAllTargetGroupsForSource: getAllTargetGroupsForSource,
4251
+ syncGroupGetViewState: syncGroupGetViewState,
4252
+ getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
4253
+ getSyncGroupTargets: getSyncGroupTargets
4254
+ });
4255
+
4256
+ /* *
4257
+ * Licensed under the Apache License, Version 2.0 (the "License");
4258
+ * you may not use this file except in compliance with the License.
4259
+ * You may obtain a copy of the License at
4260
+ *
4261
+ * http://www.apache.org/licenses/LICENSE-2.0
4262
+ *
4263
+ * Unless required by applicable law or agreed to in writing, software
4264
+ * distributed under the License is distributed on an "AS IS" BASIS,
4265
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4266
+ * See the License for the specific language governing permissions and
4267
+ * limitations under the License.
4268
+ *
4269
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4270
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
4271
+ * */
4272
+
4273
+ var index = /*#__PURE__*/Object.freeze({
4274
+ __proto__: null,
4275
+ actions: actions,
4039
4276
  constants: constants,
4040
4277
  types: types$1,
4041
- initialState: initialState$4
4278
+ initialState: initialState$4,
4279
+ syncGroupsSelectors: selectors$2
4042
4280
  });
4043
4281
 
4044
4282
  /* *
@@ -5609,119 +5847,6 @@ var slice = createSlice({
5609
5847
  var reducer = slice.reducer;
5610
5848
  var appActions = slice.actions;
5611
5849
 
5612
- /* *
5613
- * Licensed under the Apache License, Version 2.0 (the "License");
5614
- * you may not use this file except in compliance with the License.
5615
- * You may obtain a copy of the License at
5616
- *
5617
- * http://www.apache.org/licenses/LICENSE-2.0
5618
- *
5619
- * Unless required by applicable law or agreed to in writing, software
5620
- * distributed under the License is distributed on an "AS IS" BASIS,
5621
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5622
- * See the License for the specific language governing permissions and
5623
- * limitations under the License.
5624
- *
5625
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5626
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
5627
- * */
5628
- var syncGroupStore = function syncGroupStore(store) {
5629
- return store.syncronizationGroupStore || null;
5630
- };
5631
- /**
5632
- * Gets synchronization group state
5633
- *
5634
- * Example: synchronizationGroupState = getSynchronizationGroupState(store)
5635
- * @param {object} store store: object - Store object
5636
- * @returns {object} returnType: SynchronizationGroupState
5637
- */
5638
-
5639
- var getSynchronizationGroupState = createSelector(syncGroupStore, function (store) {
5640
- return store || null;
5641
- });
5642
- var getSynchronizationGroup = function getSynchronizationGroup(state, id) {
5643
- return syncGroupStore(state).groups.byId[id];
5644
- };
5645
- var getTargets = function getTargets(state, payload, actionType) {
5646
- var actionPayloads = [];
5647
- var targetsInActionPayload = {};
5648
- var syncronizationGroupStore = syncGroupStore(state);
5649
- /* All the groups the source is member of */
5650
-
5651
- if (syncronizationGroupStore && payload) {
5652
- /* Backwards compatibility, if there are no groups, connect everything */
5653
- if (syncronizationGroupStore.groups.allIds.length === 0) {
5654
- syncronizationGroupStore.sources.allIds.forEach(function (targetId) {
5655
- // Only add if should react to this action
5656
- if (syncronizationGroupStore.sources.byId[targetId].types.includes(actionType)) {
5657
- /* Remember that we have already added this target in the action payloads, prevents adding it twice */
5658
- targetsInActionPayload[targetId] = true;
5659
- /* Compose the payload */
5660
-
5661
- var newPayload = Object.assign({
5662
- targetId: targetId
5663
- }, payload);
5664
- actionPayloads.push(newPayload);
5665
- }
5666
- });
5667
- }
5668
-
5669
- syncronizationGroupStore.groups.allIds.forEach(function (id) {
5670
- var syncronizationGroup = syncronizationGroupStore.groups.byId[id];
5671
-
5672
- if (actionType === syncronizationGroup.type) {
5673
- /* Check if the source is in the target list of the synchonizationGroup */
5674
- var source = syncronizationGroup.targets.byId[payload.sourceId];
5675
- /* If the source is part of the target list, and is linked, continue syncing the other targets */
5676
-
5677
- if (source && source.linked) {
5678
- syncronizationGroup.targets.allIds.forEach(function (targetId) {
5679
- var target = syncronizationGroup.targets.byId[targetId];
5680
-
5681
- if (target.linked && !targetsInActionPayload[targetId]) {
5682
- /* Remember that we have already added this target in the action payloads, prevents adding it twice */
5683
- targetsInActionPayload[targetId] = true;
5684
- /* Compose the payload */
5685
-
5686
- var newPayload = Object.assign({
5687
- targetId: targetId
5688
- }, payload);
5689
- actionPayloads.push(newPayload);
5690
- }
5691
- });
5692
- }
5693
- }
5694
- });
5695
- }
5696
-
5697
- return actionPayloads;
5698
- };
5699
- var getTargetGroups = function getTargetGroups(state, payload, actionType) {
5700
- var syncronizationGroupStore = syncGroupStore(state);
5701
- var groups = syncronizationGroupStore.groups.allIds.reduce(function (list, groupId) {
5702
- var syncronizationGroup = syncronizationGroupStore.groups.byId[groupId];
5703
-
5704
- if (actionType === syncronizationGroup.type) {
5705
- /* Check if the source is in the target list of the synchronizationGroup */
5706
- var source = syncronizationGroup.targets.byId[payload.sourceId];
5707
- /* If the source is part of the target list, and it linked, continue syncin the other targets */
5708
-
5709
- if (source && source.linked) {
5710
- return list.concat(groupId);
5711
- }
5712
- }
5713
-
5714
- return list;
5715
- }, []);
5716
- return groups;
5717
- };
5718
- var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
5719
- return store.viewState;
5720
- });
5721
- var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
5722
- return store.viewState.timeslider.groups[0].selected;
5723
- }, selectorMemoizationOptions);
5724
-
5725
5850
  /* *
5726
5851
  * Licensed under the Apache License, Version 2.0 (the "License");
5727
5852
  * you may not use this file except in compliance with the License.
@@ -6858,11 +6983,11 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
6858
6983
  * See the License for the specific language governing permissions and
6859
6984
  * limitations under the License.
6860
6985
  *
6861
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6862
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
6986
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6987
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6863
6988
  * */
6864
6989
 
6865
- var PlayButton = function PlayButton(_ref) {
6990
+ var PlayButton$1 = function PlayButton(_ref) {
6866
6991
  var isAnimating = _ref.isAnimating,
6867
6992
  isDisabled = _ref.isDisabled,
6868
6993
  _ref$onTogglePlayButt = _ref.onTogglePlayButton,
@@ -6872,18 +6997,18 @@ var PlayButton = function PlayButton(_ref) {
6872
6997
  onTogglePlayButton();
6873
6998
  };
6874
6999
 
6875
- return /*#__PURE__*/React.createElement(CustomTooltip, {
6876
- title: isAnimating ? 'Pause' : 'Play'
6877
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
7000
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
7001
+ variant: "tool",
7002
+ tooltipTitle: isAnimating ? 'Pause' : 'Play',
6878
7003
  onClick: onTogglePlay,
6879
7004
  disabled: isDisabled,
6880
7005
  "data-testid": "playButton",
6881
- active: isAnimating
7006
+ isSelected: isAnimating
6882
7007
  }, isAnimating ? /*#__PURE__*/React.createElement(Pause, {
6883
7008
  "data-testid": "pause-svg-path"
6884
7009
  }) : /*#__PURE__*/React.createElement(Play, {
6885
7010
  "data-testid": "play-svg-path"
6886
- }))));
7011
+ }));
6887
7012
  };
6888
7013
 
6889
7014
  /* *
@@ -6942,7 +7067,7 @@ var PlayButtonConnect = connectRedux$3(function (_ref) {
6942
7067
  }
6943
7068
  };
6944
7069
 
6945
- return /*#__PURE__*/React__default.createElement(PlayButton, {
7070
+ return /*#__PURE__*/React__default.createElement(PlayButton$1, {
6946
7071
  isAnimating: linkedMapAnimationInfo.isAnimating,
6947
7072
  isDisabled: isDisabled,
6948
7073
  onTogglePlayButton: function onTogglePlayButton() {
@@ -9525,8 +9650,8 @@ var moduleConfig = {
9525
9650
  id: 'webmap-module',
9526
9651
  reducersMap: {
9527
9652
  webmap: reducer$5,
9528
- services: reducer$7,
9529
- layers: reducer$8
9653
+ services: reducer$8,
9654
+ layers: reducer$7
9530
9655
  },
9531
9656
  sagas: [rootSaga$4, rootSaga$3]
9532
9657
  };
@@ -9953,7 +10078,11 @@ var HeaderOptions = function HeaderOptions(_ref) {
9953
10078
  var isDockedLayerManager = _ref.isDockedLayerManager,
9954
10079
  shortcutsEnabled = _ref.shortcutsEnabled,
9955
10080
  onClickDockButton = _ref.onClickDockButton,
9956
- onChangeSize = _ref.onChangeSize;
10081
+ onChangeSize = _ref.onChangeSize,
10082
+ buttonSettings = _ref.buttonSettings;
10083
+
10084
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10085
+
9957
10086
  React.useEffect(function () {
9958
10087
  var handleKeyDown = function handleKeyDown(event) {
9959
10088
  if (shortcutsEnabled) {
@@ -9972,28 +10101,28 @@ var HeaderOptions = function HeaderOptions(_ref) {
9972
10101
  document.removeEventListener('keydown', handleKeyDown);
9973
10102
  };
9974
10103
  }, [onChangeSize, shortcutsEnabled]);
9975
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
10104
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !((_a = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _a === void 0 ? void 0 : _a.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
9976
10105
  tooltipTitle: "small",
9977
10106
  "data-testid": "collapseSmall-btn",
9978
10107
  onClick: function onClick() {
9979
10108
  return onChangeSize(sizeSmall);
9980
10109
  },
9981
10110
  className: "collapseSmall-btn"
9982
- }, /*#__PURE__*/React.createElement(CollapseSmall, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10111
+ }, (_c = (_b = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _b === void 0 ? void 0 : _b.icon) !== null && _c !== void 0 ? _c : /*#__PURE__*/React.createElement(CollapseSmall, null)), !((_d = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _d === void 0 ? void 0 : _d.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
9983
10112
  tooltipTitle: "medium",
9984
10113
  "data-testid": "collapseMedium-btn",
9985
10114
  onClick: function onClick() {
9986
10115
  return onChangeSize(sizeMedium);
9987
10116
  },
9988
10117
  className: "collapseMedium-btn"
9989
- }, /*#__PURE__*/React.createElement(CollapseMedium, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10118
+ }, (_f = (_e = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _e === void 0 ? void 0 : _e.icon) !== null && _f !== void 0 ? _f : /*#__PURE__*/React.createElement(CollapseMedium, null)), !((_g = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _g === void 0 ? void 0 : _g.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
9990
10119
  tooltipTitle: "large",
9991
10120
  "data-testid": "collapseLarge-btn",
9992
10121
  onClick: function onClick() {
9993
10122
  return onChangeSize(sizeLarge);
9994
10123
  },
9995
10124
  className: "collapseLarge-btn"
9996
- }, /*#__PURE__*/React.createElement(CollapseLarge, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10125
+ }, (_j = (_h = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : /*#__PURE__*/React.createElement(CollapseLarge, null)), !((_k = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.dock) === null || _k === void 0 ? void 0 : _k.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
9997
10126
  tooltipTitle: isDockedLayerManager ? 'Undock' : 'Dock',
9998
10127
  "data-testid": "dockedBtn",
9999
10128
  disableRipple: true,
@@ -10004,7 +10133,7 @@ var HeaderOptions = function HeaderOptions(_ref) {
10004
10133
  "data-testid": "dockedLayerManager-collapse"
10005
10134
  }) : /*#__PURE__*/React.createElement(ExpandWindow, {
10006
10135
  "data-testid": "dockedLayerManager-uncollapse"
10007
- })));
10136
+ })), (_l = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.divider) === null || _l === void 0 ? void 0 : _l.element);
10008
10137
  };
10009
10138
 
10010
10139
  /* *
@@ -10253,12 +10382,14 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
10253
10382
  }, icon);
10254
10383
  };
10255
10384
 
10256
- var styles$4 = {
10257
- text: {
10258
- paddingLeft: '10px',
10259
- fontSize: '12px',
10260
- fontFamily: 'Roboto',
10261
- opacity: 0.67
10385
+ var styles$5 = {
10386
+ text: function text(theme) {
10387
+ return Object.assign({
10388
+ paddingLeft: '10px',
10389
+ fontSize: '12px',
10390
+ fontFamily: 'Roboto',
10391
+ opacity: 0.67
10392
+ }, theme.palette.geowebColors.layerManager.headerRowText);
10262
10393
  }
10263
10394
  };
10264
10395
 
@@ -10301,7 +10432,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
10301
10432
  className: columnClasses.column2
10302
10433
  }, /*#__PURE__*/React.createElement(Box, {
10303
10434
  className: "header-layer ".concat(hasMapPresetsModule ? 'mappresetsModule-enabled' : ''),
10304
- sx: styles$4.text
10435
+ sx: styles$5.text
10305
10436
  }, (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.layerName) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : 'Layer'), /*#__PURE__*/React.createElement(Box, {
10306
10437
  className: "header-mapPresets",
10307
10438
  sx: {
@@ -10310,15 +10441,15 @@ var DescriptionRow = function DescriptionRow(_ref) {
10310
10441
  }, mapPresetsModuleInline)), /*#__PURE__*/React.createElement(Grid, {
10311
10442
  className: columnClasses.column3
10312
10443
  }, /*#__PURE__*/React.createElement(Box, {
10313
- sx: styles$4.text
10444
+ sx: styles$5.text
10314
10445
  }, (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : 'Style')), /*#__PURE__*/React.createElement(Grid, {
10315
10446
  className: columnClasses.column4
10316
10447
  }, /*#__PURE__*/React.createElement(Box, {
10317
- sx: styles$4.text
10448
+ sx: styles$5.text
10318
10449
  }, (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : 'Opacity')), /*#__PURE__*/React.createElement(Grid, {
10319
10450
  className: columnClasses.column5
10320
10451
  }, /*#__PURE__*/React.createElement(Box, {
10321
- sx: styles$4.text
10452
+ sx: styles$5.text
10322
10453
  }, (_k = (_j = settings === null || settings === void 0 ? void 0 : settings.dimensions) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : 'Dimensions')), /*#__PURE__*/React.createElement(Grid, {
10323
10454
  className: columnClasses.column6
10324
10455
  }));
@@ -10523,7 +10654,9 @@ var RenderLayers = function RenderLayers(_ref) {
10523
10654
  _ref$layers = _ref.layers,
10524
10655
  layers = _ref$layers === void 0 ? [] : _ref$layers,
10525
10656
  _ref$isEnabled = _ref.isEnabled,
10526
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
10657
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
10658
+ _ref$tooltipPrefix = _ref.tooltipPrefix,
10659
+ tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Layer: ' : _ref$tooltipPrefix;
10527
10660
 
10528
10661
  var _a;
10529
10662
 
@@ -10564,7 +10697,7 @@ var RenderLayers = function RenderLayers(_ref) {
10564
10697
  });
10565
10698
  return /*#__PURE__*/React.createElement(TooltipSelect, {
10566
10699
  disableUnderline: true,
10567
- tooltip: "Layer: ".concat((_a = extendedLayers[currentIndex]) === null || _a === void 0 ? void 0 : _a.title),
10700
+ tooltip: "".concat(tooltipPrefix).concat((_a = extendedLayers[currentIndex]) === null || _a === void 0 ? void 0 : _a.title),
10568
10701
  inputProps: {
10569
10702
  SelectDisplayProps: {
10570
10703
  'data-testid': 'selectLayer'
@@ -10633,7 +10766,11 @@ var OpacitySelect = function OpacitySelect(_ref) {
10633
10766
  var currentOpacity = _ref.currentOpacity,
10634
10767
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
10635
10768
  _ref$isEnabled = _ref.isEnabled,
10636
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
10769
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
10770
+ _ref$tooltipPrefix = _ref.tooltipPrefix,
10771
+ tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Opacity: ' : _ref$tooltipPrefix;
10772
+
10773
+ var _a;
10637
10774
 
10638
10775
  var _useControlledTooltip = useControlledTooltip(),
10639
10776
  _useControlledTooltip2 = _slicedToArray(_useControlledTooltip, 2),
@@ -10646,6 +10783,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
10646
10783
  setAnchorEl = _React$useState2[1];
10647
10784
 
10648
10785
  var isOpen = Boolean(anchorEl);
10786
+ var theme = useTheme();
10649
10787
 
10650
10788
  var handleClick = function handleClick(event) {
10651
10789
  setAnchorEl(anchorEl ? null : event.currentTarget);
@@ -10693,12 +10831,12 @@ var OpacitySelect = function OpacitySelect(_ref) {
10693
10831
  onWheel: onWheel,
10694
10832
  className: "opacity-select",
10695
10833
  "data-testid": "scrollOpacity",
10696
- sx: {
10834
+ sx: Object.assign({
10697
10835
  width: '100%',
10698
10836
  height: 32
10699
- }
10837
+ }, (_a = theme.palette.geowebColors.layerManager.opacitySelect) === null || _a === void 0 ? void 0 : _a.root)
10700
10838
  }, /*#__PURE__*/React.createElement(CustomTooltip, {
10701
- title: "Opacity: ".concat(currentOpacityText),
10839
+ title: "".concat(tooltipPrefix).concat(currentOpacityText),
10702
10840
  sx: tooltipContainerStyles(isEnabled),
10703
10841
  placement: "top",
10704
10842
  open: tooltipOpen
@@ -10711,12 +10849,17 @@ var OpacitySelect = function OpacitySelect(_ref) {
10711
10849
  onMouseLeave: onMouseLeave,
10712
10850
  onFocus: onFocus,
10713
10851
  onBlur: onBlur,
10714
- style: {
10852
+ sx: Object.assign({
10715
10853
  height: '100%',
10716
10854
  width: '100%',
10717
10855
  borderRadius: '0',
10718
- minWidth: '49px'
10719
- },
10856
+ minWidth: '49px',
10857
+ fontSize: function fontSize(theme) {
10858
+ return theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize;
10859
+ },
10860
+ color: isEnabled ? 'geowebColors.layerManager.tableRowDefaultText.rgba' : 'geowebColors.layerManager.tableRowDisabledText.rgba'
10861
+ }, theme.palette.geowebColors.layerManager.opacitySelect.button),
10862
+ className: isOpen ? 'open' : '',
10720
10863
  // Safari-based browsers handle focus differently with buttons
10721
10864
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
10722
10865
  // Use div instead to fix onBlur hander's event.relatedTarget below
@@ -10729,14 +10872,14 @@ var OpacitySelect = function OpacitySelect(_ref) {
10729
10872
  },
10730
10873
  placement: "right"
10731
10874
  }, /*#__PURE__*/React.createElement(Box, {
10732
- sx: {
10875
+ sx: Object.assign({
10733
10876
  padding: '0 0 60px 0',
10734
10877
  backgroundColor: 'geowebColors.background.surface',
10735
10878
  width: '82px',
10736
10879
  height: '248px',
10737
10880
  boxSizing: 'initial',
10738
10881
  boxShadow: 8
10739
- }
10882
+ }, theme.palette.geowebColors.layerManager.opacitySelect.popper)
10740
10883
  }, /*#__PURE__*/React.createElement(Box, {
10741
10884
  sx: sliderHeaderStyle
10742
10885
  }, "Opacity"), /*#__PURE__*/React.createElement(CustomSlider, {
@@ -10781,7 +10924,10 @@ var OpacitySelect = function OpacitySelect(_ref) {
10781
10924
  var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
10782
10925
  var mapId = _ref.mapId,
10783
10926
  layerId = _ref.layerId,
10784
- onLayerDuplicate = _ref.onLayerDuplicate;
10927
+ onLayerDuplicate = _ref.onLayerDuplicate,
10928
+ _ref$tooltipTitle = _ref.tooltipTitle,
10929
+ tooltipTitle = _ref$tooltipTitle === void 0 ? 'Options' : _ref$tooltipTitle,
10930
+ icon = _ref.icon;
10785
10931
 
10786
10932
  var onClickDuplicate = function onClickDuplicate() {
10787
10933
  onLayerDuplicate({
@@ -10805,7 +10951,8 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
10805
10951
  action: onClickDuplicate,
10806
10952
  icon: /*#__PURE__*/React.createElement(Copy, null)
10807
10953
  }],
10808
- tooltipTitle: "Options"
10954
+ tooltipTitle: tooltipTitle,
10955
+ buttonIcon: icon
10809
10956
  });
10810
10957
  };
10811
10958
 
@@ -10814,7 +10961,10 @@ var RenderStyles = function RenderStyles(_ref) {
10814
10961
  currentLayerStyle = _ref.currentLayerStyle,
10815
10962
  onChangeLayerStyle = _ref.onChangeLayerStyle,
10816
10963
  _ref$isEnabled = _ref.isEnabled,
10817
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
10964
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
10965
+ icon = _ref.icon,
10966
+ _ref$tooltipPrefix = _ref.tooltipPrefix,
10967
+ tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Style: ' : _ref$tooltipPrefix;
10818
10968
 
10819
10969
  var _a;
10820
10970
 
@@ -10845,7 +10995,7 @@ var RenderStyles = function RenderStyles(_ref) {
10845
10995
  return currentStyle === style.name;
10846
10996
  });
10847
10997
  return /*#__PURE__*/React.createElement(TooltipSelect, {
10848
- tooltip: "Style: ".concat((_a = styles[currentIndex]) === null || _a === void 0 ? void 0 : _a.title),
10998
+ tooltip: "".concat(tooltipPrefix).concat((_a = styles[currentIndex]) === null || _a === void 0 ? void 0 : _a.title),
10849
10999
  inputProps: {
10850
11000
  SelectDisplayProps: {
10851
11001
  'data-testid': 'selectStyle'
@@ -10859,7 +11009,8 @@ var RenderStyles = function RenderStyles(_ref) {
10859
11009
  onChangeMouseWheel: function onChangeMouseWheel(e) {
10860
11010
  return onChangeLayerStyle(e.value);
10861
11011
  },
10862
- requiresCtrlToChange: true
11012
+ requiresCtrlToChange: true,
11013
+ IconComponent: icon
10863
11014
  }, /*#__PURE__*/React.createElement(MenuItem, {
10864
11015
  disabled: true
10865
11016
  }, "Style"), styles.map(function (styleFromlayer) {
@@ -10883,8 +11034,8 @@ var RenderStyles = function RenderStyles(_ref) {
10883
11034
  * See the License for the specific language governing permissions and
10884
11035
  * limitations under the License.
10885
11036
  *
10886
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10887
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11037
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11038
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
10888
11039
  * */
10889
11040
 
10890
11041
  var getIconColor = function getIconColor(isActive, isEnabled) {
@@ -10974,7 +11125,8 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
10974
11125
  isEnabled = _ref2.isEnabled;
10975
11126
  var isActive = current !== AutoOptions.NONE;
10976
11127
  var Icon = getIcon(isActive, isEnabled, current);
10977
- return /*#__PURE__*/React.createElement(ToolButton, {
11128
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
11129
+ variant: "tool",
10978
11130
  "aria-label": current,
10979
11131
  "data-testid": "activateLayer-btn",
10980
11132
  sx: {
@@ -10982,7 +11134,7 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
10982
11134
  backgroundColor: 'inherit'
10983
11135
  }
10984
11136
  },
10985
- active: isActive
11137
+ isSelected: isActive
10986
11138
  }, Icon);
10987
11139
  };
10988
11140
 
@@ -11073,6 +11225,7 @@ var LayerRow = function LayerRow(_ref) {
11073
11225
  layerDeleteLayout = _ref.layerDeleteLayout,
11074
11226
  layerMenuLayout = _ref.layerMenuLayout,
11075
11227
  layerActiveLayout = _ref.layerActiveLayout,
11228
+ disableActivateLayer = _ref.disableActivateLayer,
11076
11229
  dragHandle = _ref.dragHandle;
11077
11230
 
11078
11231
  var onClickRow = function onClickRow() {
@@ -11124,11 +11277,11 @@ var LayerRow = function LayerRow(_ref) {
11124
11277
  });
11125
11278
  },
11126
11279
  "data-testid": "enableButton-medium"
11127
- }, isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11280
+ }, isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11128
11281
  current: AutoOptions.BOTH,
11129
11282
  onChange: onClickRow,
11130
11283
  isEnabled: true
11131
- }), /*#__PURE__*/React__default.createElement(Typography, {
11284
+ })), /*#__PURE__*/React__default.createElement(Typography, {
11132
11285
  sx: {
11133
11286
  fontWeight: '500',
11134
11287
  fontSize: '12px',
@@ -11209,11 +11362,11 @@ var LayerRow = function LayerRow(_ref) {
11209
11362
  });
11210
11363
  },
11211
11364
  "data-testid": "enableButton"
11212
- }, layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11365
+ }, layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11213
11366
  onChange: onClickRow,
11214
11367
  current: AutoOptions.BOTH,
11215
11368
  isEnabled: true
11216
- })), /*#__PURE__*/React__default.createElement(Grid, {
11369
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
11217
11370
  item: true,
11218
11371
  className: columnClasses.column2
11219
11372
  }, layerServicesLayout || /*#__PURE__*/React__default.createElement(RenderLayers, {
@@ -11312,7 +11465,11 @@ var LayerRow = function LayerRow(_ref) {
11312
11465
  var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
11313
11466
  var layerId = _ref.layerId,
11314
11467
  mapId = _ref.mapId,
11315
- layerIndex = _ref.layerIndex;
11468
+ layerIndex = _ref.layerIndex,
11469
+ _ref$tooltipTitle = _ref.tooltipTitle,
11470
+ tooltipTitle = _ref$tooltipTitle === void 0 ? 'Delete' : _ref$tooltipTitle,
11471
+ _ref$icon = _ref.icon,
11472
+ icon = _ref$icon === void 0 ? /*#__PURE__*/React.createElement(Delete, null) : _ref$icon;
11316
11473
  var dispatch = useDispatch();
11317
11474
  var layerDelete = React.useCallback(function (_ref2) {
11318
11475
  var mapId = _ref2.mapId,
@@ -11329,7 +11486,7 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
11329
11486
  return getLayerEnabled(store, layerId);
11330
11487
  });
11331
11488
  return /*#__PURE__*/React.createElement(CustomIconButton, {
11332
- tooltipTitle: "Delete",
11489
+ tooltipTitle: tooltipTitle,
11333
11490
  onClick: function onClick() {
11334
11491
  layerDelete({
11335
11492
  mapId: mapId,
@@ -11339,7 +11496,7 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
11339
11496
  },
11340
11497
  shouldShowAsDisabled: !isLayerEnabled,
11341
11498
  "data-testid": "deleteButton"
11342
- }, /*#__PURE__*/React.createElement(Delete, null));
11499
+ }, icon);
11343
11500
  };
11344
11501
 
11345
11502
  /* *
@@ -11365,7 +11522,10 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
11365
11522
  _ref$isEnabled = _ref.isEnabled,
11366
11523
  isEnabled = _ref$isEnabled === void 0 ? false : _ref$isEnabled,
11367
11524
  _ref$layerName = _ref.layerName,
11368
- layerName = _ref$layerName === void 0 ? '' : _ref$layerName;
11525
+ layerName = _ref$layerName === void 0 ? '' : _ref$layerName,
11526
+ _ref$icon = _ref.icon,
11527
+ icon = _ref$icon === void 0 ? isEnabled ? /*#__PURE__*/React.createElement(Visibility, null) : /*#__PURE__*/React.createElement(VisibilityOff, null) : _ref$icon,
11528
+ tooltipTitle = _ref.tooltipTitle;
11369
11529
  var dispatch = useDispatch();
11370
11530
  var layerChangeEnabled = React.useCallback(function (_ref2) {
11371
11531
  var layerId = _ref2.layerId,
@@ -11377,9 +11537,11 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
11377
11537
  origin: LayerActionOrigin.layerManager
11378
11538
  }));
11379
11539
  }, [dispatch, mapId]);
11540
+ var normalTooltip = tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : 'Toggle visibility';
11541
+ var miniTooltip = tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : layerName;
11380
11542
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
11381
11543
  shouldShowAsDisabled: !isEnabled,
11382
- tooltipTitle: "Toggle visibility",
11544
+ tooltipTitle: normalTooltip,
11383
11545
  onClick: function onClick(event) {
11384
11546
  event.stopPropagation();
11385
11547
  layerChangeEnabled({
@@ -11392,9 +11554,9 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
11392
11554
  sx: {
11393
11555
  margin: 'auto 0px'
11394
11556
  }
11395
- }, isEnabled ? /*#__PURE__*/React.createElement(Visibility, null) : /*#__PURE__*/React.createElement(VisibilityOff, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
11557
+ }, icon), /*#__PURE__*/React.createElement(CustomIconButton, {
11396
11558
  shouldShowAsDisabled: !isEnabled,
11397
- tooltipTitle: layerName,
11559
+ tooltipTitle: miniTooltip,
11398
11560
  onClick: function onClick(event) {
11399
11561
  event.stopPropagation();
11400
11562
  layerChangeEnabled({
@@ -11407,7 +11569,7 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
11407
11569
  sx: {
11408
11570
  margin: 'auto 0px'
11409
11571
  }
11410
- }, isEnabled ? /*#__PURE__*/React.createElement(Visibility, null) : /*#__PURE__*/React.createElement(VisibilityOff, null)));
11572
+ }, icon));
11411
11573
  };
11412
11574
 
11413
11575
  /* *
@@ -11429,7 +11591,8 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
11429
11591
 
11430
11592
  var OpacitySelectConnect = function OpacitySelectConnect(_ref) {
11431
11593
  var layerId = _ref.layerId,
11432
- mapId = _ref.mapId;
11594
+ mapId = _ref.mapId,
11595
+ tooltipPrefix = _ref.tooltipPrefix;
11433
11596
  var dispatch = useDispatch();
11434
11597
  var opacity = useSelector(function (store) {
11435
11598
  return getLayerOpacity(store, layerId);
@@ -11447,7 +11610,8 @@ var OpacitySelectConnect = function OpacitySelectConnect(_ref) {
11447
11610
  origin: LayerActionOrigin.layerManager
11448
11611
  }));
11449
11612
  },
11450
- isEnabled: isLayerEnabled
11613
+ isEnabled: isLayerEnabled,
11614
+ tooltipPrefix: tooltipPrefix
11451
11615
  });
11452
11616
  };
11453
11617
 
@@ -11524,7 +11688,9 @@ var DimensionSelectConnect = function DimensionSelectConnect(_ref) {
11524
11688
 
11525
11689
  var RenderStylesConnect = function RenderStylesConnect(_ref) {
11526
11690
  var layerId = _ref.layerId,
11527
- mapId = _ref.mapId;
11691
+ mapId = _ref.mapId,
11692
+ icon = _ref.icon,
11693
+ tooltipPrefix = _ref.tooltipPrefix;
11528
11694
  var dispatch = useDispatch();
11529
11695
  var layerService = useSelector(function (store) {
11530
11696
  return getLayerService(store, layerId);
@@ -11553,7 +11719,9 @@ var RenderStylesConnect = function RenderStylesConnect(_ref) {
11553
11719
  layerStyles: layerStyles,
11554
11720
  currentLayerStyle: currentLayerStyle,
11555
11721
  onChangeLayerStyle: layerChangeStyle,
11556
- isEnabled: isLayerEnabled
11722
+ isEnabled: isLayerEnabled,
11723
+ icon: icon,
11724
+ tooltipPrefix: tooltipPrefix
11557
11725
  });
11558
11726
  };
11559
11727
 
@@ -11576,7 +11744,8 @@ var RenderStylesConnect = function RenderStylesConnect(_ref) {
11576
11744
 
11577
11745
  var RenderLayersConnect = function RenderLayersConnect(_ref) {
11578
11746
  var layerId = _ref.layerId,
11579
- mapId = _ref.mapId;
11747
+ mapId = _ref.mapId,
11748
+ tooltipPrefix = _ref.tooltipPrefix;
11580
11749
  var dispatch = useDispatch();
11581
11750
  var layerName = useSelector(function (store) {
11582
11751
  return getLayerName(store, layerId);
@@ -11660,7 +11829,8 @@ var RenderLayersConnect = function RenderLayersConnect(_ref) {
11660
11829
  name: name
11661
11830
  });
11662
11831
  },
11663
- isEnabled: isLayerEnabled
11832
+ isEnabled: isLayerEnabled,
11833
+ tooltipPrefix: tooltipPrefix
11664
11834
  });
11665
11835
  };
11666
11836
 
@@ -11683,7 +11853,9 @@ var RenderLayersConnect = function RenderLayersConnect(_ref) {
11683
11853
 
11684
11854
  var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref) {
11685
11855
  var layerId = _ref.layerId,
11686
- mapId = _ref.mapId;
11856
+ mapId = _ref.mapId,
11857
+ tooltipTitle = _ref.tooltipTitle,
11858
+ icon = _ref.icon;
11687
11859
  var dispatch = useDispatch();
11688
11860
  var layer = useSelector(function (store) {
11689
11861
  return getLayerById(store, layerId);
@@ -11708,7 +11880,9 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
11708
11880
  mapId: mapId,
11709
11881
  layer: layer
11710
11882
  });
11711
- }
11883
+ },
11884
+ tooltipTitle: tooltipTitle,
11885
+ icon: icon
11712
11886
  });
11713
11887
  };
11714
11888
 
@@ -11875,9 +12049,10 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11875
12049
  var layerId = _ref.layerId,
11876
12050
  mapId = _ref.mapId,
11877
12051
  dragHandle = _ref.dragHandle,
11878
- layerIndex = _ref.layerIndex;
12052
+ layerIndex = _ref.layerIndex,
12053
+ settings = _ref.settings;
11879
12054
 
11880
- var _a;
12055
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11881
12056
 
11882
12057
  var isEnabled = useSelector(function (store) {
11883
12058
  return getLayerEnabled(store, layerId);
@@ -11907,15 +12082,22 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11907
12082
  layerId: layerId,
11908
12083
  mapId: mapId,
11909
12084
  isEnabled: isEnabled,
11910
- layerName: fullLayerName || layerName
12085
+ layerName: fullLayerName || layerName,
12086
+ icon: isEnabled ? (_b = settings === null || settings === void 0 ? void 0 : settings.enableLayer) === null || _b === void 0 ? void 0 : _b.enabledIcon : (_c = settings === null || settings === void 0 ? void 0 : settings.enableLayer) === null || _c === void 0 ? void 0 : _c.disabledIcon,
12087
+ tooltipTitle: isEnabled ? (_d = settings === null || settings === void 0 ? void 0 : settings.enableLayer) === null || _d === void 0 ? void 0 : _d.enabledTooltipTitle : (_e = settings === null || settings === void 0 ? void 0 : settings.enableLayer) === null || _e === void 0 ? void 0 : _e.disabledTooltipTitle
11911
12088
  }),
11912
12089
  layerOpacityLayout: /*#__PURE__*/React.createElement(OpacitySelectConnect, {
11913
12090
  layerId: layerId,
11914
- mapId: mapId
12091
+ mapId: mapId,
12092
+ tooltipPrefix: (_f = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _f === void 0 ? void 0 : _f.tooltipPrefix
11915
12093
  }),
11916
- layerServicesLayout: /*#__PURE__*/React.createElement(RenderLayersConnect, {
12094
+ layerServicesLayout: ((_g = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _g === void 0 ? void 0 : _g.Element) ? /*#__PURE__*/React.createElement(settings.renderLayer.Element, {
11917
12095
  layerId: layerId,
11918
12096
  mapId: mapId
12097
+ }) : /*#__PURE__*/React.createElement(RenderLayersConnect, {
12098
+ layerId: layerId,
12099
+ mapId: mapId,
12100
+ tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _h === void 0 ? void 0 : _h.tooltipPrefix
11919
12101
  }),
11920
12102
  layerDimensionLayout: /*#__PURE__*/React.createElement(DimensionSelectConnect, {
11921
12103
  layerId: layerId,
@@ -11923,21 +12105,28 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11923
12105
  }),
11924
12106
  layerStylesLayout: /*#__PURE__*/React.createElement(RenderStylesConnect, {
11925
12107
  layerId: layerId,
11926
- mapId: mapId
12108
+ mapId: mapId,
12109
+ tooltipPrefix: (_j = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _j === void 0 ? void 0 : _j.tooltipPrefix,
12110
+ icon: (_k = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _k === void 0 ? void 0 : _k.icon
11927
12111
  }),
11928
12112
  layerDeleteLayout: /*#__PURE__*/React.createElement(DeleteLayerConnect, {
11929
12113
  mapId: mapId,
11930
12114
  layerId: layerId,
11931
- layerIndex: layerIndex
12115
+ layerIndex: layerIndex,
12116
+ tooltipTitle: (_l = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _l === void 0 ? void 0 : _l.tooltipTitle,
12117
+ icon: (_m = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _m === void 0 ? void 0 : _m.icon
11932
12118
  }),
11933
12119
  layerMenuLayout: /*#__PURE__*/React.createElement(LayerManagerMenuButtonConnect, {
11934
12120
  mapId: mapId,
11935
- layerId: layerId
12121
+ layerId: layerId,
12122
+ tooltipTitle: (_o = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _o === void 0 ? void 0 : _o.tooltipTitle,
12123
+ icon: (_p = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _p === void 0 ? void 0 : _p.icon
11936
12124
  }),
11937
- layerActiveLayout: /*#__PURE__*/React.createElement(ActivateLayerConnect, {
12125
+ layerActiveLayout: ((_q = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _q === void 0 ? void 0 : _q.isDisabled) ? undefined : /*#__PURE__*/React.createElement(ActivateLayerConnect, {
11938
12126
  mapId: mapId,
11939
12127
  layerId: layerId
11940
12128
  }),
12129
+ disableActivateLayer: (_r = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _r === void 0 ? void 0 : _r.isDisabled,
11941
12130
  dragHandle: dragHandle
11942
12131
  });
11943
12132
  };
@@ -11968,10 +12157,16 @@ var DragHandle = function DragHandle(_ref) {
11968
12157
  _ref$hideTooltip = _ref.hideTooltip,
11969
12158
  hideTooltip = _ref$hideTooltip === void 0 ? true : _ref$hideTooltip,
11970
12159
  _ref$isSorting = _ref.isSorting,
11971
- isSorting = _ref$isSorting === void 0 ? false : _ref$isSorting;
11972
- var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
12160
+ isSorting = _ref$isSorting === void 0 ? false : _ref$isSorting,
12161
+ _ref$icon = _ref.icon,
12162
+ icon = _ref$icon === void 0 ? /*#__PURE__*/React__default.createElement(DragHandle$1, {
12163
+ "data-testid": "dragHandleIcon"
12164
+ }) : _ref$icon,
12165
+ _ref$tooltipTitle = _ref.tooltipTitle,
12166
+ tooltipTitle = _ref$tooltipTitle === void 0 ? TOOLTIP_TITLE : _ref$tooltipTitle;
12167
+ var usedTooltipTitle = hideTooltip ? '' : tooltipTitle;
11973
12168
  return /*#__PURE__*/React__default.createElement(CustomIconButton, {
11974
- tooltipTitle: tooltipTitle,
12169
+ tooltipTitle: usedTooltipTitle,
11975
12170
  "data-testid": "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
11976
12171
  className: "handle",
11977
12172
  tabIndex: -1,
@@ -11979,8 +12174,8 @@ var DragHandle = function DragHandle(_ref) {
11979
12174
  disabled: isDisabled,
11980
12175
  sx: {
11981
12176
  cursor: isSorting ? 'grabbing' : 'grab',
11982
- '&:hover': {
11983
- backgroundColor: 'inherit!important'
12177
+ '&.handle:hover': function handleHover(theme) {
12178
+ return Object.assign({}, theme.palette.geowebColors.layerManager.dragHandleHover);
11984
12179
  },
11985
12180
  marginLeft: '3px',
11986
12181
  marginRight: '3px',
@@ -11990,11 +12185,12 @@ var DragHandle = function DragHandle(_ref) {
11990
12185
  color: 'geowebColors.greys.accessible'
11991
12186
  }
11992
12187
  }
11993
- }, /*#__PURE__*/React__default.createElement(DragHandle$1, null));
12188
+ }, icon);
11994
12189
  };
11995
12190
 
11996
12191
  var LayerContainerRow = function LayerContainerRow(_ref) {
11997
- var mapId = _ref.mapId;
12192
+ var mapId = _ref.mapId,
12193
+ settings = _ref.settings;
11998
12194
  var dispatch = useDispatch();
11999
12195
 
12000
12196
  var _React$useState = React.useState(false),
@@ -12118,6 +12314,8 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
12118
12314
  width: '100%'
12119
12315
  }
12120
12316
  }, layerIds.map(function (layerId, index) {
12317
+ var _a, _b;
12318
+
12121
12319
  return /*#__PURE__*/React.createElement(LayerRowConnect, {
12122
12320
  mapId: mapId,
12123
12321
  layerId: layerId,
@@ -12127,8 +12325,11 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
12127
12325
  isDisabled: isDragDisabled,
12128
12326
  index: index,
12129
12327
  hideTooltip: isSorting || isDragDisabled,
12130
- isSorting: isSorting
12131
- })
12328
+ isSorting: isSorting,
12329
+ icon: (_a = settings === null || settings === void 0 ? void 0 : settings.dragHandle) === null || _a === void 0 ? void 0 : _a.icon,
12330
+ tooltipTitle: (_b = settings === null || settings === void 0 ? void 0 : settings.dragHandle) === null || _b === void 0 ? void 0 : _b.tooltipTitle
12331
+ }),
12332
+ settings: settings
12132
12333
  });
12133
12334
  })));
12134
12335
  };
@@ -12938,7 +13139,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
12938
13139
  }, "Close")));
12939
13140
  };
12940
13141
 
12941
- var styles$3 = {
13142
+ var styles$4 = {
12942
13143
  buttonDiv: {
12943
13144
  position: 'relative'
12944
13145
  },
@@ -12982,7 +13183,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
12982
13183
  }, []);
12983
13184
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
12984
13185
  onClick: handleClose,
12985
- sx: styles$3.button,
13186
+ sx: styles$4.button,
12986
13187
  disableRipple: true,
12987
13188
  "data-testid": "addLayersButton",
12988
13189
  ref: ref,
@@ -13023,24 +13224,25 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13023
13224
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip,
13024
13225
  settings = _ref.settings;
13025
13226
 
13026
- var _a, _b, _c;
13227
+ var _a, _b, _c, _d, _e;
13027
13228
 
13229
+ var theme = useTheme();
13028
13230
  return /*#__PURE__*/React.createElement(Grid, {
13029
13231
  container: true,
13030
13232
  item: true,
13031
13233
  "data-testid": "baseLayerRow",
13032
13234
  className: "addLayer-column",
13033
- sx: {
13235
+ sx: Object.assign({
13034
13236
  width: '100%',
13035
13237
  height: '36px'
13036
- }
13238
+ }, theme.palette.geowebColors.layerManager.baseLayerRow.root)
13037
13239
  }, /*#__PURE__*/React.createElement(Grid, {
13038
13240
  item: true,
13039
13241
  className: columnClasses.column1,
13040
13242
  sx: {
13041
13243
  marginTop: '-2px'
13042
13244
  }
13043
- }, /*#__PURE__*/React.createElement(AddLayersButton, {
13245
+ }, !((_b = (_a = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _a === void 0 ? void 0 : _a.addLayersButton) === null || _b === void 0 ? void 0 : _b.isDisabled) && /*#__PURE__*/React.createElement(AddLayersButton, {
13044
13246
  preloadedServices: preloadedServices,
13045
13247
  tooltip: tooltip,
13046
13248
  onRenderTree: function onRenderTree(service) {
@@ -13050,14 +13252,14 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13050
13252
  layerType: LayerType.baseLayer
13051
13253
  });
13052
13254
  }
13053
- })), (_a = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _a === void 0 ? void 0 : _a.title, /*#__PURE__*/React.createElement(Grid, {
13255
+ }), (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _c === void 0 ? void 0 : _c.title), /*#__PURE__*/React.createElement(Grid, {
13054
13256
  item: true,
13055
13257
  className: columnClasses.column2
13056
13258
  }, /*#__PURE__*/React.createElement(BaseLayersConnect, {
13057
13259
  mapId: mapId,
13058
13260
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13059
- tooltipPrefix: (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _b === void 0 ? void 0 : _b.tooltipPrefix,
13060
- icon: (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _c === void 0 ? void 0 : _c.icon
13261
+ tooltipPrefix: (_d = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _d === void 0 ? void 0 : _d.tooltipPrefix,
13262
+ icon: (_e = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _e === void 0 ? void 0 : _e.icon
13061
13263
  })));
13062
13264
  };
13063
13265
 
@@ -13093,7 +13295,8 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13093
13295
  var isDockedLayerManager = _ref.isDockedLayerManager,
13094
13296
  mapId = _ref.mapId,
13095
13297
  onClickDockButton = _ref.onClickDockButton,
13096
- onChangeSize = _ref.onChangeSize;
13298
+ onChangeSize = _ref.onChangeSize,
13299
+ buttonSettings = _ref.buttonSettings;
13097
13300
  var activeMapId = useSelector(function (store) {
13098
13301
  return getActiveWindowId(store);
13099
13302
  });
@@ -13105,11 +13308,12 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13105
13308
  isDockedLayerManager: isDockedLayerManager,
13106
13309
  shortcutsEnabled: shortcutsEnabled,
13107
13310
  onClickDockButton: onClickDockButton,
13108
- onChangeSize: onChangeSize
13311
+ onChangeSize: onChangeSize,
13312
+ buttonSettings: buttonSettings
13109
13313
  });
13110
13314
  };
13111
13315
 
13112
- var styles$2 = {
13316
+ var styles$3 = {
13113
13317
  layerRowContainer: {
13114
13318
  position: 'relative',
13115
13319
  width: '100%',
@@ -13141,7 +13345,8 @@ var LayerManager = function LayerManager(_ref) {
13141
13345
  preloadedBaseServices = _ref.preloadedBaseServices,
13142
13346
  bounds = _ref.bounds,
13143
13347
  onClose = _ref.onClose,
13144
- showTitle = _ref.showTitle,
13348
+ _ref$title = _ref.title,
13349
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13145
13350
  isOpen = _ref.isOpen,
13146
13351
  _ref$onMouseDown = _ref.onMouseDown,
13147
13352
  onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
@@ -13168,6 +13373,9 @@ var LayerManager = function LayerManager(_ref) {
13168
13373
  _ref$setFocused = _ref.setFocused,
13169
13374
  setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
13170
13375
  settings = _ref.settings;
13376
+
13377
+ var _a, _b, _c, _d, _e;
13378
+
13171
13379
  var minSize = {
13172
13380
  width: 100,
13173
13381
  height: 126
@@ -13179,6 +13387,7 @@ var LayerManager = function LayerManager(_ref) {
13179
13387
  sizeInState = _React$useState2[0],
13180
13388
  setSizeInState = _React$useState2[1];
13181
13389
 
13390
+ var theme = useTheme();
13182
13391
  React.useEffect(function () {
13183
13392
  if (size !== sizeInState && isDockedLayerManager && isOpen) {
13184
13393
  setSizeInState(size);
@@ -13186,7 +13395,7 @@ var LayerManager = function LayerManager(_ref) {
13186
13395
 
13187
13396
  }, [size, isOpen]);
13188
13397
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
13189
- title: showTitle ? "Layer Manager ".concat(mapId) : 'Layer Manager',
13398
+ title: title,
13190
13399
  startSize: sizeInState,
13191
13400
  minWidth: minSize.width,
13192
13401
  minHeight: minSize.height,
@@ -13215,10 +13424,13 @@ var LayerManager = function LayerManager(_ref) {
13215
13424
  setSizeInState(Object.assign(Object.assign({}, sizeInState), {
13216
13425
  width: width
13217
13426
  }));
13218
- }
13427
+ },
13428
+ buttonSettings: (_a = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _a === void 0 ? void 0 : _a.controlButtonSettings
13219
13429
  }),
13430
+ dragHandleIcon: (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _b === void 0 ? void 0 : _b.dragHandle) === null || _c === void 0 ? void 0 : _c.icon,
13431
+ closeIcon: (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _d === void 0 ? void 0 : _d.closeButton) === null || _e === void 0 ? void 0 : _e.icon,
13220
13432
  className: "layermanager",
13221
- sx: layerManagerStyle,
13433
+ sx: Object.assign(Object.assign({}, layerManagerStyle), theme.palette.geowebColors.layerManager.root),
13222
13434
  onResizeStop: function onResizeStop(_event, _direction, node) {
13223
13435
  var width = node.offsetWidth,
13224
13436
  height = node.offsetHeight;
@@ -13255,14 +13467,15 @@ var LayerManager = function LayerManager(_ref) {
13255
13467
  })), /*#__PURE__*/React.createElement(Grid, {
13256
13468
  container: true,
13257
13469
  "data-testid": "layerManagerRowContainer",
13258
- sx: styles$2.layerRowContainer
13470
+ sx: styles$3.layerRowContainer
13259
13471
  }, /*#__PURE__*/React.createElement(DescriptionRow, {
13260
13472
  mapPresetsModule: leftHeaderComponent,
13261
13473
  mapId: mapId,
13262
13474
  source: source,
13263
13475
  settings: settings === null || settings === void 0 ? void 0 : settings.header
13264
13476
  }), /*#__PURE__*/React.createElement(LayerContainerRow, {
13265
- mapId: mapId
13477
+ mapId: mapId,
13478
+ settings: settings === null || settings === void 0 ? void 0 : settings.content
13266
13479
  }), /*#__PURE__*/React.createElement(BaseLayerRow, {
13267
13480
  mapId: mapId,
13268
13481
  tooltip: "Add base layers",
@@ -13444,8 +13657,10 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13444
13657
  preloadedMapServices = _ref.preloadedMapServices,
13445
13658
  preloadedBaseServices = _ref.preloadedBaseServices,
13446
13659
  bounds = _ref.bounds,
13447
- _ref$showTitle = _ref.showTitle,
13448
- showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
13660
+ _ref$title = _ref.title,
13661
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13662
+ _ref$showMapIdInTitle = _ref.showMapIdInTitle,
13663
+ showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
13449
13664
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13450
13665
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon;
13451
13666
  var dispatch = useDispatch();
@@ -13474,6 +13689,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13474
13689
  }));
13475
13690
  };
13476
13691
 
13692
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13477
13693
  return /*#__PURE__*/React.createElement(LayerManager, {
13478
13694
  mapId: mapId,
13479
13695
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13481,7 +13697,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13481
13697
  bounds: bounds,
13482
13698
  isOpen: isDialogOpen,
13483
13699
  onClose: onCloseDialog,
13484
- showTitle: showTitle,
13700
+ title: shownTitle,
13485
13701
  onMouseDown: setDialogOrder,
13486
13702
  order: dialogOrder,
13487
13703
  source: uiSource,
@@ -13523,8 +13739,10 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13523
13739
  preloadedAvailableBaseLayers = _ref.preloadedAvailableBaseLayers,
13524
13740
  preloadedBaseServices = _ref.preloadedBaseServices,
13525
13741
  bounds = _ref.bounds,
13526
- _ref$showTitle = _ref.showTitle,
13527
- showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
13742
+ _ref$title = _ref.title,
13743
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13744
+ _ref$showMapIdInTitle = _ref.showMapIdInTitle,
13745
+ showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
13528
13746
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13529
13747
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon,
13530
13748
  _ref$source = _ref.source,
@@ -13559,6 +13777,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13559
13777
  }));
13560
13778
  };
13561
13779
 
13780
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13562
13781
  return /*#__PURE__*/React.createElement(LayerManager, {
13563
13782
  mapId: mapId,
13564
13783
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13566,7 +13785,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13566
13785
  bounds: bounds,
13567
13786
  isOpen: isDialogOpen,
13568
13787
  onClose: onCloseDialog,
13569
- showTitle: showTitle,
13788
+ title: shownTitle,
13570
13789
  leftHeaderComponent: leftHeaderComponent,
13571
13790
  // isLoading={isMapPresetLoading}
13572
13791
  // error={mapPresetError}
@@ -13596,8 +13815,8 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13596
13815
  * See the License for the specific language governing permissions and
13597
13816
  * limitations under the License.
13598
13817
  *
13599
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13600
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13818
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13819
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13601
13820
  * */
13602
13821
 
13603
13822
  var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
@@ -13619,13 +13838,12 @@ var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
13619
13838
  source: source
13620
13839
  }));
13621
13840
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
13622
- return /*#__PURE__*/React.createElement(ToolButton, {
13841
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
13842
+ variant: "tool",
13623
13843
  onClick: openFilterResultsDialog,
13624
- active: isOpenInStore,
13844
+ isSelected: isOpenInStore,
13625
13845
  id: "keywordFilterButton",
13626
- "data-testid": "keywordFilterButton",
13627
- disableRipple: true,
13628
- variant: "tool"
13846
+ "data-testid": "keywordFilterButton"
13629
13847
  }, /*#__PURE__*/React.createElement(Filter, null));
13630
13848
  };
13631
13849
 
@@ -13885,8 +14103,8 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
13885
14103
  * See the License for the specific language governing permissions and
13886
14104
  * limitations under the License.
13887
14105
  *
13888
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13889
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
14106
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14107
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13890
14108
  * */
13891
14109
 
13892
14110
  var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
@@ -13940,9 +14158,9 @@ var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
13940
14158
  }
13941
14159
  };
13942
14160
 
13943
- return /*#__PURE__*/React__default.createElement(ToolButton, {
13944
- variant: "icon",
13945
- active: isActive && isOpenInStore,
14161
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
14162
+ variant: "flat",
14163
+ isSelected: isActive && isOpenInStore,
13946
14164
  onClick: onClick,
13947
14165
  id: "layerInfoButton",
13948
14166
  "aria-label": "layer info",
@@ -15030,7 +15248,7 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
15030
15248
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15031
15249
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
15032
15250
  * */
15033
- var styles$1 = {
15251
+ var styles$2 = {
15034
15252
  servicesContainer: {
15035
15253
  width: '360px',
15036
15254
  maxHeight: '412px',
@@ -15097,7 +15315,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15097
15315
  (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
15098
15316
  }, []);
15099
15317
  return /*#__PURE__*/React.createElement(Box, {
15100
- sx: styles$1.servicesContainer,
15318
+ sx: styles$2.servicesContainer,
15101
15319
  "data-testid": "ServiceDialog",
15102
15320
  onKeyDown: function onKeyDown(event) {
15103
15321
  if (event.key !== 'Escape') {
@@ -15107,9 +15325,9 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15107
15325
  tabIndex: -1,
15108
15326
  ref: dialogRef
15109
15327
  }, /*#__PURE__*/React.createElement(Box, {
15110
- sx: styles$1.header
15328
+ sx: styles$2.header
15111
15329
  }, "Services"), /*#__PURE__*/React.createElement(Backdrop, {
15112
- sx: styles$1.loading,
15330
+ sx: styles$2.loading,
15113
15331
  open: isLoading
15114
15332
  }, /*#__PURE__*/React.createElement(CircularProgress, null)), /*#__PURE__*/React.createElement(Rows, {
15115
15333
  services: services,
@@ -15118,12 +15336,12 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15118
15336
  setServicePopupInfo: setServicePopupInfo,
15119
15337
  selectedLayers: selectedLayers
15120
15338
  }), /*#__PURE__*/React.createElement(Box, {
15121
- sx: styles$1.footer
15339
+ sx: styles$2.footer
15122
15340
  }, /*#__PURE__*/React.createElement(Button, {
15123
15341
  onClick: openAddService,
15124
15342
  onKeyDown: stopTabPropagation,
15125
15343
  "data-testid": "openAddServiceButton",
15126
- sx: styles$1.button,
15344
+ sx: styles$2.button,
15127
15345
  variant: "tertiary",
15128
15346
  startIcon: /*#__PURE__*/React.createElement(Add, null)
15129
15347
  }, "Add a new service")));
@@ -16580,8 +16798,8 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
16580
16798
  * See the License for the specific language governing permissions and
16581
16799
  * limitations under the License.
16582
16800
  *
16583
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16584
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16801
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16802
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16585
16803
  * */
16586
16804
 
16587
16805
  var MapControlButton = function MapControlButton(_a) {
@@ -16594,13 +16812,15 @@ var MapControlButton = function MapControlButton(_a) {
16594
16812
  isActive = _a$isActive === void 0 ? false : _a$isActive,
16595
16813
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
16596
16814
 
16597
- return /*#__PURE__*/React.createElement(CustomTooltip, {
16598
- placement: placement,
16599
- title: title
16600
- }, /*#__PURE__*/React.createElement(ToolButton, Object.assign({
16815
+ return /*#__PURE__*/React.createElement(CustomIconButton, Object.assign({
16816
+ variant: "tool",
16817
+ tooltipProps: {
16818
+ placement: placement,
16819
+ title: title
16820
+ },
16601
16821
  onClick: onClick,
16602
- active: isActive
16603
- }, props), children));
16822
+ isSelected: isActive
16823
+ }, props), children);
16604
16824
  };
16605
16825
 
16606
16826
  /* *
@@ -17383,8 +17603,8 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
17383
17603
  * See the License for the specific language governing permissions and
17384
17604
  * limitations under the License.
17385
17605
  *
17386
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17387
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17606
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17607
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17388
17608
  * */
17389
17609
  var titleOn = 'Auto update on';
17390
17610
  var titleOff = 'Auto update off';
@@ -17396,21 +17616,20 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
17396
17616
  isAutoUpdating = _ref$isAutoUpdating === void 0 ? false : _ref$isAutoUpdating,
17397
17617
  _ref$disabled = _ref.disabled,
17398
17618
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17399
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17400
- title: isAutoUpdating ? titleOn : titleOff,
17401
- "data-testid": "autoUpdateButtonTooltip"
17402
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
17403
- active: isAutoUpdating,
17619
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
17620
+ variant: "tool",
17621
+ isSelected: isAutoUpdating,
17404
17622
  disabled: disabled,
17405
17623
  onClick: function onClick() {
17406
17624
  return toggleAutoUpdate();
17407
17625
  },
17408
- "data-testid": "autoUpdateButton"
17626
+ "data-testid": "autoUpdateButton",
17627
+ tooltipTitle: isAutoUpdating ? titleOn : titleOff
17409
17628
  }, isAutoUpdating ? /*#__PURE__*/React.createElement(AutoUpdateActive, {
17410
17629
  "data-testid": "auto-update-svg-on"
17411
17630
  }) : /*#__PURE__*/React.createElement(AutoUpdateInActive, {
17412
17631
  "data-testid": "auto-update-svg-off"
17413
- }))));
17632
+ }));
17414
17633
  };
17415
17634
 
17416
17635
  var THROTTLE_WAIT_TIME = 300; // [ms]
@@ -17466,20 +17685,24 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17466
17685
  onKeyDown: function onKeyDown(event) {
17467
17686
  event.stopPropagation();
17468
17687
  }
17469
- }, /*#__PURE__*/React.createElement(CustomTooltip, {
17470
- title: title
17471
- }, /*#__PURE__*/React.createElement(ToolButton, {
17688
+ }, /*#__PURE__*/React.createElement(CustomIconButton, {
17689
+ variant: "tool",
17690
+ tooltipTitle: title,
17472
17691
  onClick: function onClick() {
17473
17692
  setOpen(true);
17474
17693
  },
17475
17694
  ref: setAnchorRef,
17476
- active: true,
17477
- width: "100%",
17478
- onWheel: onWheel
17695
+ isSelected: true,
17696
+ onWheel: onWheel,
17697
+ sx: {
17698
+ padding: '11px!important',
17699
+ width: '100%!important'
17700
+ }
17479
17701
  }, icon, /*#__PURE__*/React.createElement(Typography, {
17480
17702
  fontSize: 12,
17481
- fontWeight: 400
17482
- }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text))), /*#__PURE__*/React.createElement(Menu, {
17703
+ fontWeight: 400,
17704
+ textTransform: "none"
17705
+ }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text)), /*#__PURE__*/React.createElement(Menu, {
17483
17706
  anchorEl: anchorRef,
17484
17707
  open: open,
17485
17708
  onClose: function onClose() {
@@ -17535,12 +17758,19 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17535
17758
  minHeight: '30px!important'
17536
17759
  }
17537
17760
  }
17538
- }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(ToolButton, {
17761
+ }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(CustomIconButton, {
17762
+ variant: "tool",
17539
17763
  "data-testid": "menu-animation-length-button",
17540
- active: false,
17541
- disableRipple: true,
17542
- width: "100%"
17543
- }, minutesToDescribedDuration(value))));
17764
+ sx: {
17765
+ padding: '11px!important',
17766
+ width: '100%!important'
17767
+ }
17768
+ }, /*#__PURE__*/React.createElement(Typography, {
17769
+ fontSize: 14,
17770
+ fontWeight: 500,
17771
+ textTransform: "none",
17772
+ lineHeight: 2
17773
+ }, minutesToDescribedDuration(value)))));
17544
17774
  };
17545
17775
 
17546
17776
  var speedTooltipTitle = 'Speed';
@@ -17823,8 +18053,8 @@ var TimeScaleButton = function TimeScaleButton(_ref) {
17823
18053
  * See the License for the specific language governing permissions and
17824
18054
  * limitations under the License.
17825
18055
  *
17826
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17827
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18056
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18057
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17828
18058
  * */
17829
18059
  var title$1 = 'Now';
17830
18060
 
@@ -17833,18 +18063,18 @@ var NowButton = function NowButton(_ref) {
17833
18063
  onSetNow = _ref$onSetNow === void 0 ? function () {} : _ref$onSetNow,
17834
18064
  _ref$disabled = _ref.disabled,
17835
18065
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17836
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17837
- title: title$1,
17838
- "data-testid": "nowButtonTooltip"
17839
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18066
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18067
+ variant: "tool",
18068
+ "aria-label": "now",
18069
+ tooltipTitle: title$1,
18070
+ "data-testid": "nowButtonTooltip",
17840
18071
  disabled: disabled,
17841
18072
  onClick: function onClick() {
17842
18073
  return onSetNow();
17843
- },
17844
- "aria-label": "now"
18074
+ }
17845
18075
  }, /*#__PURE__*/React.createElement(Now, {
17846
18076
  "data-testid": "now-svg"
17847
- }))));
18077
+ }));
17848
18078
  };
17849
18079
 
17850
18080
  /* *
@@ -18011,21 +18241,22 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18011
18241
  setOpen(true);
18012
18242
  }
18013
18243
  }, [anchorEl, isOpenByDefault]);
18014
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomTooltip, {
18015
- title: "Animation options",
18016
- placement: "bottom"
18017
- }, /*#__PURE__*/React__default.createElement("span", {
18018
- ref: function ref(_ref2) {
18019
- setAnchorEl(_ref2);
18020
- }
18021
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
18244
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomIconButton, {
18245
+ variant: "tool",
18022
18246
  onClick: function onClick() {
18023
18247
  setOpen(!open);
18024
18248
  },
18025
18249
  "data-testid": "optionsMenuButton",
18026
- active: open,
18027
- "aria-label": "animation options"
18028
- }, /*#__PURE__*/React__default.createElement(Options, null)))), /*#__PURE__*/React__default.createElement(Popper, {
18250
+ isSelected: open,
18251
+ "aria-label": "animation options",
18252
+ tooltipProps: {
18253
+ title: 'Animation options',
18254
+ placement: 'bottom'
18255
+ },
18256
+ ref: function ref(_ref2) {
18257
+ setAnchorEl(_ref2);
18258
+ }
18259
+ }, /*#__PURE__*/React__default.createElement(Options, null)), /*#__PURE__*/React__default.createElement(Popper, {
18029
18260
  sx: {
18030
18261
  zIndex: 3
18031
18262
  },
@@ -18034,7 +18265,11 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18034
18265
  "data-testid": "optionsMenuPopOver",
18035
18266
  anchorEl: anchorEl
18036
18267
  }, /*#__PURE__*/React__default.createElement(Paper, {
18037
- elevation: 3
18268
+ elevation: 3,
18269
+ sx: {
18270
+ position: 'relative',
18271
+ top: 1
18272
+ }
18038
18273
  }, /*#__PURE__*/React__default.createElement(Grid, {
18039
18274
  sx: {
18040
18275
  padding: '0px 10px 10px'
@@ -18064,8 +18299,8 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18064
18299
  * See the License for the specific language governing permissions and
18065
18300
  * limitations under the License.
18066
18301
  *
18067
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18068
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18302
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18303
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18069
18304
  * */
18070
18305
  var forwardTooltipTitle = 'Forward';
18071
18306
  var backwardTooltipTitle = 'Backward';
@@ -18075,17 +18310,17 @@ var BackwardForwardStepButton = function BackwardForwardStepButton(_ref) {
18075
18310
  isDisabled = _ref.isDisabled,
18076
18311
  _ref$onClickBFButton = _ref.onClickBFButton,
18077
18312
  onClickBFButton = _ref$onClickBFButton === void 0 ? function () {} : _ref$onClickBFButton;
18078
- return /*#__PURE__*/React.createElement(CustomTooltip, {
18079
- title: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18080
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18313
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18314
+ variant: "tool",
18081
18315
  disabled: isDisabled,
18082
18316
  "aria-label": isForwardStep ? 'forward' : 'backward',
18083
- onClick: onClickBFButton
18317
+ onClick: onClickBFButton,
18318
+ tooltipTitle: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18084
18319
  }, isForwardStep ? /*#__PURE__*/React.createElement(StepForward, {
18085
18320
  "data-testid": "step-forward-svg-path"
18086
18321
  }) : /*#__PURE__*/React.createElement(StepBackward, {
18087
18322
  "data-testid": "step-backward-svg-path"
18088
- }))));
18323
+ }));
18089
18324
  };
18090
18325
 
18091
18326
  /* *
@@ -18118,7 +18353,7 @@ var ControlButtons = function ControlButtons(_ref) {
18118
18353
  isForwardStep: true
18119
18354
  })), /*#__PURE__*/React.createElement(Grid, {
18120
18355
  item: true
18121
- }, playBtn || /*#__PURE__*/React.createElement(PlayButton, null)));
18356
+ }, playBtn || /*#__PURE__*/React.createElement(PlayButton$1, null)));
18122
18357
  };
18123
18358
 
18124
18359
  /* *
@@ -19086,7 +19321,7 @@ var isLeftAnimationIconArea = function isLeftAnimationIconArea(x, leftMarkerPx,
19086
19321
  };
19087
19322
 
19088
19323
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
19089
- var DRAG_AREA_WIDTH = 24;
19324
+ var DRAG_AREA_WIDTH$1 = 24;
19090
19325
 
19091
19326
  function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition) {
19092
19327
  var _React$useState = React.useState(convertStringTimeToUnix(animationStartTime)),
@@ -19144,7 +19379,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19144
19379
 
19145
19380
  if (leftMarkerDragging) {
19146
19381
  var mousePosition = leftMarkerPx + x;
19147
- var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
19382
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH$1 * 2;
19148
19383
 
19149
19384
  if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
19150
19385
  return;
@@ -19161,7 +19396,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19161
19396
  if (rightMarkerDragging) {
19162
19397
  var _mousePosition = rightMarkerPx + x;
19163
19398
 
19164
- var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
19399
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH$1 * 2;
19165
19400
 
19166
19401
  if (leftAnimationPosition >= _mousePosition || _mousePosition >= canvasWidth) {
19167
19402
  return;
@@ -19363,7 +19598,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19363
19598
  selectedTimePx = _map4[2]; // start dragging selected time.
19364
19599
 
19365
19600
 
19366
- if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH)) {
19601
+ if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1)) {
19367
19602
  setCursorStyle('grabbing');
19368
19603
  setSelectedTimeDragging(true);
19369
19604
  return;
@@ -19372,7 +19607,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19372
19607
  if (animationStartTime && animationEndTime) {
19373
19608
  dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
19374
19609
 
19375
- if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
19610
+ if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1) && !rightMarkerDragging) {
19376
19611
  setCursorStyle('grabbing');
19377
19612
  setLeftMarkerDragging(true);
19378
19613
  setTooltipTime(moment.utc(animationStartTime));
@@ -19380,7 +19615,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19380
19615
  return;
19381
19616
  }
19382
19617
 
19383
- if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
19618
+ if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1) && !leftMarkerDragging) {
19384
19619
  setCursorStyle('grabbing');
19385
19620
  setRightMarkerDragging(true);
19386
19621
  setTooltipTime(moment.utc(animationEndTime));
@@ -19427,9 +19662,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19427
19662
  selectedTimePx = _map6[2]; // Adjust mouse cursor while hovering draggable areas
19428
19663
 
19429
19664
 
19430
- var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
19431
- var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
19432
- var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
19665
+ var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1);
19666
+ var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1);
19667
+ var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1);
19433
19668
  var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
19434
19669
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
19435
19670
 
@@ -19502,22 +19737,21 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19502
19737
  * See the License for the specific language governing permissions and
19503
19738
  * limitations under the License.
19504
19739
  *
19505
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19506
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
19740
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19741
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
19507
19742
  * */
19508
19743
 
19509
19744
  var HideSliderButton = function HideSliderButton(_ref) {
19510
19745
  var isVisible = _ref.isVisible,
19511
19746
  toggleTimeSliderIsVisible = _ref.toggleTimeSliderIsVisible;
19512
- return /*#__PURE__*/React__default.createElement(CustomTooltip, {
19513
- title: isVisible ? 'Hide timeslider' : 'Show timeslider',
19514
- "data-testid": "autoUpdateButtonTooltip"
19515
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(ToolButton, {
19747
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
19748
+ variant: "tool",
19516
19749
  onClick: function onClick() {
19517
19750
  toggleTimeSliderIsVisible(!isVisible);
19518
19751
  },
19519
- "data-testid": "hideTimeSliderButton"
19520
- }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null))));
19752
+ "data-testid": "hideTimeSliderButton",
19753
+ tooltipTitle: isVisible ? 'Hide timeslider' : 'Show timeslider'
19754
+ }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null));
19521
19755
  };
19522
19756
 
19523
19757
  /* *
@@ -20774,7 +21008,7 @@ var ReactMapViewLayer = function ReactMapViewLayer(props) {
20774
21008
  var tileRenderSettings = {
20775
21009
  WorldMap_Light_Grey_Canvas: {
20776
21010
  'EPSG:3857': {
20777
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap_Light_Grey_Canvas/EPSG3857/',
21011
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/',
20778
21012
  minLevel: 0,
20779
21013
  maxLevel: 9,
20780
21014
  tileServerType: 'osm',
@@ -20783,7 +21017,7 @@ var tileRenderSettings = {
20783
21017
  },
20784
21018
  OpenStreetMap_NL: {
20785
21019
  'EPSG:3857': {
20786
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreetMap_NL/EPSG3857/',
21020
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreetMap_NL/EPSG3857/',
20787
21021
  minLevel: 0,
20788
21022
  maxLevel: 16,
20789
21023
  tileServerType: 'osm',
@@ -20792,14 +21026,14 @@ var tileRenderSettings = {
20792
21026
  },
20793
21027
  OpenStreets_NL: {
20794
21028
  'EPSG:3857': {
20795
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG3857/',
21029
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG3857/',
20796
21030
  minLevel: 0,
20797
21031
  maxLevel: 16,
20798
21032
  tileServerType: 'osm',
20799
21033
  copyRight: 'OpenStreetMap - contributors | Ingmapping'
20800
21034
  },
20801
21035
  'EPSG:28992': {
20802
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG28992/',
21036
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
20803
21037
  minLevel: 0,
20804
21038
  maxLevel: 16,
20805
21039
  tileServerType: 'osm',
@@ -20808,7 +21042,7 @@ var tileRenderSettings = {
20808
21042
  },
20809
21043
  Positron_NL: {
20810
21044
  'EPSG:3857': {
20811
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL/EPSG3857/',
21045
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL/EPSG3857/',
20812
21046
  minLevel: 0,
20813
21047
  maxLevel: 16,
20814
21048
  tileServerType: 'osm',
@@ -20817,7 +21051,7 @@ var tileRenderSettings = {
20817
21051
  },
20818
21052
  Positron_NL_NoLabels: {
20819
21053
  'EPSG:3857': {
20820
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL_NoLabels/EPSG3857/',
21054
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL_NoLabels/EPSG3857/',
20821
21055
  minLevel: 0,
20822
21056
  maxLevel: 16,
20823
21057
  tileServerType: 'osm',
@@ -20826,7 +21060,7 @@ var tileRenderSettings = {
20826
21060
  },
20827
21061
  Klokantech_Basic_NL: {
20828
21062
  'EPSG:3857': {
20829
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL/EPSG3857/',
21063
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL/EPSG3857/',
20830
21064
  minLevel: 0,
20831
21065
  maxLevel: 16,
20832
21066
  tileServerType: 'osm',
@@ -20835,7 +21069,7 @@ var tileRenderSettings = {
20835
21069
  },
20836
21070
  Klokantech_Basic_NL_NoLabels: {
20837
21071
  'EPSG:3857': {
20838
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL_NoLabels/EPSG3857/',
21072
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL_NoLabels/EPSG3857/',
20839
21073
  minLevel: 0,
20840
21074
  maxLevel: 16,
20841
21075
  tileServerType: 'osm',
@@ -20844,7 +21078,7 @@ var tileRenderSettings = {
20844
21078
  },
20845
21079
  OSM_Blossom_NL: {
20846
21080
  'EPSG:3857': {
20847
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Blossom_NL/EPSG3857/',
21081
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Blossom_NL/EPSG3857/',
20848
21082
  minLevel: 0,
20849
21083
  maxLevel: 16,
20850
21084
  tileServerType: 'osm',
@@ -20853,14 +21087,14 @@ var tileRenderSettings = {
20853
21087
  },
20854
21088
  WorldMap: {
20855
21089
  'EPSG:3857': {
20856
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3857/',
21090
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3857/',
20857
21091
  minLevel: 0,
20858
21092
  maxLevel: 9,
20859
21093
  tileServerType: 'osm',
20860
21094
  copyRight: 'Natural Earth II | Ingmapping'
20861
21095
  },
20862
21096
  'TODO__EPSG:4326': {
20863
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG4326/',
21097
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
20864
21098
  minLevel: 0,
20865
21099
  maxLevel: 9,
20866
21100
  origX: -180,
@@ -20870,42 +21104,42 @@ var tileRenderSettings = {
20870
21104
  copyRight: 'Natural Earth II | Ingmapping'
20871
21105
  },
20872
21106
  'EPSG:3411': {
20873
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3411/',
21107
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
20874
21108
  minLevel: 3,
20875
21109
  maxLevel: 9,
20876
21110
  tileServerType: 'osm',
20877
21111
  copyRight: 'Natural Earth II | Ingmapping'
20878
21112
  },
20879
21113
  'EPSG:28992': {
20880
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG28992/',
21114
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG28992/',
20881
21115
  minLevel: 5,
20882
21116
  maxLevel: 9,
20883
21117
  tileServerType: 'osm',
20884
21118
  copyRight: 'Natural Earth II | Ingmapping'
20885
21119
  },
20886
21120
  'EPSG:3412': {
20887
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3412/',
21121
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3412/',
20888
21122
  minLevel: 3,
20889
21123
  maxLevel: 9,
20890
21124
  tileServerType: 'osm',
20891
21125
  copyRight: 'Natural Earth II | Ingmapping'
20892
21126
  },
20893
21127
  'EPSG:32661': {
20894
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG32661/',
21128
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG32661/',
20895
21129
  minLevel: 4,
20896
21130
  maxLevel: 9,
20897
21131
  tileServerType: 'osm',
20898
21132
  copyRight: 'Natural Earth II | Ingmapping'
20899
21133
  },
20900
21134
  'EPSG:54030': {
20901
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG54030/',
21135
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG54030/',
20902
21136
  minLevel: 3,
20903
21137
  maxLevel: 9,
20904
21138
  tileServerType: 'osm',
20905
21139
  copyRight: 'Natural Earth II | Ingmapping'
20906
21140
  },
20907
21141
  'EPSG:3575': {
20908
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3575/',
21142
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3575/',
20909
21143
  minLevel: 5,
20910
21144
  maxLevel: 9,
20911
21145
  tileServerType: 'osm',
@@ -20914,7 +21148,7 @@ var tileRenderSettings = {
20914
21148
  },
20915
21149
  OSM_Antarctica: {
20916
21150
  'EPSG:3412': {
20917
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Antarctica/EPSG3412/',
21151
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Antarctica/EPSG3412/',
20918
21152
  minLevel: 1,
20919
21153
  maxLevel: 7,
20920
21154
  origX: -3000000,
@@ -21017,7 +21251,7 @@ var tileRenderSettings = {
21017
21251
  },
21018
21252
  NaturalEarth2: {
21019
21253
  'EPSG:3411': {
21020
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3411/',
21254
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3411/',
21021
21255
  minLevel: 1,
21022
21256
  maxLevel: 6,
21023
21257
  origX: -12400000,
@@ -21027,7 +21261,7 @@ var tileRenderSettings = {
21027
21261
  copyRight: 'NPS - Natural Earth II'
21028
21262
  },
21029
21263
  'EPSG:3412': {
21030
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3412/',
21264
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3412/',
21031
21265
  minLevel: 1,
21032
21266
  maxLevel: 6,
21033
21267
  origX: -12400000,
@@ -21037,7 +21271,7 @@ var tileRenderSettings = {
21037
21271
  copyRight: 'NPS - Natural Earth II'
21038
21272
  },
21039
21273
  'EPSG:3575': {
21040
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3575/',
21274
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3575/',
21041
21275
  minLevel: 1,
21042
21276
  maxLevel: 6,
21043
21277
  origX: -13000000,
@@ -21047,14 +21281,14 @@ var tileRenderSettings = {
21047
21281
  copyRight: 'NPS - Natural Earth II'
21048
21282
  },
21049
21283
  'EPSG:3857': {
21050
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3857/',
21284
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3857/',
21051
21285
  minLevel: 1,
21052
21286
  maxLevel: 7,
21053
21287
  tileServerType: 'wmst',
21054
21288
  copyRight: 'NPS - Natural Earth II'
21055
21289
  },
21056
21290
  'EPSG:4258': {
21057
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21291
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21058
21292
  minLevel: 1,
21059
21293
  maxLevel: 6,
21060
21294
  origX: -180,
@@ -21064,7 +21298,7 @@ var tileRenderSettings = {
21064
21298
  copyRight: 'NPS - Natural Earth II'
21065
21299
  },
21066
21300
  'EPSG:4326': {
21067
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21301
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21068
21302
  minLevel: 1,
21069
21303
  maxLevel: 6,
21070
21304
  origX: -180,
@@ -21074,7 +21308,7 @@ var tileRenderSettings = {
21074
21308
  copyRight: 'NPS - Natural Earth II'
21075
21309
  },
21076
21310
  'EPSG:28992': {
21077
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG28992/',
21311
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG28992/',
21078
21312
  minLevel: 1,
21079
21313
  maxLevel: 5,
21080
21314
  origX: -2999000,
@@ -21084,7 +21318,7 @@ var tileRenderSettings = {
21084
21318
  copyRight: 'NPS - Natural Earth II'
21085
21319
  },
21086
21320
  'EPSG:32661': {
21087
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG32661/',
21321
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG32661/',
21088
21322
  minLevel: 1,
21089
21323
  maxLevel: 7,
21090
21324
  origX: -5000000,
@@ -21094,7 +21328,7 @@ var tileRenderSettings = {
21094
21328
  copyRight: 'NPS - Natural Earth II'
21095
21329
  },
21096
21330
  'EPSG:54030': {
21097
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG54030/',
21331
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG54030/',
21098
21332
  minLevel: 1,
21099
21333
  maxLevel: 7,
21100
21334
  origX: -17000000,
@@ -21122,86 +21356,50 @@ var tileRenderSettings = {
21122
21356
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21123
21357
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
21124
21358
  * */
21125
- var getCurrentDimensionValue = function getCurrentDimensionValue() {
21126
- var dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
21127
- var name = arguments.length > 1 ? arguments[1] : undefined;
21128
- var currentDimension = dimensions.find(function (dim) {
21129
- return dim.name === name;
21130
- });
21131
- return currentDimension === null || currentDimension === void 0 ? void 0 : currentDimension.currentValue;
21132
- };
21133
- var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, mapProperties, onUpdateLayerInformation) {
21359
+ var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
21134
21360
  var origin = LayerActionOrigin.ReactMapViewParseLayer;
21135
- var service = WMGetServiceFromStore(wmLayer.service);
21136
- var serviceName = mapProperties.services && mapProperties.services[service.id] && mapProperties.services[service.id].name || service.id;
21137
- var webMapJSInstance = getWMJSMapById(mapId);
21361
+ var map = getWMJSMapById(mapId);
21138
21362
  /* Update list of layers for service */
21139
21363
 
21140
- var done = function done(layers) {
21141
- var updateObject = {
21364
+ var updateObject = {
21365
+ origin: origin,
21366
+ layerStyle: {
21142
21367
  origin: origin,
21143
- serviceLayers: {
21144
- name: serviceName,
21145
- id: service.id,
21146
- serviceUrl: wmLayer.service,
21147
- layers: layers,
21148
- scope: 'system'
21149
- },
21150
- layerStyle: {
21151
- origin: origin,
21152
- layerId: wmLayer.ReactWMJSLayerId,
21153
- style: wmLayer.currentStyle
21154
- },
21155
- mapDimensions: {
21156
- origin: origin,
21157
- mapId: mapId,
21158
- dimensions: webMapJSInstance.mapdimensions.map(function (_ref) {
21159
- var name = _ref.name,
21160
- units = _ref.units,
21161
- currentValue = _ref.currentValue,
21162
- synced = _ref.synced;
21163
- var reactDim = mapProperties.dimensions && mapProperties.dimensions.find(function (dim) {
21164
- return dim.name === name;
21165
- });
21166
- var newDimValue = reactDim && reactDim.currentValue || currentValue;
21167
- var newDimSynced = reactDim && reactDim.synced || synced;
21168
- return {
21169
- name: name,
21170
- units: units,
21171
- currentValue: newDimValue,
21172
- synced: newDimSynced
21173
- };
21174
- })
21175
- },
21176
- layerDimensions: {
21177
- origin: origin,
21178
- layerId: wmLayer.id,
21179
- dimensions: wmLayer.dimensions.map(function (dim) {
21180
- var name = dim.name,
21181
- units = dim.units,
21182
- synced = dim.synced;
21183
- var currentDimensionValue = getCurrentDimensionValue(wmLayer.dimensions, name);
21184
- var newDimensionValue = currentDimensionValue || dim.getValue();
21185
- return {
21186
- name: name,
21187
- units: units,
21188
- currentValue: newDimensionValue,
21189
- minValue: dim.getFirstValue(),
21190
- maxValue: dim.getLastValue(),
21191
- timeInterval: dim.getDimInterval(),
21192
- values: dim.getValues(),
21193
- synced: synced
21194
- };
21195
- })
21196
- }
21197
- };
21198
- onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21368
+ layerId: wmLayer.ReactWMJSLayerId,
21369
+ style: wmLayer.currentStyle
21370
+ },
21371
+ mapDimensions: {
21372
+ mapId: mapId,
21373
+ origin: origin,
21374
+ dimensions: map && map.mapdimensions.map(function (mapdim) {
21375
+ return {
21376
+ units: mapdim.units,
21377
+ currentValue: mapdim.currentValue,
21378
+ name: mapdim.name
21379
+ };
21380
+ }) || []
21381
+ },
21382
+ layerDimensions: {
21383
+ origin: origin,
21384
+ layerId: wmLayer.id,
21385
+ dimensions: wmLayer.dimensions.map(function (dim) {
21386
+ var name = dim.name,
21387
+ units = dim.units,
21388
+ synced = dim.synced;
21389
+ return {
21390
+ name: name,
21391
+ units: units,
21392
+ currentValue: dim.getValue(),
21393
+ minValue: dim.getFirstValue(),
21394
+ maxValue: dim.getLastValue(),
21395
+ timeInterval: dim.getDimInterval(),
21396
+ values: dim.getValues(),
21397
+ synced: synced
21398
+ };
21399
+ })
21400
+ }
21199
21401
  };
21200
-
21201
- service.getLayerObjectsFlat(done, function () {// do nothing
21202
- }, false, {
21203
- headers: wmLayer.headers
21204
- });
21402
+ onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21205
21403
  };
21206
21404
 
21207
21405
  /* *
@@ -21300,8 +21498,7 @@ var checkHoverVertice = function checkHoverVertice(feature, mouseX, mouseY, conv
21300
21498
  coordinateIndexInFeature: _polygonIndex
21301
21499
  };
21302
21500
  }
21303
- } catch (e) {
21304
- console.warn(e);
21501
+ } catch (e) {// console.warn(e);
21305
21502
  }
21306
21503
  }
21307
21504
  }
@@ -23957,7 +24154,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
23957
24154
  mapId = _this$props.mapId;
23958
24155
 
23959
24156
  try {
23960
- setServiceMetadata(wmLayer, mapId, _this.props, onUpdateLayerInformation);
24157
+ setLayerInfo(wmLayer, mapId, onUpdateLayerInformation);
23961
24158
  } catch (e) {
23962
24159
  /* Provide a hint on what is going wrong */
23963
24160
  console.error(e);
@@ -24257,7 +24454,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
24257
24454
  _mapId = props.mapId;
24258
24455
  onUpdateLayerInformation && onUpdateLayerInformation({
24259
24456
  origin: ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO,
24260
- serviceLayers: null,
24261
24457
  layerStyle: null,
24262
24458
  layerDimensions: null,
24263
24459
  mapDimensions: {
@@ -25439,8 +25635,8 @@ var OptionsMenuConnect = function OptionsMenuConnect(_ref) {
25439
25635
  * See the License for the specific language governing permissions and
25440
25636
  * limitations under the License.
25441
25637
  *
25442
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25443
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
25638
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25639
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
25444
25640
  * */
25445
25641
  var ClockContainer = function ClockContainer(_ref) {
25446
25642
  var fontSize = _ref.fontSize,
@@ -25473,13 +25669,14 @@ var ClockContainer = function ClockContainer(_ref) {
25473
25669
  item: true,
25474
25670
  zIndex: 2,
25475
25671
  ref: setButtonElement
25476
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
25672
+ }, /*#__PURE__*/React__default.createElement(CustomIconButton, {
25673
+ variant: "tool",
25477
25674
  onClick: onButtonClick,
25478
25675
  sx: {
25479
25676
  color: '#fff!important'
25480
25677
  },
25481
25678
  "aria-label": "Animation options",
25482
- active: isPopperOpen
25679
+ isSelected: isPopperOpen
25483
25680
  }, /*#__PURE__*/React__default.createElement(Icon, {
25484
25681
  isPopperOpen: isPopperOpen,
25485
25682
  popperPlacement: popperPlacement
@@ -25911,6 +26108,31 @@ var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
25911
26108
  });
25912
26109
  };
25913
26110
 
26111
+ /* *
26112
+ * Licensed under the Apache License, Version 2.0 (the "License");
26113
+ * you may not use this file except in compliance with the License.
26114
+ * You may obtain a copy of the License at
26115
+ *
26116
+ * http://www.apache.org/licenses/LICENSE-2.0
26117
+ *
26118
+ * Unless required by applicable law or agreed to in writing, software
26119
+ * distributed under the License is distributed on an "AS IS" BASIS,
26120
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26121
+ * See the License for the specific language governing permissions and
26122
+ * limitations under the License.
26123
+ *
26124
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26125
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26126
+ * */
26127
+ var sanitizeHTML = function sanitizeHTML(htmlToBeSanitezed) {
26128
+ return {
26129
+ __html: DOMPurify.sanitize(htmlToBeSanitezed, {
26130
+ ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'table', 'td', 'tr', 'br', 'hr', 'th'],
26131
+ ALLOWED_ATTR: ['href']
26132
+ })
26133
+ };
26134
+ };
26135
+
25914
26136
  var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
25915
26137
  var layers = _ref.layers,
25916
26138
  isOpen = _ref.isOpen,
@@ -26098,9 +26320,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
26098
26320
  },
26099
26321
  "data-testid": "layer-result-ready-".concat(layerId),
26100
26322
  // eslint-disable-next-line react/no-danger
26101
- dangerouslySetInnerHTML: {
26102
- __html: result.data.replace(/<hr\/>/g, '')
26103
- }
26323
+ dangerouslySetInnerHTML: sanitizeHTML(result.data)
26104
26324
  }) : /*#__PURE__*/React__default.createElement("div", {
26105
26325
  "data-testid": "layer-result-loading-".concat(layerId)
26106
26326
  }, /*#__PURE__*/React__default.createElement(CircularProgress, {
@@ -26456,17 +26676,27 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
26456
26676
  var syncGroupAddTarget = React__default.useCallback(function (payload) {
26457
26677
  dispatch(genericActions.syncGroupAddTarget(payload));
26458
26678
  }, [dispatch]);
26679
+ var syncTargets = useSelector(function (store) {
26680
+ return getSyncGroupTargets(store);
26681
+ });
26459
26682
  React__default.useEffect(function () {
26460
26683
  maps.forEach(function (map) {
26461
26684
  map.syncGroupsIds && map.syncGroupsIds.forEach(function (syncGroupsId) {
26462
- syncGroupAddTarget({
26463
- groupId: syncGroupsId,
26464
- targetId: map.id,
26465
- linked: true
26466
- });
26685
+ var alreadySyncedTargetIndex = syncTargets.findIndex(function (target) {
26686
+ return target.targetId === map.id && target.groupId === syncGroupsId && target.linked === true;
26687
+ }); // Only trigger an action if the target was not yet added to the group or was not linked.
26688
+
26689
+ if (alreadySyncedTargetIndex === -1) {
26690
+ syncGroupAddTarget({
26691
+ groupId: syncGroupsId,
26692
+ targetId: map.id,
26693
+ linked: true,
26694
+ origin: 'system'
26695
+ });
26696
+ }
26467
26697
  });
26468
26698
  });
26469
- }, [maps, syncGroupAddTarget]);
26699
+ }, [maps, syncGroupAddTarget, syncTargets]);
26470
26700
  var mapStyle = {
26471
26701
  width: "".concat(Math.round(100 / cols), "%"),
26472
26702
  height: "".concat(Math.round(100 / rows), "%")
@@ -26731,6 +26961,793 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
26731
26961
  });
26732
26962
  };
26733
26963
 
26964
+ /* *
26965
+ * Licensed under the Apache License, Version 2.0 (the "License");
26966
+ * you may not use this file except in compliance with the License.
26967
+ * You may obtain a copy of the License at
26968
+ *
26969
+ * http://www.apache.org/licenses/LICENSE-2.0
26970
+ *
26971
+ * Unless required by applicable law or agreed to in writing, software
26972
+ * distributed under the License is distributed on an "AS IS" BASIS,
26973
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26974
+ * See the License for the specific language governing permissions and
26975
+ * limitations under the License.
26976
+ *
26977
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26978
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26979
+ * */
26980
+ var timeSliderLiteButtonDefaultProps = {
26981
+ sx: {
26982
+ width: '36px',
26983
+ height: '36px'
26984
+ }
26985
+ };
26986
+ var timeSliderLiteTooltipDefaultProps = {
26987
+ placement: 'top'
26988
+ };
26989
+
26990
+ /* *
26991
+ * Licensed under the Apache License, Version 2.0 (the "License");
26992
+ * you may not use this file except in compliance with the License.
26993
+ * You may obtain a copy of the License at
26994
+ *
26995
+ * http://www.apache.org/licenses/LICENSE-2.0
26996
+ *
26997
+ * Unless required by applicable law or agreed to in writing, software
26998
+ * distributed under the License is distributed on an "AS IS" BASIS,
26999
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27000
+ * See the License for the specific language governing permissions and
27001
+ * limitations under the License.
27002
+ *
27003
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27004
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27005
+ * */
27006
+
27007
+ var HideButton = function HideButton(_ref) {
27008
+ var isVisible = _ref.isVisible,
27009
+ settings = _ref.settings,
27010
+ onClick = _ref.onClick;
27011
+
27012
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27013
+
27014
+ var hideTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.hide) !== null && _b !== void 0 ? _b : 'Hide timeslider';
27015
+ var showTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.show) !== null && _d !== void 0 ? _d : 'Show timeslider';
27016
+ var hideIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.hide) !== null && _f !== void 0 ? _f : /*#__PURE__*/React__default.createElement(ChevronDown, null);
27017
+ var showIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.show) !== null && _h !== void 0 ? _h : /*#__PURE__*/React__default.createElement(ChevronUp, null);
27018
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27019
+ title: isVisible ? hideTitle : showTitle
27020
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27021
+ "aria-selected": !isVisible,
27022
+ onClick: onClick,
27023
+ "data-testid": "TimeSliderLite-HideButton"
27024
+ }), isVisible ? hideIcon : showIcon));
27025
+ };
27026
+
27027
+ /* *
27028
+ * Licensed under the Apache License, Version 2.0 (the "License");
27029
+ * you may not use this file except in compliance with the License.
27030
+ * You may obtain a copy of the License at
27031
+ *
27032
+ * http://www.apache.org/licenses/LICENSE-2.0
27033
+ *
27034
+ * Unless required by applicable law or agreed to in writing, software
27035
+ * distributed under the License is distributed on an "AS IS" BASIS,
27036
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27037
+ * See the License for the specific language governing permissions and
27038
+ * limitations under the License.
27039
+ *
27040
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27041
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27042
+ * */
27043
+
27044
+ var ControlButtonGroup = function ControlButtonGroup(_ref) {
27045
+ var children = _ref.children,
27046
+ right = _ref.right,
27047
+ left = _ref.left;
27048
+ return /*#__PURE__*/React__default.createElement(ButtonGroup, {
27049
+ orientation: "horizontal",
27050
+ fullWidth: true,
27051
+ sx: Object.assign(Object.assign(Object.assign({}, right && {
27052
+ borderTopLeftRadius: 0,
27053
+ borderBottomLeftRadius: 0
27054
+ }), left && {
27055
+ borderTopRightRadius: 0,
27056
+ borderBottomRightRadius: 0
27057
+ }), {
27058
+ backgroundColor: 'geowebColors.background.surface',
27059
+ height: '100%',
27060
+ alignItems: 'center',
27061
+ justifyContent: 'center',
27062
+ padding: '4px',
27063
+ gap: '2px'
27064
+ })
27065
+ }, children);
27066
+ };
27067
+
27068
+ /* *
27069
+ * Licensed under the Apache License, Version 2.0 (the "License");
27070
+ * you may not use this file except in compliance with the License.
27071
+ * You may obtain a copy of the License at
27072
+ *
27073
+ * http://www.apache.org/licenses/LICENSE-2.0
27074
+ *
27075
+ * Unless required by applicable law or agreed to in writing, software
27076
+ * distributed under the License is distributed on an "AS IS" BASIS,
27077
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27078
+ * See the License for the specific language governing permissions and
27079
+ * limitations under the License.
27080
+ *
27081
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27082
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27083
+ * */
27084
+ var TICK_HEIGHT = 8;
27085
+ var TIME_SLIDER_LITE_PADDING_RIGHT = 1;
27086
+
27087
+ var TimeSliderLiteBackgroundSvg = function TimeSliderLiteBackgroundSvg(_ref) {
27088
+ var width = _ref.width,
27089
+ height = _ref.height,
27090
+ startTime = _ref.startTime,
27091
+ endTime = _ref.endTime,
27092
+ style = _ref.style,
27093
+ locale = _ref.locale;
27094
+
27095
+ var _useTheme = useTheme(),
27096
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27097
+
27098
+ if (!width) {
27099
+ return /*#__PURE__*/React__default.createElement("svg", {
27100
+ style: style,
27101
+ height: height
27102
+ });
27103
+ } // Convert start and end time from Unix timestamp to JavaScript Date object
27104
+
27105
+
27106
+ var startDate = new Date(startTime * 1000);
27107
+ var endDate = new Date(endTime * 1000);
27108
+ var totalDays = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24);
27109
+ var tickSpacing = width / totalDays;
27110
+ var tickOffset = (startDate.getHours() + startDate.getMinutes() / 60) / 24 * tickSpacing; // Set up variables for date labels and background colors
27111
+
27112
+ var dayLabels = [];
27113
+ var currentDate = startDate;
27114
+ var lastDayLabelDate = new Date(endDate.getTime() + 2 * 24 * 60 * 60 * 1000); // Append two more days
27115
+
27116
+ while (currentDate < lastDayLabelDate) {
27117
+ var dateString = currentDate.toLocaleDateString(locale, {
27118
+ weekday: 'short',
27119
+ month: 'numeric',
27120
+ day: 'numeric'
27121
+ });
27122
+ var label = dateString.charAt(0).toUpperCase() + dateString.slice(1);
27123
+ dayLabels.push(label);
27124
+ currentDate.setDate(currentDate.getDate() + 1);
27125
+ }
27126
+
27127
+ var backgroundRectangles = dayLabels.map(function (label, index) {
27128
+ return /*#__PURE__*/React__default.createElement("rect", {
27129
+ x: index * tickSpacing - tickOffset,
27130
+ y: 0,
27131
+ width: tickSpacing,
27132
+ height: height,
27133
+ fill: index % 2 === 0 ? timeSliderLite.timelineBackground.fill : timeSliderLite.timelineBackgroundAlternative.fill,
27134
+ key: "".concat(label, "-color")
27135
+ });
27136
+ });
27137
+ var labels = dayLabels.map(function (label, index) {
27138
+ return /*#__PURE__*/React__default.createElement("text", {
27139
+ x: index * tickSpacing + 8 - tickOffset,
27140
+ y: 14,
27141
+ fill: timeSliderLite.timeline.fill,
27142
+ textAnchor: "left",
27143
+ fontSize: "12px",
27144
+ key: "".concat(label, "-text"),
27145
+ style: {
27146
+ userSelect: 'none'
27147
+ }
27148
+ }, dayLabels[index]);
27149
+ });
27150
+ var ticksPerDay = 4;
27151
+ var tickMarks = dayLabels.map(function (label, index) {
27152
+ return Array.from({
27153
+ length: ticksPerDay + 1
27154
+ }, function (_, value) {
27155
+ return /*#__PURE__*/React__default.createElement("line", {
27156
+ x1: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27157
+ y1: height,
27158
+ x2: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27159
+ y2: Math.floor(height - TICK_HEIGHT),
27160
+ stroke: timeSliderLite.timeline.stroke,
27161
+ key: "".concat(label, "-").concat(value)
27162
+ });
27163
+ });
27164
+ }).flat();
27165
+ return /*#__PURE__*/React__default.createElement("svg", {
27166
+ style: style,
27167
+ width: width + TIME_SLIDER_LITE_PADDING_RIGHT,
27168
+ height: height
27169
+ }, backgroundRectangles, tickMarks, labels);
27170
+ };
27171
+
27172
+ /* *
27173
+ * Licensed under the Apache License, Version 2.0 (the "License");
27174
+ * you may not use this file except in compliance with the License.
27175
+ * You may obtain a copy of the License at
27176
+ *
27177
+ * http://www.apache.org/licenses/LICENSE-2.0
27178
+ *
27179
+ * Unless required by applicable law or agreed to in writing, software
27180
+ * distributed under the License is distributed on an "AS IS" BASIS,
27181
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27182
+ * See the License for the specific language governing permissions and
27183
+ * limitations under the License.
27184
+ *
27185
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27186
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27187
+ * */
27188
+ var MILLISECOND_TO_SECOND = 1 / 1000;
27189
+ /**
27190
+ * Reformats a date that has capitalized first letter and colon separator for time
27191
+ * @param dateString Date string from Date.toLocaleDateString
27192
+ * @returns Reformatted date string
27193
+ */
27194
+
27195
+ var reformatFinnishDateString = function reformatFinnishDateString(dateString) {
27196
+ var charPositionOfTimestamp = -4;
27197
+ return dateString.charAt(0).toUpperCase() + dateString.slice(1, charPositionOfTimestamp) + dateString.slice(charPositionOfTimestamp).replace('.', ':');
27198
+ };
27199
+ var getSelectedTimePx = function getSelectedTimePx(startTime, endTime, selectedTime, width) {
27200
+ var startDate = new Date(startTime * 1000);
27201
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
27202
+ var selectedTimeX = selectedTime - startDateX;
27203
+ var needleX = Math.floor(selectedTimeX / (endTime - startTime) * width);
27204
+ return needleX;
27205
+ };
27206
+ var boundedValue = function boundedValue(value, bounds) {
27207
+ var _bounds = _slicedToArray(bounds, 2),
27208
+ min = _bounds[0],
27209
+ max = _bounds[1];
27210
+
27211
+ return Math.max(min, Math.min(max, value));
27212
+ };
27213
+ var getSelectedTimeFromPx = function getSelectedTimeFromPx(startTime, endTime, selectedTimePx, width) {
27214
+ var startDate = new Date(startTime * 1000);
27215
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
27216
+ var selectedTimeX = Math.floor(selectedTimePx / width * (endTime - startTime));
27217
+ var selectedTime = selectedTimeX + startDateX;
27218
+ return selectedTime;
27219
+ };
27220
+
27221
+ /* *
27222
+ * Licensed under the Apache License, Version 2.0 (the "License");
27223
+ * you may not use this file except in compliance with the License.
27224
+ * You may obtain a copy of the License at
27225
+ *
27226
+ * http://www.apache.org/licenses/LICENSE-2.0
27227
+ *
27228
+ * Unless required by applicable law or agreed to in writing, software
27229
+ * distributed under the License is distributed on an "AS IS" BASIS,
27230
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27231
+ * See the License for the specific language governing permissions and
27232
+ * limitations under the License.
27233
+ *
27234
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27235
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27236
+ * */
27237
+ var DRAG_AREA_WIDTH = 10;
27238
+ var NEEDLE_WIDTH = 5;
27239
+ var SHADOW_SPREAD = 2;
27240
+
27241
+ var NeedleShadow = function NeedleShadow(_ref) {
27242
+ var x = _ref.x,
27243
+ stroke = _ref.stroke,
27244
+ height = _ref.height,
27245
+ width = _ref.width;
27246
+ return /*#__PURE__*/React__default.createElement("line", {
27247
+ x1: x,
27248
+ y1: height - (height - SHADOW_SPREAD / 2),
27249
+ x2: x,
27250
+ y2: height - SHADOW_SPREAD / 2,
27251
+ strokeWidth: width + SHADOW_SPREAD,
27252
+ stroke: stroke,
27253
+ strokeLinecap: "round",
27254
+ filter: "blur(0.5px)",
27255
+ "data-testid": "TimeSliderLite-NeedleShadow"
27256
+ });
27257
+ };
27258
+
27259
+ var NeedleLine = function NeedleLine(_ref2) {
27260
+ var x = _ref2.x,
27261
+ stroke = _ref2.stroke,
27262
+ height = _ref2.height,
27263
+ width = _ref2.width;
27264
+ return /*#__PURE__*/React__default.createElement("line", {
27265
+ x1: x,
27266
+ y1: width / 2,
27267
+ x2: x,
27268
+ y2: height - width / 2,
27269
+ strokeWidth: width,
27270
+ strokeLinecap: "round",
27271
+ stroke: stroke,
27272
+ "data-testid": "TimeSliderLite-NeedleLine"
27273
+ });
27274
+ };
27275
+
27276
+ var TimeSliderDraggableNeedle = function TimeSliderDraggableNeedle(_ref3) {
27277
+ var draggableLabel = _ref3.draggableLabel,
27278
+ width = _ref3.width,
27279
+ height = _ref3.height,
27280
+ locale = _ref3.locale,
27281
+ startTime = _ref3.startTime,
27282
+ endTime = _ref3.endTime,
27283
+ _ref3$needleDragAreaW = _ref3.needleDragAreaWidth,
27284
+ needleDragAreaWidth = _ref3$needleDragAreaW === void 0 ? DRAG_AREA_WIDTH : _ref3$needleDragAreaW,
27285
+ needleLabelZIndex = _ref3.needleLabelZIndex,
27286
+ needleLabelOffset = _ref3.needleLabelOffset,
27287
+ _ref3$needleWidth = _ref3.needleWidth,
27288
+ needleWidth = _ref3$needleWidth === void 0 ? NEEDLE_WIDTH : _ref3$needleWidth,
27289
+ timeStep = _ref3.timeStep,
27290
+ selectedTime = _ref3.selectedTime,
27291
+ setSelectedTime = _ref3.setSelectedTime,
27292
+ style = _ref3.style;
27293
+ var draggableRef = useRef(null);
27294
+
27295
+ var _useTheme = useTheme(),
27296
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27297
+
27298
+ var x = getSelectedTimePx(startTime, endTime, selectedTime, width) - needleDragAreaWidth / 2;
27299
+ var roundedSelectedTime = Math.floor(selectedTime / timeStep) * timeStep;
27300
+ var dateString = new Date(roundedSelectedTime * 1000).toLocaleDateString(locale, {
27301
+ weekday: 'short',
27302
+ month: 'numeric',
27303
+ day: 'numeric',
27304
+ hour: 'numeric',
27305
+ minute: 'numeric'
27306
+ });
27307
+ var label = locale === 'fi' || locale === 'sv-FI' ? reformatFinnishDateString(dateString) : dateString;
27308
+ return /*#__PURE__*/React__default.createElement(Draggable, {
27309
+ handle: ".TimeSliderLite-DraggableNeedle",
27310
+ axis: "x",
27311
+ nodeRef: draggableRef,
27312
+ bounds: {
27313
+ left: -needleDragAreaWidth / 2,
27314
+ right: width - needleDragAreaWidth / 2
27315
+ },
27316
+ position: {
27317
+ x: x,
27318
+ y: 0
27319
+ },
27320
+ onDrag: function onDrag(_, position) {
27321
+ var positionOffsetToCompensateFlooring = 0.5;
27322
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27323
+ setSelectedTime(newSelectedTime);
27324
+ },
27325
+ onStop: function onStop(_, position) {
27326
+ var positionOffsetToCompensateFlooring = 0.5;
27327
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27328
+ var roundedSelectedTime = Math.floor(newSelectedTime / timeStep) * timeStep;
27329
+ setSelectedTime(roundedSelectedTime);
27330
+ }
27331
+ }, /*#__PURE__*/React__default.createElement("div", {
27332
+ className: "TimeSliderLite-DraggableNeedle",
27333
+ ref: draggableRef,
27334
+ "data-testid": "TimeSliderLite-DraggableNeedle"
27335
+ }, /*#__PURE__*/React__default.createElement(Tooltip, {
27336
+ title: label,
27337
+ arrow: true,
27338
+ placement: "top",
27339
+ open: true,
27340
+ componentsProps: {
27341
+ tooltip: {
27342
+ sx: {
27343
+ padding: '0 3px 0 3px',
27344
+ fontSize: '12px',
27345
+ backgroundColor: timeSliderLite.needleLabel.backgroundColor,
27346
+ border: "1px solid ".concat(timeSliderLite.needleLabel.borderColor)
27347
+ }
27348
+ },
27349
+ arrow: {
27350
+ sx: {
27351
+ color: timeSliderLite.needleLabel.backgroundColor
27352
+ }
27353
+ },
27354
+ popper: {
27355
+ className: draggableLabel ? 'TimeSliderLite-DraggableNeedle' : '',
27356
+ sx: {
27357
+ pointerEvents: draggableLabel ? null : 'none',
27358
+ zIndex: needleLabelZIndex !== null && needleLabelZIndex !== void 0 ? needleLabelZIndex : null,
27359
+ cursor: draggableLabel ? 'ew-resize' : 'default'
27360
+ },
27361
+ modifiers: [{
27362
+ name: 'offset',
27363
+ options: {
27364
+ offset: needleLabelOffset !== null && needleLabelOffset !== void 0 ? needleLabelOffset : [0, 30 - height]
27365
+ }
27366
+ }]
27367
+ }
27368
+ }
27369
+ }, /*#__PURE__*/React__default.createElement("svg", {
27370
+ style: style,
27371
+ cursor: "ew-resize",
27372
+ width: needleDragAreaWidth,
27373
+ height: height,
27374
+ "data-testid": "TimeSliderLite-NeedleSvg"
27375
+ }, /*#__PURE__*/React__default.createElement(NeedleShadow, {
27376
+ x: needleDragAreaWidth / 2,
27377
+ stroke: timeSliderLite.needleShadow.stroke,
27378
+ height: height,
27379
+ width: needleWidth
27380
+ }), /*#__PURE__*/React__default.createElement(NeedleLine, {
27381
+ x: needleDragAreaWidth / 2,
27382
+ stroke: timeSliderLite.needle.stroke,
27383
+ height: height,
27384
+ width: needleWidth
27385
+ })))));
27386
+ };
27387
+
27388
+ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
27389
+ var height = _ref.height,
27390
+ draggableTimeStamp = _ref.draggableTimeStamp,
27391
+ locale = _ref.locale,
27392
+ startTime = _ref.startTime,
27393
+ endTime = _ref.endTime,
27394
+ needleWidth = _ref.needleWidth,
27395
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27396
+ needleLabelZIndex = _ref.needleLabelZIndex,
27397
+ needleLabelOffset = _ref.needleLabelOffset,
27398
+ timeStep = _ref.timeStep,
27399
+ selectedTime = _ref.selectedTime,
27400
+ setSelectedTime = _ref.setSelectedTime;
27401
+ var sliderAreaRef = useRef(null);
27402
+
27403
+ var _React$useState = React__default.useState(0),
27404
+ _React$useState2 = _slicedToArray(_React$useState, 2),
27405
+ areaWidth = _React$useState2[0],
27406
+ setAreaWidth = _React$useState2[1];
27407
+
27408
+ var drawNeedle = selectedTime && areaWidth;
27409
+ useLayoutEffect(function () {
27410
+ var sliderArea = sliderAreaRef.current;
27411
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27412
+ var observer = new ResizeObserver(function () {
27413
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27414
+ });
27415
+ observer.observe(sliderArea);
27416
+ return function () {
27417
+ observer.disconnect();
27418
+ };
27419
+ }, [sliderAreaRef]);
27420
+ return /*#__PURE__*/React__default.createElement(Box, {
27421
+ ref: sliderAreaRef,
27422
+ sx: {
27423
+ position: 'relative',
27424
+ height: "".concat(height, "px"),
27425
+ overflow: 'hidden',
27426
+ width: '100%'
27427
+ },
27428
+ "data-testid": "TimeSliderLite-Background"
27429
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackgroundSvg, {
27430
+ style: {
27431
+ position: 'absolute',
27432
+ top: 0
27433
+ },
27434
+ width: areaWidth,
27435
+ height: height,
27436
+ startTime: startTime,
27437
+ endTime: endTime,
27438
+ locale: locale
27439
+ }), drawNeedle && /*#__PURE__*/React__default.createElement(TimeSliderDraggableNeedle, {
27440
+ needleWidth: needleWidth,
27441
+ draggableLabel: draggableTimeStamp,
27442
+ style: {
27443
+ position: 'absolute',
27444
+ top: 0
27445
+ },
27446
+ locale: locale,
27447
+ width: areaWidth,
27448
+ needleDragAreaWidth: needleDragAreaWidth,
27449
+ needleLabelZIndex: needleLabelZIndex,
27450
+ needleLabelOffset: needleLabelOffset,
27451
+ height: height,
27452
+ startTime: startTime,
27453
+ endTime: endTime,
27454
+ timeStep: timeStep,
27455
+ selectedTime: selectedTime,
27456
+ setSelectedTime: setSelectedTime
27457
+ }));
27458
+ };
27459
+
27460
+ /* *
27461
+ * Licensed under the Apache License, Version 2.0 (the "License");
27462
+ * you may not use this file except in compliance with the License.
27463
+ * You may obtain a copy of the License at
27464
+ *
27465
+ * http://www.apache.org/licenses/LICENSE-2.0
27466
+ *
27467
+ * Unless required by applicable law or agreed to in writing, software
27468
+ * distributed under the License is distributed on an "AS IS" BASIS,
27469
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27470
+ * See the License for the specific language governing permissions and
27471
+ * limitations under the License.
27472
+ *
27473
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27474
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27475
+ * */
27476
+
27477
+ var StepButton = function StepButton(_ref) {
27478
+ var forward = _ref.forward,
27479
+ isDisabled = _ref.isDisabled,
27480
+ _ref$onClick = _ref.onClick,
27481
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
27482
+ settings = _ref.settings;
27483
+
27484
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27485
+
27486
+ var forwardTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.forward) !== null && _b !== void 0 ? _b : 'Forward';
27487
+ var backwardTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.backward) !== null && _d !== void 0 ? _d : 'Backward';
27488
+ var forwardIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.forward) !== null && _f !== void 0 ? _f : /*#__PURE__*/React.createElement(StepForward, {
27489
+ "data-testid": "step-forward-svg-path"
27490
+ });
27491
+ var backwardIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.backward) !== null && _h !== void 0 ? _h : /*#__PURE__*/React.createElement(StepBackward, {
27492
+ "data-testid": "step-backward-svg-path"
27493
+ });
27494
+ return /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27495
+ title: forward ? forwardTitle : backwardTitle
27496
+ }), /*#__PURE__*/React.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27497
+ disabled: isDisabled,
27498
+ "aria-label": forward ? forwardTitle : backwardTitle,
27499
+ onClick: onClick,
27500
+ "data-testid": "TimeSliderLite-StepButton".concat(forward ? 'Forward' : 'Backward')
27501
+ }), forward ? forwardIcon : backwardIcon));
27502
+ };
27503
+
27504
+ /* *
27505
+ * Licensed under the Apache License, Version 2.0 (the "License");
27506
+ * you may not use this file except in compliance with the License.
27507
+ * You may obtain a copy of the License at
27508
+ *
27509
+ * http://www.apache.org/licenses/LICENSE-2.0
27510
+ *
27511
+ * Unless required by applicable law or agreed to in writing, software
27512
+ * distributed under the License is distributed on an "AS IS" BASIS,
27513
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27514
+ * See the License for the specific language governing permissions and
27515
+ * limitations under the License.
27516
+ *
27517
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27518
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27519
+ * */
27520
+
27521
+ var PlayButton = function PlayButton(_ref) {
27522
+ var isAnimating = _ref.isAnimating,
27523
+ isDisabled = _ref.isDisabled,
27524
+ onTogglePlayButton = _ref.onTogglePlayButton,
27525
+ settings = _ref.settings;
27526
+
27527
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27528
+
27529
+ var pauseTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.pause) !== null && _b !== void 0 ? _b : 'Pause';
27530
+ var playTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.play) !== null && _d !== void 0 ? _d : 'Play';
27531
+ var pauseIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.pause) !== null && _f !== void 0 ? _f : /*#__PURE__*/React__default.createElement(Pause, null);
27532
+ var playIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.play) !== null && _h !== void 0 ? _h : /*#__PURE__*/React__default.createElement(Play, null);
27533
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27534
+ title: isAnimating ? pauseTitle : playTitle
27535
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27536
+ sx: Object.assign(Object.assign({}, isAnimating && {
27537
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27538
+ }), timeSliderLiteButtonDefaultProps.sx),
27539
+ onClick: function onClick() {
27540
+ onTogglePlayButton();
27541
+ },
27542
+ disabled: isDisabled,
27543
+ "data-testid": "TimeSliderLite-PlayButton"
27544
+ }), isAnimating ? pauseIcon : playIcon));
27545
+ };
27546
+
27547
+ /* *
27548
+ * Licensed under the Apache License, Version 2.0 (the "License");
27549
+ * you may not use this file except in compliance with the License.
27550
+ * You may obtain a copy of the License at
27551
+ *
27552
+ * http://www.apache.org/licenses/LICENSE-2.0
27553
+ *
27554
+ * Unless required by applicable law or agreed to in writing, software
27555
+ * distributed under the License is distributed on an "AS IS" BASIS,
27556
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27557
+ * See the License for the specific language governing permissions and
27558
+ * limitations under the License.
27559
+ *
27560
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27561
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27562
+ * */
27563
+
27564
+ var MenuButton = function MenuButton(_ref) {
27565
+ var menuOpen = _ref.menuOpen,
27566
+ onClick = _ref.onClick,
27567
+ settings = _ref.settings;
27568
+
27569
+ var _a, _b;
27570
+
27571
+ var title = (_a = settings === null || settings === void 0 ? void 0 : settings.label) !== null && _a !== void 0 ? _a : 'Animation options';
27572
+ var icon = (_b = settings === null || settings === void 0 ? void 0 : settings.icon) !== null && _b !== void 0 ? _b : /*#__PURE__*/React__default.createElement(Options, null);
27573
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27574
+ title: title
27575
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27576
+ sx: Object.assign(Object.assign({}, menuOpen && {
27577
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27578
+ }), timeSliderLiteButtonDefaultProps.sx),
27579
+ "aria-selected": menuOpen,
27580
+ onClick: onClick,
27581
+ "data-testid": "TimeSliderLite-MenuButton"
27582
+ }), icon));
27583
+ };
27584
+
27585
+ var TIME_SLIDER_LITE_DEFAULT_HEIGHT = 40;
27586
+ var TIME_SLIDER_LITE_DEFAULT_LOCALE = 'en';
27587
+ var TIME_SLIDER_LITE_DEFAULT_TIME_STEP = 5;
27588
+ var styles$1 = {
27589
+ container: {
27590
+ display: 'grid',
27591
+ alignItems: 'center',
27592
+ justifyContent: 'center',
27593
+ borderRadius: '4px'
27594
+ }
27595
+ };
27596
+
27597
+ var TimeSliderLite = function TimeSliderLite(_ref) {
27598
+ var controlButtons = _ref.controlButtons,
27599
+ endTime = _ref.endTime,
27600
+ _ref$height = _ref.height,
27601
+ height = _ref$height === void 0 ? TIME_SLIDER_LITE_DEFAULT_HEIGHT : _ref$height,
27602
+ hideButton = _ref.hideButton,
27603
+ isAnimating = _ref.isAnimating,
27604
+ isVisible = _ref.isVisible,
27605
+ _ref$locale = _ref.locale,
27606
+ locale = _ref$locale === void 0 ? TIME_SLIDER_LITE_DEFAULT_LOCALE : _ref$locale,
27607
+ mapId = _ref.mapId,
27608
+ menuOpen = _ref.menuOpen,
27609
+ overrideAnimation = _ref.overrideAnimation,
27610
+ onToggleAnimation = _ref.onToggleAnimation,
27611
+ onToggleMenu = _ref.onToggleMenu,
27612
+ needleWidth = _ref.needleWidth,
27613
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27614
+ needleLabelZIndex = _ref.needleLabelZIndex,
27615
+ needleLabelOffset = _ref.needleLabelOffset,
27616
+ draggableTimeStamp = _ref.draggableTimeStamp,
27617
+ onToggleTimeSlider = _ref.onToggleTimeSlider,
27618
+ selectedTime = _ref.selectedTime,
27619
+ setSelectedTime = _ref.setSelectedTime,
27620
+ settings = _ref.settings,
27621
+ startTime = _ref.startTime,
27622
+ sx = _ref.sx,
27623
+ _ref$timeStep = _ref.timeStep,
27624
+ timeStep = _ref$timeStep === void 0 ? TIME_SLIDER_LITE_DEFAULT_TIME_STEP : _ref$timeStep;
27625
+
27626
+ var _useState = useState(selectedTime),
27627
+ _useState2 = _slicedToArray(_useState, 2),
27628
+ rawSelectedTime = _useState2[0],
27629
+ setRawSelectedTime = _useState2[1];
27630
+
27631
+ var timeStepSeconds = timeStep * 60;
27632
+ var roundedStartTime = Math.floor(startTime / timeStepSeconds) * timeStepSeconds;
27633
+ var roundedEndTime = Math.floor(endTime / timeStepSeconds) * timeStepSeconds;
27634
+ var runningExternalAnimation = overrideAnimation && isAnimating;
27635
+ var runningInternalAnimation = !overrideAnimation && isAnimating;
27636
+ useEffect(function () {
27637
+ if (!runningExternalAnimation) {
27638
+ var roundedSelectedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds;
27639
+ setSelectedTime(roundedSelectedTime);
27640
+ }
27641
+ }, [setSelectedTime, rawSelectedTime, timeStepSeconds, runningExternalAnimation]);
27642
+ useEffect(function () {
27643
+ if (runningInternalAnimation) {
27644
+ var interval = setInterval(function () {
27645
+ setRawSelectedTime(function (prevTime) {
27646
+ if (prevTime + timeStepSeconds > roundedEndTime) {
27647
+ return roundedStartTime;
27648
+ }
27649
+
27650
+ return prevTime + timeStepSeconds;
27651
+ });
27652
+ }, 200);
27653
+ return function () {
27654
+ return clearInterval(interval);
27655
+ };
27656
+ }
27657
+
27658
+ if (runningExternalAnimation) {
27659
+ setRawSelectedTime(selectedTime);
27660
+ }
27661
+
27662
+ return function () {};
27663
+ }, [roundedEndTime, isAnimating, roundedStartTime, timeStepSeconds, runningInternalAnimation, runningExternalAnimation, selectedTime]);
27664
+
27665
+ var handleTimeStep = function handleTimeStep(stepSeconds) {
27666
+ var newSteppedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds + stepSeconds;
27667
+ setRawSelectedTime(boundedValue(newSteppedTime, [roundedStartTime, roundedEndTime]));
27668
+
27669
+ if (isAnimating && onToggleAnimation) {
27670
+ onToggleAnimation();
27671
+ }
27672
+ };
27673
+
27674
+ var handleTimeSelect = function handleTimeSelect(value) {
27675
+ setRawSelectedTime(boundedValue(value, [roundedStartTime, roundedEndTime]));
27676
+
27677
+ if (isAnimating && onToggleAnimation) {
27678
+ onToggleAnimation();
27679
+ }
27680
+ };
27681
+
27682
+ return /*#__PURE__*/React__default.createElement(Grid, {
27683
+ container: true,
27684
+ sx: Object.assign(Object.assign(Object.assign({}, styles$1.container), sx), {
27685
+ gridTemplateColumns: isVisible ? 'auto 1fr auto' : "1fr auto"
27686
+ }),
27687
+ "data-testid": "timeSliderLite-".concat(mapId)
27688
+ }, isVisible ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
27689
+ item: true,
27690
+ sx: {
27691
+ height: "".concat(height, "px")
27692
+ }
27693
+ }, controlButtons || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27694
+ left: true
27695
+ }, /*#__PURE__*/React__default.createElement(MenuButton, {
27696
+ settings: settings === null || settings === void 0 ? void 0 : settings.menuButton,
27697
+ menuOpen: menuOpen,
27698
+ onClick: onToggleMenu
27699
+ }), /*#__PURE__*/React__default.createElement(Divider, {
27700
+ orientation: "vertical",
27701
+ sx: {
27702
+ height: "".concat(height, "px"),
27703
+ margin: '2px'
27704
+ }
27705
+ }), /*#__PURE__*/React__default.createElement(PlayButton, {
27706
+ settings: settings === null || settings === void 0 ? void 0 : settings.playButton,
27707
+ isAnimating: isAnimating,
27708
+ onTogglePlayButton: onToggleAnimation
27709
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27710
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27711
+ onClick: function onClick() {
27712
+ return handleTimeStep(-timeStepSeconds);
27713
+ }
27714
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27715
+ forward: true,
27716
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27717
+ onClick: function onClick() {
27718
+ return handleTimeStep(timeStepSeconds);
27719
+ }
27720
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
27721
+ item: true
27722
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackground, {
27723
+ draggableTimeStamp: draggableTimeStamp,
27724
+ startTime: roundedStartTime,
27725
+ locale: locale,
27726
+ endTime: roundedEndTime,
27727
+ needleWidth: needleWidth,
27728
+ needleDragAreaWidth: needleDragAreaWidth,
27729
+ needleLabelZIndex: needleLabelZIndex,
27730
+ needleLabelOffset: needleLabelOffset,
27731
+ timeStep: timeStepSeconds,
27732
+ selectedTime: runningExternalAnimation ? selectedTime : rawSelectedTime,
27733
+ setSelectedTime: handleTimeSelect,
27734
+ height: height
27735
+ }))) : /*#__PURE__*/React__default.createElement(Grid, {
27736
+ item: true
27737
+ }), /*#__PURE__*/React__default.createElement(Grid, {
27738
+ item: true,
27739
+ sx: {
27740
+ height: "".concat(height, "px")
27741
+ }
27742
+ }, hideButton || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27743
+ right: isVisible
27744
+ }, /*#__PURE__*/React__default.createElement(HideButton, {
27745
+ settings: settings === null || settings === void 0 ? void 0 : settings.hideButton,
27746
+ onClick: onToggleTimeSlider,
27747
+ isVisible: isVisible
27748
+ }))));
27749
+ };
27750
+
26734
27751
  /* *
26735
27752
  * Licensed under the Apache License, Version 2.0 (the "License");
26736
27753
  * you may not use this file except in compliance with the License.
@@ -26989,7 +28006,8 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
26989
28006
  if (isChecked) {
26990
28007
  syncGroupRemoveTarget({
26991
28008
  groupId: String(groupId),
26992
- targetId: String(sourceId)
28009
+ targetId: String(sourceId),
28010
+ origin: 'user'
26993
28011
  });
26994
28012
  } else {
26995
28013
  var groups = syncGroupViewState[groupCategory].groups; // Check all other groups and if checkmark is found -> uncheck it
@@ -27004,7 +28022,8 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
27004
28022
  if (group.id !== groupId && group.selected.includes(sourceId)) {
27005
28023
  syncGroupRemoveTarget({
27006
28024
  groupId: String(group.id),
27007
- targetId: String(sourceId)
28025
+ targetId: String(sourceId),
28026
+ origin: 'user'
27008
28027
  });
27009
28028
  }
27010
28029
  } // Add new checkmark
@@ -27017,7 +28036,8 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
27017
28036
 
27018
28037
  syncGroupAddTarget({
27019
28038
  groupId: String(groupId),
27020
- targetId: String(sourceId)
28039
+ targetId: String(sourceId),
28040
+ origin: 'user'
27021
28041
  });
27022
28042
  }
27023
28043
  };
@@ -27695,4 +28715,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
27695
28715
  * */
27696
28716
  var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
27697
28717
 
27698
- export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$8 as layerReducer, selectors$3 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, snackbarActions, store, genericActions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, selectors$2 as uiSelectors, types as uiTypes, unRegisterWMJSLayer, unRegisterWMJSMap, useSetupDialog };
28718
+ export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$7 as layerReducer, selectors$4 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, selectors$5 as serviceSelectors, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$3 as uiSelectors, types as uiTypes, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, useFetchServices, useSetupDialog, reducer$5 as webmapReducer };