@opengeoweb/core 4.19.1 → 4.21.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 (52) hide show
  1. package/index.esm.js +1884 -847
  2. package/index.umd.js +1992 -930
  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/LayerRow/LayerRow.d.ts +1 -0
  6. package/lib/components/LayerManager/LayerManager.d.ts +1 -1
  7. package/lib/components/LayerManager/LayerManagerConnect.d.ts +2 -1
  8. package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +21 -0
  9. package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +2 -1
  10. package/lib/components/LayerManager/LayerManagerUtils.d.ts +20 -1
  11. package/lib/components/LayerManager/index.d.ts +1 -0
  12. package/lib/components/MapControls/MapControlButton.d.ts +2 -3
  13. package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -2
  14. package/lib/components/TimeSliderLite/TimeSliderLite.d.ts +36 -0
  15. package/lib/components/TimeSliderLite/TimeSliderLite.stories.d.ts +9 -0
  16. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.d.ts +20 -0
  17. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.spec.d.ts +1 -0
  18. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackground.d.ts +17 -0
  19. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.d.ts +13 -0
  20. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.spec.d.ts +1 -0
  21. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/ControlButtonGroup/ControlButtonGroup.d.ts +8 -0
  22. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/HideButton/HideButton.d.ts +9 -0
  23. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/MenuButton/MenuButton.d.ts +9 -0
  24. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/PlayButton/PlayButton.d.ts +11 -0
  25. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/StepButton/StepButton.d.ts +11 -0
  26. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/TimeSliderLiteButtonUtils.d.ts +3 -0
  27. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.d.ts +20 -0
  28. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.spec.d.ts +1 -0
  29. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.stories.d.ts +9 -0
  30. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/SubmenuWrapper.d.ts +8 -0
  31. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/SubmenuWrapper.spec.d.ts +1 -0
  32. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeRangeOptions/DayHourSelector.d.ts +21 -0
  33. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeRangeOptions/DayHourSelector.spec.d.ts +1 -0
  34. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeRangeOptions/TimeRangeOptions.d.ts +15 -0
  35. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeSliderLiteOptionsMenu.d.ts +27 -0
  36. package/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeSliderLiteOptionsMenu.spec.d.ts +1 -0
  37. package/lib/components/TimeSliderLite/index.d.ts +4 -0
  38. package/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +83 -0
  39. package/lib/components/TimeSliderLite/timeSliderLiteUtils.spec.d.ts +1 -0
  40. package/lib/index.d.ts +5 -4
  41. package/lib/store/generic/synchronizationGroups/selectors.d.ts +2 -1
  42. package/lib/store/generic/synchronizationGroups/types.d.ts +4 -4
  43. package/lib/store/mapStore/layers/reducer.d.ts +2 -2
  44. package/lib/store/mapStore/layers/types.d.ts +0 -2
  45. package/lib/store/mapStore/map/index.d.ts +1 -1
  46. package/lib/store/mapStore/utils/helpers.d.ts +1 -0
  47. package/lib/store/ui/index.d.ts +1 -1
  48. package/lib/utils/sanitizeHTML.d.ts +3 -0
  49. package/lib/utils/sanitizeHTML.spec.d.ts +1 -0
  50. package/package.json +11 -10
  51. package/lib/components/LayerManager/LayerSelect/LayerList/SearchHighlight.d.ts +0 -7
  52. /package/lib/components/{LayerManager/LayerSelect/LayerList/SearchHighlight.spec.d.ts → TimeSliderLite/TimeSliderLite.spec.d.ts} +0 -0
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, 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, SearchHighlight, 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,
@@ -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)) {
@@ -4150,6 +4220,24 @@ var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
4150
4220
  var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
4151
4221
  return store.viewState.timeslider.groups[0].selected;
4152
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
+ };
4153
4241
 
4154
4242
  var selectors$2 = /*#__PURE__*/Object.freeze({
4155
4243
  __proto__: null,
@@ -4161,7 +4249,8 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
4161
4249
  getTargetGroups: getTargetGroups,
4162
4250
  getAllTargetGroupsForSource: getAllTargetGroupsForSource,
4163
4251
  syncGroupGetViewState: syncGroupGetViewState,
4164
- getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider
4252
+ getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
4253
+ getSyncGroupTargets: getSyncGroupTargets
4165
4254
  });
4166
4255
 
4167
4256
  /* *
@@ -6894,11 +6983,11 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
6894
6983
  * See the License for the specific language governing permissions and
6895
6984
  * limitations under the License.
6896
6985
  *
6897
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6898
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
6986
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6987
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6899
6988
  * */
6900
6989
 
6901
- var PlayButton = function PlayButton(_ref) {
6990
+ var PlayButton$1 = function PlayButton(_ref) {
6902
6991
  var isAnimating = _ref.isAnimating,
6903
6992
  isDisabled = _ref.isDisabled,
6904
6993
  _ref$onTogglePlayButt = _ref.onTogglePlayButton,
@@ -6908,18 +6997,18 @@ var PlayButton = function PlayButton(_ref) {
6908
6997
  onTogglePlayButton();
6909
6998
  };
6910
6999
 
6911
- return /*#__PURE__*/React.createElement(CustomTooltip, {
6912
- title: isAnimating ? 'Pause' : 'Play'
6913
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
7000
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
7001
+ variant: "tool",
7002
+ tooltipTitle: isAnimating ? 'Pause' : 'Play',
6914
7003
  onClick: onTogglePlay,
6915
7004
  disabled: isDisabled,
6916
7005
  "data-testid": "playButton",
6917
- active: isAnimating
7006
+ isSelected: isAnimating
6918
7007
  }, isAnimating ? /*#__PURE__*/React.createElement(Pause, {
6919
7008
  "data-testid": "pause-svg-path"
6920
7009
  }) : /*#__PURE__*/React.createElement(Play, {
6921
7010
  "data-testid": "play-svg-path"
6922
- }))));
7011
+ }));
6923
7012
  };
6924
7013
 
