@opengeoweb/sigmet-airmet 4.17.0 → 4.18.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/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './lib/components/ProductList';
5
5
  export * from './lib/components/MetInfoWrapper';
6
6
  export { createApi } from './lib/utils/api';
7
7
  export * from './lib/types';
8
+ export * from './lib/components/ComponentsLookUp';
package/index.esm.js CHANGED
@@ -3,12 +3,12 @@ import React__default from 'react';
3
3
  import { Box, Button, FormControlLabel, Radio, Grid, Typography, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, LinearProgress, List, ListItem, Backdrop, CircularProgress } from '@mui/material';
4
4
  import { useFormContext } from 'react-hook-form';
5
5
  import { useDraftFormHelpers, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
6
- import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance } from '@opengeoweb/api';
6
+ import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, ApiProvider } from '@opengeoweb/api';
7
7
  import produce, { produce as produce$1 } from 'immer';
8
8
  import * as turf from '@turf/turf';
9
9
  import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
10
10
  import moment from 'moment';
11
- import { ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller } from '@opengeoweb/shared';
11
+ import { ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
12
12
  import { layerTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, MapViewLayer, TimeSliderConnect, LegendConnect, DockedLayerManagerConnect } from '@opengeoweb/core';
13
13
  import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
14
14
  import { debounce } from 'lodash';
@@ -294,10 +294,10 @@ var StartOrEndDrawing;
294
294
 
295
295
  var srsAndBboxDefault = {
296
296
  bbox: {
297
- left: -1205884.85699446,
298
- bottom: 5808323.764379622,
299
- right: 2219822.701688853,
300
- top: 8298305.647311475
297
+ left: -911501,
298
+ right: 3738819,
299
+ top: 11688874,
300
+ bottom: 5930186
301
301
  },
302
302
  srs: 'EPSG:3857'
303
303
  };
@@ -443,7 +443,10 @@ var geoJSONTemplate = {
443
443
  };
444
444
 
445
445
  var getHoursBeforeValidity = function getHoursBeforeValidity(phenomenon, fir, config) {
446
- if (!fir) return 4;
446
+ if (!fir) {
447
+ return 4;
448
+ }
449
+
447
450
  var _config$fir_areas$fir = config.fir_areas[fir],
448
451
  hours_before_validity = _config$fir_areas$fir.hours_before_validity,
449
452
  va_hours_before_validity = _config$fir_areas$fir.va_hours_before_validity,
@@ -463,7 +466,10 @@ var getHoursBeforeValidity = function getHoursBeforeValidity(phenomenon, fir, co
463
466
  }
464
467
  };
465
468
  var getMaxHoursOfValidity = function getMaxHoursOfValidity(phenomenon, fir, config) {
466
- if (!fir) return 4;
469
+ if (!fir) {
470
+ return 4;
471
+ }
472
+
467
473
  var _config$fir_areas$fir2 = config.fir_areas[fir],
468
474
  max_hours_of_validity = _config$fir_areas$fir2.max_hours_of_validity,
469
475
  va_max_hours_of_validity = _config$fir_areas$fir2.va_max_hours_of_validity,
@@ -595,13 +601,25 @@ var getFirOptions = function getFirOptions(productConfig) {
595
601
  return optionsFIR;
596
602
  };
597
603
  var getLevelInFeet = function getLevelInFeet(level, unit) {
598
- if (LevelUnits[unit] === 'm') return level / 0.3048;
599
- if (LevelUnits[unit] === 'FL') return level * 100;
604
+ if (LevelUnits[unit] === 'm') {
605
+ return level / 0.3048;
606
+ }
607
+
608
+ if (LevelUnits[unit] === 'FL') {
609
+ return level * 100;
610
+ }
611
+
600
612
  return level;
601
613
  };
602
614
  var isLevelLower = function isLevelLower(ownValue, ownUnit, otherValue, otherUnit) {
603
- if (typeof ownValue === 'string' && !ownValue.length) return true;
604
- if (ownUnit === otherUnit) return ownValue < otherValue; // not same units - convert both to feet and compare
615
+ if (typeof ownValue === 'string' && !ownValue.length) {
616
+ return true;
617
+ }
618
+
619
+ if (ownUnit === otherUnit && typeof ownValue === 'number') {
620
+ return ownValue < otherValue;
621
+ } // not same units - convert both to feet and compare
622
+
605
623
 
606
624
  var ownValueFeet = getLevelInFeet(ownValue, ownUnit);
607
625
  var otherValueFeet = getLevelInFeet(otherValue, otherUnit);
@@ -626,7 +644,10 @@ var getDialogtitle = function getDialogtitle(product, productType) {
626
644
  return "".concat(productName, " Cancels ").concat(product.cancelsAirmetSequenceId);
627
645
  };
628
646
  var getProductFormMode = function getProductFormMode(canBeOptions, productListItem) {
629
- if (productListItem === null) return 'new';
647
+ if (productListItem === null) {
648
+ return 'new';
649
+ }
650
+
630
651
  return canBeOptions.includes('PUBLISHED') ? 'edit' : 'view';
631
652
  };
632
653
  var buttonStyle = {
@@ -712,7 +733,7 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(can
712
733
  })));
713
734
  };
