@opengeoweb/soundings 19.2.0 → 19.3.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.
package/dist/index.esm.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { Stack, Box, Tooltip, Typography, styled, Card, IconButton, Menu, ListSubheader, MenuItem, LinearProgress, List as List$1, ListItem, ListItemIcon, Checkbox, ListItemText, Grid, ListItemButton, Switch, ToggleButtonGroup, ToggleButton } from '@mui/material';
3
3
  import { range, isEqual } from 'lodash';
4
- import React, { useMemo, useRef, useEffect, useState, Fragment as Fragment$1, useCallback } from 'react';
4
+ import React, { useMemo, useRef, useEffect, useId, useState, Fragment as Fragment$1, useCallback } from 'react';
5
5
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
6
- import { dateUtils, referenceTimeUtils, safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, SwitchButton, CustomToggleButton, CustomSlider, AlertBanner, ToolContainerDraggable, StyledSelect, SearchField, CustomAccordion } from '@opengeoweb/shared';
7
- import { selectorMemoizationOptions, uiSelectors, uiTypes, uiActions, genericActions, useRegisterFeatureSyncSource, genericSelectors, useSyncgroupTimeState, mapSelectors, mapActions, useUpdateFeatureSyncLayers, useSetupDialog, layerActions, storeReducerMap, storeMiddlewares } from '@opengeoweb/store';
6
+ import { dateUtils, referenceTimeUtils, safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, SwitchButton, CustomToggleButton, CustomSlider, AlertBanner, ToolContainerDraggable, TooltipSelect, AlertIcon, useResizeObserver, SearchField, CustomAccordion } from '@opengeoweb/shared';
7
+ import { selectorMemoizationOptions, uiSelectors, uiTypes, uiActions, genericActions, useRegisterFeatureSyncSource, genericSelectors, useSyncgroupTimeState, mapSelectors, mapActions, useUpdateFeatureSyncLayers, layerActions, useSetupDialog, storeReducerMap, storeMiddlewares } from '@opengeoweb/store';
8
8
  import { Layers, Sources, Location, Equalizer, ArrowDropDownDown, DragHandle, Close, Visibility, VisibilityOff } from '@opengeoweb/theme';
9
9
  import { ParseISOTimeRangeDuration, parseISO8601IntervalToDateInterval, handleDateUtilsISOString, webmapUtils } from '@opengeoweb/webmap';
10
10
  import { MapFeatureClass } from '@opengeoweb/webmap-react';
11
11
  import * as d3 from 'd3';
12
- import { useQueries } from '@tanstack/react-query';
12
+ import { queryOptions, useQueryClient, useQueries } from '@tanstack/react-query';
13
13
  import { withJsonFormat, getHeaders, handleResponse } from '@opengeoweb/api';
14
14
  import { createSlice, createSelector, combineReducers, configureStore } from '@reduxjs/toolkit';
15
15
  import i18n from 'i18next';
@@ -139,6 +139,8 @@ var REFERENCE_PRESSURE = 1000 * 100; // 1000hPa = 100000Pa
139
139
  var EARTH_MEAN_RADIUS = 6371; // [km]
140
140
  var MAX_PROXIMITY_RADIUS = 100; // [km]
141
141
  var SAME_POINT_DISTANCE_KM = 0.05;
142
+ var SOUNDINGS_CONTAINER_BREAKPOINT_PX = '600px';
143
+ var SOUNDINGS_CONTAINER_NAME = 'soundings-container';
142
144
 
143
145
  /* *
144
146
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -717,13 +719,13 @@ var SoundingsLegend = function SoundingsLegend(_ref) {
717
719
  return jsx(Stack, {
718
720
  direction: "row",
719
721
  spacing: 1,
720
- useFlexGap: true,
721
722
  sx: {
722
723
  justifyContent: 'center',
723
724
  flexWrap: 'wrap',
724
725
  paddingLeft: 2,
725
726
  paddingTop: 0.5
726
727
  },
728
+ useFlexGap: true,
727
729
  children: sourceSelections.map(function (source, index) {
728
730
  var resolvedInstanceId = sourceResolvedInstanceIds == null ? void 0 : sourceResolvedInstanceIds[source.collectionId];
729
731
  var title = getLegendTitle(source, resolvedInstanceId);
@@ -985,77 +987,92 @@ var getCollectionLocations = /*#__PURE__*/function () {
985
987
  return _ref.apply(this, arguments);
986
988
  };
987
989
  }();
988
- var getCollectionInstances = /*#__PURE__*/function () {
989
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(collectionId, baseUrl) {
990
+ var getInstanceLocations = /*#__PURE__*/function () {
991
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(collectionId, instanceId, baseUrl) {
990
992
  return _regenerator().w(function (_context2) {
991
993
  while (1) switch (_context2.n) {
992
994
  case 0:
993
- return _context2.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId + "/instances"), {
995
+ return _context2.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId + "/instances/" + instanceId + "/locations"), {
994
996
  headers: getHeaders()
995
997
  }).then(handleResponse));
996
998
  }
997
999
  }, _callee2);
998
1000
  }));
999
- return function getCollectionInstances(_x3, _x4) {
1001
+ return function getInstanceLocations(_x3, _x4, _x5) {
1000
1002
  return _ref2.apply(this, arguments);
1001
1003
  };
1002
1004
  }();
1003
- var getCollectionDetails = /*#__PURE__*/function () {
1005
+ var getCollectionInstances = /*#__PURE__*/function () {
1004
1006
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(collectionId, baseUrl) {
1005
1007
  return _regenerator().w(function (_context3) {
1006
1008
  while (1) switch (_context3.n) {
1007
1009
  case 0:
1008
- return _context3.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId), {
1010
+ return _context3.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId + "/instances"), {
1009
1011
  headers: getHeaders()
1010
1012
  }).then(handleResponse));
1011
1013
  }
1012
1014
  }, _callee3);
1013
1015
  }));
1014
- return function getCollectionDetails(_x5, _x6) {
1016
+ return function getCollectionInstances(_x6, _x7) {
1015
1017
  return _ref3.apply(this, arguments);
1016
1018
  };
1017
1019
  }();
1018
- var getInstanceDetails = /*#__PURE__*/function () {
1019
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(collectionId, instanceId, baseUrl) {
1020
+ var getCollectionDetails = /*#__PURE__*/function () {
1021
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(collectionId, baseUrl) {
1020
1022
  return _regenerator().w(function (_context4) {
1021
1023
  while (1) switch (_context4.n) {
1022
1024
  case 0:
1023
- return _context4.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId + "/instances/" + instanceId), {
1025
+ return _context4.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId), {
1024
1026
  headers: getHeaders()
1025
1027
  }).then(handleResponse));
1026
1028
  }
1027
1029
  }, _callee4);
1028
1030
  }));
1029
- return function getInstanceDetails(_x7, _x8, _x9) {
1031
+ return function getCollectionDetails(_x8, _x9) {
1030
1032
  return _ref4.apply(this, arguments);
1031
1033
  };
1032
1034
  }();
1033
- var getEdrCollectionForLocation = /*#__PURE__*/function () {
1034
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(collectionId, baseUrl, instanceId, locationId, parameters, datetime, verticalRange) {
1035
- var url;
1035
+ var getInstanceDetails = /*#__PURE__*/function () {
1036
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(collectionId, instanceId, baseUrl) {
1036
1037
  return _regenerator().w(function (_context5) {
1037
1038
  while (1) switch (_context5.n) {
1039
+ case 0:
1040
+ return _context5.a(2, fetch(withJsonFormat(baseUrl + "/collections/" + collectionId + "/instances/" + instanceId), {
1041
+ headers: getHeaders()
1042
+ }).then(handleResponse));
1043
+ }
1044
+ }, _callee5);
1045
+ }));
1046
+ return function getInstanceDetails(_x0, _x1, _x10) {
1047
+ return _ref5.apply(this, arguments);
1048
+ };
1049
+ }();
1050
+ var getEdrCollectionForLocation = /*#__PURE__*/function () {
1051
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(collectionId, baseUrl, instanceId, locationId, parameters, datetime, verticalRange) {
1052
+ var url;
1053
+ return _regenerator().w(function (_context6) {
1054
+ while (1) switch (_context6.n) {
1038
1055
  case 0:
1039
1056
  url = new URL(baseUrl + "/collections/" + collectionId + (instanceId ? "/instances/" + instanceId : '') + "/locations/" + locationId);
1040
1057
  url.searchParams.append('parameter-name', parameters.join(','));
1041
1058
  url.searchParams.append('datetime', datetime);
1042
1059
  url.searchParams.append('z', verticalRange);
1043
1060
  url.searchParams.append('f', 'CoverageJSON');
1044
- return _context5.a(2, fetch(url.toString(), {
1061
+ return _context6.a(2, fetch(url.toString(), {
1045
1062
  headers: getHeaders()
1046
1063
  }).then(handleResponse));
1047
1064
  }
1048
- }, _callee5);
1065
+ }, _callee6);
1049
1066
  }));
1050
- return function getEdrCollectionForLocation(_x0, _x1, _x10, _x11, _x12, _x13, _x14) {
1051
- return _ref5.apply(this, arguments);
1067
+ return function getEdrCollectionForLocation(_x11, _x12, _x13, _x14, _x15, _x16, _x17) {
1068
+ return _ref6.apply(this, arguments);
1052
1069
  };
1053
1070
  }();