6925
7014
  /* *
@@ -6978,7 +7067,7 @@ var PlayButtonConnect = connectRedux$3(function (_ref) {
6978
7067
  }
6979
7068
  };
6980
7069
 
6981
- return /*#__PURE__*/React__default.createElement(PlayButton, {
7070
+ return /*#__PURE__*/React__default.createElement(PlayButton$1, {
6982
7071
  isAnimating: linkedMapAnimationInfo.isAnimating,
6983
7072
  isDisabled: isDisabled,
6984
7073
  onTogglePlayButton: function onTogglePlayButton() {
@@ -9561,8 +9650,8 @@ var moduleConfig = {
9561
9650
  id: 'webmap-module',
9562
9651
  reducersMap: {
9563
9652
  webmap: reducer$5,
9564
- services: reducer$7,
9565
- layers: reducer$8
9653
+ services: reducer$8,
9654
+ layers: reducer$7
9566
9655
  },
9567
9656
  sagas: [rootSaga$4, rootSaga$3]
9568
9657
  };
@@ -9989,8 +10078,12 @@ var HeaderOptions = function HeaderOptions(_ref) {
9989
10078
  var isDockedLayerManager = _ref.isDockedLayerManager,
9990
10079
  shortcutsEnabled = _ref.shortcutsEnabled,
9991
10080
  onClickDockButton = _ref.onClickDockButton,
9992
- onChangeSize = _ref.onChangeSize;
9993
- React.useEffect(function () {
10081
+ onChangeSize = _ref.onChangeSize,
10082
+ buttonSettings = _ref.buttonSettings;
10083
+
10084
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10085
+
10086
+ React.useEffect(function () {
9994
10087
  var handleKeyDown = function handleKeyDown(event) {
9995
10088
  if (shortcutsEnabled) {
9996
10089
  if (event.ctrlKey && event.altKey && event.code === 'KeyS') {
@@ -10008,28 +10101,28 @@ var HeaderOptions = function HeaderOptions(_ref) {
10008
10101
  document.removeEventListener('keydown', handleKeyDown);
10009
10102
  };
10010
10103
  }, [onChangeSize, shortcutsEnabled]);
10011
- 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, {
10012
10105
  tooltipTitle: "small",
10013
10106
  "data-testid": "collapseSmall-btn",
10014
10107
  onClick: function onClick() {
10015
10108
  return onChangeSize(sizeSmall);
10016
10109
  },
10017
10110
  className: "collapseSmall-btn"
10018
- }, /*#__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, {
10019
10112
  tooltipTitle: "medium",
10020
10113
  "data-testid": "collapseMedium-btn",
10021
10114
  onClick: function onClick() {
10022
10115
  return onChangeSize(sizeMedium);
10023
10116
  },
10024
10117
  className: "collapseMedium-btn"
10025
- }, /*#__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, {
10026
10119
  tooltipTitle: "large",
10027
10120
  "data-testid": "collapseLarge-btn",
10028
10121
  onClick: function onClick() {
10029
10122
  return onChangeSize(sizeLarge);
10030
10123
  },
10031
10124
  className: "collapseLarge-btn"
10032
- }, /*#__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, {
10033
10126
  tooltipTitle: isDockedLayerManager ? 'Undock' : 'Dock',
10034
10127
  "data-testid": "dockedBtn",
10035
10128
  disableRipple: true,
@@ -10040,7 +10133,7 @@ var HeaderOptions = function HeaderOptions(_ref) {
10040
10133
  "data-testid": "dockedLayerManager-collapse"
10041
10134
  }) : /*#__PURE__*/React.createElement(ExpandWindow, {
10042
10135
  "data-testid": "dockedLayerManager-uncollapse"
10043
- })));
10136
+ })), (_l = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.divider) === null || _l === void 0 ? void 0 : _l.element);
10044
10137
  };
10045
10138
 
10046
10139
  /* *
@@ -10289,12 +10382,14 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
10289
10382
  }, icon);
10290
10383
  };
10291
10384
 
10292
- var styles$4 = {
10293
- text: {
10294
- paddingLeft: '10px',
10295
- fontSize: '12px',
10296
- fontFamily: 'Roboto',
10297
- 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);
10298
10393
  }
10299
10394
  };
10300
10395
 
@@ -10337,7 +10432,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
10337
10432
  className: columnClasses.column2
10338
10433
  }, /*#__PURE__*/React.createElement(Box, {
10339
10434
  className: "header-layer ".concat(hasMapPresetsModule ? 'mappresetsModule-enabled' : ''),
10340
- sx: styles$4.text
10435
+ sx: styles$5.text
10341
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, {
10342
10437
  className: "header-mapPresets",
10343
10438
  sx: {
@@ -10346,15 +10441,15 @@ var DescriptionRow = function DescriptionRow(_ref) {
10346
10441
  }, mapPresetsModuleInline)), /*#__PURE__*/React.createElement(Grid, {
10347
10442
  className: columnClasses.column3
10348
10443
  }, /*#__PURE__*/React.createElement(Box, {
10349
- sx: styles$4.text
10444
+ sx: styles$5.text
10350
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, {
10351
10446
  className: columnClasses.column4
10352
10447
  }, /*#__PURE__*/React.createElement(Box, {
10353
- sx: styles$4.text
10448
+ sx: styles$5.text
10354
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, {
10355
10450
  className: columnClasses.column5
10356
10451
  }, /*#__PURE__*/React.createElement(Box, {
10357
- sx: styles$4.text
10452
+ sx: styles$5.text
10358
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, {
10359
10454
  className: columnClasses.column6
10360
10455
  }));
@@ -10675,6 +10770,8 @@ var OpacitySelect = function OpacitySelect(_ref) {
10675
10770
  _ref$tooltipPrefix = _ref.tooltipPrefix,
10676
10771
  tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Opacity: ' : _ref$tooltipPrefix;
10677
10772
 
10773
+ var _a;
10774
+
10678
10775
  var _useControlledTooltip = useControlledTooltip(),
10679
10776
  _useControlledTooltip2 = _slicedToArray(_useControlledTooltip, 2),
10680
10777
  tooltipOpen = _useControlledTooltip2[0],
@@ -10686,6 +10783,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
10686
10783
  setAnchorEl = _React$useState2[1];
10687
10784
 
10688
10785
  var isOpen = Boolean(anchorEl);
10786
+ var theme = useTheme();
10689
10787
 
10690
10788
  var handleClick = function handleClick(event) {
10691
10789
  setAnchorEl(anchorEl ? null : event.currentTarget);
@@ -10733,10 +10831,10 @@ var OpacitySelect = function OpacitySelect(_ref) {
10733
10831
  onWheel: onWheel,
10734
10832
  className: "opacity-select",
10735
10833
  "data-testid": "scrollOpacity",
10736
- sx: {
10834
+ sx: Object.assign({
10737
10835
  width: '100%',
10738
10836
  height: 32
10739
- }
10837
+ }, (_a = theme.palette.geowebColors.layerManager.opacitySelect) === null || _a === void 0 ? void 0 : _a.root)
10740
10838
  }, /*#__PURE__*/React.createElement(CustomTooltip, {
10741
10839
  title: "".concat(tooltipPrefix).concat(currentOpacityText),
10742
10840
  sx: tooltipContainerStyles(isEnabled),
@@ -10751,12 +10849,17 @@ var OpacitySelect = function OpacitySelect(_ref) {
10751
10849
  onMouseLeave: onMouseLeave,
10752
10850
  onFocus: onFocus,
10753
10851
  onBlur: onBlur,
10754
- style: {
10852
+ sx: Object.assign({
10755
10853
  height: '100%',
10756
10854
  width: '100%',
10757
10855
  borderRadius: '0',
10758
- minWidth: '49px'
10759
- },
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' : '',
10760
10863
  // Safari-based browsers handle focus differently with buttons
10761
10864
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
10762
10865
  // Use div instead to fix onBlur hander's event.relatedTarget below
@@ -10769,14 +10872,14 @@ var OpacitySelect = function OpacitySelect(_ref) {
10769
10872
  },
10770
10873
  placement: "right"
10771
10874
  }, /*#__PURE__*/React.createElement(Box, {
10772
- sx: {
10875
+ sx: Object.assign({
10773
10876
  padding: '0 0 60px 0',
10774
10877
  backgroundColor: 'geowebColors.background.surface',
10775
10878
  width: '82px',
10776
10879
  height: '248px',
10777
10880
  boxSizing: 'initial',
10778
10881
  boxShadow: 8
10779
- }
10882
+ }, theme.palette.geowebColors.layerManager.opacitySelect.popper)
10780
10883
  }, /*#__PURE__*/React.createElement(Box, {
10781
10884
  sx: sliderHeaderStyle
10782
10885
  }, "Opacity"), /*#__PURE__*/React.createElement(CustomSlider, {
@@ -10931,8 +11034,8 @@ var RenderStyles = function RenderStyles(_ref) {
10931
11034
  * See the License for the specific language governing permissions and
10932
11035
  * limitations under the License.
10933
11036
  *
10934
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10935
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11037
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11038
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
10936
11039
  * */
10937
11040
 
10938
11041
  var getIconColor = function getIconColor(isActive, isEnabled) {
@@ -11022,7 +11125,8 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
11022
11125
  isEnabled = _ref2.isEnabled;
11023
11126
  var isActive = current !== AutoOptions.NONE;
11024
11127
  var Icon = getIcon(isActive, isEnabled, current);
11025
- return /*#__PURE__*/React.createElement(ToolButton, {
11128
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
11129
+ variant: "tool",
11026
11130
  "aria-label": current,
11027
11131
  "data-testid": "activateLayer-btn",
11028
11132
  sx: {
@@ -11030,7 +11134,7 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
11030
11134
  backgroundColor: 'inherit'
11031
11135
  }
11032
11136
  },
11033
- active: isActive
11137
+ isSelected: isActive
11034
11138
  }, Icon);
11035
11139
  };
11036
11140
 
@@ -11121,6 +11225,7 @@ var LayerRow = function LayerRow(_ref) {
11121
11225
  layerDeleteLayout = _ref.layerDeleteLayout,
11122
11226
  layerMenuLayout = _ref.layerMenuLayout,
11123
11227
  layerActiveLayout = _ref.layerActiveLayout,
11228
+ disableActivateLayer = _ref.disableActivateLayer,
11124
11229
  dragHandle = _ref.dragHandle;
11125
11230
 
11126
11231
  var onClickRow = function onClickRow() {
@@ -11172,11 +11277,11 @@ var LayerRow = function LayerRow(_ref) {
11172
11277
  });
11173
11278
  },
11174
11279
  "data-testid": "enableButton-medium"
11175
- }, 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, {
11176
11281
  current: AutoOptions.BOTH,
11177
11282
  onChange: onClickRow,
11178
11283
  isEnabled: true
11179
- }), /*#__PURE__*/React__default.createElement(Typography, {
11284
+ })), /*#__PURE__*/React__default.createElement(Typography, {
11180
11285
  sx: {
11181
11286
  fontWeight: '500',
11182
11287
  fontSize: '12px',
@@ -11257,11 +11362,11 @@ var LayerRow = function LayerRow(_ref) {
11257
11362
  });
11258
11363
  },
11259
11364
  "data-testid": "enableButton"
11260
- }, 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, {
11261
11366
  onChange: onClickRow,
11262
11367
  current: AutoOptions.BOTH,
11263
11368
  isEnabled: true
11264
- })), /*#__PURE__*/React__default.createElement(Grid, {
11369
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
11265
11370
  item: true,
11266
11371
  className: columnClasses.column2
11267
11372
  }, layerServicesLayout || /*#__PURE__*/React__default.createElement(RenderLayers, {
@@ -11947,7 +12052,7 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11947
12052
  layerIndex = _ref.layerIndex,
11948
12053
  settings = _ref.settings;
11949
12054
 
11950
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12055
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11951
12056
 
11952
12057
  var isEnabled = useSelector(function (store) {
11953
12058
  return getLayerEnabled(store, layerId);
@@ -11986,10 +12091,13 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11986
12091
  mapId: mapId,
11987
12092
  tooltipPrefix: (_f = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _f === void 0 ? void 0 : _f.tooltipPrefix
11988
12093
  }),
11989
- 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, {
12095
+ layerId: layerId,
12096
+ mapId: mapId
12097
+ }) : /*#__PURE__*/React.createElement(RenderLayersConnect, {
11990
12098
  layerId: layerId,
11991
12099
  mapId: mapId,
11992
- tooltipPrefix: (_g = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _g === void 0 ? void 0 : _g.tooltipPrefix
12100
+ tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _h === void 0 ? void 0 : _h.tooltipPrefix
11993
12101
  }),
11994
12102
  layerDimensionLayout: /*#__PURE__*/React.createElement(DimensionSelectConnect, {
11995
12103
  layerId: layerId,
@@ -11998,26 +12106,27 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11998
12106
  layerStylesLayout: /*#__PURE__*/React.createElement(RenderStylesConnect, {
11999
12107
  layerId: layerId,
12000
12108
  mapId: mapId,
12001
- tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _h === void 0 ? void 0 : _h.tooltipPrefix,
12002
- icon: (_j = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _j === void 0 ? void 0 : _j.icon
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
12003
12111
  }),
12004
12112
  layerDeleteLayout: /*#__PURE__*/React.createElement(DeleteLayerConnect, {
12005
12113
  mapId: mapId,
12006
12114
  layerId: layerId,
12007
12115
  layerIndex: layerIndex,
12008
- tooltipTitle: (_k = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _k === void 0 ? void 0 : _k.tooltipTitle,
12009
- icon: (_l = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _l === void 0 ? void 0 : _l.icon
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
12010
12118
  }),
12011
12119
  layerMenuLayout: /*#__PURE__*/React.createElement(LayerManagerMenuButtonConnect, {
12012
12120
  mapId: mapId,
12013
12121
  layerId: layerId,
12014
- tooltipTitle: (_m = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _m === void 0 ? void 0 : _m.tooltipTitle,
12015
- icon: (_o = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _o === void 0 ? void 0 : _o.icon
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
12016
12124
  }),
12017
- 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, {
12018
12126
  mapId: mapId,
12019
12127
  layerId: layerId
12020
12128
  }),
12129
+ disableActivateLayer: (_r = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _r === void 0 ? void 0 : _r.isDisabled,
12021
12130
  dragHandle: dragHandle
12022
12131
  });
12023
12132
  };
@@ -12065,8 +12174,8 @@ var DragHandle = function DragHandle(_ref) {
12065
12174
  disabled: isDisabled,
12066
12175
  sx: {
12067
12176
  cursor: isSorting ? 'grabbing' : 'grab',
12068
- '&:hover': {
12069
- backgroundColor: 'inherit!important'
12177
+ '&.handle:hover': function handleHover(theme) {
12178
+ return Object.assign({}, theme.palette.geowebColors.layerManager.dragHandleHover);
12070
12179
  },
12071
12180
  marginLeft: '3px',
12072
12181
  marginRight: '3px',
@@ -13030,7 +13139,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
13030
13139
  }, "Close")));
13031
13140
  };
13032
13141
 
13033
- var styles$3 = {
13142
+ var styles$4 = {
13034
13143
  buttonDiv: {
13035
13144
  position: 'relative'
13036
13145
  },
@@ -13074,7 +13183,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
13074
13183
  }, []);
13075
13184
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
13076
13185
  onClick: handleClose,
13077
- sx: styles$3.button,
13186
+ sx: styles$4.button,
13078
13187
  disableRipple: true,
13079
13188
  "data-testid": "addLayersButton",
13080
13189
  ref: ref,
@@ -13115,24 +13224,25 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13115
13224
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip,
13116
13225
  settings = _ref.settings;
13117
13226
 
13118
- var _a, _b, _c;
13227
+ var _a, _b, _c, _d, _e;
13119
13228
 
13229
+ var theme = useTheme();
13120
13230
  return /*#__PURE__*/React.createElement(Grid, {
13121
13231
  container: true,
13122
13232
  item: true,
13123
13233
  "data-testid": "baseLayerRow",
13124
13234
  className: "addLayer-column",
13125
- sx: {
13235
+ sx: Object.assign({
13126
13236
  width: '100%',
13127
13237
  height: '36px'
13128
- }
13238
+ }, theme.palette.geowebColors.layerManager.baseLayerRow.root)
13129
13239
  }, /*#__PURE__*/React.createElement(Grid, {
13130
13240
  item: true,
13131
13241
  className: columnClasses.column1,
13132
13242
  sx: {
13133
13243
  marginTop: '-2px'
13134
13244
  }
13135
- }, /*#__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, {
13136
13246
  preloadedServices: preloadedServices,
13137
13247
  tooltip: tooltip,
13138
13248
  onRenderTree: function onRenderTree(service) {
@@ -13142,14 +13252,14 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13142
13252
  layerType: LayerType.baseLayer
13143
13253
  });
13144
13254
  }
13145
- })), (_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, {
13146
13256
  item: true,
13147
13257
  className: columnClasses.column2
13148
13258
  }, /*#__PURE__*/React.createElement(BaseLayersConnect, {
13149
13259
  mapId: mapId,
13150
13260
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13151
- tooltipPrefix: (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _b === void 0 ? void 0 : _b.tooltipPrefix,
13152
- 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
13153
13263
  })));
13154
13264
  };
13155
13265
 
@@ -13185,7 +13295,8 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13185
13295
  var isDockedLayerManager = _ref.isDockedLayerManager,
13186
13296
  mapId = _ref.mapId,
13187
13297
  onClickDockButton = _ref.onClickDockButton,
13188
- onChangeSize = _ref.onChangeSize;
13298
+ onChangeSize = _ref.onChangeSize,
13299
+ buttonSettings = _ref.buttonSettings;
13189
13300
  var activeMapId = useSelector(function (store) {
13190
13301
  return getActiveWindowId(store);
13191
13302
  });
@@ -13197,11 +13308,12 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13197
13308
  isDockedLayerManager: isDockedLayerManager,
13198
13309
  shortcutsEnabled: shortcutsEnabled,
13199
13310
  onClickDockButton: onClickDockButton,
13200
- onChangeSize: onChangeSize
13311
+ onChangeSize: onChangeSize,
13312
+ buttonSettings: buttonSettings
13201
13313
  });
13202
13314
  };
13203
13315
 
13204
- var styles$2 = {
13316
+ var styles$3 = {
13205
13317
  layerRowContainer: {
13206
13318
  position: 'relative',
13207
13319
  width: '100%',
@@ -13233,7 +13345,8 @@ var LayerManager = function LayerManager(_ref) {
13233
13345
  preloadedBaseServices = _ref.preloadedBaseServices,
13234
13346
  bounds = _ref.bounds,
13235
13347
  onClose = _ref.onClose,
13236
- showTitle = _ref.showTitle,
13348
+ _ref$title = _ref.title,
13349
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13237
13350
  isOpen = _ref.isOpen,
13238
13351
  _ref$onMouseDown = _ref.onMouseDown,
13239
13352
  onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
@@ -13260,6 +13373,9 @@ var LayerManager = function LayerManager(_ref) {
13260
13373
  _ref$setFocused = _ref.setFocused,
13261
13374
  setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
13262
13375
  settings = _ref.settings;
13376
+
13377
+ var _a, _b, _c, _d, _e;
13378
+
13263
13379
  var minSize = {
13264
13380
  width: 100,
13265
13381
  height: 126
@@ -13271,6 +13387,7 @@ var LayerManager = function LayerManager(_ref) {
13271
13387
  sizeInState = _React$useState2[0],
13272
13388
  setSizeInState = _React$useState2[1];
13273
13389
 
13390
+ var theme = useTheme();
13274
13391
  React.useEffect(function () {
13275
13392
  if (size !== sizeInState && isDockedLayerManager && isOpen) {
13276
13393
  setSizeInState(size);
@@ -13278,7 +13395,7 @@ var LayerManager = function LayerManager(_ref) {
13278
13395
 
13279
13396
  }, [size, isOpen]);
13280
13397
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
13281
- title: showTitle ? "Layer Manager ".concat(mapId) : 'Layer Manager',
13398
+ title: title,
13282
13399
  startSize: sizeInState,
13283
13400
  minWidth: minSize.width,
13284
13401
  minHeight: minSize.height,
@@ -13307,10 +13424,13 @@ var LayerManager = function LayerManager(_ref) {
13307
13424
  setSizeInState(Object.assign(Object.assign({}, sizeInState), {
13308
13425
  width: width
13309
13426
  }));
13310
- }
13427
+ },
13428
+ buttonSettings: (_a = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _a === void 0 ? void 0 : _a.controlButtonSettings
13311
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,
13312
13432
  className: "layermanager",
13313
- sx: layerManagerStyle,
13433
+ sx: Object.assign(Object.assign({}, layerManagerStyle), theme.palette.geowebColors.layerManager.root),
13314
13434
  onResizeStop: function onResizeStop(_event, _direction, node) {
13315
13435
  var width = node.offsetWidth,
13316
13436
  height = node.offsetHeight;
@@ -13347,7 +13467,7 @@ var LayerManager = function LayerManager(_ref) {
13347
13467
  })), /*#__PURE__*/React.createElement(Grid, {
13348
13468
  container: true,
13349
13469
  "data-testid": "layerManagerRowContainer",
13350
- sx: styles$2.layerRowContainer
13470
+ sx: styles$3.layerRowContainer
13351
13471
  }, /*#__PURE__*/React.createElement(DescriptionRow, {
13352
13472
  mapPresetsModule: leftHeaderComponent,
13353
13473
  mapId: mapId,
@@ -13537,8 +13657,10 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13537
13657
  preloadedMapServices = _ref.preloadedMapServices,
13538
13658
  preloadedBaseServices = _ref.preloadedBaseServices,
13539
13659
  bounds = _ref.bounds,
13540
- _ref$showTitle = _ref.showTitle,
13541
- 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,
13542
13664
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13543
13665
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon;
13544
13666
  var dispatch = useDispatch();
@@ -13567,6 +13689,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13567
13689
  }));
13568
13690
  };
13569
13691
 
13692
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13570
13693
  return /*#__PURE__*/React.createElement(LayerManager, {
13571
13694
  mapId: mapId,
13572
13695
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13574,7 +13697,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13574
13697
  bounds: bounds,
13575
13698
  isOpen: isDialogOpen,
13576
13699
  onClose: onCloseDialog,
13577
- showTitle: showTitle,
13700
+ title: shownTitle,
13578
13701
  onMouseDown: setDialogOrder,
13579
13702
  order: dialogOrder,
13580
13703
  source: uiSource,
@@ -13616,8 +13739,10 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13616
13739
  preloadedAvailableBaseLayers = _ref.preloadedAvailableBaseLayers,
13617
13740
  preloadedBaseServices = _ref.preloadedBaseServices,
13618
13741
  bounds = _ref.bounds,
13619
- _ref$showTitle = _ref.showTitle,
13620
- 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,
13621
13746
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13622
13747
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon,
13623
13748
  _ref$source = _ref.source,
@@ -13652,6 +13777,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13652
13777
  }));
13653
13778
  };
13654
13779
 
13780
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13655
13781
  return /*#__PURE__*/React.createElement(LayerManager, {
13656
13782
  mapId: mapId,
13657
13783
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13659,7 +13785,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13659
13785
  bounds: bounds,
13660
13786
  isOpen: isDialogOpen,
13661
13787
  onClose: onCloseDialog,
13662
- showTitle: showTitle,
13788
+ title: shownTitle,
13663
13789
  leftHeaderComponent: leftHeaderComponent,
13664
13790
  // isLoading={isMapPresetLoading}
13665
13791
  // error={mapPresetError}
@@ -13689,8 +13815,8 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13689
13815
  * See the License for the specific language governing permissions and
13690
13816
  * limitations under the License.
13691
13817
  *
13692
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13693
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13818
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13819
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13694
13820
  * */
13695
13821
 
13696
13822
  var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
@@ -13712,13 +13838,12 @@ var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
13712
13838
  source: source
13713
13839
  }));
13714
13840
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
13715
- return /*#__PURE__*/React.createElement(ToolButton, {
13841
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
13842
+ variant: "tool",
13716
13843
  onClick: openFilterResultsDialog,
13717
- active: isOpenInStore,
13844
+ isSelected: isOpenInStore,
13718
13845
  id: "keywordFilterButton",
13719
- "data-testid": "keywordFilterButton",
13720
- disableRipple: true,
13721
- variant: "tool"
13846
+ "data-testid": "keywordFilterButton"
13722
13847
  }, /*#__PURE__*/React.createElement(Filter, null));
13723
13848
  };
13724
13849
 
@@ -13978,8 +14103,8 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
13978
14103
  * See the License for the specific language governing permissions and
13979
14104
  * limitations under the License.
13980
14105
  *
13981
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13982
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
14106
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14107
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13983
14108
  * */
13984
14109
 
13985
14110
  var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
@@ -14033,9 +14158,9 @@ var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
14033
14158
  }
14034
14159
  };
14035
14160
 
14036
- return /*#__PURE__*/React__default.createElement(ToolButton, {
14037
- variant: "icon",
14038
- active: isActive && isOpenInStore,
14161
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
14162
+ variant: "flat",
14163
+ isSelected: isActive && isOpenInStore,
14039
14164
  onClick: onClick,
14040
14165
  id: "layerInfoButton",
14041
14166
  "aria-label": "layer info",
@@ -14539,43 +14664,6 @@ var sortByService = function sortByService(serviceObj) {
14539
14664
  }, {});
14540
14665
  };
14541
14666
 
14542
- var highlightStyle = {
14543
- background: '#ffeecc'
14544
- };
14545
-
14546
- var SearchHighlight = function SearchHighlight(_ref) {
14547
- var text = _ref.text,
14548
- search = _ref.search;
14549
-
14550
- if (search === '') {
14551
- return /*#__PURE__*/React__default.createElement("span", null, text);
14552
- }
14553
-
14554
- var searchWords = search.split(' ').reduce(function (words, word) {
14555
- return word ? [].concat(_toConsumableArray(words), [word.toLocaleLowerCase()]) : words;
14556
- }, []);
14557
- var searchRegex = searchWords.map(function (word) {
14558
- return escapeRegExp(word);
14559
- }).join('|');
14560
- var textParts = text.split(new RegExp("(".concat(searchRegex, ")"), 'gi'));
14561
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, textParts.map(function (part, index) {
14562
- var key = "".concat(part, "-").concat(index);
14563
-
14564
- if (searchWords.some(function (search) {
14565
- return part.toLocaleLowerCase().includes(search);
14566
- })) {
14567
- return /*#__PURE__*/React__default.createElement("mark", {
14568
- key: key,
14569
- style: highlightStyle
14570
- }, part);
14571
- }
14572
-
14573
- return /*#__PURE__*/React__default.createElement("span", {
14574
- key: key
14575
- }, part);
14576
- }));
14577
- };
14578
-
14579
14667
  /* *
14580
14668
  * Licensed under the Apache License, Version 2.0 (the "License");
14581
14669
  * you may not use this file except in compliance with the License.
@@ -15123,7 +15211,7 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
15123
15211
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15124
15212
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
15125
15213
  * */
15126
- var styles$1 = {
15214
+ var styles$2 = {
15127
15215
  servicesContainer: {
15128
15216
  width: '360px',
15129
15217
  maxHeight: '412px',
@@ -15190,7 +15278,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15190
15278
  (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
15191
15279
  }, []);
15192
15280
  return /*#__PURE__*/React.createElement(Box, {
15193
- sx: styles$1.servicesContainer,
15281
+ sx: styles$2.servicesContainer,
15194
15282
  "data-testid": "ServiceDialog",
15195
15283
  onKeyDown: function onKeyDown(event) {
15196
15284
  if (event.key !== 'Escape') {
@@ -15200,9 +15288,9 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15200
15288
  tabIndex: -1,
15201
15289
  ref: dialogRef
15202
15290
  }, /*#__PURE__*/React.createElement(Box, {
15203
- sx: styles$1.header
15291
+ sx: styles$2.header
15204
15292
  }, "Services"), /*#__PURE__*/React.createElement(Backdrop, {
15205
- sx: styles$1.loading,
15293
+ sx: styles$2.loading,
15206
15294
  open: isLoading
15207
15295
  }, /*#__PURE__*/React.createElement(CircularProgress, null)), /*#__PURE__*/React.createElement(Rows, {
15208
15296
  services: services,
@@ -15211,12 +15299,12 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15211
15299
  setServicePopupInfo: setServicePopupInfo,
15212
15300
  selectedLayers: selectedLayers
15213
15301
  }), /*#__PURE__*/React.createElement(Box, {
15214
- sx: styles$1.footer
15302
+ sx: styles$2.footer
15215
15303
  }, /*#__PURE__*/React.createElement(Button, {
15216
15304
  onClick: openAddService,
15217
15305
  onKeyDown: stopTabPropagation,
15218
15306
  "data-testid": "openAddServiceButton",
15219
- sx: styles$1.button,
15307
+ sx: styles$2.button,
15220
15308
  variant: "tertiary",
15221
15309
  startIcon: /*#__PURE__*/React.createElement(Add, null)
15222
15310
  }, "Add a new service")));
@@ -16673,8 +16761,8 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
16673
16761
  * See the License for the specific language governing permissions and
16674
16762
  * limitations under the License.
16675
16763
  *
16676
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16677
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16764
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16765
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16678
16766
  * */
16679
16767
 
16680
16768
  var MapControlButton = function MapControlButton(_a) {
@@ -16687,13 +16775,15 @@ var MapControlButton = function MapControlButton(_a) {
16687
16775
  isActive = _a$isActive === void 0 ? false : _a$isActive,
16688
16776
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
16689
16777
 
16690
- return /*#__PURE__*/React.createElement(CustomTooltip, {
16691
- placement: placement,
16692
- title: title
16693
- }, /*#__PURE__*/React.createElement(ToolButton, Object.assign({
16778
+ return /*#__PURE__*/React.createElement(CustomIconButton, Object.assign({
16779
+ variant: "tool",
16780
+ tooltipProps: {
16781
+ placement: placement,
16782
+ title: title
16783
+ },
16694
16784
  onClick: onClick,
16695
- active: isActive
16696
- }, props), children));
16785
+ isSelected: isActive
16786
+ }, props), children);
16697
16787
  };
16698
16788
 
16699
16789
  /* *
@@ -17476,8 +17566,8 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
17476
17566
  * See the License for the specific language governing permissions and
17477
17567
  * limitations under the License.
17478
17568
  *
17479
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17480
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17569
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17570
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17481
17571
  * */
17482
17572
  var titleOn = 'Auto update on';
17483
17573
  var titleOff = 'Auto update off';
@@ -17489,21 +17579,20 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
17489
17579
  isAutoUpdating = _ref$isAutoUpdating === void 0 ? false : _ref$isAutoUpdating,
17490
17580
  _ref$disabled = _ref.disabled,
17491
17581
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17492
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17493
- title: isAutoUpdating ? titleOn : titleOff,
17494
- "data-testid": "autoUpdateButtonTooltip"
17495
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
17496
- active: isAutoUpdating,
17582
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
17583
+ variant: "tool",
17584
+ isSelected: isAutoUpdating,
17497
17585
  disabled: disabled,
17498
17586
  onClick: function onClick() {
17499
17587
  return toggleAutoUpdate();
17500
17588
  },
17501
- "data-testid": "autoUpdateButton"
17589
+ "data-testid": "autoUpdateButton",
17590
+ tooltipTitle: isAutoUpdating ? titleOn : titleOff
17502
17591
  }, isAutoUpdating ? /*#__PURE__*/React.createElement(AutoUpdateActive, {
17503
17592
  "data-testid": "auto-update-svg-on"
17504
17593
  }) : /*#__PURE__*/React.createElement(AutoUpdateInActive, {
17505
17594
  "data-testid": "auto-update-svg-off"
17506
- }))));
17595
+ }));
17507
17596
  };
17508
17597
 
17509
17598
  var THROTTLE_WAIT_TIME = 300; // [ms]
@@ -17559,20 +17648,24 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17559
17648
  onKeyDown: function onKeyDown(event) {
17560
17649
  event.stopPropagation();
17561
17650
  }
17562
- }, /*#__PURE__*/React.createElement(CustomTooltip, {
17563
- title: title
17564
- }, /*#__PURE__*/React.createElement(ToolButton, {
17651
+ }, /*#__PURE__*/React.createElement(CustomIconButton, {
17652
+ variant: "tool",
17653
+ tooltipTitle: title,
17565
17654
  onClick: function onClick() {
17566
17655
  setOpen(true);
17567
17656
  },
17568
17657
  ref: setAnchorRef,
17569
- active: true,
17570
- width: "100%",
17571
- onWheel: onWheel
17658
+ isSelected: true,
17659
+ onWheel: onWheel,
17660
+ sx: {
17661
+ padding: '11px!important',
17662
+ width: '100%!important'
17663
+ }
17572
17664
  }, icon, /*#__PURE__*/React.createElement(Typography, {
17573
17665
  fontSize: 12,
17574
- fontWeight: 400
17575
- }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text))), /*#__PURE__*/React.createElement(Menu, {
17666
+ fontWeight: 400,
17667
+ textTransform: "none"
17668
+ }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text)), /*#__PURE__*/React.createElement(Menu, {
17576
17669
  anchorEl: anchorRef,
17577
17670
  open: open,
17578
17671
  onClose: function onClose() {
@@ -17628,12 +17721,19 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17628
17721
  minHeight: '30px!important'
17629
17722
  }
17630
17723
  }
17631
- }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(ToolButton, {
17724
+ }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(CustomIconButton, {
17725
+ variant: "tool",
17632
17726
  "data-testid": "menu-animation-length-button",
17633
- active: false,
17634
- disableRipple: true,
17635
- width: "100%"
17636
- }, minutesToDescribedDuration(value))));
17727
+ sx: {
17728
+ padding: '11px!important',
17729
+ width: '100%!important'
17730
+ }
17731
+ }, /*#__PURE__*/React.createElement(Typography, {
17732
+ fontSize: 14,
17733
+ fontWeight: 500,
17734
+ textTransform: "none",
17735
+ lineHeight: 2
17736
+ }, minutesToDescribedDuration(value)))));
17637
17737
  };
17638
17738
 
17639
17739
  var speedTooltipTitle = 'Speed';
@@ -17916,8 +18016,8 @@ var TimeScaleButton = function TimeScaleButton(_ref) {
17916
18016
  * See the License for the specific language governing permissions and
17917
18017
  * limitations under the License.
17918
18018
  *
17919
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17920
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18019
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18020
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17921
18021
  * */
17922
18022
  var title$1 = 'Now';
17923
18023
 
@@ -17926,18 +18026,18 @@ var NowButton = function NowButton(_ref) {
17926
18026
  onSetNow = _ref$onSetNow === void 0 ? function () {} : _ref$onSetNow,
17927
18027
  _ref$disabled = _ref.disabled,
17928
18028
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17929
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17930
- title: title$1,
17931
- "data-testid": "nowButtonTooltip"
17932
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18029
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18030
+ variant: "tool",
18031
+ "aria-label": "now",
18032
+ tooltipTitle: title$1,
18033
+ "data-testid": "nowButtonTooltip",
17933
18034
  disabled: disabled,
17934
18035
  onClick: function onClick() {
17935
18036
  return onSetNow();
17936
- },
17937
- "aria-label": "now"
18037
+ }
17938
18038
  }, /*#__PURE__*/React.createElement(Now, {
17939
18039
  "data-testid": "now-svg"
17940
- }))));
18040
+ }));
17941
18041
  };
17942
18042
 
17943
18043
  /* *
@@ -18104,21 +18204,22 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18104
18204
  setOpen(true);
18105
18205
  }
18106
18206
  }, [anchorEl, isOpenByDefault]);
18107
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomTooltip, {
18108
- title: "Animation options",
18109
- placement: "bottom"
18110
- }, /*#__PURE__*/React__default.createElement("span", {
18111
- ref: function ref(_ref2) {
18112
- setAnchorEl(_ref2);
18113
- }
18114
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
18207
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomIconButton, {
18208
+ variant: "tool",
18115
18209
  onClick: function onClick() {
18116
18210
  setOpen(!open);
18117
18211
  },
18118
18212
  "data-testid": "optionsMenuButton",
18119
- active: open,
18120
- "aria-label": "animation options"
18121
- }, /*#__PURE__*/React__default.createElement(Options, null)))), /*#__PURE__*/React__default.createElement(Popper, {
18213
+ isSelected: open,
18214
+ "aria-label": "animation options",
18215
+ tooltipProps: {
18216
+ title: 'Animation options',
18217
+ placement: 'bottom'
18218
+ },
18219
+ ref: function ref(_ref2) {
18220
+ setAnchorEl(_ref2);
18221
+ }
18222
+ }, /*#__PURE__*/React__default.createElement(Options, null)), /*#__PURE__*/React__default.createElement(Popper, {
18122
18223
  sx: {
18123
18224
  zIndex: 3
18124
18225
  },
@@ -18127,7 +18228,11 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18127
18228
  "data-testid": "optionsMenuPopOver",
18128
18229
  anchorEl: anchorEl
18129
18230
  }, /*#__PURE__*/React__default.createElement(Paper, {
18130
- elevation: 3
18231
+ elevation: 3,
18232
+ sx: {
18233
+ position: 'relative',
18234
+ top: 1
18235
+ }
18131
18236
  }, /*#__PURE__*/React__default.createElement(Grid, {
18132
18237
  sx: {
18133
18238
  padding: '0px 10px 10px'
@@ -18157,8 +18262,8 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18157
18262
  * See the License for the specific language governing permissions and
18158
18263
  * limitations under the License.
18159
18264
  *
18160
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18161
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18265
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18266
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18162
18267
  * */
18163
18268
  var forwardTooltipTitle = 'Forward';
18164
18269
  var backwardTooltipTitle = 'Backward';
@@ -18168,17 +18273,17 @@ var BackwardForwardStepButton = function BackwardForwardStepButton(_ref) {
18168
18273
  isDisabled = _ref.isDisabled,
18169
18274
  _ref$onClickBFButton = _ref.onClickBFButton,
18170
18275
  onClickBFButton = _ref$onClickBFButton === void 0 ? function () {} : _ref$onClickBFButton;
18171
- return /*#__PURE__*/React.createElement(CustomTooltip, {
18172
- title: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18173
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18276
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18277
+ variant: "tool",
18174
18278
  disabled: isDisabled,
18175
18279
  "aria-label": isForwardStep ? 'forward' : 'backward',
18176
- onClick: onClickBFButton
18280
+ onClick: onClickBFButton,
18281
+ tooltipTitle: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18177
18282
  }, isForwardStep ? /*#__PURE__*/React.createElement(StepForward, {
18178
18283
  "data-testid": "step-forward-svg-path"
18179
18284
  }) : /*#__PURE__*/React.createElement(StepBackward, {
18180
18285
  "data-testid": "step-backward-svg-path"
18181
- }))));
18286
+ }));
18182
18287
  };