714
735
  var hasValue = function hasValue(value) {
715
- return value !== null && value.toString() !== 'NaN';
736
+ return value !== null && value.toString() !== 'NaN' && value !== '';
716
737
  };
717
738
  var prepareFormValues = function prepareFormValues(product) {
718
739
  return Object.keys(product).reduce(function (list, key) {
@@ -770,9 +791,19 @@ var createAirmetPostParameter = function createAirmetPostParameter(airmetToPost,
770
791
  };
771
792
  var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, productType) {
772
793
  var product = productType.toUpperCase();
773
- if (action === 'CLOSED') return "Close ".concat(product);
774
- if (action === 'DISCARDED') return "Discard ".concat(product);
775
- if (action === 'PUBLISHED') return 'Publish';
794
+
795
+ if (action === 'CLOSED') {
796
+ return "Close ".concat(product);
797
+ }
798
+
799
+ if (action === 'DISCARDED') {
800
+ return "Discard ".concat(product);
801
+ }
802
+
803
+ if (action === 'PUBLISHED') {
804
+ return 'Publish';
805
+ }
806
+
776
807
  return "Cancel ".concat(product);
777
808
  };
778
809
  var getConfirmationDialogContent = function getConfirmationDialogContent(action, productType) {
@@ -782,7 +813,9 @@ var getConfirmationDialogContent = function getConfirmationDialogContent(action,
782
813
  return "Are you sure you would like to discard this ".concat(product, "? Its properties will be lost");
783
814
  }
784
815
 
785
- if (action === 'CLOSED') return 'Do you want to save any changes made?';
816
+ if (action === 'CLOSED') {
817
+ return 'Do you want to save any changes made?';
818
+ }
786
819
 
787
820
  if (action === 'PUBLISHED') {
788
821
  return "Are you sure you want to publish this ".concat(product, "?");
@@ -916,6 +949,11 @@ var triggerValidations = function triggerValidations(fieldNames, getValues, trig
916
949
  }
917
950
  });
918
951
  };
952
+ var getProjection = function getProjection(productConfig) {
953
+ var _a;
954
+
955
+ return ((_a = productConfig.mapPreset) === null || _a === void 0 ? void 0 : _a.proj) || undefined;
956
+ };
919
957
 
920
958
  var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selectionType) {
921
959
  switch (selectionType) {
@@ -943,7 +981,10 @@ var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selecti
943
981
 
944
982
 
945
983
  var addFeatureProperties = function addFeatureProperties(geojson, featureProperties) {
946
- if (!geojson) return null;
984
+ if (!geojson) {
985
+ return null;
986
+ }
987
+
947
988
  return produce(geojson, function (draft) {
948
989
  if (draft.features && draft.features.length > 0 && draft.features[0].properties) {
949
990
  Object.keys(featureProperties).forEach(function (key) {
@@ -1053,7 +1094,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
1053
1094
  setLayersDrawModes(newGeoJSONDrawMode);
1054
1095
  var intersections = createInterSections(_cleanGeoJSON);
1055
1096
  setLayerGeoJSONs(intersections);
1056
- if (updateCallback) updateCallback(intersections);
1097
+
1098
+ if (updateCallback) {
1099
+ updateCallback(intersections);
1100
+ }
1101
+
1057
1102
  break;
1058
1103
  }
1059
1104
 
@@ -1076,7 +1121,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
1076
1121
  var _intersections = createInterSections(_cleanGeoJSON2);
1077
1122
 
1078
1123
  setLayerGeoJSONs(_intersections);
1079
- if (updateCallback) updateCallback(_intersections);
1124
+
1125
+ if (updateCallback) {
1126
+ updateCallback(_intersections);
1127
+ }
1128
+
1080
1129
  break;
1081
1130
  }
1082
1131
 
@@ -1089,7 +1138,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
1089
1138
  var _intersections2 = createInterSections(_cleanGeoJSON3);
1090
1139
 
1091
1140
  setLayerGeoJSONs(_intersections2);
1092
- if (updateCallback) updateCallback(_intersections2);
1141
+
1142
+ if (updateCallback) {
1143
+ updateCallback(_intersections2);
1144
+ }
1145
+
1093
1146
  break;
1094
1147
  }
1095
1148
  }
@@ -2258,7 +2311,9 @@ var noIntersectionMessage = 'The end position needs to be (partly) inside the FI
2258
2311
  var maximum6PointsMessage = 'The end position drawing allows a maximum of 6 individual points';
2259
2312
 
2260
2313
  var _validateMovementSteps = function validateMovementSteps(value, unit, productConfig, selectedFIR) {
2261
- if (isEmpty(value)) return true;
2314
+ if (isEmpty(value)) {
2315
+ return true;
2316
+ }
2262
2317
 
2263
2318
  var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
2264
2319
  _getActiveFIRArea$mov = _getActiveFIRArea.movement_rounding_kt,
@@ -2934,7 +2989,9 @@ var getInvalidSurfaceVisibilityFrom750StepsMessage = function getInvalidSurfaceV
2934
2989
  };
2935
2990
 
2936
2991
  var _validateSurfaceVisibility = function validateSurfaceVisibility(value, productConfig, selectedFIR) {
2937
- if (isEmpty(value)) return true;
2992
+ if (isEmpty(value)) {
2993
+ return true;
2994
+ }
2938
2995
 
2939
2996
  var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
2940
2997
  _getActiveFIRArea$vis = _getActiveFIRArea.visibility_rounding_below,
@@ -3064,7 +3121,9 @@ var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirecti
3064
3121
  };
3065
3122
 
3066
3123
  var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value, productConfig, selectedFIR) {
3067
- if (isEmpty(value)) return true;
3124
+ if (isEmpty(value)) {
3125
+ return true;
3126
+ }
3068
3127
 
3069
3128
  var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
3070
3129
  _getActiveFIRArea$win = _getActiveFIRArea.wind_direction_rounding,
@@ -3741,6 +3800,7 @@ var allowOneGeoJSONFeature = function allowOneGeoJSONFeature(mode, geojson) {
3741
3800
  var MapViewGeoJson = function MapViewGeoJson(_ref) {
3742
3801
  var geoJSONs = _ref.geoJSONs,
3743
3802
  initialBaseLayers = _ref.baseLayers,
3803
+ initialProjection = _ref.projection,
3744
3804
  _ref$setLayerGeoJSONs = _ref.setLayerGeoJSONs,
3745
3805
  setLayerGeoJSONs = _ref$setLayerGeoJSONs === void 0 ? function () {} : _ref$setLayerGeoJSONs,
3746
3806
  _ref$layerDrawModes = _ref.layerDrawModes,
@@ -3808,10 +3868,11 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
3808
3868
  mapId: mapId,
3809
3869
  layers: baseLayers
3810
3870
  }));
3871
+ var projection = initialProjection || srsAndBboxDefault;
3811
3872
  dispatch(mapActions.setBbox({
3812
3873
  mapId: mapId,
3813
- bbox: srsAndBboxDefault.bbox,
3814
- srs: srsAndBboxDefault.srs
3874
+ bbox: projection.bbox,
3875
+ srs: projection.srs
3815
3876
  }));
3816
3877
  syncGroupAddGroup({
3817
3878
  groupId: 'Time_SigmetAirmet',
@@ -3922,6 +3983,7 @@ var ProductFormLayout = function ProductFormLayout(_a) {
3922
3983
 
3923
3984
  var theme = useTheme();
3924
3985
  var baseLayers = getBaseLayers(productConfig);
3986
+ var projection = getProjection(productConfig);
3925
3987
  return /*#__PURE__*/React__default.createElement(Grid, {
3926
3988
  container: true,
3927
3989
  sx: _defineProperty({
@@ -3943,7 +4005,8 @@ var ProductFormLayout = function ProductFormLayout(_a) {
3943
4005
  padding: 0
3944
4006
  })
3945
4007
  }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, Object.assign({
3946
- baseLayers: baseLayers
4008
+ baseLayers: baseLayers,
4009
+ projection: projection
3947
4010
  }, geojsonProps))), /*#__PURE__*/React__default.createElement(Grid, {
3948
4011
  item: true,
3949
4012
  xs: 12,
@@ -5455,7 +5518,16 @@ var mapPreset$1 = {
5455
5518
  format: "image/png",
5456
5519
  enabled: true
5457
5520
  }
5458
- ]
5521
+ ],
5522
+ proj: {
5523
+ bbox: {
5524
+ left: -1205884.85699446,
5525
+ bottom: 5808323.764379622,
5526
+ right: 2219822.701688853,
5527
+ top: 8298305.647311475
5528
+ },
5529
+ srs: "EPSG:3857"
5530
+ }
5459
5531
  };
5460
5532
  var sigmetDefaultConfig = {
5461
5533
  location_indicator_mwo: location_indicator_mwo$1,
@@ -6987,7 +7059,16 @@ var mapPreset = {
6987
7059
  format: "image/png",
6988
7060
  enabled: true
6989
7061
  }
6990
- ]
7062
+ ],
7063
+ proj: {
7064
+ bbox: {
7065
+ left: -1205884.85699446,
7066
+ bottom: 5808323.764379622,
7067
+ right: 2219822.701688853,
7068
+ top: 8298305.647311475
7069
+ },
7070
+ srs: "EPSG:3857"
7071
+ }
6991
7072
  };
6992
7073
  var airmetDefaultConfig = {
6993
7074
  location_indicator_mwo: location_indicator_mwo,
@@ -7746,6 +7827,43 @@ var properties$1 = {
7746
7827
  "layerType"
7747
7828
  ]
7748
7829
  }
7830
+ },
7831
+ proj: {
7832
+ type: "object",
7833
+ properties: {
7834
+ bbox: {
7835
+ type: "object",
7836
+ properties: {
7837
+ left: {
7838
+ type: "number"
7839
+ },
7840
+ right: {
7841
+ type: "number"
7842
+ },
7843
+ top: {
7844
+ type: "number"
7845
+ },
7846
+ bottom: {
7847
+ type: "number"
7848
+ }
7849
+ },
7850
+ additionalProperties: false,
7851
+ required: [
7852
+ "left",
7853
+ "right",
7854
+ "top",
7855
+ "bottom"
7856
+ ]
7857
+ },
7858
+ srs: {
7859
+ type: "string"
7860
+ }
7861
+ },
7862
+ additionalProperties: false,
7863
+ required: [
7864
+ "bbox",
7865
+ "srs"
7866
+ ]
7749
7867
  }
7750
7868
  }
7751
7869
  }