1054
1071
  var getEdrCollectionForPosition = /*#__PURE__*/function () {
1055
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(collectionId, baseUrl, instanceId, coordinates, parameters, datetime, verticalRange) {
1072
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(collectionId, baseUrl, instanceId, coordinates, parameters, datetime, verticalRange) {
1056
1073
  var url;
1057
- return _regenerator().w(function (_context6) {
1058
- while (1) switch (_context6.n) {
1074
+ return _regenerator().w(function (_context7) {
1075
+ while (1) switch (_context7.n) {
1059
1076
  case 0:
1060
1077
  url = new URL(baseUrl + "/collections/" + collectionId + (instanceId ? "/instances/" + instanceId : '') + "/position");
1061
1078
  url.searchParams.append('coords', "POINT(" + coordinates[0] + " " + coordinates[1] + ")");
@@ -1065,14 +1082,14 @@ var getEdrCollectionForPosition = /*#__PURE__*/function () {
1065
1082
  url.searchParams.append('z', verticalRange);
1066
1083
  }
1067
1084
  url.searchParams.append('f', 'CoverageJSON');
1068
- return _context6.a(2, fetch(url.toString(), {
1085
+ return _context7.a(2, fetch(url.toString(), {
1069
1086
  headers: getHeaders()
1070
1087
  }).then(handleResponse));
1071
1088
  }
1072
- }, _callee6);
1089
+ }, _callee7);
1073
1090
  }));
1074
- return function getEdrCollectionForPosition(_x15, _x16, _x17, _x18, _x19, _x20, _x21) {
1075
- return _ref6.apply(this, arguments);
1091
+ return function getEdrCollectionForPosition(_x18, _x19, _x20, _x21, _x22, _x23, _x24) {
1092
+ return _ref7.apply(this, arguments);
1076
1093
  };
1077
1094
  }();
1078
1095
  /**
@@ -1081,10 +1098,10 @@ var getEdrCollectionForPosition = /*#__PURE__*/function () {
1081
1098
  * Returns a CoverageCollection with coverages for each grid point within the radius.
1082
1099
  */
1083
1100
  var getEdrCollectionForRadius = /*#__PURE__*/function () {
1084
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(collectionId, baseUrl, instanceId, centerCoordinates, radiusKm, parameters, datetime, verticalRange) {
1101
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(collectionId, baseUrl, instanceId, centerCoordinates, radiusKm, parameters, datetime, verticalRange) {
1085
1102
  var url;
1086
- return _regenerator().w(function (_context7) {
1087
- while (1) switch (_context7.n) {
1103
+ return _regenerator().w(function (_context8) {
1104
+ while (1) switch (_context8.n) {
1088
1105
  case 0:
1089
1106
  url = new URL(baseUrl + "/collections/" + collectionId + (instanceId ? "/instances/" + instanceId : '') + "/radius");
1090
1107
  url.searchParams.append('coords', "POINT(" + centerCoordinates[0] + " " + centerCoordinates[1] + ")");
@@ -1097,17 +1114,40 @@ var getEdrCollectionForRadius = /*#__PURE__*/function () {
1097
1114
  url.searchParams.append('z', verticalRange);
1098
1115
  }
1099
1116
  url.searchParams.append('f', 'CoverageJSON');
1100
- return _context7.a(2, fetch(url.toString(), {
1117
+ return _context8.a(2, fetch(url.toString(), {
1101
1118
  headers: getHeaders()
1102
1119
  }).then(handleResponse));
1103
1120
  }
1104
- }, _callee7);
1121
+ }, _callee8);
1105
1122
  }));
1106
- return function getEdrCollectionForRadius(_x22, _x23, _x24, _x25, _x26, _x27, _x28, _x29) {
1107
- return _ref7.apply(this, arguments);
1123
+ return function getEdrCollectionForRadius(_x25, _x26, _x27, _x28, _x29, _x30, _x31, _x32) {
1124
+ return _ref8.apply(this, arguments);
1108
1125
  };
1109
1126
  }();
1110
1127
 
1128
+ var soundingsQueryOptions = {
1129
+ getCollectionInstances: function getCollectionInstances$1(collectionId, url) {
1130
+ return queryOptions({
1131
+ queryKey: ['edr-soundings-instances', collectionId, url],
1132
+ queryFn: function () {
1133
+ var _queryFn = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
1134
+ return _regenerator().w(function (_context) {
1135
+ while (1) switch (_context.n) {
1136
+ case 0:
1137
+ return _context.a(2, getCollectionInstances(collectionId, url));
1138
+ }
1139
+ }, _callee);
1140
+ }));
1141
+ function queryFn() {
1142
+ return _queryFn.apply(this, arguments);
1143
+ }
1144
+ return queryFn;
1145
+ }(),
1146
+ refetchInterval: 5 * 60 * 1000
1147
+ });
1148
+ }
1149
+ };
1150
+
1111
1151
  var epsilon = 0.622; // Ratio of molecular weights of water vapour and dry air
1112
1152
  var e0 = 611.2; // Reference vapor pressure [Pa]
1113
1153
  var aConstant = 17.67;
@@ -1625,28 +1665,12 @@ var useResolvedSourceSelections = function useResolvedSourceSelections(sources)
1625
1665
  var collectionId = _ref2.collectionId,
1626
1666
  url = _ref2.url,
1627
1667
  instanceId = _ref2.instanceId;
1628
- return {
1629
- queryKey: ['edr-soundings-instances', collectionId],
1630
- queryFn: function () {
1631
- var _queryFn3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1632
- return _regenerator().w(function (_context3) {
1633
- while (1) switch (_context3.n) {
1634
- case 0:
1635
- return _context3.a(2, getCollectionInstances(collectionId, url));
1636
- }
1637
- }, _callee3);
1638
- }));
1639
- function queryFn() {
1640
- return _queryFn3.apply(this, arguments);
1641
- }
1642
- return queryFn;
1643
- }(),
1668
+ return Object.assign({}, soundingsQueryOptions.getCollectionInstances(collectionId, url), {
1644
1669
  enabled: referenceTimeUtils.isRelativeReferenceTime(instanceId),
1645
- refetchInterval: 5 * 60 * 1000,
1646
1670
  select: function select(data) {
1647
1671
  return data.instances;
1648
1672
  }
1649
- };
1673
+ });
1650
1674
  });
1651
1675
  }, [sources]);