18183
18288
 
18184
18289
  /* *
@@ -18211,7 +18316,7 @@ var ControlButtons = function ControlButtons(_ref) {
18211
18316
  isForwardStep: true
18212
18317
  })), /*#__PURE__*/React.createElement(Grid, {
18213
18318
  item: true
18214
- }, playBtn || /*#__PURE__*/React.createElement(PlayButton, null)));
18319
+ }, playBtn || /*#__PURE__*/React.createElement(PlayButton$1, null)));
18215
18320
  };
18216
18321
 
18217
18322
  /* *
@@ -19179,7 +19284,7 @@ var isLeftAnimationIconArea = function isLeftAnimationIconArea(x, leftMarkerPx,
19179
19284
  };
19180
19285
 
19181
19286
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
19182
- var DRAG_AREA_WIDTH = 24;
19287
+ var DRAG_AREA_WIDTH$1 = 24;
19183
19288
 
19184
19289
  function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition) {
19185
19290
  var _React$useState = React.useState(convertStringTimeToUnix(animationStartTime)),
@@ -19237,7 +19342,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19237
19342
 
19238
19343
  if (leftMarkerDragging) {
19239
19344
  var mousePosition = leftMarkerPx + x;
19240
- var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
19345
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH$1 * 2;
19241
19346
 
19242
19347
  if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
19243
19348
  return;
@@ -19254,7 +19359,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19254
19359
  if (rightMarkerDragging) {
19255
19360
  var _mousePosition = rightMarkerPx + x;
19256
19361
 
19257
- var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
19362
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH$1 * 2;
19258
19363
 
19259
19364
  if (leftAnimationPosition >= _mousePosition || _mousePosition >= canvasWidth) {
19260
19365
  return;
@@ -19456,7 +19561,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19456
19561
  selectedTimePx = _map4[2]; // start dragging selected time.
19457
19562
 
19458
19563
 
19459
- if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH)) {
19564
+ if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1)) {
19460
19565
  setCursorStyle('grabbing');
19461
19566
  setSelectedTimeDragging(true);
19462
19567
  return;
@@ -19465,7 +19570,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19465
19570
  if (animationStartTime && animationEndTime) {
19466
19571
  dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
19467
19572
 
19468
- if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
19573
+ if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1) && !rightMarkerDragging) {
19469
19574
  setCursorStyle('grabbing');
19470
19575
  setLeftMarkerDragging(true);
19471
19576
  setTooltipTime(moment.utc(animationStartTime));
@@ -19473,7 +19578,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19473
19578
  return;
19474
19579
  }
19475
19580
 
19476
- if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
19581
+ if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1) && !leftMarkerDragging) {
19477
19582
  setCursorStyle('grabbing');
19478
19583
  setRightMarkerDragging(true);
19479
19584
  setTooltipTime(moment.utc(animationEndTime));
@@ -19520,9 +19625,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19520
19625
  selectedTimePx = _map6[2]; // Adjust mouse cursor while hovering draggable areas
19521
19626
 
19522
19627
 
19523
- var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
19524
- var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
19525
- var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
19628
+ var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1);
19629
+ var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1);
19630
+ var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1);
19526
19631
  var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
19527
19632
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
19528
19633
 
@@ -19595,22 +19700,21 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19595
19700
  * See the License for the specific language governing permissions and
19596
19701
  * limitations under the License.
19597
19702
  *
19598
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19599
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
19703
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19704
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
19600
19705
  * */