@@ -7904,6 +8022,43 @@ var properties = {
7904
8022
  "layerType"
7905
8023
  ]
7906
8024
  }
8025
+ },
8026
+ proj: {
8027
+ type: "object",
8028
+ properties: {
8029
+ bbox: {
8030
+ type: "object",
8031
+ properties: {
8032
+ left: {
8033
+ type: "number"
8034
+ },
8035
+ right: {
8036
+ type: "number"
8037
+ },
8038
+ top: {
8039
+ type: "number"
8040
+ },
8041
+ bottom: {
8042
+ type: "number"
8043
+ }
8044
+ },
8045
+ additionalProperties: false,
8046
+ required: [
8047
+ "left",
8048
+ "right",
8049
+ "top",
8050
+ "bottom"
8051
+ ]
8052
+ },
8053
+ srs: {
8054
+ type: "string"
8055
+ }
8056
+ },
8057
+ additionalProperties: false,
8058
+ required: [
8059
+ "bbox",
8060
+ "srs"
8061
+ ]
7907
8062
  }
7908
8063
  }
7909
8064
  }
@@ -9452,8 +9607,12 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
9452
9607
 
9453
9608
  var toggleDialogOpen = function toggleDialogOpen() {
9454
9609
  var shouldRefreshList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
9610
+
9455
9611
  // Refresh list on closing dialog
9456
- if (isFormDialogOpen === true && shouldRefreshList) getNewProductList();
9612
+ if (isFormDialogOpen === true && shouldRefreshList) {
9613
+ getNewProductList();
9614
+ }
9615
+
9457
9616
  setIsFormDialogOpen(!isFormDialogOpen);
9458
9617
  };