1652
1676
  var instancesBySource = useQueries({
@@ -1686,42 +1710,42 @@ var useTimesteps = function useTimesteps(sourceSelections) {
1686
1710
  return {
1687
1711
  queryKey: ['edr-soundings-instance', collectionId, instanceId || ''],
1688
1712
  queryFn: function () {
1689
- var _queryFn4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1713
+ var _queryFn3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1690
1714
  var _instanceData$extent, instanceData, timeExtentValues, allInstancesData, collectionData;
1691
- return _regenerator().w(function (_context4) {
1692
- while (1) switch (_context4.n) {
1715
+ return _regenerator().w(function (_context3) {
1716
+ while (1) switch (_context3.n) {
1693
1717
  case 0:
1694
1718
  if (!(instanceId && instanceId !== '')) {
1695
- _context4.n = 4;
1719
+ _context3.n = 4;
1696
1720
  break;
1697
1721
  }
1698
- _context4.n = 1;
1722
+ _context3.n = 1;
1699
1723
  return getInstanceDetails(collectionId, instanceId, url);
1700
1724
  case 1:
1701
- instanceData = _context4.v;
1725
+ instanceData = _context3.v;
1702
1726
  timeExtentValues = instanceData == null || (_instanceData$extent = instanceData.extent) == null || (_instanceData$extent = _instanceData$extent.temporal) == null ? void 0 : _instanceData$extent.values;
1703
1727
  if (timeExtentValues) {
1704
- _context4.n = 3;
1728
+ _context3.n = 3;
1705
1729
  break;
1706
1730
  }
1707
- _context4.n = 2;
1731
+ _context3.n = 2;
1708
1732
  return getCollectionInstances(collectionId, url);
1709
1733
  case 2:
1710
- allInstancesData = _context4.v;
1711
- return _context4.a(2, allInstancesData);
1734
+ allInstancesData = _context3.v;
1735
+ return _context3.a(2, allInstancesData);
1712
1736
  case 3:
1713
- return _context4.a(2, instanceData);
1737
+ return _context3.a(2, instanceData);
1714
1738
  case 4:
1715
- _context4.n = 5;
1739
+ _context3.n = 5;
1716
1740
  return getCollectionDetails(collectionId, url);
1717
1741
  case 5:
1718
- collectionData = _context4.v;
1719
- return _context4.a(2, collectionData);
1742
+ collectionData = _context3.v;
1743
+ return _context3.a(2, collectionData);
1720
1744
  }
1721
- }, _callee4);
1745
+ }, _callee3);
1722
1746
  }));
1723
1747
  function queryFn() {
1724
- return _queryFn4.apply(this, arguments);
1748
+ return _queryFn3.apply(this, arguments);
1725
1749
  }
1726
1750
  return queryFn;
1727
1751
  }(),
@@ -1782,21 +1806,21 @@ var useGetCollectionsInstances = function useGetCollectionsInstances(collections
1782
1806
  return {
1783
1807
  queryKey: ['edr-soundings-collection-details', id, url],
1784
1808
  queryFn: function () {
1785
- var _queryFn5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
1809
+ var _queryFn4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1786
1810
  var data;
1787
- return _regenerator().w(function (_context5) {
1788
- while (1) switch (_context5.n) {
1811
+ return _regenerator().w(function (_context4) {
1812
+ while (1) switch (_context4.n) {
1789
1813
  case 0:
1790
- _context5.n = 1;
1814
+ _context4.n = 1;
1791
1815
  return getCollectionDetails(id, url);
1792
1816
  case 1:
1793
- data = _context5.v;
1794
- return _context5.a(2, data);
1817
+ data = _context4.v;
1818
+ return _context4.a(2, data);
1795
1819
  }
1796
- }, _callee5);
1820
+ }, _callee4);
1797
1821
  }));
1798
1822
  function queryFn() {
1799
- return _queryFn5.apply(this, arguments);
1823
+ return _queryFn4.apply(this, arguments);
1800
1824
  }
1801
1825
  return queryFn;
1802
1826
  }(),
@@ -1833,29 +1857,29 @@ var useGetCollectionsInstances = function useGetCollectionsInstances(collections
1833
1857
  return {
1834
1858
  queryKey: ['edr-soundings-instances', id, resultsCollection.data],
1835
1859
  queryFn: function () {
1836
- var _queryFn6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
1860
+ var _queryFn5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
1837
1861
  var data;
1838
- return _regenerator().w(function (_context6) {
1839
- while (1) switch (_context6.n) {
1862
+ return _regenerator().w(function (_context5) {
1863
+ while (1) switch (_context5.n) {
1840
1864
  case 0:
1841
1865
  if (!resultsCollection.data[index]) {
1842
- _context6.n = 2;
1866
+ _context5.n = 2;
1843
1867
  break;
1844
1868
  }
1845
- _context6.n = 1;
1869
+ _context5.n = 1;
1846
1870
  return getCollectionInstances(id, url);
1847
1871
  case 1:
1848
- data = _context6.v;
1849
- return _context6.a(2, data);
1872
+ data = _context5.v;
1873
+ return _context5.a(2, data);
1850
1874
  case 2:
1851
- return _context6.a(2, {
1875
+ return _context5.a(2, {
1852
1876
  instances: []
1853
1877
  });
1854
1878
  }
1855
- }, _callee6);
1879
+ }, _callee5);
1856
1880
  }));
1857
1881
  function queryFn() {
1858
- return _queryFn6.apply(this, arguments);
1882
+ return _queryFn5.apply(this, arguments);
1859
1883
  }
1860
1884
  return queryFn;
1861
1885
  }(),
@@ -1900,37 +1924,76 @@ var useGetCollectionsInstances = function useGetCollectionsInstances(collections
1900
1924
  data: dataWithCollectionInfo
1901
1925
  });
1902
1926
  };
1903
- var useGetCollectionLocations = function useGetCollectionLocations(collections, enabled) {
1927
+ var useGetLocations = function useGetLocations(collections, enabled) {
1928
+ var queryClient = useQueryClient();
1904
1929
  var edrQueries = useMemo(function () {
1905
1930
  return collections == null ? void 0 : collections.map(function (collection) {
1931
+ var _collection$instanceI;
1906
1932
  return {
1907
- queryKey: ['edr-locations', collection.id],
1933
+ queryKey: ['edr-locations', collection.id, collection.url, (_collection$instanceI = collection.instanceId) != null ? _collection$instanceI : ''],
1908
1934
  queryFn: function () {
1909
- var _queryFn7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1910
- var locations;
1911
- return _regenerator().w(function (_context7) {
1912
- while (1) switch (_context7.n) {
1935
+ var _queryFn6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
1936
+ var resolvedInstanceId, instances, resolved, locationsExplicitlyUnsupported, _locations, locations;
1937
+ return _regenerator().w(function (_context6) {
1938
+ while (1) switch (_context6.p = _context6.n) {
1913
1939
  case 0:
1914
- _context7.n = 1;
1940
+ resolvedInstanceId = collection.instanceId;
1941
+ if (!(resolvedInstanceId && referenceTimeUtils.isRelativeReferenceTime(resolvedInstanceId))) {
1942
+ _context6.n = 4;
1943
+ break;
1944
+ }
1945
+ _context6.p = 1;
1946
+ _context6.n = 2;
1947
+ return queryClient.fetchQuery(soundingsQueryOptions.getCollectionInstances(collection.id, collection.url));
1948
+ case 2:
1949
+ instances = _context6.v;
1950
+ resolved = referenceTimeUtils.resolveReferenceTimeInstance(instances.instances, resolvedInstanceId); // Skip instance-level only when data_queries is present but explicitly excludes locations — if data_queries is absent, try instance-level anyway
1951
+ locationsExplicitlyUnsupported = (resolved == null ? void 0 : resolved.data_queries) !== undefined && !resolved.data_queries.locations;
1952
+ resolvedInstanceId = locationsExplicitlyUnsupported ? undefined : resolved == null ? void 0 : resolved.id;
1953
+ _context6.n = 4;
1954
+ break;
1955
+ case 3:
1956
+ _context6.p = 3;
1957
+ _context6.v;
1958
+ resolvedInstanceId = undefined;
1959
+ case 4:
1960
+ if (!resolvedInstanceId) {
1961
+ _context6.n = 8;
1962
+ break;
1963
+ }
1964
+ _context6.p = 5;
1965
+ _context6.n = 6;
1966
+ return getInstanceLocations(collection.id, resolvedInstanceId, collection.url);
1967
+ case 6:
1968
+ _locations = _context6.v;
1969
+ return _context6.a(2, Object.assign({}, _locations, {
1970
+ id: collection.id,
1971
+ name: collection.name
1972
+ }));
1973
+ case 7:
1974
+ _context6.p = 7;
1975
+ _context6.v;
1976
+ case 8:
1977
+ _context6.n = 9;
1915
1978
  return getCollectionLocations(collection.id, collection.url);
1916
- case 1:
1917
- locations = _context7.v;
1918
- return _context7.a(2, Object.assign({}, locations, {
1979
+ case 9:
1980
+ locations = _context6.v;
1981
+ return _context6.a(2, Object.assign({}, locations, {
1919
1982
  id: collection.id,
1920
1983
  name: collection.name
1921
1984
  }));
1922
1985
  }
1923
- }, _callee7);
1986
+ }, _callee6, null, [[5, 7], [1, 3]]);
1924
1987
  }));
1925
1988
  function queryFn() {
1926
- return _queryFn7.apply(this, arguments);
1989
+ return _queryFn6.apply(this, arguments);
1927
1990
  }
1928
1991
  return queryFn;
1929
1992
  }(),
1930
1993
  enabled: enabled
1931
1994
  };
1932
1995
  });
1933
- }, [collections, enabled]);
1996
+ }, [collections, enabled, queryClient]);
1934
1997
  return useQueries({
1935
1998
  queries: edrQueries,
1936
1999
  combine: function combine(results) {
@@ -1972,48 +2035,48 @@ var useCheckPositionQuerySupportBySource = function useCheckPositionQuerySupport
1972
2035
  return {
1973
2036
  queryKey: ['edr-position-support', collectionId, instanceId || ''],
1974
2037
  queryFn: function () {
1975
- var _queryFn8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
2038
+ var _queryFn7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1976
2039
  var _details$data_queries, _instance$data_querie, instances, instance, details;
1977
- return _regenerator().w(function (_context8) {
1978
- while (1) switch (_context8.p = _context8.n) {
2040
+ return _regenerator().w(function (_context7) {
2041
+ while (1) switch (_context7.p = _context7.n) {
1979
2042
  case 0:
1980
- _context8.p = 0;
2043
+ _context7.p = 0;
1981
2044
  if (!instanceId) {
1982
- _context8.n = 2;
2045
+ _context7.n = 2;
1983
2046
  break;
1984
2047
  }
1985
- _context8.n = 1;
2048
+ _context7.n = 1;
1986
2049
  return getCollectionInstances(collectionId, url);
1987
2050
  case 1:
1988
- instances = _context8.v;
2051
+ instances = _context7.v;
1989
2052
  instance = instances.instances.find(function (i) {
1990
2053
  return i.id === instanceId;
1991
2054
  });
1992
- return _context8.a(2, {
2055
+ return _context7.a(2, {
1993
2056
  collectionId: collectionId,
1994
2057
  supported: !!(instance != null && (_instance$data_querie = instance.data_queries) != null && _instance$data_querie.position)
1995
2058
  });
1996
2059
  case 2:
1997
- _context8.n = 3;
2060
+ _context7.n = 3;
1998
2061
  return getCollectionDetails(collectionId, url);
1999
2062
  case 3:
2000
- details = _context8.v;
2001
- return _context8.a(2, {
2063
+ details = _context7.v;
2064
+ return _context7.a(2, {
2002
2065
  collectionId: collectionId,
2003
2066
  supported: !!(details != null && (_details$data_queries = details.data_queries) != null && _details$data_queries.position)
2004
2067
  });
2005
2068
  case 4:
2006
- _context8.p = 4;
2007
- _context8.v;
2008
- return _context8.a(2, {
2069
+ _context7.p = 4;
2070
+ _context7.v;
2071
+ return _context7.a(2, {
2009
2072
  collectionId: collectionId,
2010
2073
  supported: false
2011
2074
  });
2012
2075
  }
2013
- }, _callee8, null, [[0, 4]]);
2076
+ }, _callee7, null, [[0, 4]]);
2014
2077
  }));
2015
2078
  function queryFn() {
2016
- return _queryFn8.apply(this, arguments);
2079
+ return _queryFn7.apply(this, arguments);
2017
2080
  }
2018
2081
  return queryFn;
2019
2082
  }(),
@@ -2062,48 +2125,48 @@ var useCheckRadiusQuerySupportBySource = function useCheckRadiusQuerySupportBySo
2062
2125
  return {
2063
2126
  queryKey: ['edr-radius-support', collectionId, instanceId || ''],
2064
2127
  queryFn: function () {
2065
- var _queryFn9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
2128
+ var _queryFn8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
2066
2129
  var _details$data_queries2, _instance$data_querie2, instances, instance, details;
2067
- return _regenerator().w(function (_context9) {
2068
- while (1) switch (_context9.p = _context9.n) {
2130
+ return _regenerator().w(function (_context8) {
2131
+ while (1) switch (_context8.p = _context8.n) {
2069
2132
  case 0:
2070
- _context9.p = 0;
2133
+ _context8.p = 0;
2071
2134
  if (!instanceId) {
2072
- _context9.n = 2;
2135
+ _context8.n = 2;
2073
2136
  break;
2074
2137
  }
2075
- _context9.n = 1;
2138
+ _context8.n = 1;
2076
2139
  return getCollectionInstances(collectionId, url);
2077
2140
  case 1:
2078
- instances = _context9.v;
2141
+ instances = _context8.v;
2079
2142
  instance = instances.instances.find(function (i) {
2080
2143
  return i.id === instanceId;
2081
2144
  });
2082
- return _context9.a(2, {
2145
+ return _context8.a(2, {
2083
2146
  collectionId: collectionId,
2084
2147
  supported: !!(instance != null && (_instance$data_querie2 = instance.data_queries) != null && _instance$data_querie2.radius)
2085
2148
  });
2086
2149
  case 2:
2087
- _context9.n = 3;
2150
+ _context8.n = 3;
2088
2151
  return getCollectionDetails(collectionId, url);
2089
2152
  case 3:
2090
- details = _context9.v;
2091
- return _context9.a(2, {
2153
+ details = _context8.v;
2154
+ return _context8.a(2, {
2092
2155
  collectionId: collectionId,
2093
2156
  supported: !!(details != null && (_details$data_queries2 = details.data_queries) != null && _details$data_queries2.radius)
2094
2157
  });
2095
2158
  case 4:
2096
- _context9.p = 4;
2097
- _context9.v;
2098
- return _context9.a(2, {
2159
+ _context8.p = 4;
2160
+ _context8.v;
2161
+ return _context8.a(2, {
2099
2162
  collectionId: collectionId,
2100
2163
  supported: false
2101
2164
  });
2102
2165
  }
2103
- }, _callee9, null, [[0, 4]]);
2166
+ }, _callee8, null, [[0, 4]]);
2104
2167
  }));
2105
2168
  function queryFn() {
2106
- return _queryFn9.apply(this, arguments);
2169
+ return _queryFn8.apply(this, arguments);
2107
2170
  }
2108
2171
  return queryFn;
2109
2172
  }(),
@@ -2160,20 +2223,20 @@ var useGridPointsFromRadius = function useGridPointsFromRadius(sources, radiusSu
2160
2223
  return {
2161
2224
  queryKey: ['edr-grid-points-disabled', collectionId],
2162
2225
  queryFn: function () {
2163
- var _queryFn0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
2164
- return _regenerator().w(function (_context0) {
2165
- while (1) switch (_context0.n) {
2226
+ var _queryFn9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
2227
+ return _regenerator().w(function (_context9) {
2228
+ while (1) switch (_context9.n) {
2166
2229
  case 0:
2167
- return _context0.a(2, {
2230
+ return _context9.a(2, {
2168
2231
  sourceId: collectionId,
2169
2232
  gridPoint: undefined,
2170
2233
  allGridPoints: []
2171
2234
  });
2172
2235
  }
2173
- }, _callee0);
2236
+ }, _callee9);
2174
2237
  }));
2175
2238
  function queryFn() {
2176
- return _queryFn0.apply(this, arguments);
2239
+ return _queryFn9.apply(this, arguments);
2177
2240
  }
2178
2241
  return queryFn;
2179
2242
  }(),
@@ -2198,22 +2261,22 @@ var useGridPointsFromRadius = function useGridPointsFromRadius(sources, radiusSu
2198
2261
  return {
2199
2262
  queryKey: ['edr-grid-points-radius', collectionId, instanceId || '', centerCoordinates.join(','), radiusKm.toString(), datetime],
2200
2263
  queryFn: function () {
2201
- var _queryFn1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
2264
+ var _queryFn0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
2202
2265
  var minimalParameters, minimalVerticalRange, rawData, allGridPoints, nearestPoint, minSquaredDistance;
2203
- return _regenerator().w(function (_context1) {
2204
- while (1) switch (_context1.p = _context1.n) {
2266
+ return _regenerator().w(function (_context0) {
2267
+ while (1) switch (_context0.p = _context0.n) {
2205
2268
  case 0:
2206
2269
  if (supportsRadius) {
2207
- _context1.n = 1;
2270
+ _context0.n = 1;
2208
2271
  break;
2209
2272
  }
2210
- return _context1.a(2, {
2273
+ return _context0.a(2, {
2211
2274
  sourceId: collectionId,
2212
2275
  gridPoint: undefined,
2213
2276
  allGridPoints: []
2214
2277
  });
2215
2278
  case 1:
2216
- _context1.p = 1;
2279
+ _context0.p = 1;
2217
2280
  // Optimization: Only request a single parameter to minimize data transfer
2218
2281
  // We only need the grid point coordinates, not the actual sounding data
2219
2282
  minimalParameters = parameters.slice(0, 1); // Just one parameter
@@ -2221,10 +2284,10 @@ var useGridPointsFromRadius = function useGridPointsFromRadius(sources, radiusSu
2221
2284
  // (Don't hardcode '1000' as that only works for pressure-level sources,
2222
2285
  // not for hybrid/model-level sources which use levels 1-65)
2223
2286
  minimalVerticalRange = '';
2224
- _context1.n = 2;
2287
+ _context0.n = 2;
2225
2288
  return getEdrCollectionForRadius(collectionId, url, instanceId, centerCoordinates, radiusKm, minimalParameters, datetime, minimalVerticalRange);
2226
2289
  case 2:
2227
- rawData = _context1.v;
2290
+ rawData = _context0.v;
2228
2291
  allGridPoints = extractGridPointsFromCoverage(rawData); // Find the nearest grid point to the center coordinates
2229
2292
  minSquaredDistance = Infinity;
2230
2293
  allGridPoints.forEach(function (point) {
@@ -2239,24 +2302,24 @@ var useGridPointsFromRadius = function useGridPointsFromRadius(sources, radiusSu
2239
2302
  nearestPoint = point;
2240
2303
  }
2241
2304
  });
2242
- return _context1.a(2, {
2305
+ return _context0.a(2, {
2243
2306
  sourceId: collectionId,
2244
2307
  gridPoint: nearestPoint,
2245
2308
  allGridPoints: allGridPoints
2246
2309
  });
2247
2310
  case 3:
2248
- _context1.p = 3;
2249
- _context1.v;
2250
- return _context1.a(2, {
2311
+ _context0.p = 3;
2312
+ _context0.v;
2313
+ return _context0.a(2, {
2251
2314
  sourceId: collectionId,
2252
2315
  gridPoint: undefined,
2253
2316
  allGridPoints: []
2254
2317
  });
2255
2318
  }
2256
- }, _callee1, null, [[1, 3]]);
2319
+ }, _callee0, null, [[1, 3]]);
2257
2320
  }));
2258
2321
  function queryFn() {
2259
- return _queryFn1.apply(this, arguments);
2322
+ return _queryFn0.apply(this, arguments);
2260
2323
  }
2261
2324
  return queryFn;
2262
2325
  }(),
@@ -3034,12 +3097,13 @@ var useSoundingsTranslation = function useSoundingsTranslation() {
3034
3097
  };
3035
3098
 
3036
3099
  var SoundingsMarkersSwitch = function SoundingsMarkersSwitch(_ref) {
3100
+ var _sx;
3037
3101
  var shouldHideMarkers = _ref.shouldHideMarkers,
3038
3102
  toggleMarkers = _ref.toggleMarkers;
3039
3103
  var _useSoundingsTranslat = useSoundingsTranslation(),
3040
3104
  t = _useSoundingsTranslat.t;
3041
3105
  return jsxs(Box, {
3042
- sx: {
3106
+ sx: (_sx = {
3043
3107
  display: 'flex',
3044
3108
  flexWrap: 'wrap',
3045
3109
  alignItems: 'flex-start',
@@ -3055,14 +3119,13 @@ var SoundingsMarkersSwitch = function SoundingsMarkersSwitch(_ref) {
3055
3119
  },
3056
3120
  '.markers-label': {
3057
3121
  display: 'none'
3058
- },
3059
- '@container soundings-container (min-width: 560px)': {
3060
- minWidth: '146px',
3061
- '.markers-label, .switch-button label': {
3062
- display: 'initial'
3063
- }
3064
3122
  }
3065
- },
3123
+ }, _sx["@container " + SOUNDINGS_CONTAINER_NAME + " (min-width: " + SOUNDINGS_CONTAINER_BREAKPOINT_PX + ")"] = {
3124
+ minWidth: '146px',
3125
+ '.markers-label, .switch-button label': {
3126
+ display: 'initial'
3127
+ }
3128
+ }, _sx),
3066
3129
  children: [jsx(Typography, {
3067
3130
  className: "markers-label",
3068
3131
  sx: {
@@ -3087,6 +3150,7 @@ var SoundingsMarkersSwitch = function SoundingsMarkersSwitch(_ref) {
3087
3150
  });
3088
3151
  };
3089
3152
 
3153
+ var _styled;
3090
3154
  var _excluded = ["icon", "shortText", "longText"];
3091
3155
  var SoundingsTopRowButtonUnstyled = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3092
3156
  var icon = _ref.icon,
@@ -3105,30 +3169,27 @@ var SoundingsTopRowButtonUnstyled = /*#__PURE__*/React.forwardRef(function (_ref
3105
3169
  })]
3106
3170
  }));
3107
3171
  });
3108
- var SoundingsTopRowButton = styled(SoundingsTopRowButtonUnstyled)({
3109
- height: '10px !important',
3110
- '@container soundings-container (width < 560px)': {
3111
- maxWidth: '90px',
3112
- '& .longText': {
3113
- display: 'none'
3114
- },
3115
- '& svg': {
3116
- marginRight: '0 !important'
3117
- }
3172
+ var SoundingsTopRowButton = styled(SoundingsTopRowButtonUnstyled)((_styled = {
3173
+ height: '10px !important'
3174
+ }, _styled["@container " + SOUNDINGS_CONTAINER_NAME + " (width < " + SOUNDINGS_CONTAINER_BREAKPOINT_PX + ")"] = {
3175
+ maxWidth: '90px',
3176
+ '& .longText': {
3177
+ display: 'none'
3118
3178
  },
3119
- '@container soundings-container (width >= 560px)': {
3120
- width: '130px',
3121
- '& .shortText': {
3122
- display: 'none'
3123
- }
3124
- },
3125
- '& span': {
3126
- fontSize: '9pt',
3127
- whiteSpace: 'nowrap',
3128
- textOverflow: 'ellipsis',
3129
- overflow: 'hidden'
3179
+ '& svg': {
3180
+ marginRight: '0 !important'
3130
3181
  }
3131
- });
3182
+ }, _styled["@container " + SOUNDINGS_CONTAINER_NAME + " (min-width: " + SOUNDINGS_CONTAINER_BREAKPOINT_PX + ")"] = {
3183
+ width: '130px',
3184
+ '& .shortText': {
3185
+ display: 'none'
3186
+ }
3187
+ }, _styled['& span'] = {
3188
+ fontSize: '9pt',
3189
+ whiteSpace: 'nowrap',
3190
+ textOverflow: 'ellipsis',
3191
+ overflow: 'hidden'
3192
+ }, _styled));
3132
3193
 
3133
3194
  var MenuOptions;
3134
3195
  (function (MenuOptions) {
@@ -3138,6 +3199,7 @@ var MenuOptions;
3138
3199
  MenuOptions["profileData"] = "profileData";
3139
3200
  })(MenuOptions || (MenuOptions = {}));
3140
3201
  var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3202
+ var _sx;
3141
3203
  var handleClick = _ref.handleClick,
3142
3204
  isOpen = _ref.isOpen,
3143
3205
  _ref$selectedSourcesA = _ref.selectedSourcesAmount,
@@ -3149,9 +3211,12 @@ var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3149
3211
  return jsxs(Stack, {
3150
3212
  direction: "row",
3151
3213
  spacing: 1,
3152
- sx: {
3153
- marginBottom: '4px'
3154
- },
3214
+ sx: (_sx = {
3215
+ marginBottom: '4px',
3216
+ overflowX: 'auto'
3217
+ }, _sx["@container " + SOUNDINGS_CONTAINER_NAME + " (min-width: " + SOUNDINGS_CONTAINER_BREAKPOINT_PX + ")"] = {
3218
+ overflowX: 'initial'
3219
+ }, _sx),
3155
3220
  children: [jsx(SoundingsTopRowButton, {
3156
3221
  "data-testid": "soundingsManagerButton",
3157
3222
  icon: jsx(Layers, {}),
@@ -3930,13 +3995,13 @@ var getLegendItem = function getLegendItem(color, text) {
3930
3995
  var HodographLegend = function HodographLegend() {
3931
3996
  return jsxs(Stack, {
3932
3997
  direction: "column",
3933
- useFlexGap: true,
3934
3998
  sx: {
3935
3999
  justifyContent: 'center',
3936
4000
  flexWrap: 'wrap',
3937
4001
  paddingLeft: 2,
3938
4002
  paddingTop: 0.5
3939
4003
  },
4004
+ useFlexGap: true,
3940
4005
  children: [getLegendItem(HODOGRAPH_COLORS[0], '0 - 1 km'), getLegendItem(HODOGRAPH_COLORS[1], '1 - 3 km'), getLegendItem(HODOGRAPH_COLORS[2], '3 - 6 km'), getLegendItem(HODOGRAPH_COLORS[3], '6 - 9 km'), getLegendItem(HODOGRAPH_COLORS[4], '9 - 19 km')]
3941
4006
  });
3942
4007
  };
@@ -4739,6 +4804,8 @@ var Soundings = function Soundings(_ref) {
4739
4804
  showTooltip = _ref$showTooltip === void 0 ? true : _ref$showTooltip,
4740
4805
  _ref$diagramType = _ref.diagramType,
4741
4806
  diagramType = _ref$diagramType === void 0 ? 'SKEWT' : _ref$diagramType;
4807
+ var instanceId = useId().replace(/:/g, '_');
4808
+ var scopedGraphId = d3GraphId + "-" + instanceId;
4742
4809
  var svgRef = useRef(null);
4743
4810
  var canvasRef = useRef(null);
4744
4811
  var pressureRef = useRef(null);
@@ -4768,7 +4835,7 @@ var Soundings = function Soundings(_ref) {
4768
4835
  height: height,
4769
4836
  margin: margin,
4770
4837
  diagramType: diagramType,
4771
- d3GraphId: d3GraphId
4838
+ d3GraphId: scopedGraphId
4772
4839
  });
4773
4840
  var svgRectangle = svgRef.current.getBoundingClientRect();
4774
4841
  svgRectRef.current = svgRectangle;
@@ -4800,7 +4867,7 @@ var Soundings = function Soundings(_ref) {
4800
4867
  minPressure: minPressure,
4801
4868
  maxPressure: maxPressure,
4802
4869
  svg: svg,
4803
- d3GraphId: d3GraphId
4870
+ d3GraphId: scopedGraphId
4804
4871
  });
4805
4872
  data.forEach(function (features, index) {
4806
4873
  var color = SOUNDING_COLORS[index] || SOUNDING_COLORS[0];
@@ -4842,7 +4909,7 @@ var Soundings = function Soundings(_ref) {
4842
4909
  return function () {
4843
4910
  d3.select(svgRefCur).selectAll('*').remove();
4844
4911
  };
4845
- }, [data, diagramType, width, height, d3GraphId, margin]);
4912
+ }, [data, diagramType, width, height, scopedGraphId, margin]);
4846
4913
  useEffect(function () {
4847
4914
  var _svgRectRef$current;
4848
4915
  if (!showTooltip || !svgRef.current) {
@@ -5859,10 +5926,10 @@ var SoundingsProfileDataTable = function SoundingsProfileDataTable(_ref2) {
5859
5926
  py: 4
5860
5927
  },
5861
5928
  children: jsx(Typography, {
5862
- variant: "body2",
5863
5929
  sx: {
5864
5930
  color: 'text.secondary'
5865
5931
  },
5932
+ variant: "body2",
5866
5933
  children: t('no-sounding-data-available')
5867
5934
  })
5868
5935
  }) : jsx(Box, {
@@ -5884,7 +5951,9 @@ var SoundingsProfileDataTable = function SoundingsProfileDataTable(_ref2) {
5884
5951
  },
5885
5952
  style: {
5886
5953
  height: '100%',
5887
- width: '100%'
5954
+ width: '100%',
5955
+ minWidth: tableMinWidth,
5956
+ overflowX: 'hidden'
5888
5957
  }
5889
5958
  })
5890
5959
  })]
@@ -6212,6 +6281,9 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6212
6281
  var locationSelections = useSelector(function (state) {
6213
6282
  return getLocationSelections(state, viewId);
6214
6283
  }, shallowEqual);
6284
+ var soundingsCollections = useSelector(function (state) {
6285
+ return getSoundingsCollections(state);
6286
+ });
6215
6287
  var diagramType = useSelector(function (state) {
6216
6288
  return getDiagramType(state, viewId);
6217
6289
  });
@@ -6224,6 +6296,9 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6224
6296
  var selectedMapIds = useSelector(function (state) {
6225
6297
  return genericSelectors.getLinkedTargetIds(state, viewId);
6226
6298
  }, shallowEqual);
6299
+ var ownedFeatureLayerIds = useSelector(function (state) {
6300
+ return genericSelectors.selectFeatureSyncLayerIdsForPanel(state, viewId);
6301
+ }, shallowEqual);
6227
6302
  var linkedPanelIdsByMapId = useSelector(function (state) {
6228
6303
  return Object.fromEntries(selectedMapIds.map(function (mapId) {
6229
6304
  return [mapId, genericSelectors.selectLinkedPanelIdsForMap(state, mapId)];
@@ -6270,23 +6345,23 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6270
6345
  // Ref for reading selectedMapPin in effects without causing dependency loops
6271
6346
  var selectedMapPinRef = React.useRef(selectedMapPin);
6272
6347
  selectedMapPinRef.current = selectedMapPin;
6273
- // Get map bbox and SRS for zoom-dependent overlap prevention
6274
- var mapBbox = useSelector(function (state) {
6275
- return mapSelectors.getBbox(state, firstLinkedMapId);
6276
- }, shallowEqual);
6277
- var mapSrs = useSelector(function (state) {
6278
- return mapSelectors.getSrs(state, firstLinkedMapId);
6279
- });
6280
6348
  var collectionsRef = React.useRef(undefined);
6281
6349
  var collections = useMemo(function () {
6350
+ // Only use instanceId for location fetching when the preset configures it, so collection-level sources (e.g. harmonie) are not affected
6351
+ var presetMap = new Map(soundingsCollections.map(function (collection) {
6352
+ return [collection.id, collection];
6353
+ }));
6282
6354
  var newCollections = sourceSelections.map(function (_ref2) {
6355
+ var _presetMap$get;
6283
6356
  var collectionId = _ref2.collectionId,
6284
6357
  url = _ref2.url,
6285
- name = _ref2.name;
6358
+ name = _ref2.name,
6359
+ instanceId = _ref2.instanceId;
6286
6360
  return {
6287
6361
  id: collectionId,
6288
6362
  url: url,
6289
- name: name || collectionId
6363
+ name: name || collectionId,
6364
+ instanceId: ((_presetMap$get = presetMap.get(collectionId)) == null ? void 0 : _presetMap$get.instanceId) !== undefined ? instanceId : undefined
6290
6365
  };
6291
6366
  });
6292
6367
  if (isEqual(newCollections, collectionsRef.current)) {
@@ -6294,9 +6369,9 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6294
6369
  }
6295
6370
  collectionsRef.current = newCollections;
6296
6371
  return newCollections;
6297
- }, [sourceSelections]);
6298
- var _useGetCollectionLoca = useGetCollectionLocations(collections, true),
6299
- rawLocationData = _useGetCollectionLoca.data;
6372
+ }, [sourceSelections, soundingsCollections]);
6373
+ var _useGetLocations = useGetLocations(collections, true),
6374
+ rawLocationData = _useGetLocations.data;
6300
6375
  var _useCheckPositionQuer = useCheckPositionQuerySupportBySource(resolvedSourceSelections),
6301
6376
  positionQuerySupportBySource = _useCheckPositionQuer.data;
6302
6377
  var _useCheckRadiusQueryS = useCheckRadiusQuerySupportBySource(resolvedSourceSelections),
@@ -6317,10 +6392,11 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6317
6392
  sourceSelections.forEach(function (source) {
6318
6393
  var selection = locationSelections == null ? void 0 : locationSelections[source.collectionId];
6319
6394
  if (typeof selection === 'string') {
6395
+ var _sourceLocations$feat;
6320
6396
  var sourceLocations = locationData == null ? void 0 : locationData.find(function (service) {
6321
6397
  return service.id === source.collectionId;
6322
6398
  });
6323
- var feature = sourceLocations == null ? void 0 : sourceLocations.features.find(function (feature) {
6399
+ var feature = sourceLocations == null || (_sourceLocations$feat = sourceLocations.features) == null ? void 0 : _sourceLocations$feat.find(function (feature) {
6324
6400
  return feature.id === selection;
6325
6401
  });
6326
6402
  if ((feature == null ? void 0 : feature.geometry.type) === 'Point') {
@@ -6335,6 +6411,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6335
6411
  var sourceLocationNames = useMemo(function () {
6336
6412
  var result = {};
6337
6413
  sourceSelections.forEach(function (source) {
6414
+ var _sourceLocations$feat2;
6338
6415
  var selection = locationSelections == null ? void 0 : locationSelections[source.collectionId];
6339
6416
  if (typeof selection !== 'string') {
6340
6417
  return;
@@ -6342,7 +6419,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6342
6419
  var sourceLocations = locationData == null ? void 0 : locationData.find(function (service) {
6343
6420
  return service.id === source.collectionId;
6344
6421
  });
6345
- var feature = sourceLocations == null ? void 0 : sourceLocations.features.find(function (feature) {
6422
+ var feature = sourceLocations == null || (_sourceLocations$feat2 = sourceLocations.features) == null ? void 0 : _sourceLocations$feat2.find(function (feature) {
6346
6423
  return feature.id === selection;
6347
6424
  });
6348
6425
  var name = feature == null ? void 0 : feature.properties.name;
@@ -6396,7 +6473,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6396
6473
  var locationFeatures = (locationData || []).flatMap(function (_ref3) {
6397
6474
  var serviceId = _ref3.id,
6398
6475
  features = _ref3.features;
6399
- return features.map(function (feature) {
6476
+ return (features != null ? features : []).map(function (feature) {
6400
6477
  // Check if this feature is highlighted by its source (for sources without position support)
6401
6478
  var isHighlightedBySource = highlightedFeaturesBySource[serviceId] === feature.id;
6402
6479
  // Get the source index to determine color (same color as sounding diagram)
@@ -6512,54 +6589,20 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6512
6589
  });
6513
6590
  // Small fixed offset for markers sharing same grid position (~200m)
6514
6591
  var SOURCE_OVERLAP_OFFSET_DEG = 0.002;
6515
- // Calculate zoom-dependent minimum separation from clicked marker
6516
- // Handle different map projections for bbox interpretation
6517
- var MARKER_DIAMETER_PIXELS = 5; // Small separation - only push when very close to clicked marker
6518
- var ASSUMED_MAP_WIDTH_PIXELS = 800;
6519
- var MIN_CLICKED_SEPARATION_DEG = 0.005; // Minimum ~500m
6520
- var minClickedSeparationDeg = MIN_CLICKED_SEPARATION_DEG;
6521
- if ((mapBbox == null ? void 0 : mapBbox.right) != null && (mapBbox == null ? void 0 : mapBbox.left) != null) {
6522
- var bboxExtent = mapBbox.right - mapBbox.left;
6523
- var extentDeg;
6524
- // Convert bbox extent to degrees based on map projection
6525
- if (mapSrs === 'EPSG:4326') {
6526
- // Geographic projection - bbox already in degrees
6527
- extentDeg = bboxExtent;
6528
- } else if (mapSrs === 'EPSG:3857') {
6529
- // Web Mercator - convert meters to degrees
6530
- var WEB_MERCATOR_MAX = 20037508.34; // Half of Earth's circumference in meters
6531
- extentDeg = bboxExtent * 180 / WEB_MERCATOR_MAX;
6532
- } else if (Math.abs(bboxExtent) > 360) {
6533
- // Other projections: use heuristic based on magnitude
6534
- // If extent > 360, assume it's in meters/similar units
6535
- // Likely meters - use Web Mercator conversion as approximation
6536
- var _WEB_MERCATOR_MAX = 20037508.34;
6537
- extentDeg = bboxExtent * 180 / _WEB_MERCATOR_MAX;
6538
- } else {
6539
- // Likely already in degrees or degree-like units
6540
- extentDeg = bboxExtent;
6541
- }
6542
- minClickedSeparationDeg = Math.max(MIN_CLICKED_SEPARATION_DEG, extentDeg / ASSUMED_MAP_WIDTH_PIXELS * MARKER_DIAMETER_PIXELS);
6543
- }
6544
- var clickedLon = targetLocation[0],
6545
- clickedLat = targetLocation[1];
6546
- // Place markers at their true geographic positions with two adjustments:
6547
- // 1. Offset if multiple sources share the same grid point
6548
- // 2. Push away from clicked marker if too close (zoom-dependent)
6592
+ // Place markers at their true geographic positions.
6593
+ // The only adjustment is a small fixed offset when multiple sources share the same grid point.
6549
6594
  return gridPoints.map(function (item) {
6550
6595
  var source = item.source,
6551
6596
  sourceIndex = item.sourceIndex,
6552
6597
  gridPoint = item.gridPoint;
6553
6598
  var baseLon = gridPoint[0],
6554
6599
  baseLat = gridPoint[1];
6555
- // Step 1: Handle source overlap (multiple sources at same grid position)
6556
6600
  var key = baseLon.toFixed(6) + "," + baseLat.toFixed(6);
6557
6601
  var group = positionGroups.get(key) || [];
6558
6602
  var lon = baseLon;
6559
6603
  var lat = baseLat;
6560
6604
  if (group.length > 1) {
6561
6605
  // Multiple sources share this grid point - offset in circle around it
6562
- // Direction is based on index (arbitrary but consistent)
6563
6606
  var indexInGroup = group.findIndex(function (gr) {
6564
6607
  return gr.sourceIndex === sourceIndex;
6565
6608
  });
@@ -6567,25 +6610,6 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6567
6610
  lon = baseLon + SOURCE_OVERLAP_OFFSET_DEG * Math.cos(offsetAngle);
6568
6611
  lat = baseLat + SOURCE_OVERLAP_OFFSET_DEG * Math.sin(offsetAngle);
6569
6612
  }
6570
- // Step 2: Check overlap with clicked marker
6571
- // Account for longitude convergence at higher latitudes (1° lon = cos(lat) * 1° lat in distance)
6572
- var meanLat = (lat + clickedLat) / 2;
6573
- var cosLat = Math.cos(meanLat * Math.PI / 180);
6574
- var deltaLon = lon - clickedLon;
6575
- var deltaLat = lat - clickedLat;
6576
- // Scale longitude difference by cos(lat) for accurate distance
6577
- var scaledDeltaLon = deltaLon * cosLat;
6578
- var distanceToClicked = Math.sqrt(scaledDeltaLon * scaledDeltaLon + deltaLat * deltaLat);
6579
- if (distanceToClicked < minClickedSeparationDeg) {
6580
- // Too close to clicked marker - push outward preserving direction
6581
- // Direction is from clicked point to marker's current position (in scaled coordinates)
6582
- var directionAngle = distanceToClicked > 0.0001 ? Math.atan2(deltaLat, scaledDeltaLon) :
6583
- // If exactly on clicked point, use direction to original grid point
6584
- Math.atan2(baseLat - clickedLat, (baseLon - clickedLon) * cosLat);
6585
- // When applying offset, divide lon component by cos(lat) to get correct degree offset
6586
- lon = clickedLon + minClickedSeparationDeg * Math.cos(directionAngle) / cosLat;
6587
- lat = clickedLat + minClickedSeparationDeg * Math.sin(directionAngle);
6588
- }
6589
6613
  return {
6590
6614
  type: 'Feature',
6591
6615
  geometry: {
@@ -6602,7 +6626,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6602
6626
  }
6603
6627
  };
6604
6628
  });
6605
- }, [isFreePositionClick, targetLocation, gridPointData, sourceSelections, shouldHideLocationMarkers, mapBbox, mapSrs]);
6629
+ }, [isFreePositionClick, targetLocation, gridPointData, sourceSelections, shouldHideLocationMarkers]);
6606
6630
  // Combine location features with grid point features for dispatch to map
6607
6631
  var combinedGeoJson = useMemo(function () {
6608
6632
  if (gridPointFeatures.length === 0) {
@@ -6646,7 +6670,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6646
6670
  var allNearestFeatures = [];
6647
6671
  sourceSelections.forEach(function (source) {
6648
6672
  if (source.collectionId && targetLocation) {
6649
- var _sourceData$features, _positionQuerySupport;
6673
+ var _sourceData$features, _positionQuerySupport, _radiusQuerySupportBy, _gridPointData$source;
6650
6674
  // Get features owned by this source
6651
6675
  var sourceData = locationData == null ? void 0 : locationData.find(function (service) {
6652
6676
  return service.id === source.collectionId;
@@ -6665,17 +6689,29 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6665
6689
  // Detect if user clicked directly on a location marker owned by this source
6666
6690
  // A direct click means selectedFeature has an id that matches a feature owned by this source
6667
6691
  var isDirectClickOnOwnedMarker = !!(currentSelectedFeature != null && currentSelectedFeature.id) && (nearestOwnedFeature == null ? void 0 : nearestOwnedFeature.id) === (currentSelectedFeature == null ? void 0 : currentSelectedFeature.id);
6692
+ // When clicking a free position, snap to the nearest grid point from the radius query
6693
+ // so the sounding data comes from an actual model grid point rather than an arbitrary coordinate.
6694
+ var supportsRadius = (_radiusQuerySupportBy = radiusQuerySupportBySource[source.collectionId]) != null ? _radiusQuerySupportBy : false;
6695
+ var isGridPointMarkerClick = typeof (currentMapPin == null ? void 0 : currentMapPin.id) === 'string' && currentMapPin.id.startsWith('grid-point-');
6696
+ var isLocalFreePositionClick = !(currentSelectedFeature != null && currentSelectedFeature.id) || isGridPointMarkerClick;
6697
+ var gridPoint = isLocalFreePositionClick && supportsRadius ? gridPointData == null || (_gridPointData$source = gridPointData[source.collectionId]) == null ? void 0 : _gridPointData$source.gridPoint : undefined;
6698
+ var radiusPending = isLocalFreePositionClick && supportsRadius && !(gridPointData != null && gridPointData[source.collectionId]);
6668
6699
  // Determine the location to use:
6669
6700
  // 1. If user clicked directly on a marker owned by this source: use that marker's ID (location query)
6670
- // 2. If position query is supported AND not a direct click: use exact clicked coordinates (position query)
6701
+ // 2. If position query is supported AND not a direct click: use nearest grid point coordinates
6702
+ // if available (from radius query), otherwise fall back to exact clicked coordinates
6671
6703
  // 3. If position query is NOT supported: fall back to nearest location marker (location query)
6672
6704
  var newLocation = locationSelectionsRef.current[source.collectionId];
6673
6705
  if (isDirectClickOnOwnedMarker && nearestOwnedFeature) {
6674
6706
  // Direct click on marker - use location query with marker ID
6675
6707
  newLocation = nearestOwnedFeature.id;
6676
6708
  } else if (supportsPosition && targetLocation) {
6677
- // Use position query with exact coordinates
6678
- newLocation = targetLocation;
6709
+ if (radiusPending) {
6710
+ // Radius query in flight — defer until gridPointData arrives
6711
+ return;
6712
+ }
6713
+ // Snap to nearest grid point when available, otherwise use exact clicked coordinates
6714
+ newLocation = gridPoint != null ? gridPoint : targetLocation;
6679
6715
  } else if (nearestOwnedFeature) {
6680
6716
  // Fall back to location query with nearest marker
6681
6717
  newLocation = nearestOwnedFeature.id;
@@ -6716,7 +6752,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6716
6752
  isProcessingLocationUpdateRef.current = false;
6717
6753
  }, 0);
6718
6754
  // Note: selectedFeature and selectedMapPin are read from refs to avoid dependency cycles
6719
- }, [dispatch, locationData, positionQuerySupportBySource, targetLocation, sourceSelections, viewId, updateHighlightedFeaturesBySource]);
6755
+ }, [dispatch, locationData, positionQuerySupportBySource, radiusQuerySupportBySource, gridPointData, targetLocation, sourceSelections, viewId, updateHighlightedFeaturesBySource]);
6720
6756
  // Effect 2 was removed - it was redundant with effect 1 which handles all cases
6721
6757
  // (with or without selectedFeature, falls back to targetLocation if no nearby feature)
6722
6758
  useEffect(function () {
@@ -6759,7 +6795,8 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6759
6795
  return;
6760
6796
  }
6761
6797
  if (typeof selectedLocation === 'string') {
6762
- var foundFeature = serviceData.features.find(function (feature) {
6798
+ var _serviceData$features;
6799
+ var foundFeature = (_serviceData$features = serviceData.features) == null ? void 0 : _serviceData$features.find(function (feature) {
6763
6800
  return feature.id === selectedLocation;
6764
6801
  });
6765
6802
  if ((foundFeature == null ? void 0 : foundFeature.geometry.type) === 'Point') {
@@ -6796,29 +6833,35 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6796
6833
  });
6797
6834
  }
6798
6835
  if (featureNeedsUpdate) {
6799
- dispatch(genericActions.addFeatureSyncState({
6800
- panelId: viewId,
6801
- data: {
6802
- selectedFeatureId: selectedLocation
6803
- }
6804
- }));
6836
+ ownedFeatureLayerIds.forEach(function (layerId) {
6837
+ dispatch(layerActions.setSelectedFeatures({
6838
+ layerId: layerId,
6839
+ selectedFeatureIds: [selectedLocation]
6840
+ }));
6841
+ });
6805
6842
  }
6806
6843
  }
6807
6844
  } else if (Array.isArray(selectedLocation)) {
6808
6845
  var _lon = selectedLocation[0],
6809
6846
  _lat = selectedLocation[1];
6810
6847
  var _currentMapPin = selectedMapPinRef.current;
6811
- var needsUpdate = (_currentMapPin == null ? void 0 : _currentMapPin.lon) !== _lon || (_currentMapPin == null ? void 0 : _currentMapPin.lat) !== _lat;
6812
- if (needsUpdate) {
6813
- selectedMapIds.forEach(function (mapId) {
6814
- dispatch(mapActions.setMapPinLocation({
6815
- mapId: mapId,
6816
- mapPinLocation: {
6817
- lon: _lon,
6818
- lat: _lat
6819
- }
6820
- }));
6821
- });
6848
+ // When locationSelections was snapped to a grid point (differs from the clicked
6849
+ // position), keep the map pin at the clicked position so targetLocation stays at the
6850
+ // click and the legend can compute a meaningful distance to the data origin.
6851
+ var isGridPointSnap = targetLocationRef.current !== undefined && !isEqual(selectedLocation, targetLocationRef.current);
6852
+ if (!isGridPointSnap) {
6853
+ var needsUpdate = (_currentMapPin == null ? void 0 : _currentMapPin.lon) !== _lon || (_currentMapPin == null ? void 0 : _currentMapPin.lat) !== _lat;
6854
+ if (needsUpdate) {
6855
+ selectedMapIds.forEach(function (mapId) {
6856
+ dispatch(mapActions.setMapPinLocation({
6857
+ mapId: mapId,
6858
+ mapPinLocation: {
6859
+ lon: _lon,
6860
+ lat: _lat
6861
+ }
6862
+ }));
6863
+ });
6864
+ }
6822
6865
  }
6823
6866
  }
6824
6867
  });
@@ -6826,7 +6869,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6826
6869
  setTimeout(function () {
6827
6870
  isProcessingLocationUpdateRef.current = false;
6828
6871
  }, 0);
6829
- }, [locationData, locationSelections, sourceSelections, selectedMapIds, dispatch, viewId, updateHighlightedFeaturesBySource
6872
+ }, [locationData, locationSelections, sourceSelections, selectedMapIds, ownedFeatureLayerIds, dispatch, viewId, updateHighlightedFeaturesBySource
6830
6873
  // Note: highlightedFeaturesBySource intentionally excluded - we use highlightedFeaturesBySourceRef.current
6831
6874
  // inside this effect, and including the state would cause infinite loops since we call
6832
6875
  // updateHighlightedFeaturesBySource within the effect
@@ -6875,7 +6918,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6875
6918
  backgroundColor: 'geowebColors.background.surfaceApp',
6876
6919
  position: 'relative',
6877
6920
  containerType: 'inline-size',
6878
- containerName: 'soundings-container'
6921
+ containerName: SOUNDINGS_CONTAINER_NAME
6879
6922
  },
6880
6923
  children: [jsx(Box, {
6881
6924
  sx: {
@@ -6981,6 +7024,7 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6981
7024
  });
6982
7025
  };
6983
7026
 
7027
+ var defaultInstanceId = 'latest-0';
6984
7028
  var extractVerticalRange = function extractVerticalRange(collection, selectedInstanceId) {
6985
7029
  return getVerticalRangeFromInstance(collection.instances.find(function (instance) {
6986
7030
  return instance.id === selectedInstanceId;
@@ -7007,7 +7051,11 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7007
7051
  order = _ref$order === void 0 ? 0 : _ref$order,
7008
7052
  _ref$isLoading = _ref.isLoading,
7009
7053
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
7010
- error = _ref.error;
7054
+ error = _ref.error,
7055
+ _ref$startSize = _ref.startSize,
7056
+ startSize = _ref$startSize === void 0 ? {
7057
+ width: 320
7058
+ } : _ref$startSize;
7011
7059
  var _useSoundingsTranslat = useSoundingsTranslation(),
7012
7060
  t = _useSoundingsTranslat.t;
7013
7061
  return jsxs(ToolContainerDraggable, {
@@ -7022,9 +7070,7 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7022
7070
  top: 40,
7023
7071
  left: 50
7024
7072
  },
7025
- startSize: {
7026
- width: 320
7027
- },
7073
+ startSize: startSize,
7028
7074
  title: t('sources'),
7029
7075
  children: [!!isLoading && jsx(LinearProgress, {
7030
7076
  sx: {
@@ -7039,14 +7085,16 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7039
7085
  pr: 1
7040
7086
  },
7041
7087
  children: soundingsCollections && soundingsCollections.length > 0 ? soundingsCollections.map(function (collection) {
7042
- var _collection$instances;
7043
7088
  var _ref2 = sourceSelections[collection.id] || {},
7044
7089
  isChecked = _ref2.isChecked,
7045
7090
  instanceId = _ref2.instanceId,
7046
7091
  url = _ref2.url;
7047
7092
  var sourceUrl = url || collection.url;
7048
7093
  var hasInstances = collection.instances.length > 0;
7049
- var selectedInstanceId = instanceId || ((_collection$instances = collection.instances[0]) == null ? void 0 : _collection$instances.id) || undefined;
7094
+ var selectedInstanceId = hasInstances ? instanceId || defaultInstanceId : undefined;
7095
+ var hasNonExistingInstanceId = selectedInstanceId && !referenceTimeUtils.isRelativeReferenceTime(selectedInstanceId) && !collection.instances.some(function (instance) {
7096
+ return instance.id === selectedInstanceId;
7097
+ });
7050
7098
  return jsxs(ListItem, {
7051
7099
  disablePadding: true,
7052
7100
  children: [jsx(ListItemIcon, {
@@ -7066,7 +7114,7 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7066
7114
  });
7067
7115
  }
7068
7116
  })
7069
- }), jsxs(StyledSelect, {
7117
+ }), jsxs(TooltipSelect, {
7070
7118
  additionalStyling: {
7071
7119
  width: 'calc(100% - 42px)'
7072
7120
  },
@@ -7081,31 +7129,54 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7081
7129
  });
7082
7130
  },
7083
7131
  renderValue: function renderValue(value) {
7084
- return jsx(Box, {
7132
+ return jsxs(Box, {
7085
7133
  sx: {
7086
- textOverflow: 'ellipsis',
7087
- overflow: 'hidden'
7134
+ display: 'flex',
7135
+ alignItems: 'center',
7136
+ width: '100%',
7137
+ gap: 1
7088
7138
  },
7089
- children: jsxs(Box, {
7139
+ children: [jsx(Box, {
7140
+ sx: {
7141
+ flex: '4 1 0',
7142
+ minWidth: 0,
7143
+ textOverflow: 'ellipsis',
7144
+ overflow: 'hidden',
7145
+ whiteSpace: 'nowrap'
7146
+ },
7147
+ children: collection.name
7148
+ }), jsxs(Box, {
7090
7149
  sx: {
7091
- display: 'flex'
7150
+ flex: '1 1 0',
7151
+ minWidth: 0,
7152
+ display: 'flex',
7153
+ alignItems: 'center',
7154
+ justifyContent: 'space-between',
7155
+ gap: 0.5
7092
7156
  },
7093
7157
  children: [jsx(Box, {
7094
7158
  sx: {
7095
- minWidth: 200
7096
- },
7097
- children: collection.name
7098
- }), jsx(Box, {
7099
- sx: {
7159
+ minWidth: 0,
7100
7160
  textOverflow: 'ellipsis',
7101
- overflow: 'hidden'
7161
+ overflow: 'hidden',
7162
+ whiteSpace: 'nowrap'
7102
7163
  },
7103
7164
  children: getSelectedDisplayValue(value)
7104
- })]
7105
- })
7165
+ }), hasNonExistingInstanceId ? jsx(Box, {
7166
+ sx: {
7167
+ '& .MuiSvgIcon-root': {
7168
+ fill: 'currentcolor!important'
7169
+ }
7170
+ },
7171
+ children: jsx(AlertIcon, {
7172
+ severity: "error"
7173
+ })
7174
+ }) : null]
7175
+ })]
7106
7176
  });
7107
7177
  },
7108
7178
  skipLocalStyling: false,
7179
+ tooltip: collection.name + ": " + getSelectedDisplayValue(selectedInstanceId || t('noInstancesAvailable')),
7109
7180
  value: selectedInstanceId || t('noInstancesAvailable'),
7110
7181
  children: [!hasInstances && jsx(MenuItem, {
7111
7182
  disabled: true,
@@ -7120,10 +7191,12 @@ var SoundingsSourceMenu = function SoundingsSourceMenu(_ref) {
7120
7191
  value: option.token,
7121
7192
  children: option.label
7122
7193
  }, option.token);
7123
- }), collection.instances.map(function (instance) {
7124
- return jsx(MenuItem, {
7194
+ }), referenceTimeUtils.extendCollectionInstances(collection.instances, selectedInstanceId).map(function (instance, currentIndex) {
7195
+ return jsxs(MenuItem, {
7125
7196
  value: instance.id,
7126
- children: getDisplayValue(instance.id)
7197
+ children: [getDisplayValue(instance.id), currentIndex === collection.instances.length && jsx(AlertIcon, {
7198
+ severity: "error"
7199
+ })]
7127
7200
  }, instance.id);
7128
7201
  })]
7129
7202
  })]
@@ -7267,6 +7340,7 @@ var LocationsMenu = function LocationsMenu(_ref2) {
7267
7340
  setSearchFilter = _useState[1];
7268
7341
  var _useSoundingsTranslat = useSoundingsTranslation(),
7269
7342
  t = _useSoundingsTranslat.t;
7343
+ var listContainerRef = useRef(null);
7270
7344
  var filteredResults = useMemo(function () {
7271
7345
  return services == null ? void 0 : services.map(function (service) {
7272
7346
  var filteredFeatures = service.features ? service.features.filter(function (feature) {
@@ -7278,6 +7352,7 @@ var LocationsMenu = function LocationsMenu(_ref2) {
7278
7352
  });
7279
7353
  });
7280
7354
  }, [services, searchFilter]);
7355
+ var heightObserver = useResizeObserver(listContainerRef, filteredResults);
7281
7356
  var isChecked = function isChecked(sourceId, locationId) {
7282
7357
  return selectedLocations[sourceId] === locationId;
7283
7358
  };
@@ -7310,58 +7385,65 @@ var LocationsMenu = function LocationsMenu(_ref2) {
7310
7385
  margin: 1
7311
7386
  },
7312
7387
  children: t('locations-menu-warning')
7313
- }) : jsxs(Grid, {
7314
- container: true,
7315
- children: [jsx(Box, {
7316
- sx: {
7317
- width: '100%',
7318
- padding: 1,
7319
- position: 'sticky',
7320
- top: 0,
7321
- zIndex: 1,
7322
- backgroundColor: 'geowebColors.background.surfaceApp'
7323
- },
7324
- children: jsx(SearchField, {
7325
- searchFilter: searchFilter,
7326
- setSearchFilter: setSearchFilter,
7327
- small: true
7328
- })
7329
- }), filteredResults.map(function (service) {
7330
- return jsx(Fragment$1, {
7331
- children: jsx(CustomAccordion, {
7332
- amountOfItems: service.features.length,
7333
- defaultExpanded: false,
7334
- sx: {
7335
- width: '100%',
7336
- margin: '0 8px 2px 8px',
7337
- '.MuiAccordionDetails-root': {
7338
- padding: 0
7339
- },
7340
- '.MuiAccordionSummary-root': {
7341
- minHeight: '40px'
7342
- },
7343
- '.MuiAccordionSummary-content': {
7344
- paddingLeft: 3
7345
- }
7346
- },
7347
- title: service.name,
7348
- children: jsx(List, {
7349
- rowComponent: RowComponent,
7350
- rowCount: service.features.length,
7351
- rowHeight: 40,
7352
- rowProps: {
7353
- service: service,
7354
- isChecked: isChecked,
7355
- updateSelectedLocation: updateSelectedLocation
7388
+ }) : jsx(Box, {
7389
+ ref: listContainerRef,
7390
+ sx: {
7391
+ width: '100%',
7392
+ height: '100%'
7393
+ },
7394
+ children: jsxs(Grid, {
7395
+ container: true,
7396
+ children: [jsx(Box, {
7397
+ sx: {
7398
+ width: '100%',
7399
+ padding: 1,
7400
+ position: 'sticky',
7401
+ top: 0,
7402
+ zIndex: 1,
7403
+ backgroundColor: 'geowebColors.background.surfaceApp'
7404
+ },
7405
+ children: jsx(SearchField, {
7406
+ searchFilter: searchFilter,
7407
+ setSearchFilter: setSearchFilter,
7408
+ small: true
7409
+ })
7410
+ }), filteredResults.map(function (service) {
7411
+ return jsx(Fragment$1, {
7412
+ children: jsx(CustomAccordion, {
7413
+ amountOfItems: service.features.length,
7414
+ defaultExpanded: false,
7415
+ sx: {
7416
+ width: '100%',
7417
+ margin: '0 8px 2px 8px',
7418
+ '.MuiAccordionDetails-root': {
7419
+ padding: 0
7420
+ },
7421
+ '.MuiAccordionSummary-root': {
7422
+ minHeight: '40px'
7423
+ },
7424
+ '.MuiAccordionSummary-content': {
7425
+ paddingLeft: 3
7426
+ }
7356
7427
  },
7357
- style: {
7358
- height: 320,
7359
- width: '100%'
7360
- }
7428
+ title: service.name,
7429
+ children: jsx(List, {
7430
+ rowComponent: RowComponent,
7431
+ rowCount: service.features.length,
7432
+ rowHeight: 40,
7433
+ rowProps: {
7434
+ service: service,
7435
+ isChecked: isChecked,
7436
+ updateSelectedLocation: updateSelectedLocation
7437
+ },
7438
+ style: {
7439
+ height: heightObserver,
7440
+ width: '100%'
7441
+ }
7442
+ })
7361
7443
  })
7362
- })
7363
- }, service.id);
7364
- })]
7444
+ }, service.id);
7445
+ })]
7446
+ })
7365
7447
  })]
7366
7448
  });
7367
7449
  };
@@ -7401,10 +7483,10 @@ var LocationsMenuConnect = function LocationsMenuConnect(_ref) {
7401
7483
  dispatch(soundingsActions.setSoundingsCollections(soundingsCollections));
7402
7484
  }
7403
7485
  }, [dispatch, soundingsCollections]);
7404
- var _useGetCollectionLoca = useGetCollectionLocations(collections, isDialogOpen),
7405
- data = _useGetCollectionLoca.data,
7406
- isPending = _useGetCollectionLoca.isPending,
7407
- error = _useGetCollectionLoca.error;
7486
+ var _useGetLocations = useGetLocations(collections, isDialogOpen),
7487
+ data = _useGetLocations.data,
7488
+ isPending = _useGetLocations.isPending,
7489
+ error = _useGetLocations.error;
7408
7490
  var services = useMemo(function () {
7409
7491
  return (data == null ? void 0 : data.filter(function (service) {
7410
7492
  return selectedSourceIds.includes(service.id);