19601
19706
 
19602
19707
  var HideSliderButton = function HideSliderButton(_ref) {
19603
19708
  var isVisible = _ref.isVisible,
19604
19709
  toggleTimeSliderIsVisible = _ref.toggleTimeSliderIsVisible;
19605
- return /*#__PURE__*/React__default.createElement(CustomTooltip, {
19606
- title: isVisible ? 'Hide timeslider' : 'Show timeslider',
19607
- "data-testid": "autoUpdateButtonTooltip"
19608
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(ToolButton, {
19710
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
19711
+ variant: "tool",
19609
19712
  onClick: function onClick() {
19610
19713
  toggleTimeSliderIsVisible(!isVisible);
19611
19714
  },
19612
- "data-testid": "hideTimeSliderButton"
19613
- }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null))));
19715
+ "data-testid": "hideTimeSliderButton",
19716
+ tooltipTitle: isVisible ? 'Hide timeslider' : 'Show timeslider'
19717
+ }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null));
19614
19718
  };
19615
19719
 
19616
19720
  /* *
@@ -20867,7 +20971,7 @@ var ReactMapViewLayer = function ReactMapViewLayer(props) {
20867
20971
  var tileRenderSettings = {
20868
20972
  WorldMap_Light_Grey_Canvas: {
20869
20973
  'EPSG:3857': {
20870
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap_Light_Grey_Canvas/EPSG3857/',
20974
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/',
20871
20975
  minLevel: 0,
20872
20976
  maxLevel: 9,
20873
20977
  tileServerType: 'osm',
@@ -20876,7 +20980,7 @@ var tileRenderSettings = {
20876
20980
  },
20877
20981
  OpenStreetMap_NL: {
20878
20982
  'EPSG:3857': {
20879
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreetMap_NL/EPSG3857/',
20983
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreetMap_NL/EPSG3857/',
20880
20984
  minLevel: 0,
20881
20985
  maxLevel: 16,
20882
20986
  tileServerType: 'osm',
@@ -20885,14 +20989,14 @@ var tileRenderSettings = {
20885
20989
  },
20886
20990
  OpenStreets_NL: {
20887
20991
  'EPSG:3857': {
20888
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG3857/',
20992
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG3857/',
20889
20993
  minLevel: 0,
20890
20994
  maxLevel: 16,
20891
20995
  tileServerType: 'osm',
20892
20996
  copyRight: 'OpenStreetMap - contributors | Ingmapping'
20893
20997
  },
20894
20998
  'EPSG:28992': {
20895
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG28992/',
20999
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
20896
21000
  minLevel: 0,
20897
21001
  maxLevel: 16,
20898
21002
  tileServerType: 'osm',
@@ -20901,7 +21005,7 @@ var tileRenderSettings = {
20901
21005
  },
20902
21006
  Positron_NL: {
20903
21007
  'EPSG:3857': {
20904
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL/EPSG3857/',
21008
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL/EPSG3857/',
20905
21009
  minLevel: 0,
20906
21010
  maxLevel: 16,
20907
21011
  tileServerType: 'osm',
@@ -20910,7 +21014,7 @@ var tileRenderSettings = {
20910
21014
  },
20911
21015
  Positron_NL_NoLabels: {
20912
21016
  'EPSG:3857': {
20913
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL_NoLabels/EPSG3857/',
21017
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL_NoLabels/EPSG3857/',
20914
21018
  minLevel: 0,
20915
21019
  maxLevel: 16,
20916
21020
  tileServerType: 'osm',
@@ -20919,7 +21023,7 @@ var tileRenderSettings = {
20919
21023
  },
20920
21024
  Klokantech_Basic_NL: {
20921
21025
  'EPSG:3857': {
20922
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL/EPSG3857/',
21026
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL/EPSG3857/',
20923
21027
  minLevel: 0,
20924
21028
  maxLevel: 16,
20925
21029
  tileServerType: 'osm',
@@ -20928,7 +21032,7 @@ var tileRenderSettings = {
20928
21032
  },
20929
21033
  Klokantech_Basic_NL_NoLabels: {
20930
21034
  'EPSG:3857': {
20931
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL_NoLabels/EPSG3857/',
21035
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL_NoLabels/EPSG3857/',
20932
21036
  minLevel: 0,
20933
21037
  maxLevel: 16,
20934
21038
  tileServerType: 'osm',
@@ -20937,7 +21041,7 @@ var tileRenderSettings = {
20937
21041
  },
20938
21042
  OSM_Blossom_NL: {
20939
21043
  'EPSG:3857': {
20940
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Blossom_NL/EPSG3857/',
21044
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Blossom_NL/EPSG3857/',
20941
21045
  minLevel: 0,
20942
21046
  maxLevel: 16,
20943
21047
  tileServerType: 'osm',
@@ -20946,14 +21050,14 @@ var tileRenderSettings = {
20946
21050
  },
20947
21051
  WorldMap: {
20948
21052
  'EPSG:3857': {
20949
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3857/',
21053
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3857/',
20950
21054
  minLevel: 0,
20951
21055
  maxLevel: 9,
20952
21056
  tileServerType: 'osm',
20953
21057
  copyRight: 'Natural Earth II | Ingmapping'
20954
21058
  },
20955
21059
  'TODO__EPSG:4326': {
20956
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG4326/',
21060
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
20957
21061
  minLevel: 0,
20958
21062
  maxLevel: 9,
20959
21063
  origX: -180,
@@ -20963,42 +21067,42 @@ var tileRenderSettings = {
20963
21067
  copyRight: 'Natural Earth II | Ingmapping'
20964
21068
  },
20965
21069
  'EPSG:3411': {
20966
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3411/',
21070
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
20967
21071
  minLevel: 3,
20968
21072
  maxLevel: 9,
20969
21073
  tileServerType: 'osm',
20970
21074
  copyRight: 'Natural Earth II | Ingmapping'
20971
21075
  },
20972
21076
  'EPSG:28992': {
20973
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG28992/',
21077
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG28992/',
20974
21078
  minLevel: 5,
20975
21079
  maxLevel: 9,
20976
21080
  tileServerType: 'osm',
20977
21081
  copyRight: 'Natural Earth II | Ingmapping'
20978
21082
  },
20979
21083
  'EPSG:3412': {
20980
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3412/',
21084
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3412/',
20981
21085
  minLevel: 3,
20982
21086
  maxLevel: 9,
20983
21087
  tileServerType: 'osm',
20984
21088
  copyRight: 'Natural Earth II | Ingmapping'
20985
21089
  },
20986
21090
  'EPSG:32661': {
20987
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG32661/',
21091
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG32661/',
20988
21092
  minLevel: 4,
20989
21093
  maxLevel: 9,
20990
21094
  tileServerType: 'osm',
20991
21095
  copyRight: 'Natural Earth II | Ingmapping'
20992
21096
  },
20993
21097
  'EPSG:54030': {
20994
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG54030/',
21098
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG54030/',
20995
21099
  minLevel: 3,
20996
21100
  maxLevel: 9,
20997
21101
  tileServerType: 'osm',
20998
21102
  copyRight: 'Natural Earth II | Ingmapping'
20999
21103
  },
21000
21104
  'EPSG:3575': {
21001
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3575/',
21105
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3575/',
21002
21106
  minLevel: 5,
21003
21107
  maxLevel: 9,
21004
21108
  tileServerType: 'osm',
@@ -21007,7 +21111,7 @@ var tileRenderSettings = {
21007
21111
  },
21008
21112
  OSM_Antarctica: {
21009
21113
  'EPSG:3412': {
21010
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Antarctica/EPSG3412/',
21114
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Antarctica/EPSG3412/',
21011
21115
  minLevel: 1,
21012
21116
  maxLevel: 7,
21013
21117
  origX: -3000000,
@@ -21110,7 +21214,7 @@ var tileRenderSettings = {
21110
21214
  },
21111
21215
  NaturalEarth2: {
21112
21216
  'EPSG:3411': {
21113
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3411/',
21217
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3411/',
21114
21218
  minLevel: 1,
21115
21219
  maxLevel: 6,
21116
21220
  origX: -12400000,
@@ -21120,7 +21224,7 @@ var tileRenderSettings = {
21120
21224
  copyRight: 'NPS - Natural Earth II'
21121
21225
  },
21122
21226
  'EPSG:3412': {
21123
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3412/',
21227
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3412/',
21124
21228
  minLevel: 1,
21125
21229
  maxLevel: 6,
21126
21230
  origX: -12400000,
@@ -21130,7 +21234,7 @@ var tileRenderSettings = {
21130
21234
  copyRight: 'NPS - Natural Earth II'
21131
21235
  },
21132
21236
  'EPSG:3575': {
21133
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3575/',
21237
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3575/',
21134
21238
  minLevel: 1,
21135
21239
  maxLevel: 6,
21136
21240
  origX: -13000000,
@@ -21140,14 +21244,14 @@ var tileRenderSettings = {
21140
21244
  copyRight: 'NPS - Natural Earth II'
21141
21245
  },
21142
21246
  'EPSG:3857': {
21143
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3857/',
21247
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3857/',
21144
21248
  minLevel: 1,
21145
21249
  maxLevel: 7,
21146
21250
  tileServerType: 'wmst',
21147
21251
  copyRight: 'NPS - Natural Earth II'
21148
21252
  },
21149
21253
  'EPSG:4258': {
21150
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21254
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21151
21255
  minLevel: 1,
21152
21256
  maxLevel: 6,
21153
21257
  origX: -180,
@@ -21157,7 +21261,7 @@ var tileRenderSettings = {
21157
21261
  copyRight: 'NPS - Natural Earth II'
21158
21262
  },
21159
21263
  'EPSG:4326': {
21160
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21264
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21161
21265
  minLevel: 1,
21162
21266
  maxLevel: 6,
21163
21267
  origX: -180,
@@ -21167,7 +21271,7 @@ var tileRenderSettings = {
21167
21271
  copyRight: 'NPS - Natural Earth II'
21168
21272
  },
21169
21273
  'EPSG:28992': {
21170
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG28992/',
21274
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG28992/',
21171
21275
  minLevel: 1,
21172
21276
  maxLevel: 5,
21173
21277
  origX: -2999000,
@@ -21177,7 +21281,7 @@ var tileRenderSettings = {
21177
21281
  copyRight: 'NPS - Natural Earth II'
21178
21282
  },
21179
21283
  'EPSG:32661': {
21180
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG32661/',
21284
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG32661/',
21181
21285
  minLevel: 1,
21182
21286
  maxLevel: 7,
21183
21287
  origX: -5000000,
@@ -21187,7 +21291,7 @@ var tileRenderSettings = {
21187
21291
  copyRight: 'NPS - Natural Earth II'
21188
21292
  },
21189
21293
  'EPSG:54030': {
21190
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG54030/',
21294
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG54030/',
21191
21295
  minLevel: 1,
21192
21296
  maxLevel: 7,
21193
21297
  origX: -17000000,
@@ -21215,86 +21319,50 @@ var tileRenderSettings = {
21215
21319
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21216
21320
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
21217
21321
  * */
21218
- var getCurrentDimensionValue = function getCurrentDimensionValue() {
21219
- var dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
21220
- var name = arguments.length > 1 ? arguments[1] : undefined;
21221
- var currentDimension = dimensions.find(function (dim) {
21222
- return dim.name === name;
21223
- });
21224
- return currentDimension === null || currentDimension === void 0 ? void 0 : currentDimension.currentValue;
21225
- };
21226
- var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, mapProperties, onUpdateLayerInformation) {
21322
+ var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
21227
21323
  var origin = LayerActionOrigin.ReactMapViewParseLayer;
21228
- var service = WMGetServiceFromStore(wmLayer.service);
21229
- var serviceName = mapProperties.services && mapProperties.services[service.id] && mapProperties.services[service.id].name || service.id;
21230
- var webMapJSInstance = getWMJSMapById(mapId);
21324
+ var map = getWMJSMapById(mapId);
21231
21325
  /* Update list of layers for service */
21232
21326
 
21233
- var done = function done(layers) {
21234
- var updateObject = {
21327
+ var updateObject = {
21328
+ origin: origin,
21329
+ layerStyle: {
21235
21330
  origin: origin,
21236
- serviceLayers: {
21237
- name: serviceName,
21238
- id: service.id,
21239
- serviceUrl: wmLayer.service,
21240
- layers: layers,
21241
- scope: 'system'
21242
- },
21243
- layerStyle: {
21244
- origin: origin,
21245
- layerId: wmLayer.ReactWMJSLayerId,
21246
- style: wmLayer.currentStyle
21247
- },
21248
- mapDimensions: {
21249
- origin: origin,
21250
- mapId: mapId,
21251
- dimensions: webMapJSInstance.mapdimensions.map(function (_ref) {
21252
- var name = _ref.name,
21253
- units = _ref.units,
21254
- currentValue = _ref.currentValue,
21255
- synced = _ref.synced;
21256
- var reactDim = mapProperties.dimensions && mapProperties.dimensions.find(function (dim) {
21257
- return dim.name === name;
21258
- });
21259
- var newDimValue = reactDim && reactDim.currentValue || currentValue;
21260
- var newDimSynced = reactDim && reactDim.synced || synced;
21261
- return {
21262
- name: name,
21263
- units: units,
21264
- currentValue: newDimValue,
21265
- synced: newDimSynced
21266
- };
21267
- })
21268
- },
21269
- layerDimensions: {
21270
- origin: origin,
21271
- layerId: wmLayer.id,
21272
- dimensions: wmLayer.dimensions.map(function (dim) {
21273
- var name = dim.name,
21274
- units = dim.units,
21275
- synced = dim.synced;
21276
- var currentDimensionValue = getCurrentDimensionValue(wmLayer.dimensions, name);
21277
- var newDimensionValue = currentDimensionValue || dim.getValue();
21278
- return {
21279
- name: name,
21280
- units: units,
21281
- currentValue: newDimensionValue,
21282
- minValue: dim.getFirstValue(),
21283
- maxValue: dim.getLastValue(),
21284
- timeInterval: dim.getDimInterval(),
21285
- values: dim.getValues(),
21286
- synced: synced
21287
- };
21288
- })
21289
- }
21290
- };
21291
- onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21331
+ layerId: wmLayer.ReactWMJSLayerId,
21332
+ style: wmLayer.currentStyle
21333
+ },
21334
+ mapDimensions: {
21335
+ mapId: mapId,
21336
+ origin: origin,
21337
+ dimensions: map && map.mapdimensions.map(function (mapdim) {
21338
+ return {
21339
+ units: mapdim.units,
21340
+ currentValue: mapdim.currentValue,
21341
+ name: mapdim.name
21342
+ };
21343
+ }) || []
21344
+ },
21345
+ layerDimensions: {
21346
+ origin: origin,
21347
+ layerId: wmLayer.id,
21348
+ dimensions: wmLayer.dimensions.map(function (dim) {
21349
+ var name = dim.name,
21350
+ units = dim.units,
21351
+ synced = dim.synced;
21352
+ return {
21353
+ name: name,
21354
+ units: units,
21355
+ currentValue: dim.getValue(),
21356
+ minValue: dim.getFirstValue(),
21357
+ maxValue: dim.getLastValue(),
21358
+ timeInterval: dim.getDimInterval(),
21359
+ values: dim.getValues(),
21360
+ synced: synced
21361
+ };
21362
+ })
21363
+ }
21292
21364
  };
21293
-
21294
- service.getLayerObjectsFlat(done, function () {// do nothing
21295
- }, false, {
21296
- headers: wmLayer.headers
21297
- });
21365
+ onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21298
21366
  };
21299
21367
 
21300
21368
  /* *
@@ -21393,8 +21461,7 @@ var checkHoverVertice = function checkHoverVertice(feature, mouseX, mouseY, conv
21393
21461
  coordinateIndexInFeature: _polygonIndex
21394
21462
  };
21395
21463
  }
21396
- } catch (e) {
21397
- console.warn(e);
21464
+ } catch (e) {// console.warn(e);
21398
21465
  }
21399
21466
  }
21400
21467
  }
@@ -24050,7 +24117,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
24050
24117
  mapId = _this$props.mapId;
24051
24118
 
24052
24119
  try {
24053
- setServiceMetadata(wmLayer, mapId, _this.props, onUpdateLayerInformation);
24120
+ setLayerInfo(wmLayer, mapId, onUpdateLayerInformation);
24054
24121
  } catch (e) {
24055
24122
  /* Provide a hint on what is going wrong */
24056
24123
  console.error(e);
@@ -24350,7 +24417,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
24350
24417
  _mapId = props.mapId;
24351
24418
  onUpdateLayerInformation && onUpdateLayerInformation({
24352
24419
  origin: ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO,
24353
- serviceLayers: null,
24354
24420
  layerStyle: null,
24355
24421
  layerDimensions: null,
24356
24422
  mapDimensions: {
@@ -25532,8 +25598,8 @@ var OptionsMenuConnect = function OptionsMenuConnect(_ref) {
25532
25598
  * See the License for the specific language governing permissions and
25533
25599
  * limitations under the License.
25534
25600
  *
25535
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25536
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
25601
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25602
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
25537
25603
  * */
25538
25604
  var ClockContainer = function ClockContainer(_ref) {
25539
25605
  var fontSize = _ref.fontSize,
@@ -25566,13 +25632,14 @@ var ClockContainer = function ClockContainer(_ref) {
25566
25632
  item: true,
25567
25633
  zIndex: 2,
25568
25634
  ref: setButtonElement
25569
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
25635
+ }, /*#__PURE__*/React__default.createElement(CustomIconButton, {
25636
+ variant: "tool",
25570
25637
  onClick: onButtonClick,
25571
25638
  sx: {
25572
25639
  color: '#fff!important'
25573
25640
  },
25574
25641
  "aria-label": "Animation options",
25575
- active: isPopperOpen
25642
+ isSelected: isPopperOpen
25576
25643
  }, /*#__PURE__*/React__default.createElement(Icon, {
25577
25644
  isPopperOpen: isPopperOpen,
25578
25645
  popperPlacement: popperPlacement
@@ -26004,6 +26071,31 @@ var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
26004
26071
  });
26005
26072
  };
26006
26073
 
26074
+ /* *
26075
+ * Licensed under the Apache License, Version 2.0 (the "License");
26076
+ * you may not use this file except in compliance with the License.
26077
+ * You may obtain a copy of the License at
26078
+ *
26079
+ * http://www.apache.org/licenses/LICENSE-2.0
26080
+ *
26081
+ * Unless required by applicable law or agreed to in writing, software
26082
+ * distributed under the License is distributed on an "AS IS" BASIS,
26083
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26084
+ * See the License for the specific language governing permissions and
26085
+ * limitations under the License.
26086
+ *
26087
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26088
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26089
+ * */
26090
+ var sanitizeHTML = function sanitizeHTML(htmlToBeSanitezed) {
26091
+ return {
26092
+ __html: DOMPurify.sanitize(htmlToBeSanitezed, {
26093
+ ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'table', 'td', 'tr', 'br', 'hr', 'th'],
26094
+ ALLOWED_ATTR: ['href']
26095
+ })
26096
+ };
26097
+ };
26098
+
26007
26099
  var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
26008
26100
  var layers = _ref.layers,
26009
26101
  isOpen = _ref.isOpen,
@@ -26191,9 +26283,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
26191
26283
  },
26192
26284
  "data-testid": "layer-result-ready-".concat(layerId),
26193
26285
  // eslint-disable-next-line react/no-danger
26194
- dangerouslySetInnerHTML: {
26195
- __html: result.data.replace(/<hr\/>/g, '')
26196
- }
26286
+ dangerouslySetInnerHTML: sanitizeHTML(result.data)
26197
26287
  }) : /*#__PURE__*/React__default.createElement("div", {
26198
26288
  "data-testid": "layer-result-loading-".concat(layerId)
26199
26289
  }, /*#__PURE__*/React__default.createElement(CircularProgress, {
@@ -26549,17 +26639,27 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
26549
26639
  var syncGroupAddTarget = React__default.useCallback(function (payload) {
26550
26640
  dispatch(genericActions.syncGroupAddTarget(payload));
26551
26641
  }, [dispatch]);
26642
+ var syncTargets = useSelector(function (store) {
26643
+ return getSyncGroupTargets(store);
26644
+ });
26552
26645
  React__default.useEffect(function () {
26553
26646
  maps.forEach(function (map) {
26554
26647
  map.syncGroupsIds && map.syncGroupsIds.forEach(function (syncGroupsId) {
26555
- syncGroupAddTarget({
26556
- groupId: syncGroupsId,
26557
- targetId: map.id,
26558
- linked: true
26559
- });
26648
+ var alreadySyncedTargetIndex = syncTargets.findIndex(function (target) {
26649
+ return target.targetId === map.id && target.groupId === syncGroupsId && target.linked === true;
26650
+ }); // Only trigger an action if the target was not yet added to the group or was not linked.
26651
+
26652
+ if (alreadySyncedTargetIndex === -1) {
26653
+ syncGroupAddTarget({
26654
+ groupId: syncGroupsId,
26655
+ targetId: map.id,
26656
+ linked: true,
26657
+ origin: 'system'
26658
+ });
26659
+ }
26560
26660
  });
26561
26661
  });
26562
- }, [maps, syncGroupAddTarget]);
26662
+ }, [maps, syncGroupAddTarget, syncTargets]);
26563
26663
  var mapStyle = {
26564
26664
  width: "".concat(Math.round(100 / cols), "%"),
26565
26665
  height: "".concat(Math.round(100 / rows), "%")
@@ -26824,6 +26924,943 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
26824
26924
  });
26825
26925
  };
26826
26926
 
26927
+ var DAY_TO_MILLISECOND = 24 * 60 * 60 * 1000;
26928
+ var DAY_TO_SECOND = 86400;
26929
+ var MILLISECOND_TO_DAY = 1 / 86400000;
26930
+ var MILLISECOND_TO_SECOND = 1 / 1000;
26931
+ var MINUTE_TO_SECOND = 60;
26932
+ var SECOND_TO_MILLISECOND = 1000;
26933
+ var ONE_DAY_IN_SECONDS = DAY_TO_SECOND;
26934
+ /**
26935
+ * Reformats a date that has capitalized first letter and colon separator for time
26936
+ * @param dateString Date string from Date.toLocaleDateString
26937
+ * @returns Reformatted date string
26938
+ */
26939
+
26940
+ var reformatFinnishDateString = function reformatFinnishDateString(dateString) {
26941
+ var charPositionOfTimestamp = -4;
26942
+ return dateString.charAt(0).toUpperCase() + dateString.slice(1, charPositionOfTimestamp) + dateString.slice(charPositionOfTimestamp).replace('.', ':');
26943
+ };
26944
+ var getMonthChanges = function getMonthChanges(startDate, endDate) {
26945
+ var result = [];
26946
+ var currentDate = new Date(startDate.getTime());
26947
+ var lastDate = new Date(endDate.getTime());
26948
+ currentDate.setDate(1);
26949
+ currentDate.setHours(0, 0, 0, 0);
26950
+
26951
+ while (currentDate <= lastDate) {
26952
+ result.push(currentDate.getTime() * MILLISECOND_TO_SECOND);
26953
+ currentDate.setMonth(currentDate.getMonth() + 1);
26954
+ }
26955
+
26956
+ return result;
26957
+ };
26958
+ var getSelectedTimePx = function getSelectedTimePx(startTime, endTime, selectedTime, width) {
26959
+ var startDate = new Date(startTime * SECOND_TO_MILLISECOND);
26960
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
26961
+ var selectedTimeX = selectedTime - startDateX;
26962
+ var needleX = Math.floor(selectedTimeX / (endTime - startTime) * width);
26963
+ return needleX;
26964
+ };
26965
+ var boundedValue = function boundedValue(value, bounds) {
26966
+ var _bounds = _slicedToArray(bounds, 2),
26967
+ min = _bounds[0],
26968
+ max = _bounds[1];
26969
+
26970
+ return Math.max(min, Math.min(max, value));
26971
+ };
26972
+ var getSelectedTimeFromPx = function getSelectedTimeFromPx(startTime, endTime, selectedTimePx, width) {
26973
+ var startDate = new Date(startTime * SECOND_TO_MILLISECOND);
26974
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
26975
+ var selectedTimeX = Math.floor(selectedTimePx / width * (endTime - startTime));
26976
+ var selectedTime = selectedTimeX + startDateX;
26977
+ return selectedTime;
26978
+ };
26979
+ var TickMode;
26980
+
26981
+ (function (TickMode) {
26982
+ TickMode[TickMode["DAY"] = 1] = "DAY";
26983
+ TickMode[TickMode["HALF_A_DAY"] = 2] = "HALF_A_DAY";
26984
+ TickMode[TickMode["SIX_HOURS"] = 4] = "SIX_HOURS";
26985
+ TickMode[TickMode["THREE_HOURS"] = 8] = "THREE_HOURS";
26986
+ TickMode[TickMode["ONE_HOUR"] = 24] = "ONE_HOUR";
26987
+ TickMode[TickMode["HALF_AN_HOUR"] = 48] = "HALF_AN_HOUR";
26988
+ TickMode[TickMode["FIFTEEN_MINUTES"] = 96] = "FIFTEEN_MINUTES";
26989
+ })(TickMode || (TickMode = {}));
26990
+
26991
+ var subTicksPerDay = function subTicksPerDay(dayWidthInPixels) {
26992
+ if (dayWidthInPixels < 40) {
26993
+ return TickMode.DAY;
26994
+ }
26995
+
26996
+ if (dayWidthInPixels < 75) {
26997
+ return TickMode.HALF_A_DAY;
26998
+ }
26999
+
27000
+ if (dayWidthInPixels < 400) {
27001
+ return TickMode.SIX_HOURS;
27002
+ }
27003
+
27004
+ if (dayWidthInPixels < 800) {
27005
+ return TickMode.THREE_HOURS;
27006
+ }
27007
+
27008
+ if (dayWidthInPixels < 1600) {
27009
+ return TickMode.ONE_HOUR;
27010
+ }
27011
+
27012
+ if (dayWidthInPixels < 3200) {
27013
+ return TickMode.HALF_AN_HOUR;
27014
+ }
27015
+
27016
+ return TickMode.FIFTEEN_MINUTES;
27017
+ };
27018
+ var maxSubTicksPerDay = function maxSubTicksPerDay(dayWidthInPixels, timeStep) {
27019
+ return Math.min(subTicksPerDay(dayWidthInPixels), Math.floor(ONE_DAY_IN_SECONDS / timeStep));
27020
+ };
27021
+
27022
+ var Submenu;
27023
+
27024
+ (function (Submenu) {
27025
+ Submenu["TIME_RANGE"] = "Time range";
27026
+ Submenu["TIME_STEP"] = "Time step";
27027
+ Submenu["SPEED"] = "Speed";
27028
+ Submenu["UPDATE_INTERVAL"] = "Update interval";
27029
+ })(Submenu || (Submenu = {}));
27030
+
27031
+ /* *
27032
+ * Licensed under the Apache License, Version 2.0 (the "License");
27033
+ * you may not use this file except in compliance with the License.
27034
+ * You may obtain a copy of the License at
27035
+ *
27036
+ * http://www.apache.org/licenses/LICENSE-2.0
27037
+ *
27038
+ * Unless required by applicable law or agreed to in writing, software
27039
+ * distributed under the License is distributed on an "AS IS" BASIS,
27040
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27041
+ * See the License for the specific language governing permissions and
27042
+ * limitations under the License.
27043
+ *
27044
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27045
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27046
+ * */
27047
+ var timeSliderLiteButtonDefaultProps = {
27048
+ sx: {
27049
+ width: '36px',
27050
+ height: '36px'
27051
+ }
27052
+ };
27053
+ var timeSliderLiteTooltipDefaultProps = {
27054
+ placement: 'top'
27055
+ };
27056
+
27057
+ /* *
27058
+ * Licensed under the Apache License, Version 2.0 (the "License");
27059
+ * you may not use this file except in compliance with the License.
27060
+ * You may obtain a copy of the License at
27061
+ *
27062
+ * http://www.apache.org/licenses/LICENSE-2.0
27063
+ *
27064
+ * Unless required by applicable law or agreed to in writing, software
27065
+ * distributed under the License is distributed on an "AS IS" BASIS,
27066
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27067
+ * See the License for the specific language governing permissions and
27068
+ * limitations under the License.
27069
+ *
27070
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27071
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27072
+ * */
27073
+
27074
+ var HideButton = function HideButton(_ref) {
27075
+ var isVisible = _ref.isVisible,
27076
+ settings = _ref.settings,
27077
+ onClick = _ref.onClick;
27078
+
27079
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27080
+
27081
+ 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';
27082
+ 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';
27083
+ 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);
27084
+ 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);
27085
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27086
+ title: isVisible ? hideTitle : showTitle
27087
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27088
+ "aria-selected": !isVisible,
27089
+ onClick: onClick,
27090
+ "data-testid": "TimeSliderLite-HideButton"
27091
+ }), isVisible ? hideIcon : showIcon));
27092
+ };
27093
+
27094
+ /* *
27095
+ * Licensed under the Apache License, Version 2.0 (the "License");
27096
+ * you may not use this file except in compliance with the License.
27097
+ * You may obtain a copy of the License at
27098
+ *
27099
+ * http://www.apache.org/licenses/LICENSE-2.0
27100
+ *
27101
+ * Unless required by applicable law or agreed to in writing, software
27102
+ * distributed under the License is distributed on an "AS IS" BASIS,
27103
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27104
+ * See the License for the specific language governing permissions and
27105
+ * limitations under the License.
27106
+ *
27107
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27108
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27109
+ * */
27110
+
27111
+ var ControlButtonGroup = function ControlButtonGroup(_a) {
27112
+ var children = _a.children,
27113
+ right = _a.right,
27114
+ left = _a.left,
27115
+ props = __rest(_a, ["children", "right", "left"]);
27116
+
27117
+ return /*#__PURE__*/React__default.createElement(ButtonGroup, Object.assign({
27118
+ orientation: "horizontal",
27119
+ fullWidth: true
27120
+ }, props, {
27121
+ sx: Object.assign(Object.assign(Object.assign(Object.assign({}, right && {
27122
+ borderTopLeftRadius: 0,
27123
+ borderBottomLeftRadius: 0
27124
+ }), left && {
27125
+ borderTopRightRadius: 0,
27126
+ borderBottomRightRadius: 0
27127
+ }), {
27128
+ backgroundColor: 'geowebColors.background.surface',
27129
+ height: '100%',
27130
+ alignItems: 'center',
27131
+ justifyContent: 'center',
27132
+ padding: '4px',
27133
+ gap: '2px'
27134
+ }), props.sx)
27135
+ }), children);
27136
+ };
27137
+
27138
+ /* *
27139
+ * Licensed under the Apache License, Version 2.0 (the "License");
27140
+ * you may not use this file except in compliance with the License.
27141
+ * You may obtain a copy of the License at
27142
+ *
27143
+ * http://www.apache.org/licenses/LICENSE-2.0
27144
+ *
27145
+ * Unless required by applicable law or agreed to in writing, software
27146
+ * distributed under the License is distributed on an "AS IS" BASIS,
27147
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27148
+ * See the License for the specific language governing permissions and
27149
+ * limitations under the License.
27150
+ *
27151
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27152
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27153
+ * */
27154
+ var TICK_HEIGHT = 6;
27155
+ var HOUR_LABEL_OFFSET = 1.5;
27156
+ var MONTH_LABEL_BREAKPOINT = 65;
27157
+ var HOUR_LABEL_BREAKPOINT = 800;
27158
+ var HOUR_LABEL_EVERY_THIRD_HOUR_BREAKPOINT = 1600;
27159
+ var TIME_SLIDER_LITE_PADDING_RIGHT = 1;
27160
+
27161
+ var TimeSliderLiteBackgroundSvg = function TimeSliderLiteBackgroundSvg(_ref) {
27162
+ var width = _ref.width,
27163
+ height = _ref.height,
27164
+ startTime = _ref.startTime,
27165
+ endTime = _ref.endTime,
27166
+ timeStep = _ref.timeStep,
27167
+ style = _ref.style,
27168
+ locale = _ref.locale;
27169
+
27170
+ var _useTheme = useTheme(),
27171
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27172
+
27173
+ if (!width) {
27174
+ return /*#__PURE__*/React__default.createElement("svg", {
27175
+ style: style,
27176
+ height: height
27177
+ });
27178
+ } // Convert start and end time from Unix timestamp to JavaScript Date object
27179
+
27180
+
27181
+ var startDate = new Date(startTime * SECOND_TO_MILLISECOND);
27182
+ var endDate = new Date(endTime * SECOND_TO_MILLISECOND);
27183
+ var totalDays = (endDate.getTime() - startDate.getTime()) * MILLISECOND_TO_DAY;
27184
+ var tickSpacing = width / totalDays;
27185
+
27186
+ if (tickSpacing === Infinity || tickSpacing === -Infinity || isNaN(tickSpacing)) {
27187
+ return null;
27188
+ }
27189
+
27190
+ var tickOffset = (startDate.getHours() + startDate.getMinutes() / 60) / 24 * tickSpacing;
27191
+ var showMonthLabel = tickSpacing < MONTH_LABEL_BREAKPOINT;
27192
+ var showHourLabel = tickSpacing > HOUR_LABEL_BREAKPOINT;
27193
+ var showHourLabelEveryThirdHour = tickSpacing < HOUR_LABEL_EVERY_THIRD_HOUR_BREAKPOINT; // Set up variables for date labels and background colors
27194
+
27195
+ var dayLabels = [];
27196
+ var currentDate = startDate;
27197
+ var lastDayLabelDate = new Date(endDate.getTime() + 2 * DAY_TO_MILLISECOND); // Append two more days
27198
+
27199
+ while (currentDate < lastDayLabelDate) {
27200
+ var dateString = currentDate.toLocaleDateString(locale, {
27201
+ weekday: 'short',
27202
+ month: 'numeric',
27203
+ day: 'numeric'
27204
+ });
27205
+ var label = dateString.charAt(0).toUpperCase() + dateString.slice(1);
27206
+ dayLabels.push(label);
27207
+ currentDate.setDate(currentDate.getDate() + 1);
27208
+ }
27209
+
27210
+ var monthChanges = getMonthChanges(startDate, endDate);
27211
+ var monthLabels = showMonthLabel ? monthChanges.map(function (monthChange) {
27212
+ var x = getSelectedTimePx(startTime, endTime, monthChange, width) + 4;
27213
+ var dateString = new Date(monthChange * 1000).toLocaleDateString(locale, {
27214
+ weekday: 'short',
27215
+ month: 'numeric',
27216
+ day: 'numeric'
27217
+ });
27218
+ var label = dateString.charAt(0).toUpperCase() + dateString.slice(1);
27219
+ return /*#__PURE__*/React__default.createElement("text", {
27220
+ x: x,
27221
+ y: 14,
27222
+ fill: timeSliderLite.timeline.fill,
27223
+ textAnchor: "left",
27224
+ fontSize: "12px",
27225
+ key: "".concat(monthChange, "-month-change-text"),
27226
+ style: {
27227
+ userSelect: 'none'
27228
+ }
27229
+ }, label);
27230
+ }) : null;
27231
+ var backgroundRectangles = dayLabels.map(function (label, index) {
27232
+ return /*#__PURE__*/React__default.createElement("rect", {
27233
+ x: Math.floor(index * tickSpacing - tickOffset),
27234
+ y: 0,
27235
+ width: Math.ceil(tickSpacing),
27236
+ height: height,
27237
+ fill: index % 2 === 0 ? timeSliderLite.timelineBackground.fill : timeSliderLite.timelineBackgroundAlternative.fill,
27238
+ key: "".concat(label, "-color")
27239
+ });
27240
+ });
27241
+ var dailyLabels = !showMonthLabel ? dayLabels.map(function (label, index) {
27242
+ return /*#__PURE__*/React__default.createElement("text", {
27243
+ x: index * tickSpacing + 8 - tickOffset,
27244
+ y: 14,
27245
+ fill: timeSliderLite.timeline.fill,
27246
+ textAnchor: "left",
27247
+ fontSize: "12px",
27248
+ key: "".concat(label, "-text"),
27249
+ style: {
27250
+ userSelect: 'none'
27251
+ }
27252
+ }, dayLabels[index]);
27253
+ }) : null;
27254
+ var hourLabelsPerDay = 24;
27255
+ var hourLabels = showHourLabel ? dayLabels.map(function (label, index) {
27256
+ return Array.from({
27257
+ length: hourLabelsPerDay
27258
+ }, function (_, value) {
27259
+ var defaultProps = {
27260
+ x: index * tickSpacing + value * (tickSpacing / hourLabelsPerDay) - tickOffset - HOUR_LABEL_OFFSET,
27261
+ y: height - 10,
27262
+ visibility: showHourLabelEveryThirdHour && value % 3 !== 0 ? 'hidden' : 'visible',
27263
+ fill: timeSliderLite.timeline.fill,
27264
+ fontSize: '12px'
27265
+ };
27266
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("text", Object.assign({}, defaultProps, {
27267
+ textAnchor: "end",
27268
+ key: "".concat(label, "-").concat(value, "-hour-label"),
27269
+ style: {
27270
+ userSelect: 'none'
27271
+ }
27272
+ }), value), /*#__PURE__*/React__default.createElement("text", Object.assign({}, defaultProps, {
27273
+ textAnchor: "start",
27274
+ key: "".concat(label, "-").concat(value, "-00-label"),
27275
+ style: {
27276
+ userSelect: 'none'
27277
+ }
27278
+ }), ":00"));
27279
+ });
27280
+ }).flat() : null;
27281
+ var ticksPerDay = timeStep ? maxSubTicksPerDay(tickSpacing, timeStep) : subTicksPerDay(tickSpacing);
27282
+ var tickMarks = dayLabels.map(function (label, index) {
27283
+ return Array.from({
27284
+ length: ticksPerDay + 1
27285
+ }, function (_, value) {
27286
+ return /*#__PURE__*/React__default.createElement("line", {
27287
+ x1: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27288
+ y1: height,
27289
+ x2: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27290
+ y2: Math.floor(height - TICK_HEIGHT),
27291
+ stroke: timeSliderLite.timeline.stroke,
27292
+ key: "".concat(label, "-").concat(value)
27293
+ });
27294
+ });
27295
+ }).flat();
27296
+ return /*#__PURE__*/React__default.createElement("svg", {
27297
+ style: style,
27298
+ width: width + TIME_SLIDER_LITE_PADDING_RIGHT,
27299
+ height: height
27300
+ }, backgroundRectangles, tickMarks, monthLabels, dailyLabels, hourLabels);
27301
+ };
27302
+
27303
+ /* *
27304
+ * Licensed under the Apache License, Version 2.0 (the "License");
27305
+ * you may not use this file except in compliance with the License.
27306
+ * You may obtain a copy of the License at
27307
+ *
27308
+ * http://www.apache.org/licenses/LICENSE-2.0
27309
+ *
27310
+ * Unless required by applicable law or agreed to in writing, software
27311
+ * distributed under the License is distributed on an "AS IS" BASIS,
27312
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27313
+ * See the License for the specific language governing permissions and
27314
+ * limitations under the License.
27315
+ *
27316
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27317
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27318
+ * */
27319
+ var DRAG_AREA_WIDTH = 10;
27320
+ var NEEDLE_WIDTH = 5;
27321
+ var SHADOW_SPREAD = 2;
27322
+
27323
+ var NeedleShadow = function NeedleShadow(_ref) {
27324
+ var x = _ref.x,
27325
+ stroke = _ref.stroke,
27326
+ height = _ref.height,
27327
+ width = _ref.width;
27328
+ return /*#__PURE__*/React__default.createElement("line", {
27329
+ x1: x,
27330
+ y1: height - (height - SHADOW_SPREAD / 2),
27331
+ x2: x,
27332
+ y2: height - SHADOW_SPREAD / 2,
27333
+ strokeWidth: width + SHADOW_SPREAD,
27334
+ stroke: stroke,
27335
+ strokeLinecap: "round",
27336
+ filter: "blur(0.5px)",
27337
+ "data-testid": "TimeSliderLite-NeedleShadow"
27338
+ });
27339
+ };
27340
+
27341
+ var NeedleLine = function NeedleLine(_ref2) {
27342
+ var x = _ref2.x,
27343
+ stroke = _ref2.stroke,
27344
+ height = _ref2.height,
27345
+ width = _ref2.width;
27346
+ return /*#__PURE__*/React__default.createElement("line", {
27347
+ x1: x,
27348
+ y1: width / 2,
27349
+ x2: x,
27350
+ y2: height - width / 2,
27351
+ strokeWidth: width,
27352
+ strokeLinecap: "round",
27353
+ stroke: stroke,
27354
+ "data-testid": "TimeSliderLite-NeedleLine"
27355
+ });
27356
+ };
27357
+
27358
+ var TimeSliderDraggableNeedle = function TimeSliderDraggableNeedle(_ref3) {
27359
+ var draggableLabel = _ref3.draggableLabel,
27360
+ width = _ref3.width,
27361
+ height = _ref3.height,
27362
+ locale = _ref3.locale,
27363
+ startTime = _ref3.startTime,
27364
+ endTime = _ref3.endTime,
27365
+ _ref3$needleDragAreaW = _ref3.needleDragAreaWidth,
27366
+ needleDragAreaWidth = _ref3$needleDragAreaW === void 0 ? DRAG_AREA_WIDTH : _ref3$needleDragAreaW,
27367
+ needleLabelZIndex = _ref3.needleLabelZIndex,
27368
+ needleLabelOffset = _ref3.needleLabelOffset,
27369
+ _ref3$needleWidth = _ref3.needleWidth,
27370
+ needleWidth = _ref3$needleWidth === void 0 ? NEEDLE_WIDTH : _ref3$needleWidth,
27371
+ timeStep = _ref3.timeStep,
27372
+ selectedTime = _ref3.selectedTime,
27373
+ setSelectedTime = _ref3.setSelectedTime,
27374
+ style = _ref3.style;
27375
+ var draggableRef = useRef(null);
27376
+
27377
+ var _useTheme = useTheme(),
27378
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27379
+
27380
+ var x = getSelectedTimePx(startTime, endTime, selectedTime, width) - needleDragAreaWidth / 2;
27381
+ var roundedSelectedTime = Math.floor(selectedTime / timeStep) * timeStep;
27382
+ var dateString = new Date(roundedSelectedTime * 1000).toLocaleDateString(locale, {
27383
+ weekday: 'short',
27384
+ month: 'numeric',
27385
+ day: 'numeric',
27386
+ hour: 'numeric',
27387
+ minute: 'numeric'
27388
+ });
27389
+ var label = locale === 'fi' || locale === 'sv-FI' ? reformatFinnishDateString(dateString) : dateString;
27390
+ return /*#__PURE__*/React__default.createElement(Draggable, {
27391
+ handle: ".TimeSliderLite-DraggableNeedle",
27392
+ axis: "x",
27393
+ nodeRef: draggableRef,
27394
+ bounds: {
27395
+ left: -needleDragAreaWidth / 2,
27396
+ right: width - needleDragAreaWidth / 2
27397
+ },
27398
+ position: {
27399
+ x: x,
27400
+ y: 0
27401
+ },
27402
+ onDrag: function onDrag(_, position) {
27403
+ var positionOffsetToCompensateFlooring = 0.5;
27404
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27405
+ setSelectedTime(newSelectedTime);
27406
+ },
27407
+ onStop: function onStop(_, position) {
27408
+ var positionOffsetToCompensateFlooring = 0.5;
27409
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27410
+ var roundedSelectedTime = Math.floor(newSelectedTime / timeStep) * timeStep;
27411
+ setSelectedTime(roundedSelectedTime);
27412
+ }
27413
+ }, /*#__PURE__*/React__default.createElement("div", {
27414
+ className: "TimeSliderLite-DraggableNeedle",
27415
+ ref: draggableRef,
27416
+ "data-testid": "TimeSliderLite-DraggableNeedle"
27417
+ }, /*#__PURE__*/React__default.createElement(Tooltip, {
27418
+ title: label,
27419
+ arrow: true,
27420
+ placement: "top",
27421
+ open: true,
27422
+ componentsProps: {
27423
+ tooltip: {
27424
+ sx: {
27425
+ padding: '0 3px 0 3px',
27426
+ fontSize: '12px',
27427
+ backgroundColor: timeSliderLite.needleLabel.backgroundColor,
27428
+ border: "1px solid ".concat(timeSliderLite.needleLabel.borderColor)
27429
+ }
27430
+ },
27431
+ arrow: {
27432
+ sx: {
27433
+ color: timeSliderLite.needleLabel.backgroundColor
27434
+ }
27435
+ },
27436
+ popper: {
27437
+ className: draggableLabel ? 'TimeSliderLite-DraggableNeedle' : '',
27438
+ sx: {
27439
+ pointerEvents: draggableLabel ? null : 'none',
27440
+ zIndex: needleLabelZIndex !== null && needleLabelZIndex !== void 0 ? needleLabelZIndex : null,
27441
+ cursor: draggableLabel ? 'ew-resize' : 'default'
27442
+ },
27443
+ modifiers: [{
27444
+ name: 'offset',
27445
+ options: {
27446
+ offset: needleLabelOffset !== null && needleLabelOffset !== void 0 ? needleLabelOffset : [0, 30 - height]
27447
+ }
27448
+ }]
27449
+ }
27450
+ }
27451
+ }, /*#__PURE__*/React__default.createElement("svg", {
27452
+ style: style,
27453
+ cursor: "ew-resize",
27454
+ width: needleDragAreaWidth,
27455
+ height: height,
27456
+ "data-testid": "TimeSliderLite-NeedleSvg"
27457
+ }, /*#__PURE__*/React__default.createElement(NeedleShadow, {
27458
+ x: needleDragAreaWidth / 2,
27459
+ stroke: timeSliderLite.needleShadow.stroke,
27460
+ height: height,
27461
+ width: needleWidth
27462
+ }), /*#__PURE__*/React__default.createElement(NeedleLine, {
27463
+ x: needleDragAreaWidth / 2,
27464
+ stroke: timeSliderLite.needle.stroke,
27465
+ height: height,
27466
+ width: needleWidth
27467
+ })))));
27468
+ };
27469
+
27470
+ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
27471
+ var height = _ref.height,
27472
+ draggableTimeStamp = _ref.draggableTimeStamp,
27473
+ locale = _ref.locale,
27474
+ startTime = _ref.startTime,
27475
+ endTime = _ref.endTime,
27476
+ needleWidth = _ref.needleWidth,
27477
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27478
+ needleLabelZIndex = _ref.needleLabelZIndex,
27479
+ needleLabelOffset = _ref.needleLabelOffset,
27480
+ timeStep = _ref.timeStep,
27481
+ selectedTime = _ref.selectedTime,
27482
+ setSelectedTime = _ref.setSelectedTime;
27483
+ var sliderAreaRef = useRef(null);
27484
+
27485
+ var _React$useState = React__default.useState(0),
27486
+ _React$useState2 = _slicedToArray(_React$useState, 2),
27487
+ areaWidth = _React$useState2[0],
27488
+ setAreaWidth = _React$useState2[1];
27489
+
27490
+ var drawNeedle = selectedTime && areaWidth && startTime < endTime;
27491
+ useLayoutEffect(function () {
27492
+ var sliderArea = sliderAreaRef.current;
27493
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27494
+ var observer = new ResizeObserver(function () {
27495
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27496
+ });
27497
+ observer.observe(sliderArea);
27498
+ return function () {
27499
+ observer.disconnect();
27500
+ };
27501
+ }, [sliderAreaRef]);
27502
+ return /*#__PURE__*/React__default.createElement(Box, {
27503
+ ref: sliderAreaRef,
27504
+ sx: {
27505
+ position: 'relative',
27506
+ height: "".concat(height, "px"),
27507
+ overflow: 'hidden',
27508
+ width: '100%'
27509
+ },
27510
+ "data-testid": "TimeSliderLite-Background"
27511
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackgroundSvg, {
27512
+ style: {
27513
+ position: 'absolute',
27514
+ top: 0
27515
+ },
27516
+ timeStep: timeStep,
27517
+ width: areaWidth,
27518
+ height: height,
27519
+ startTime: startTime,
27520
+ endTime: endTime,
27521
+ locale: locale
27522
+ }), drawNeedle && /*#__PURE__*/React__default.createElement(TimeSliderDraggableNeedle, {
27523
+ needleWidth: needleWidth,
27524
+ draggableLabel: draggableTimeStamp,
27525
+ style: {
27526
+ position: 'absolute',
27527
+ top: 0
27528
+ },
27529
+ locale: locale,
27530
+ width: areaWidth,
27531
+ needleDragAreaWidth: needleDragAreaWidth,
27532
+ needleLabelZIndex: needleLabelZIndex,
27533
+ needleLabelOffset: needleLabelOffset,
27534
+ height: height,
27535
+ startTime: startTime,
27536
+ endTime: endTime,
27537
+ timeStep: timeStep,
27538
+ selectedTime: selectedTime,
27539
+ setSelectedTime: setSelectedTime
27540
+ }));
27541
+ };
27542
+
27543
+ /* *
27544
+ * Licensed under the Apache License, Version 2.0 (the "License");
27545
+ * you may not use this file except in compliance with the License.
27546
+ * You may obtain a copy of the License at
27547
+ *
27548
+ * http://www.apache.org/licenses/LICENSE-2.0
27549
+ *
27550
+ * Unless required by applicable law or agreed to in writing, software
27551
+ * distributed under the License is distributed on an "AS IS" BASIS,
27552
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27553
+ * See the License for the specific language governing permissions and
27554
+ * limitations under the License.
27555
+ *
27556
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27557
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27558
+ * */
27559
+
27560
+ var StepButton = function StepButton(_ref) {
27561
+ var forward = _ref.forward,
27562
+ isDisabled = _ref.isDisabled,
27563
+ _ref$onClick = _ref.onClick,
27564
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
27565
+ settings = _ref.settings,
27566
+ tooltipDelay = _ref.tooltipDelay;
27567
+
27568
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27569
+
27570
+ 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';
27571
+ 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';
27572
+ 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, {
27573
+ "data-testid": "step-forward-svg-path"
27574
+ });
27575
+ 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, {
27576
+ "data-testid": "step-backward-svg-path"
27577
+ });
27578
+ return /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27579
+ title: forward ? forwardTitle : backwardTitle,
27580
+ enterDelay: tooltipDelay,
27581
+ enterNextDelay: tooltipDelay
27582
+ }), /*#__PURE__*/React.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27583
+ disabled: isDisabled,
27584
+ "aria-label": forward ? forwardTitle : backwardTitle,
27585
+ onClick: onClick,
27586
+ "data-testid": "TimeSliderLite-StepButton".concat(forward ? 'Forward' : 'Backward')
27587
+ }), forward ? forwardIcon : backwardIcon));
27588
+ };
27589
+
27590
+ /* *
27591
+ * Licensed under the Apache License, Version 2.0 (the "License");
27592
+ * you may not use this file except in compliance with the License.
27593
+ * You may obtain a copy of the License at
27594
+ *
27595
+ * http://www.apache.org/licenses/LICENSE-2.0
27596
+ *
27597
+ * Unless required by applicable law or agreed to in writing, software
27598
+ * distributed under the License is distributed on an "AS IS" BASIS,
27599
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27600
+ * See the License for the specific language governing permissions and
27601
+ * limitations under the License.
27602
+ *
27603
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27604
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27605
+ * */
27606
+
27607
+ var PlayButton = function PlayButton(_ref) {
27608
+ var isAnimating = _ref.isAnimating,
27609
+ isDisabled = _ref.isDisabled,
27610
+ onTogglePlayButton = _ref.onTogglePlayButton,
27611
+ settings = _ref.settings,
27612
+ tooltipDelay = _ref.tooltipDelay;
27613
+
27614
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27615
+
27616
+ 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';
27617
+ 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';
27618
+ 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);
27619
+ 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);
27620
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27621
+ title: isAnimating ? pauseTitle : playTitle,
27622
+ placement: "top",
27623
+ enterDelay: tooltipDelay,
27624
+ enterNextDelay: tooltipDelay
27625
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27626
+ sx: Object.assign(Object.assign({}, isAnimating && {
27627
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27628
+ }), timeSliderLiteButtonDefaultProps.sx),
27629
+ onClick: function onClick() {
27630
+ onTogglePlayButton();
27631
+ },
27632
+ disabled: isDisabled,
27633
+ "data-testid": "TimeSliderLite-PlayButton"
27634
+ }), isAnimating ? pauseIcon : playIcon));
27635
+ };
27636
+
27637
+ /* *
27638
+ * Licensed under the Apache License, Version 2.0 (the "License");
27639
+ * you may not use this file except in compliance with the License.
27640
+ * You may obtain a copy of the License at
27641
+ *
27642
+ * http://www.apache.org/licenses/LICENSE-2.0
27643
+ *
27644
+ * Unless required by applicable law or agreed to in writing, software
27645
+ * distributed under the License is distributed on an "AS IS" BASIS,
27646
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27647
+ * See the License for the specific language governing permissions and
27648
+ * limitations under the License.
27649
+ *
27650
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27651
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27652
+ * */
27653
+
27654
+ var MenuButton = function MenuButton(_ref) {
27655
+ var menuOpen = _ref.menuOpen,
27656
+ onClick = _ref.onClick,
27657
+ settings = _ref.settings;
27658
+
27659
+ var _a, _b;
27660
+
27661
+ var title = (_a = settings === null || settings === void 0 ? void 0 : settings.label) !== null && _a !== void 0 ? _a : 'Animation options';
27662
+ var icon = (_b = settings === null || settings === void 0 ? void 0 : settings.icon) !== null && _b !== void 0 ? _b : /*#__PURE__*/React__default.createElement(Options, null);
27663
+ var Button = /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27664
+ sx: Object.assign(Object.assign({}, menuOpen && {
27665
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27666
+ }), timeSliderLiteButtonDefaultProps.sx),
27667
+ "aria-selected": menuOpen,
27668
+ onClick: onClick,
27669
+ "data-testid": "TimeSliderLite-MenuButton"
27670
+ }), icon);
27671
+
27672
+ if (menuOpen) {
27673
+ return Button;
27674
+ }
27675
+
27676
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27677
+ title: title
27678
+ }), Button);
27679
+ };
27680
+
27681
+ var TIME_SLIDER_LITE_DEFAULT_HEIGHT = 40;
27682
+ var TIME_SLIDER_LITE_DEFAULT_LOCALE = 'en';
27683
+ var TIME_SLIDER_LITE_DEFAULT_TIME_STEP = 5;
27684
+ var TIME_SLIDER_LITE_TOOLTIP_DELAY = 3000;
27685
+ var styles$1 = {
27686
+ container: {
27687
+ display: 'grid',
27688
+ alignItems: 'center',
27689
+ justifyContent: 'center',
27690
+ borderRadius: '4px'
27691
+ }
27692
+ };
27693
+
27694
+ var TimeSliderLite = function TimeSliderLite(_ref) {
27695
+ var controlButtons = _ref.controlButtons,
27696
+ endTime = _ref.endTime,
27697
+ _ref$height = _ref.height,
27698
+ height = _ref$height === void 0 ? TIME_SLIDER_LITE_DEFAULT_HEIGHT : _ref$height,
27699
+ hideButton = _ref.hideButton,
27700
+ isAnimating = _ref.isAnimating,
27701
+ isVisible = _ref.isVisible,
27702
+ _ref$locale = _ref.locale,
27703
+ locale = _ref$locale === void 0 ? TIME_SLIDER_LITE_DEFAULT_LOCALE : _ref$locale,
27704
+ mapId = _ref.mapId,
27705
+ menuOpen = _ref.menuOpen,
27706
+ overrideAnimation = _ref.overrideAnimation,
27707
+ onToggleAnimation = _ref.onToggleAnimation,
27708
+ onToggleMenu = _ref.onToggleMenu,
27709
+ needleWidth = _ref.needleWidth,
27710
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27711
+ needleLabelZIndex = _ref.needleLabelZIndex,
27712
+ needleLabelOffset = _ref.needleLabelOffset,
27713
+ draggableTimeStamp = _ref.draggableTimeStamp,
27714
+ onToggleTimeSlider = _ref.onToggleTimeSlider,
27715
+ selectedTime = _ref.selectedTime,
27716
+ setSelectedTime = _ref.setSelectedTime,
27717
+ settings = _ref.settings,
27718
+ startTime = _ref.startTime,
27719
+ sx = _ref.sx,
27720
+ _ref$timeStep = _ref.timeStep,
27721
+ timeStep = _ref$timeStep === void 0 ? TIME_SLIDER_LITE_DEFAULT_TIME_STEP : _ref$timeStep;
27722
+
27723
+ var _a, _b;
27724
+
27725
+ var _useState = useState(selectedTime),
27726
+ _useState2 = _slicedToArray(_useState, 2),
27727
+ rawSelectedTime = _useState2[0],
27728
+ setRawSelectedTime = _useState2[1];
27729
+
27730
+ var timeStepSeconds = timeStep * MINUTE_TO_SECOND;
27731
+ var roundedStartTime = Math.floor(startTime / timeStepSeconds) * timeStepSeconds;
27732
+ var roundedEndTime = Math.floor(endTime / timeStepSeconds) * timeStepSeconds;
27733
+ var runningExternalAnimation = overrideAnimation && isAnimating;
27734
+ var runningInternalAnimation = !overrideAnimation && isAnimating;
27735
+ useEffect(function () {
27736
+ if (!runningExternalAnimation) {
27737
+ var roundedSelectedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds;
27738
+ setSelectedTime(roundedSelectedTime);
27739
+ }
27740
+ }, [setSelectedTime, rawSelectedTime, timeStepSeconds, runningExternalAnimation]);
27741
+ useEffect(function () {
27742
+ if (runningInternalAnimation) {
27743
+ var interval = setInterval(function () {
27744
+ setRawSelectedTime(function (prevTime) {
27745
+ if (prevTime + timeStepSeconds > roundedEndTime) {
27746
+ return roundedStartTime;
27747
+ }
27748
+
27749
+ return prevTime + timeStepSeconds;
27750
+ });
27751
+ }, 200);
27752
+ return function () {
27753
+ return clearInterval(interval);
27754
+ };
27755
+ }
27756
+
27757
+ if (runningExternalAnimation) {
27758
+ setRawSelectedTime(selectedTime);
27759
+ }
27760
+
27761
+ return function () {};
27762
+ }, [roundedEndTime, isAnimating, roundedStartTime, timeStepSeconds, runningInternalAnimation, runningExternalAnimation, selectedTime]);
27763
+
27764
+ var handleTimeStep = function handleTimeStep(stepSeconds) {
27765
+ var newSteppedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds + stepSeconds;
27766
+ setRawSelectedTime(boundedValue(newSteppedTime, [roundedStartTime, roundedEndTime]));
27767
+
27768
+ if (isAnimating && onToggleAnimation) {
27769
+ onToggleAnimation();
27770
+ }
27771
+ };
27772
+
27773
+ var handleTimeSelect = function handleTimeSelect(value) {
27774
+ setRawSelectedTime(boundedValue(value, [roundedStartTime, roundedEndTime]));
27775
+
27776
+ if (isAnimating && onToggleAnimation) {
27777
+ onToggleAnimation();
27778
+ }
27779
+ }; // Handle time range selection
27780
+
27781
+
27782
+ useEffect(function () {
27783
+ setRawSelectedTime(boundedValue(selectedTime, [roundedStartTime, roundedEndTime])); // eslint-disable-next-line react-hooks/exhaustive-deps
27784
+ }, [startTime, endTime]);
27785
+ var tooltipDelay = menuOpen ? TIME_SLIDER_LITE_TOOLTIP_DELAY : undefined;
27786
+ return /*#__PURE__*/React__default.createElement(Grid, {
27787
+ container: true,
27788
+ sx: Object.assign(Object.assign(Object.assign({}, styles$1.container), sx), {
27789
+ gridTemplateColumns: isVisible ? 'auto 1fr auto' : "1fr auto",
27790
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27791
+ boxShadow: isVisible ? (_a = sx) === null || _a === void 0 ? void 0 : _a.boxShadow : undefined
27792
+ }),
27793
+ "data-testid": "timeSliderLite-".concat(mapId)
27794
+ }, isVisible ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
27795
+ item: true,
27796
+ sx: {
27797
+ height: "".concat(height, "px")
27798
+ }
27799
+ }, controlButtons || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27800
+ left: true
27801
+ }, /*#__PURE__*/React__default.createElement(MenuButton, {
27802
+ settings: settings === null || settings === void 0 ? void 0 : settings.menuButton,
27803
+ menuOpen: menuOpen,
27804
+ onClick: onToggleMenu
27805
+ }), /*#__PURE__*/React__default.createElement(Divider, {
27806
+ orientation: "vertical",
27807
+ sx: {
27808
+ height: "".concat(height, "px"),
27809
+ margin: '2px'
27810
+ }
27811
+ }), /*#__PURE__*/React__default.createElement(PlayButton, {
27812
+ settings: settings === null || settings === void 0 ? void 0 : settings.playButton,
27813
+ isAnimating: isAnimating,
27814
+ onTogglePlayButton: onToggleAnimation,
27815
+ tooltipDelay: tooltipDelay
27816
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27817
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27818
+ onClick: function onClick() {
27819
+ return handleTimeStep(-timeStepSeconds);
27820
+ },
27821
+ tooltipDelay: tooltipDelay
27822
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27823
+ forward: true,
27824
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27825
+ onClick: function onClick() {
27826
+ return handleTimeStep(timeStepSeconds);
27827
+ },
27828
+ tooltipDelay: tooltipDelay
27829
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
27830
+ item: true
27831
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackground, {
27832
+ draggableTimeStamp: draggableTimeStamp,
27833
+ startTime: roundedStartTime,
27834
+ locale: locale,
27835
+ endTime: roundedEndTime,
27836
+ needleWidth: needleWidth,
27837
+ needleDragAreaWidth: needleDragAreaWidth,
27838
+ needleLabelZIndex: needleLabelZIndex,
27839
+ needleLabelOffset: needleLabelOffset,
27840
+ timeStep: timeStepSeconds,
27841
+ selectedTime: runningExternalAnimation ? selectedTime : rawSelectedTime,
27842
+ setSelectedTime: handleTimeSelect,
27843
+ height: height
27844
+ }))) : /*#__PURE__*/React__default.createElement(Grid, {
27845
+ item: true
27846
+ }), /*#__PURE__*/React__default.createElement(Grid, {
27847
+ item: true,
27848
+ sx: {
27849
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27850
+ boxShadow: isVisible ? 'none' : (_b = sx) === null || _b === void 0 ? void 0 : _b.boxShadow,
27851
+ borderRadius: isVisible ? 'none' : '4px',
27852
+ height: "".concat(height, "px")
27853
+ }
27854
+ }, hideButton || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27855
+ className: "timeSliderLite-hideButtonGroup-".concat(isVisible ? 'hide' : 'show'),
27856
+ right: isVisible
27857
+ }, /*#__PURE__*/React__default.createElement(HideButton, {
27858
+ settings: settings === null || settings === void 0 ? void 0 : settings.hideButton,
27859
+ onClick: onToggleTimeSlider,
27860
+ isVisible: isVisible
27861
+ }))));
27862
+ };
27863
+
26827
27864
  /* *
26828
27865
  * Licensed under the Apache License, Version 2.0 (the "License");
26829
27866
  * you may not use this file except in compliance with the License.
@@ -27791,4 +28828,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
27791
28828
  * */
27792
28829
  var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
27793
28830
 
27794
- 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$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, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, selectors$3 as uiSelectors, types as uiTypes, unRegisterWMJSLayer, unRegisterWMJSMap, useSetupDialog };
28831
+ 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 };