9459
9618
 
@@ -9471,8 +9630,14 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
9471
9630
  };
9472
9631
 
9473
9632
  return /*#__PURE__*/React__default.createElement(Box$1, {
9474
- "data-testid": "sigmetAirmetComponent"
9633
+ "data-testid": "sigmetAirmetComponent",
9634
+ sx: {
9635
+ padding: '24px',
9636
+ height: '100%',
9637
+ overflowY: 'auto'
9638
+ }
9475
9639
  }, /*#__PURE__*/React__default.createElement(ProductList, {
9640
+ "data-testid": "sigmetAirmetList",
9476
9641
  productList: productList,
9477
9642
  productType: productType,
9478
9643
  isLoading: isLoadingList,
@@ -9508,14 +9673,14 @@ var ERROR_TITLE = 'Something went wrong with loading the configuration file';
9508
9673
 
9509
9674
  var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapper(_ref) {
9510
9675
  var productType = _ref.productType,
9511
- config = _ref.config;
9676
+ productConfigKey = _ref.productConfigKey;
9512
9677
 
9513
9678
  var _useApiContext = useApiContext(),
9514
9679
  api = _useApiContext.api;
9515
9680
 
9516
9681
  var getConfigurationRequest = api[productType === 'sigmet' ? 'getSigmetConfiguration' : 'getAirmetConfiguration'];
9517
9682
 
9518
- var _useApi = useApi(getConfigurationRequest, config),
9683
+ var _useApi = useApi(getConfigurationRequest, productConfigKey),
9519
9684
  productConfig = _useApi.result,
9520
9685
  isConfigLoading = _useApi.isLoading,
9521
9686
  error = _useApi.error;
@@ -9564,8 +9729,8 @@ var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapp
9564
9729
 
9565
9730
  var getApiRoutes = function getApiRoutes(axiosInstance, nonAuthAxiosInstance) {
9566
9731
  return {
9567
- getSigmetConfiguration: function getSigmetConfiguration(config) {
9568
- return nonAuthAxiosInstance.get("/assets/".concat(config.GW_FEATURE_MODULE_SIGMET_CONFIGURATION));
9732
+ getSigmetConfiguration: function getSigmetConfiguration(productConfigKey) {
9733
+ return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
9569
9734
  },
9570
9735
  getSigmetList: function getSigmetList() {
9571
9736
  return axiosInstance.get('/sigmetlist');
@@ -9576,8 +9741,8 @@ var getApiRoutes = function getApiRoutes(axiosInstance, nonAuthAxiosInstance) {
9576
9741
  getSigmetTAC: function getSigmetTAC(sigmetData) {
9577
9742
  return axiosInstance.post('/sigmet2tac', Object.assign({}, sigmetData));
9578
9743
  },
9579
- getAirmetConfiguration: function getAirmetConfiguration(config) {
9580
- return nonAuthAxiosInstance.get("/assets/".concat(config.GW_FEATURE_MODULE_AIRMET_CONFIGURATION));
9744
+ getAirmetConfiguration: function getAirmetConfiguration(productConfigKey) {
9745
+ return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
9581
9746
  },
9582
9747
  getAirmetList: function getAirmetList() {
9583
9748
  return axiosInstance.get('/airmetlist');
@@ -9597,4 +9762,148 @@ var createApi = function createApi(props) {
9597
9762
  return getApiRoutes(axiosInstance, nonAuthAxiosInstance);
9598
9763
  };
9599
9764
 
9600
- export { AirmetForm, AirmetPhenomena, CloudLevelUnits, ContentDialog, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapDrawMode, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductList, ProductListRow, ProductStatusDescription, SigmetForm, SigmetPhenomena, StartOrEndDrawing, VisibilityCause, WindUnit, createApi, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet };
9765
+ /* *
9766
+ * Licensed under the Apache License, Version 2.0 (the "License");
9767
+ * you may not use this file except in compliance with the License.
9768
+ * You may obtain a copy of the License at
9769
+ *
9770
+ * http://www.apache.org/licenses/LICENSE-2.0
9771
+ *
9772
+ * Unless required by applicable law or agreed to in writing, software
9773
+ * distributed under the License is distributed on an "AS IS" BASIS,
9774
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9775
+ * See the License for the specific language governing permissions and
9776
+ * limitations under the License.
9777
+ *
9778
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9779
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
9780
+ * */
9781
+ var AviationProductApiWrapper = function AviationProductApiWrapper(_ref) {
9782
+ var config = _ref.config,
9783
+ auth = _ref.auth,
9784
+ onSetAuth = _ref.onSetAuth,
9785
+ productConfigKey = _ref.productConfigKey,
9786
+ productType = _ref.productType;
9787
+ return config ? /*#__PURE__*/React.createElement(ApiProvider, {
9788
+ config: {
9789
+ baseURL: config.baseURL,
9790
+ appURL: config.appURL,
9791
+ authTokenURL: config.authTokenURL,
9792
+ authClientId: config.authClientId
9793
+ },
9794
+ auth: auth,
9795
+ onSetAuth: onSetAuth,
9796
+ createApi: createApi
9797
+ }, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(DownloadSigmetAirmetConfigWrapper, {
9798
+ productType: productType,
9799
+ productConfigKey: productConfigKey
9800
+ }))) : null;
9801
+ };
9802
+
9803
+ /* *
9804
+ * Licensed under the Apache License, Version 2.0 (the "License");
9805
+ * you may not use this file except in compliance with the License.
9806
+ * You may obtain a copy of the License at
9807
+ *
9808
+ * http://www.apache.org/licenses/LICENSE-2.0
9809
+ *
9810
+ * Unless required by applicable law or agreed to in writing, software
9811
+ * distributed under the License is distributed on an "AS IS" BASIS,
9812
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9813
+ * See the License for the specific language governing permissions and
9814
+ * limitations under the License.
9815
+ *
9816
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9817
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
9818
+ * */
9819
+ var SigmetComponentsLookUp = function SigmetComponentsLookUp(payload, _ref) {
9820
+ var config = _ref.config,
9821
+ auth = _ref.auth,
9822
+ onSetAuth = _ref.onSetAuth,
9823
+ productConfigKey = _ref.productConfigKey;
9824
+ var ConnectedModuleWrapper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
9825
+ var componentType = payload.componentType;
9826
+
9827
+ switch (componentType) {
9828
+ case 'SigmetModule':
9829
+ if (ConnectedModuleWrapper) {
9830
+ return /*#__PURE__*/React.createElement(ConnectedModuleWrapper, {
9831
+ component: AviationProductApiWrapper,
9832
+ payload: payload,
9833
+ "data-testid": "sigmetModule",
9834
+ config: config,
9835
+ auth: auth,
9836
+ onSetAuth: onSetAuth,
9837
+ productConfigKey: productConfigKey,
9838
+ productType: "sigmet"
9839
+ });
9840
+ }
9841
+
9842
+ return /*#__PURE__*/React.createElement(AviationProductApiWrapper, {
9843
+ "data-testid": "sigmetModule",
9844
+ config: config,
9845
+ auth: auth,
9846
+ onSetAuth: onSetAuth,
9847
+ productConfigKey: productConfigKey,
9848
+ productType: "sigmet"
9849
+ });
9850
+
9851
+ default:
9852
+ return null;
9853
+ }
9854
+ };
9855
+
9856
+ /* *
9857
+ * Licensed under the Apache License, Version 2.0 (the "License");
9858
+ * you may not use this file except in compliance with the License.
9859
+ * You may obtain a copy of the License at
9860
+ *
9861
+ * http://www.apache.org/licenses/LICENSE-2.0
9862
+ *
9863
+ * Unless required by applicable law or agreed to in writing, software
9864
+ * distributed under the License is distributed on an "AS IS" BASIS,
9865
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9866
+ * See the License for the specific language governing permissions and
9867
+ * limitations under the License.
9868
+ *
9869
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9870
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
9871
+ * */
9872
+ var AirmetComponentsLookUp = function AirmetComponentsLookUp(payload, _ref) {
9873
+ var config = _ref.config,
9874
+ auth = _ref.auth,
9875
+ onSetAuth = _ref.onSetAuth,
9876
+ productConfigKey = _ref.productConfigKey;
9877
+ var ConnectedModuleWrapper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
9878
+ var componentType = payload.componentType;
9879
+
9880
+ switch (componentType) {
9881
+ case 'AirmetModule':
9882
+ if (ConnectedModuleWrapper) {
9883
+ return /*#__PURE__*/React.createElement(ConnectedModuleWrapper, {
9884
+ component: AviationProductApiWrapper,
9885
+ payload: payload,
9886
+ "data-testid": "airmetModule",
9887
+ config: config,
9888
+ auth: auth,
9889
+ onSetAuth: onSetAuth,
9890
+ productConfigKey: productConfigKey,
9891
+ productType: "airmet"
9892
+ });
9893
+ }
9894
+
9895
+ return /*#__PURE__*/React.createElement(AviationProductApiWrapper, {
9896
+ "data-testid": "airmetModule",
9897
+ config: config,
9898
+ auth: auth,
9899
+ onSetAuth: onSetAuth,
9900
+ productConfigKey: productConfigKey,
9901
+ productType: "airmet"
9902
+ });
9903
+
9904
+ default:
9905
+ return null;
9906
+ }
9907
+ };
9908
+
9909
+ export { AirmetComponentsLookUp, AirmetForm, AirmetPhenomena, CloudLevelUnits, ContentDialog, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapDrawMode, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductList, ProductListRow, ProductStatusDescription, SigmetComponentsLookUp, SigmetForm, SigmetPhenomena, StartOrEndDrawing, VisibilityCause, WindUnit, createApi, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet };