@geowiki/map 0.15.1-dev.0 → 0.16.0-dev.1

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.js CHANGED
@@ -2958,7 +2958,7 @@ var SelectedPoint = () => {
2958
2958
  };
2959
2959
 
2960
2960
  // src/Components/LayerStoreList.tsx
2961
- var import_core6 = require("@geowiki/core");
2961
+ var import_core7 = require("@geowiki/core");
2962
2962
 
2963
2963
  // src/store/mapLayers.ts
2964
2964
  var import_zustand3 = require("zustand");
@@ -3681,7 +3681,7 @@ var BiodiversityObservationPopup = ({
3681
3681
 
3682
3682
  // src/Components/Ifbn/IfbnSitePopup.tsx
3683
3683
  var import_react6 = require("react");
3684
- var import_react7 = require("next-auth/react");
3684
+ var import_core6 = require("@geowiki/core");
3685
3685
  var import_ui5 = require("@geowiki/ui");
3686
3686
  var import_image2 = __toESM(require("next/image"));
3687
3687
  var import_jsx_runtime10 = require("react/jsx-runtime");
@@ -3861,7 +3861,7 @@ var IfbnSitePopup = ({ properties }) => {
3861
3861
  const [siteData, setSiteData] = (0, import_react6.useState)(null);
3862
3862
  const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
3863
3863
  const [imageError, setImageError] = (0, import_react6.useState)(false);
3864
- const { status: sessionStatus, data: session } = (0, import_react7.useSession)();
3864
+ const { status: sessionStatus, data: session } = (0, import_core6.useSession)();
3865
3865
  if (!properties)
3866
3866
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
3867
3867
  const plotId = properties["Plot_ID"];
@@ -3949,15 +3949,15 @@ var IfbnSitePopup = ({ properties }) => {
3949
3949
  };
3950
3950
 
3951
3951
  // src/Components/Ifbn/IfbnPlotPopup.tsx
3952
- var import_react8 = require("react");
3952
+ var import_react7 = require("react");
3953
3953
  var import_jsx_runtime11 = require("react/jsx-runtime");
3954
3954
  var IfbnPlotPopup = ({ properties }) => {
3955
3955
  console.log(properties);
3956
- const [apiData, setApiData] = (0, import_react8.useState)(null);
3957
- const [isLoading, setIsLoading] = (0, import_react8.useState)(false);
3958
- const [error, setError] = (0, import_react8.useState)(null);
3956
+ const [apiData, setApiData] = (0, import_react7.useState)(null);
3957
+ const [isLoading, setIsLoading] = (0, import_react7.useState)(false);
3958
+ const [error, setError] = (0, import_react7.useState)(null);
3959
3959
  const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
3960
- (0, import_react8.useEffect)(() => {
3960
+ (0, import_react7.useEffect)(() => {
3961
3961
  const fetchApiData = () => __async(void 0, null, function* () {
3962
3962
  if (!(properties == null ? void 0 : properties.id))
3963
3963
  return;
@@ -4110,7 +4110,7 @@ var GeoJsonLayerPopup_default = GeoJsonLayerPopup;
4110
4110
  // src/Components/GeoJsonLayer.tsx
4111
4111
  var import_server2 = require("react-dom/server");
4112
4112
  var import_MapPinIcon = __toESM(require("@heroicons/react/24/solid/MapPinIcon"));
4113
- var import_react9 = require("react");
4113
+ var import_react8 = require("react");
4114
4114
  var turf2 = __toESM(require("@turf/turf"));
4115
4115
  var import_ui7 = require("@geowiki/ui");
4116
4116
  var import_jsx_runtime13 = require("react/jsx-runtime");
@@ -4168,7 +4168,7 @@ var createClusterIcon = (color) => {
4168
4168
  });
4169
4169
  };
4170
4170
  };
4171
- var GeoJsonLayer = (0, import_react9.memo)(
4171
+ var GeoJsonLayer = (0, import_react8.memo)(
4172
4172
  ({ layer }) => {
4173
4173
  const { isLoading, error, data } = (0, import_react_query.useQuery)({
4174
4174
  queryKey: ["geoJson", layer.id],
@@ -4177,20 +4177,20 @@ var GeoJsonLayer = (0, import_react9.memo)(
4177
4177
  return yield res.json();
4178
4178
  })
4179
4179
  });
4180
- const ref = (0, import_react9.useRef)(null);
4181
- const [forceUpdate, setForceUpdate] = (0, import_react9.useState)(0);
4182
- (0, import_react9.useEffect)(() => {
4180
+ const ref = (0, import_react8.useRef)(null);
4181
+ const [forceUpdate, setForceUpdate] = (0, import_react8.useState)(0);
4182
+ (0, import_react8.useEffect)(() => {
4183
4183
  setForceUpdate((prev) => prev + 1);
4184
4184
  }, [layer.id]);
4185
- const layerIcon = (0, import_react9.useMemo)(
4185
+ const layerIcon = (0, import_react8.useMemo)(
4186
4186
  () => createIcon(layer.color, layer.title),
4187
4187
  [layer.color, layer.title]
4188
4188
  );
4189
- const clusterIconFunction = (0, import_react9.useMemo)(
4189
+ const clusterIconFunction = (0, import_react8.useMemo)(
4190
4190
  () => createClusterIcon(layer.color),
4191
4191
  [layer.color]
4192
4192
  );
4193
- const onEachFeature = (0, import_react9.useCallback)(
4193
+ const onEachFeature = (0, import_react8.useCallback)(
4194
4194
  (feature, layerInfo, layerItem) => {
4195
4195
  const popupContent = ReactDOMServer.renderToString(
4196
4196
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GeoJsonLayerPopup_default, { feature, layerItem })
@@ -4221,7 +4221,7 @@ var GeoJsonLayer = (0, import_react9.memo)(
4221
4221
  },
4222
4222
  [layerIcon]
4223
4223
  );
4224
- const processedData = (0, import_react9.useMemo)(() => {
4224
+ const processedData = (0, import_react8.useMemo)(() => {
4225
4225
  if (!(data == null ? void 0 : data.features))
4226
4226
  return data;
4227
4227
  const processed = __spreadValues({}, data);
@@ -4239,7 +4239,7 @@ var GeoJsonLayer = (0, import_react9.memo)(
4239
4239
  });
4240
4240
  return processed;
4241
4241
  }, [data]);
4242
- const eventHandlers = (0, import_react9.useMemo)(
4242
+ const eventHandlers = (0, import_react8.useMemo)(
4243
4243
  () => ({
4244
4244
  add: (e) => {
4245
4245
  if (e.target._container) {
@@ -4275,12 +4275,12 @@ var GeoJsonLayer = (0, import_react9.memo)(
4275
4275
  GeoJsonLayer.displayName = "GeoJsonLayer";
4276
4276
 
4277
4277
  // src/Components/LayerStoreList.tsx
4278
- var import_react13 = require("react");
4278
+ var import_react12 = require("react");
4279
4279
 
4280
4280
  // src/Components/Ifbn/IfbnPlotLayer.tsx
4281
4281
  var import_ui8 = require("@geowiki/ui");
4282
4282
  var import_react_query2 = require("@tanstack/react-query");
4283
- var import_react10 = require("react");
4283
+ var import_react9 = require("react");
4284
4284
  var import_react_leaflet7 = require("react-leaflet");
4285
4285
  var turf3 = __toESM(require("@turf/turf"));
4286
4286
  var import_leaflet7 = __toESM(require("leaflet"));
@@ -4361,12 +4361,12 @@ var IfbnPlotLayer = ({
4361
4361
  options = {}
4362
4362
  }) => {
4363
4363
  const { hideMarkersAboveZoom = 15 } = options;
4364
- const [selectedFeature, setSelectedFeature] = (0, import_react10.useState)(null);
4365
- const [currentZoom, setCurrentZoom] = (0, import_react10.useState)(0);
4366
- const [forceUpdate, setForceUpdate] = (0, import_react10.useState)(0);
4367
- const markerClusterGroupRef = (0, import_react10.useRef)(null);
4368
- const markersRef = (0, import_react10.useRef)([]);
4369
- (0, import_react10.useEffect)(() => {
4364
+ const [selectedFeature, setSelectedFeature] = (0, import_react9.useState)(null);
4365
+ const [currentZoom, setCurrentZoom] = (0, import_react9.useState)(0);
4366
+ const [forceUpdate, setForceUpdate] = (0, import_react9.useState)(0);
4367
+ const markerClusterGroupRef = (0, import_react9.useRef)(null);
4368
+ const markersRef = (0, import_react9.useRef)([]);
4369
+ (0, import_react9.useEffect)(() => {
4370
4370
  setForceUpdate((prev) => prev + 1);
4371
4371
  }, [layer.id]);
4372
4372
  const map = (0, import_react_leaflet7.useMapEvents)({
@@ -4387,7 +4387,7 @@ var IfbnPlotLayer = ({
4387
4387
  const shouldShowMarkers = () => {
4388
4388
  return currentZoom <= hideMarkersAboveZoom;
4389
4389
  };
4390
- (0, import_react10.useEffect)(() => {
4390
+ (0, import_react9.useEffect)(() => {
4391
4391
  if (!markerClusterGroupRef.current)
4392
4392
  return;
4393
4393
  if (shouldShowMarkers()) {
@@ -4412,7 +4412,7 @@ var IfbnPlotLayer = ({
4412
4412
  }
4413
4413
  return zoom >= 16 ? 0 : 80;
4414
4414
  };
4415
- (0, import_react10.useEffect)(() => {
4415
+ (0, import_react9.useEffect)(() => {
4416
4416
  markerClusterGroupRef.current = import_leaflet7.default.markerClusterGroup({
4417
4417
  maxClusterRadius: (zoom) => getClusterRadius(zoom),
4418
4418
  disableClusteringAtZoom: 16,
@@ -4424,7 +4424,7 @@ var IfbnPlotLayer = ({
4424
4424
  markerClusterGroupRef.current = null;
4425
4425
  };
4426
4426
  }, [hideMarkersAboveZoom]);
4427
- (0, import_react10.useEffect)(() => {
4427
+ (0, import_react9.useEffect)(() => {
4428
4428
  const currentRef = ref.current;
4429
4429
  if (currentRef && markerClusterGroupRef.current) {
4430
4430
  currentRef.addLayer(markerClusterGroupRef.current);
@@ -4476,7 +4476,7 @@ var IfbnPlotLayer = ({
4476
4476
  const handleFeatureClick = (feature, latlng) => {
4477
4477
  setSelectedFeature({ feature, latlng });
4478
4478
  };
4479
- const ref = (0, import_react10.useRef)(null);
4479
+ const ref = (0, import_react9.useRef)(null);
4480
4480
  if (error)
4481
4481
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "error" });
4482
4482
  if (isLoading)
@@ -4529,7 +4529,7 @@ var IfbnPlotLayer = ({
4529
4529
  };
4530
4530
 
4531
4531
  // src/Components/CustomLayerRenderer.tsx
4532
- var import_react12 = require("react");
4532
+ var import_react11 = require("react");
4533
4533
  var import_react_leaflet9 = require("react-leaflet");
4534
4534
 
4535
4535
  // src/store/customLayers.ts
@@ -4841,7 +4841,7 @@ var import_react_leaflet8 = require("react-leaflet");
4841
4841
  var import_leaflet8 = __toESM(require("leaflet"));
4842
4842
  var ReactDOMServer2 = __toESM(require("react-dom/server"));
4843
4843
  var import_ui9 = require("@geowiki/ui");
4844
- var import_react11 = require("react");
4844
+ var import_react10 = require("react");
4845
4845
  var turf4 = __toESM(require("@turf/turf"));
4846
4846
 
4847
4847
  // src/utils/GoogleSheetsUtils.ts
@@ -5994,12 +5994,12 @@ var GoogleSheetsLayer = ({
5994
5994
  layer
5995
5995
  }) => {
5996
5996
  var _a;
5997
- const ref = (0, import_react11.useRef)(null);
5997
+ const ref = (0, import_react10.useRef)(null);
5998
5998
  const markerClusterGroup = import_leaflet8.default.markerClusterGroup();
5999
5999
  const { updateLayer } = mapLayers_default();
6000
- const legendConfigUpdated = (0, import_react11.useRef)(false);
6001
- const [forceUpdate, setForceUpdate] = (0, import_react11.useState)(0);
6002
- const sheetConfig = (0, import_react11.useMemo)(() => {
6000
+ const legendConfigUpdated = (0, import_react10.useRef)(false);
6001
+ const [forceUpdate, setForceUpdate] = (0, import_react10.useState)(0);
6002
+ const sheetConfig = (0, import_react10.useMemo)(() => {
6003
6003
  if (!layer.url) {
6004
6004
  return null;
6005
6005
  }
@@ -6036,11 +6036,11 @@ var GoogleSheetsLayer = ({
6036
6036
  refetchOnMount: true,
6037
6037
  refetchOnReconnect: true
6038
6038
  });
6039
- (0, import_react11.useEffect)(() => {
6039
+ (0, import_react10.useEffect)(() => {
6040
6040
  if (data && !isLoading) {
6041
6041
  }
6042
6042
  }, [data, isLoading, isCached, layer.id, cacheStats]);
6043
- (0, import_react11.useEffect)(() => {
6043
+ (0, import_react10.useEffect)(() => {
6044
6044
  const currentRef = ref.current;
6045
6045
  if (currentRef) {
6046
6046
  currentRef.addLayer(markerClusterGroup);
@@ -6085,7 +6085,7 @@ var GoogleSheetsLayer = ({
6085
6085
  markerClusterGroup.addLayer(marker2);
6086
6086
  }
6087
6087
  };
6088
- const processedData = (0, import_react11.useMemo)(() => {
6088
+ const processedData = (0, import_react10.useMemo)(() => {
6089
6089
  var _a2;
6090
6090
  if (!data)
6091
6091
  return null;
@@ -6105,7 +6105,7 @@ var GoogleSheetsLayer = ({
6105
6105
  })
6106
6106
  });
6107
6107
  }, [data]);
6108
- const legendConfig = (0, import_react11.useMemo)(() => {
6108
+ const legendConfig = (0, import_react10.useMemo)(() => {
6109
6109
  if (!processedData || !processedData.features || processedData.features.length === 0) {
6110
6110
  console.log(
6111
6111
  "GoogleSheetsLayer: No processed data available for legend generation"
@@ -6177,7 +6177,7 @@ var GoogleSheetsLayer = ({
6177
6177
  }
6178
6178
  return null;
6179
6179
  }, [processedData, layer.title, layer.id]);
6180
- const updateLayerWithLegend = (0, import_react11.useCallback)(() => {
6180
+ const updateLayerWithLegend = (0, import_react10.useCallback)(() => {
6181
6181
  if (legendConfig && layer.id && !legendConfigUpdated.current) {
6182
6182
  if (JSON.stringify(layer.legendConfig) !== JSON.stringify(legendConfig)) {
6183
6183
  console.log("GoogleSheetsLayer: Updating layer with legend config");
@@ -6199,10 +6199,10 @@ var GoogleSheetsLayer = ({
6199
6199
  });
6200
6200
  }
6201
6201
  }, [legendConfig, layer, updateLayer]);
6202
- (0, import_react11.useEffect)(() => {
6202
+ (0, import_react10.useEffect)(() => {
6203
6203
  updateLayerWithLegend();
6204
6204
  }, [updateLayerWithLegend]);
6205
- (0, import_react11.useEffect)(() => {
6205
+ (0, import_react10.useEffect)(() => {
6206
6206
  legendConfigUpdated.current = false;
6207
6207
  }, [processedData]);
6208
6208
  if (error) {
@@ -6361,10 +6361,10 @@ var createPopupContent = (feature, layer) => {
6361
6361
  }
6362
6362
  return null;
6363
6363
  };
6364
- var GeoJSONRenderer = (0, import_react12.memo)(
6364
+ var GeoJSONRenderer = (0, import_react11.memo)(
6365
6365
  ({ layer }) => {
6366
6366
  const { layerData, styleConfig, opacity } = layer;
6367
- const style = (0, import_react12.useMemo)(
6367
+ const style = (0, import_react11.useMemo)(
6368
6368
  () => ({
6369
6369
  fillColor: (styleConfig == null ? void 0 : styleConfig.fillColor) || "#3388ff",
6370
6370
  weight: (styleConfig == null ? void 0 : styleConfig.strokeWidth) || 2,
@@ -6374,7 +6374,7 @@ var GeoJSONRenderer = (0, import_react12.memo)(
6374
6374
  }),
6375
6375
  [styleConfig, opacity]
6376
6376
  );
6377
- const onEachFeature = (0, import_react12.useCallback)((feature, leafletLayer) => {
6377
+ const onEachFeature = (0, import_react11.useCallback)((feature, leafletLayer) => {
6378
6378
  if (feature.properties) {
6379
6379
  const popupContent = Object.entries(feature.properties).map(([key, value]) => `<strong>${key}:</strong> ${value}`).join("<br/>");
6380
6380
  leafletLayer.bindPopup(popupContent);
@@ -6396,11 +6396,11 @@ var GeoJSONRenderer = (0, import_react12.memo)(
6396
6396
  }
6397
6397
  );
6398
6398
  GeoJSONRenderer.displayName = "GeoJSONRenderer";
6399
- var MarkerRenderer = (0, import_react12.memo)(
6399
+ var MarkerRenderer = (0, import_react11.memo)(
6400
6400
  ({ layer }) => {
6401
6401
  var _a;
6402
6402
  const { layerData, opacity } = layer;
6403
- const pointFeatures = (0, import_react12.useMemo)(
6403
+ const pointFeatures = (0, import_react11.useMemo)(
6404
6404
  () => {
6405
6405
  var _a2;
6406
6406
  return ((_a2 = layerData == null ? void 0 : layerData.features) == null ? void 0 : _a2.filter(
@@ -6409,7 +6409,7 @@ var MarkerRenderer = (0, import_react12.memo)(
6409
6409
  },
6410
6410
  [layerData == null ? void 0 : layerData.features]
6411
6411
  );
6412
- const popupOptions = (0, import_react12.useMemo)(
6412
+ const popupOptions = (0, import_react11.useMemo)(
6413
6413
  () => {
6414
6414
  var _a2;
6415
6415
  return ((_a2 = layer.popupConfig) == null ? void 0 : _a2.popupOptions) || {
@@ -6459,15 +6459,15 @@ var MarkerRenderer = (0, import_react12.memo)(
6459
6459
  }
6460
6460
  );
6461
6461
  MarkerRenderer.displayName = "MarkerRenderer";
6462
- var MarkerClusterRenderer = (0, import_react12.memo)(
6462
+ var MarkerClusterRenderer = (0, import_react11.memo)(
6463
6463
  ({ layer }) => {
6464
6464
  var _a;
6465
6465
  const { layerData, opacity } = layer;
6466
- const [forceUpdate, setForceUpdate] = (0, import_react12.useState)(0);
6467
- (0, import_react12.useEffect)(() => {
6466
+ const [forceUpdate, setForceUpdate] = (0, import_react11.useState)(0);
6467
+ (0, import_react11.useEffect)(() => {
6468
6468
  setForceUpdate((prev) => prev + 1);
6469
6469
  }, [layer.id]);
6470
- const pointFeatures = (0, import_react12.useMemo)(
6470
+ const pointFeatures = (0, import_react11.useMemo)(
6471
6471
  () => {
6472
6472
  var _a2;
6473
6473
  return ((_a2 = layerData == null ? void 0 : layerData.features) == null ? void 0 : _a2.filter(
@@ -6476,7 +6476,7 @@ var MarkerClusterRenderer = (0, import_react12.memo)(
6476
6476
  },
6477
6477
  [layerData == null ? void 0 : layerData.features]
6478
6478
  );
6479
- const popupOptions = (0, import_react12.useMemo)(
6479
+ const popupOptions = (0, import_react11.useMemo)(
6480
6480
  () => {
6481
6481
  var _a2;
6482
6482
  return ((_a2 = layer.popupConfig) == null ? void 0 : _a2.popupOptions) || {
@@ -6541,7 +6541,7 @@ var MarkerClusterRenderer = (0, import_react12.memo)(
6541
6541
  }
6542
6542
  );
6543
6543
  MarkerClusterRenderer.displayName = "MarkerClusterRenderer";
6544
- var WMSRenderer = (0, import_react12.memo)(({ layer }) => {
6544
+ var WMSRenderer = (0, import_react11.memo)(({ layer }) => {
6545
6545
  const { url, layerName, opacity } = layer;
6546
6546
  if (!url || !layerName) {
6547
6547
  console.warn("WMS layer missing url or layerName:", layer.title);
@@ -6560,7 +6560,7 @@ var WMSRenderer = (0, import_react12.memo)(({ layer }) => {
6560
6560
  );
6561
6561
  });
6562
6562
  WMSRenderer.displayName = "WMSRenderer";
6563
- var TileRenderer = (0, import_react12.memo)(({ layer }) => {
6563
+ var TileRenderer = (0, import_react11.memo)(({ layer }) => {
6564
6564
  const { url, opacity } = layer;
6565
6565
  if (!url) {
6566
6566
  console.warn("Tile layer missing url:", layer.title);
@@ -6569,9 +6569,9 @@ var TileRenderer = (0, import_react12.memo)(({ layer }) => {
6569
6569
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_leaflet9.TileLayer, { url, opacity: opacity / 100 }, layer.id);
6570
6570
  });
6571
6571
  TileRenderer.displayName = "TileRenderer";
6572
- var GoogleSheetsRenderer = (0, import_react12.memo)(
6572
+ var GoogleSheetsRenderer = (0, import_react11.memo)(
6573
6573
  ({ layer }) => {
6574
- const mapLayer = (0, import_react12.useMemo)(
6574
+ const mapLayer = (0, import_react11.useMemo)(
6575
6575
  () => {
6576
6576
  var _a;
6577
6577
  return __spreadProps(__spreadValues({}, layer), {
@@ -6587,9 +6587,9 @@ var GoogleSheetsRenderer = (0, import_react12.memo)(
6587
6587
  }
6588
6588
  );
6589
6589
  GoogleSheetsRenderer.displayName = "GoogleSheetsRenderer";
6590
- var CustomLayerRenderer = (0, import_react12.memo)(
6590
+ var CustomLayerRenderer = (0, import_react11.memo)(
6591
6591
  ({ layer }) => {
6592
- const renderers = (0, import_react12.useMemo)(
6592
+ const renderers = (0, import_react11.useMemo)(
6593
6593
  () => ({
6594
6594
  geojson: GeoJSONRenderer,
6595
6595
  GeoJson: GeoJSONRenderer,
@@ -6619,9 +6619,9 @@ var CustomLayerRenderer = (0, import_react12.memo)(
6619
6619
  }
6620
6620
  );
6621
6621
  CustomLayerRenderer.displayName = "CustomLayerRenderer";
6622
- var CustomLayerList = (0, import_react12.memo)(() => {
6622
+ var CustomLayerList = (0, import_react11.memo)(() => {
6623
6623
  const { customLayers } = useCustomLayerStore();
6624
- const sortedLayers = (0, import_react12.useMemo)(() => {
6624
+ const sortedLayers = (0, import_react11.useMemo)(() => {
6625
6625
  return [...customLayers].sort((a, b) => {
6626
6626
  var _a, _b, _c, _d;
6627
6627
  const orderA = (_b = (_a = a.order) != null ? _a : a.index) != null ? _b : 0;
@@ -6638,10 +6638,10 @@ var import_jsx_runtime21 = require("react/jsx-runtime");
6638
6638
  var LayerStoreList = () => {
6639
6639
  const layerStore = useMapLayerStore();
6640
6640
  const mapStore = map_default();
6641
- const { data: mapMenuItems, isLoading } = (0, import_core6.useMapMenuItems)();
6641
+ const { data: mapMenuItems, isLoading } = (0, import_core7.useMapMenuItems)();
6642
6642
  const parsedMenuItems = parseMapMenuItems(mapMenuItems);
6643
6643
  const layerItems = parsedMenuItems == null ? void 0 : parsedMenuItems.map((menu) => menu.subMenus);
6644
- (0, import_react13.useEffect)(() => {
6644
+ (0, import_react12.useEffect)(() => {
6645
6645
  layerItems == null ? void 0 : layerItems.forEach((layers) => {
6646
6646
  layers == null ? void 0 : layers.forEach((layer) => {
6647
6647
  var _a;
@@ -6713,7 +6713,7 @@ var LayerStoreList = () => {
6713
6713
 
6714
6714
  // src/Components/MapEvents.tsx
6715
6715
  var import_react_leaflet10 = require("react-leaflet");
6716
- var import_react14 = require("react");
6716
+ var import_react13 = require("react");
6717
6717
  var MapEvents = () => {
6718
6718
  const mapStore = map_default();
6719
6719
  var map = (0, import_react_leaflet10.useMap)();
@@ -6728,7 +6728,7 @@ var MapEvents = () => {
6728
6728
  mapStore.onMapMove(center4);
6729
6729
  }
6730
6730
  });
6731
- (0, import_react14.useEffect)(() => {
6731
+ (0, import_react13.useEffect)(() => {
6732
6732
  mapStore.setMapRef(map);
6733
6733
  if (map) {
6734
6734
  setTimeout(() => {
@@ -6781,11 +6781,11 @@ var LabelButtonView = ({}) => {
6781
6781
  };
6782
6782
 
6783
6783
  // src/Components/MapSidebar.tsx
6784
- var import_core7 = require("@geowiki/core");
6784
+ var import_core8 = require("@geowiki/core");
6785
6785
 
6786
6786
  // src/Components/MiniMapElement.tsx
6787
6787
  var import_react_leaflet11 = require("react-leaflet");
6788
- var import_react15 = require("react");
6788
+ var import_react14 = require("react");
6789
6789
  var import_server4 = require("react-dom/server");
6790
6790
  var import_solid2 = require("@heroicons/react/20/solid");
6791
6791
  var L12 = __toESM(require("leaflet"));
@@ -6795,14 +6795,14 @@ function getIcon3(Icon3) {
6795
6795
  }
6796
6796
  var MiniMapElement = ({ layerName }) => {
6797
6797
  const mapStore = map_default();
6798
- const ref = (0, import_react15.useRef)(null);
6799
- (0, import_react15.useEffect)(() => {
6798
+ const ref = (0, import_react14.useRef)(null);
6799
+ (0, import_react14.useEffect)(() => {
6800
6800
  const map = ref.current;
6801
6801
  if (map != null) {
6802
6802
  map.setView(mapStore.center, mapStore.zoom, { animate: true });
6803
6803
  }
6804
6804
  }, [mapStore.center, mapStore.zoom]);
6805
- const miniMap = (0, import_react15.useMemo)(() => {
6805
+ const miniMap = (0, import_react14.useMemo)(() => {
6806
6806
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6807
6807
  import_react_leaflet11.MapContainer,
6808
6808
  {
@@ -6844,12 +6844,12 @@ var MiniMapElement = ({ layerName }) => {
6844
6844
  }, [layerName, mapStore.center, mapStore.zoom]);
6845
6845
  return miniMap;
6846
6846
  };
6847
- var MiniMapElement_default = (0, import_react15.memo)(MiniMapElement);
6847
+ var MiniMapElement_default = (0, import_react14.memo)(MiniMapElement);
6848
6848
 
6849
6849
  // src/Components/MapSidebar.tsx
6850
6850
  var import_jsx_runtime25 = require("react/jsx-runtime");
6851
6851
  var MapSidebar = ({}) => {
6852
- const { data: wmsLayerNames } = (0, import_core7.useEvolandWmsLayers)();
6852
+ const { data: wmsLayerNames } = (0, import_core8.useEvolandWmsLayers)();
6853
6853
  const layerStore = useMapLayerStore();
6854
6854
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "grid gap-1 p-2 grid-cols-1 overflow-y-scroll 3xl:grid-cols-2 h-[92.5vh] driver-left-panel", children: wmsLayerNames == null ? void 0 : wmsLayerNames.layers.map((layer) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "px-2", children: [
6855
6855
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "w-60 lx:w-80 line-clamp-1", children: layer.layerDescription }),
@@ -6860,8 +6860,8 @@ var MapSidebar = ({}) => {
6860
6860
  // src/Components/Evoland/RasterPreview.tsx
6861
6861
  var import_evoland_api_proxy3 = require("@geowiki/evoland-api-proxy");
6862
6862
  var import_navigation = require("next/navigation");
6863
- var import_react16 = require("react");
6864
- var import_core8 = require("@geowiki/core");
6863
+ var import_react15 = require("react");
6864
+ var import_core9 = require("@geowiki/core");
6865
6865
  var import_ui10 = require("@geowiki/ui");
6866
6866
  var import_react_hotkeys_hook = require("react-hotkeys-hook");
6867
6867
  var import_jsx_runtime26 = require("react/jsx-runtime");
@@ -6871,22 +6871,22 @@ var RasterPreview = (_props) => {
6871
6871
  const router = (0, import_navigation.useRouter)();
6872
6872
  const searchParams = (0, import_navigation.useSearchParams)();
6873
6873
  const layerStore = useMapLayerStore();
6874
- const [noNextLocation, setNoNextLocation] = (0, import_react16.useState)(false);
6875
- const [status, setStatus] = (0, import_react16.useState)();
6876
- const [submitNotification, setSubmitNotification] = (0, import_react16.useState)(false);
6877
- const [goToNextTask, setGoToNextTask] = (0, import_react16.useState)(false);
6878
- const [submitNotificationMessage, setSubmitNotificationMessage] = (0, import_react16.useState)("");
6879
- const [disableSubmit, setDisableSubmit] = (0, import_react16.useState)(false);
6874
+ const [noNextLocation, setNoNextLocation] = (0, import_react15.useState)(false);
6875
+ const [status, setStatus] = (0, import_react15.useState)();
6876
+ const [submitNotification, setSubmitNotification] = (0, import_react15.useState)(false);
6877
+ const [goToNextTask, setGoToNextTask] = (0, import_react15.useState)(false);
6878
+ const [submitNotificationMessage, setSubmitNotificationMessage] = (0, import_react15.useState)("");
6879
+ const [disableSubmit, setDisableSubmit] = (0, import_react15.useState)(false);
6880
6880
  var projectId = searchParams.get("projectId");
6881
6881
  var locationId = searchParams.get("locationId");
6882
- const { data: tasks } = (0, import_core8.useRandomTasksPerLocation)({
6882
+ const { data: tasks } = (0, import_core9.useRandomTasksPerLocation)({
6883
6883
  taskForReview: evolandStore.task_for_review,
6884
6884
  pageIdx: 0,
6885
6885
  pageSize: 1,
6886
6886
  locationProjectId: parseInt(projectId),
6887
6887
  groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
6888
6888
  search: null,
6889
- statusIn: !localStorage.getItem("searchStatus") ? import_core8.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
6889
+ statusIn: !localStorage.getItem("searchStatus") ? import_core9.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
6890
6890
  dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
6891
6891
  dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
6892
6892
  userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
@@ -6915,20 +6915,20 @@ var RasterPreview = (_props) => {
6915
6915
  var { data: savedAnnotationBuffer, indexArr: savedAnnotationIndexArr } = evolandStore.savedAnnotations && evolandStore.isAnnualAnnotation ? { data: evolandStore.savedAnnotations.buffer, indexArr: 0 } : evolandStore.savedAnnotations ? flatten(evolandStore.savedAnnotations.buffer) : { data: void 0, indexArr: 0 };
6916
6916
  var { data: annotationBuffer, indexArr: annotationBufferIndexArr } = evolandStore.annotatedRasterAsset && evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : evolandStore.annotatedRasterAsset ? flatten(evolandStore.annotatedRasterAsset.buffer) : { data: void 0, indexArr: 0 };
6917
6917
  setStatus(taskStatus[0]);
6918
- bufferData = taskStatus[1] === import_core8.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_b2 = (_a2 = evolandStore.annotationUndoRedo) == null ? void 0 : _a2.past) == null ? void 0 : _b2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_d2 = (_c2 = evolandStore.annotationUndoRedo) == null ? void 0 : _c2.past) == null ? void 0 : _d2.length) == 0 && evolandStore.savedAnnotations ? Buffer.from(savedAnnotationBuffer == null ? void 0 : savedAnnotationBuffer.buffer).toString("base64") : Buffer.from(annotationBuffer == null ? void 0 : annotationBuffer.buffer).toString("base64");
6919
- var annotation_dates = evolandStore.isAnnualAnnotation ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_f2 = (_e2 = evolandStore.annotationUndoRedo) == null ? void 0 : _e2.past) == null ? void 0 : _f2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_h2 = (_g2 = evolandStore.annotationUndoRedo) == null ? void 0 : _g2.past) == null ? void 0 : _h2.length) == 0 && evolandStore.savedAnnotations ? savedAnnotationIndexArr.map(
6918
+ bufferData = taskStatus[1] === import_core9.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_b2 = (_a2 = evolandStore.annotationUndoRedo) == null ? void 0 : _a2.past) == null ? void 0 : _b2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_d2 = (_c2 = evolandStore.annotationUndoRedo) == null ? void 0 : _c2.past) == null ? void 0 : _d2.length) == 0 && evolandStore.savedAnnotations ? Buffer.from(savedAnnotationBuffer == null ? void 0 : savedAnnotationBuffer.buffer).toString("base64") : Buffer.from(annotationBuffer == null ? void 0 : annotationBuffer.buffer).toString("base64");
6919
+ var annotation_dates = evolandStore.isAnnualAnnotation ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_f2 = (_e2 = evolandStore.annotationUndoRedo) == null ? void 0 : _e2.past) == null ? void 0 : _f2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_h2 = (_g2 = evolandStore.annotationUndoRedo) == null ? void 0 : _g2.past) == null ? void 0 : _h2.length) == 0 && evolandStore.savedAnnotations ? savedAnnotationIndexArr.map(
6920
6920
  (item) => evolandStore.reference_dates[item]
6921
6921
  ) : annotationBufferIndexArr.map(
6922
6922
  (item) => evolandStore.reference_dates[item]
6923
6923
  );
6924
- if (!evolandStore.isAnnualAnnotation && annotation_dates && annotation_dates.length < ((_i2 = evolandStore.projectDetail) == null ? void 0 : _i2.minimum_annotation) && taskStatus[1] === import_core8.AnnotationRequired.REQUIRED) {
6924
+ if (!evolandStore.isAnnualAnnotation && annotation_dates && annotation_dates.length < ((_i2 = evolandStore.projectDetail) == null ? void 0 : _i2.minimum_annotation) && taskStatus[1] === import_core9.AnnotationRequired.REQUIRED) {
6925
6925
  alert(
6926
6926
  "Task should have minimum " + ((_j2 = evolandStore.projectDetail) == null ? void 0 : _j2.minimum_annotation) + " annotations"
6927
6927
  );
6928
6928
  return;
6929
6929
  }
6930
6930
  if (evolandStore.annotatedRasterAsset && evolandStore.currentTask) {
6931
- if (taskStatus[1] === import_core8.AnnotationRequired.REQUIRED) {
6931
+ if (taskStatus[1] === import_core9.AnnotationRequired.REQUIRED) {
6932
6932
  if (evolandStore.isAnnualAnnotation && isBase64Zeros(bufferData)) {
6933
6933
  alert("Please provide annotation");
6934
6934
  return;
@@ -6940,16 +6940,16 @@ var RasterPreview = (_props) => {
6940
6940
  task_type: ((_k2 = evolandStore.projectDetail) == null ? void 0 : _k2.meta_data.ANNOTATION) ? [import_evoland_api_proxy3.TaskType.ANNOTATION] : [],
6941
6941
  target_status: taskStatus[0],
6942
6942
  base64_array: bufferData,
6943
- array_height: taskStatus[1] === import_core8.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_m2 = (_l2 = evolandStore.annotationUndoRedo) == null ? void 0 : _l2.past) == null ? void 0 : _m2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_o2 = (_n2 = evolandStore.annotationUndoRedo) == null ? void 0 : _n2.past) == null ? void 0 : _o2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.height : evolandStore.annotatedRasterAsset.height,
6944
- array_width: taskStatus[1] === import_core8.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_q2 = (_p2 = evolandStore.annotationUndoRedo) == null ? void 0 : _p2.past) == null ? void 0 : _q2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_s2 = (_r2 = evolandStore.annotationUndoRedo) == null ? void 0 : _r2.past) == null ? void 0 : _s2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.width : evolandStore.annotatedRasterAsset.width,
6945
- annotation_time: taskStatus[1] === (import_core8.AnnotationRequired.NOT_REQUIRED || import_core8.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
6943
+ array_height: taskStatus[1] === import_core9.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_m2 = (_l2 = evolandStore.annotationUndoRedo) == null ? void 0 : _l2.past) == null ? void 0 : _m2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_o2 = (_n2 = evolandStore.annotationUndoRedo) == null ? void 0 : _n2.past) == null ? void 0 : _o2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.height : evolandStore.annotatedRasterAsset.height,
6944
+ array_width: taskStatus[1] === import_core9.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_q2 = (_p2 = evolandStore.annotationUndoRedo) == null ? void 0 : _p2.past) == null ? void 0 : _q2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_s2 = (_r2 = evolandStore.annotationUndoRedo) == null ? void 0 : _r2.past) == null ? void 0 : _s2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.width : evolandStore.annotatedRasterAsset.width,
6945
+ annotation_time: taskStatus[1] === (import_core9.AnnotationRequired.NOT_REQUIRED || import_core9.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
6946
6946
  annotation_dates: !evolandStore.isAnnualAnnotation && (annotation_dates == null ? void 0 : annotation_dates.length) > 0 ? annotation_dates : null,
6947
6947
  comment: evolandStore.comment === "" ? void 0 : evolandStore.comment
6948
6948
  };
6949
6949
  try {
6950
6950
  var response = yield import_evoland_api_proxy3.TaskService.updateTaskUpdatetaskPost(submitReq);
6951
6951
  if (response !== void 0) {
6952
- response ? taskStatus[1] == import_core8.AnnotationRequired.REQUIRED || taskStatus[1] === import_core8.AnnotationRequired.OPTIONAL && ((_u2 = (_t2 = evolandStore.annotationUndoRedo) == null ? void 0 : _t2.past) == null ? void 0 : _u2.pop()) !== void 0 ? setSubmitNotificationMessage(
6952
+ response ? taskStatus[1] == import_core9.AnnotationRequired.REQUIRED || taskStatus[1] === import_core9.AnnotationRequired.OPTIONAL && ((_u2 = (_t2 = evolandStore.annotationUndoRedo) == null ? void 0 : _t2.past) == null ? void 0 : _u2.pop()) !== void 0 ? setSubmitNotificationMessage(
6953
6953
  "Annotation has been moved to " + taskStatus[0].toUpperCase() + " state successfully with a new annotation. Moving to next location, please wait."
6954
6954
  ) : setSubmitNotificationMessage(
6955
6955
  "Annotation has been moved to " + taskStatus[0].toUpperCase() + " successfully. Moving to next location, please wait."
@@ -7148,7 +7148,7 @@ var RasterPreview = (_props) => {
7148
7148
  if (layerStore.layerOpacity == 0)
7149
7149
  layerStore.setLayerOpacity(0.4);
7150
7150
  if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
7151
- if (status == import_core8.TaskStatus.ACCEPTED || status == import_core8.TaskStatus.DISCARDED || status == import_core8.TaskStatus.TO_FIX) {
7151
+ if (status == import_core9.TaskStatus.ACCEPTED || status == import_core9.TaskStatus.DISCARDED || status == import_core9.TaskStatus.TO_FIX) {
7152
7152
  setGoToNextTask(true);
7153
7153
  if (_props.userRole === "admin")
7154
7154
  if (tasks == null ? void 0 : tasks.task)
@@ -7214,7 +7214,7 @@ var RasterPreview = (_props) => {
7214
7214
  }
7215
7215
  ) }),
7216
7216
  evolandStore.currentTask !== null && ((_h = (_g = evolandStore.currentTask) == null ? void 0 : _g.transition_states) == null ? void 0 : _h.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-center", children: [
7217
- ((_i = evolandStore.currentTask) == null ? void 0 : _i.status) !== import_core8.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7217
+ ((_i = evolandStore.currentTask) == null ? void 0 : _i.status) !== import_core9.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7218
7218
  import_ui10.Button,
7219
7219
  {
7220
7220
  className: "mb-2 mt-2 mr-2 text-xs -flex-col",
@@ -7270,13 +7270,13 @@ var RasterPreview = (_props) => {
7270
7270
  {
7271
7271
  disabled: disableSubmit,
7272
7272
  style: {
7273
- backgroundColor: import_core8.TaskStatusColor[x[0]]
7273
+ backgroundColor: import_core9.TaskStatusColor[x[0]]
7274
7274
  },
7275
7275
  className: "h-6 text-xs p-1 m-1 text-forground-black -px-4 -py-2 w-full",
7276
7276
  onClick: () => {
7277
7277
  onSubmit(x);
7278
7278
  },
7279
- children: import_core8.TaskState[x[0]]
7279
+ children: import_core9.TaskState[x[0]]
7280
7280
  }
7281
7281
  ) });
7282
7282
  }
@@ -7405,7 +7405,7 @@ var RasterPreview = (_props) => {
7405
7405
  );
7406
7406
  },
7407
7407
  alt: "annotation",
7408
- className: (0, import_core8.classNames)(
7408
+ className: (0, import_core9.classNames)(
7409
7409
  "text-xs w-48 border-y border-x border-gray-100 hover:border-gray-400",
7410
7410
  ((_q = evolandStore.selectedRasterAsset) == null ? void 0 : _q.id) === ((_r = evolandStore.annotatedRasterAsset) == null ? void 0 : _r.id) && " border-2 border-red-600 ",
7411
7411
  evolandStore.selectedRasterAsset === null || ((_s = evolandStore.selectedRasterAsset) == null ? void 0 : _s.id) !== ((_t = evolandStore.annotatedRasterAsset) == null ? void 0 : _t.id) && " border-gray-50"
@@ -7467,7 +7467,7 @@ var RasterPreview = (_props) => {
7467
7467
 
7468
7468
  // src/Components/Evoland/Annotation.tsx
7469
7469
  var import_ui11 = require("@geowiki/ui");
7470
- var import_react17 = require("react");
7470
+ var import_react16 = require("react");
7471
7471
  var import_link = __toESM(require("next/link"));
7472
7472
  var import_router2 = require("next/router");
7473
7473
  var import_evoland_api_proxy4 = require("@geowiki/evoland-api-proxy");
@@ -7478,26 +7478,26 @@ var Annotation = (props) => {
7478
7478
  const router = (0, import_router2.useRouter)();
7479
7479
  var projectId = router.query.projectId;
7480
7480
  var locationId = router.query.locationId;
7481
- const [activeLearningLoading, setActiveLearningLoading] = (0, import_react17.useState)(false);
7481
+ const [activeLearningLoading, setActiveLearningLoading] = (0, import_react16.useState)(false);
7482
7482
  const labels = (_a = evolandStore.labels) == null ? void 0 : _a.filter(
7483
7483
  (x) => !x.labelName.includes("/")
7484
7484
  );
7485
- const [primaryLabelItem, setPrimaryLabelItem] = (0, import_react17.useState)({
7485
+ const [primaryLabelItem, setPrimaryLabelItem] = (0, import_react16.useState)({
7486
7486
  labelColor: [],
7487
7487
  labelName: "Primary",
7488
7488
  labelId: 0
7489
7489
  });
7490
- const [secondaryLabelItem, setSecondaryLabelItem] = (0, import_react17.useState)({
7490
+ const [secondaryLabelItem, setSecondaryLabelItem] = (0, import_react16.useState)({
7491
7491
  labelColor: [],
7492
7492
  labelName: "Secondary",
7493
7493
  labelId: 0
7494
7494
  });
7495
- const [tertiaryLabelItem, setTertiaryLabelItem] = (0, import_react17.useState)({
7495
+ const [tertiaryLabelItem, setTertiaryLabelItem] = (0, import_react16.useState)({
7496
7496
  labelColor: [],
7497
7497
  labelName: "Tertiary",
7498
7498
  labelId: 0
7499
7499
  });
7500
- const [currentLabelItem, setCurrentLabelItem] = (0, import_react17.useState)();
7500
+ const [currentLabelItem, setCurrentLabelItem] = (0, import_react16.useState)();
7501
7501
  const OnSubmitActiveLearning = () => __async(void 0, null, function* () {
7502
7502
  var _a2, _b2;
7503
7503
  setActiveLearningLoading(true);
@@ -8083,8 +8083,8 @@ var Annotation = (props) => {
8083
8083
 
8084
8084
  // src/Components/Evoland/EvolandLeftSideBar.tsx
8085
8085
  var import_router3 = require("next/router");
8086
- var import_core13 = require("@geowiki/core");
8087
- var import_react21 = require("react");
8086
+ var import_core14 = require("@geowiki/core");
8087
+ var import_react20 = require("react");
8088
8088
  var import_ui15 = require("@geowiki/ui");
8089
8089
  var import_react_hotkeys_hook2 = require("react-hotkeys-hook");
8090
8090
  var import_link2 = __toESM(require("next/link"));
@@ -8092,11 +8092,11 @@ var import_link2 = __toESM(require("next/link"));
8092
8092
  // src/Components/Evoland/GeoWikiTools.tsx
8093
8093
  var turf5 = __toESM(require("@turf/turf"));
8094
8094
  var import_geojson_to_kml = __toESM(require("geojson-to-kml"));
8095
- var import_react18 = require("react");
8095
+ var import_react17 = require("react");
8096
8096
  var import_jsx_runtime28 = require("react/jsx-runtime");
8097
8097
  var GeoWikiTools = () => {
8098
8098
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
8099
- const [esriDate, setEsriDate] = (0, import_react18.useState)(void 0);
8099
+ const [esriDate, setEsriDate] = (0, import_react17.useState)(void 0);
8100
8100
  const scale = 16;
8101
8101
  const evolandStore = evoland_default();
8102
8102
  const centroid3 = getCentroid(
@@ -8520,11 +8520,11 @@ var AssetOpacity = (props) => {
8520
8520
  };
8521
8521
 
8522
8522
  // src/Components/ViewAssets.tsx
8523
- var import_react19 = require("react");
8524
- var import_core10 = require("@geowiki/core");
8523
+ var import_react18 = require("react");
8524
+ var import_core11 = require("@geowiki/core");
8525
8525
 
8526
8526
  // src/Components/Evoland/RasterImage.tsx
8527
- var import_core9 = require("@geowiki/core");
8527
+ var import_core10 = require("@geowiki/core");
8528
8528
  var import_jsx_runtime30 = require("react/jsx-runtime");
8529
8529
  var RasterImageWithColorMap = (props) => {
8530
8530
  var _a, _b, _c, _d, _e;
@@ -8533,7 +8533,7 @@ var RasterImageWithColorMap = (props) => {
8533
8533
  imgUri && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
8534
8534
  "div",
8535
8535
  {
8536
- className: (0, import_core9.classNames)(
8536
+ className: (0, import_core10.classNames)(
8537
8537
  "relative text-xs border-y border-x hover:border-gray-600",
8538
8538
  ((_a = props.selectedItem) == null ? void 0 : _a.id) === ((_b = props.rasterAssetItem) == null ? void 0 : _b.id) && " border-blue-600 bg-primary",
8539
8539
  props.selectedItem === null || ((_c = props.selectedItem) == null ? void 0 : _c.id) !== ((_d = props.rasterAssetItem) == null ? void 0 : _d.id) && "border-gray-300"
@@ -8577,46 +8577,46 @@ var assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, ite
8577
8577
  var ViewAssets = (props) => {
8578
8578
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
8579
8579
  const evolandStore = evoland_default();
8580
- const [submittedAnnotations, setSubmittedAnnotations] = (0, import_react19.useState)(
8580
+ const [submittedAnnotations, setSubmittedAnnotations] = (0, import_react18.useState)(
8581
8581
  evolandStore.submittedAnnotations !== null ? evolandStore.submittedAnnotations : []
8582
8582
  );
8583
- const [savedAnnotations, setSavedAnnotations] = (0, import_react19.useState)(
8583
+ const [savedAnnotations, setSavedAnnotations] = (0, import_react18.useState)(
8584
8584
  evolandStore.savedAnnotations !== null ? evolandStore.savedAnnotations : null
8585
8585
  );
8586
- const [maskTab, setMaskTab] = (0, import_react19.useState)(
8586
+ const [maskTab, setMaskTab] = (0, import_react18.useState)(
8587
8587
  props.defaultAssetView == "SEGMENTATION_MASK" /* SegmentationMask */ ? true : false
8588
8588
  );
8589
- const [changeMaskTab, setChangeMaskTab] = (0, import_react19.useState)(
8589
+ const [changeMaskTab, setChangeMaskTab] = (0, import_react18.useState)(
8590
8590
  props.defaultAssetView == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */ ? true : false
8591
8591
  );
8592
- const [annotationTab, setAnnotationTab] = (0, import_react19.useState)(false);
8593
- const [compositesTab, setCompositesTab] = (0, import_react19.useState)(
8592
+ const [annotationTab, setAnnotationTab] = (0, import_react18.useState)(false);
8593
+ const [compositesTab, setCompositesTab] = (0, import_react18.useState)(
8594
8594
  props.defaultAssetView == "COMPOSITE" /* Composite */ ? true : false
8595
8595
  );
8596
- const [masks, setMasks] = (0, import_react19.useState)(
8596
+ const [masks, setMasks] = (0, import_react18.useState)(
8597
8597
  evolandStore.maskAsset !== null ? evolandStore.maskAsset : []
8598
8598
  );
8599
- const [changeMasks, setChangeMasks] = (0, import_react19.useState)(
8599
+ const [changeMasks, setChangeMasks] = (0, import_react18.useState)(
8600
8600
  evolandStore.changeMaskAsset !== null ? evolandStore.changeMaskAsset : []
8601
8601
  );
8602
- const [annotations, setAnnotations] = (0, import_react19.useState)(
8602
+ const [annotations, setAnnotations] = (0, import_react18.useState)(
8603
8603
  evolandStore.annotatedRasterAsset !== null ? [evolandStore.annotatedRasterAsset] : []
8604
8604
  );
8605
- const [composites, setComposites] = (0, import_react19.useState)(
8605
+ const [composites, setComposites] = (0, import_react18.useState)(
8606
8606
  evolandStore.compositeAsset !== null ? assetsByYear(evolandStore.compositeAsset) : []
8607
8607
  );
8608
- const [fetchAnnotationRaster, setFetchAnnotationRaster] = (0, import_react19.useState)(false);
8608
+ const [fetchAnnotationRaster, setFetchAnnotationRaster] = (0, import_react18.useState)(false);
8609
8609
  const {
8610
8610
  data: taskAnnotation,
8611
8611
  isLoading: IsTaskAnnotationLoading,
8612
8612
  error
8613
- } = (0, import_core10.useTaskMultipleAnnotations)(
8613
+ } = (0, import_core11.useTaskMultipleAnnotations)(
8614
8614
  props.taskId !== void 0 && props.taskId !== 0 && submittedAnnotations.length == 0 ? props.taskId : submittedAnnotations.length == 0 && evolandStore.currentTask != null && ((_a = evolandStore.currentTask) == null ? void 0 : _a.task_id) !== void 0 ? evolandStore.currentTask.task_id : null
8615
8615
  );
8616
- const { data: taskSavedAnnotation } = (0, import_core10.useTaskSavedAnnotations)(
8616
+ const { data: taskSavedAnnotation } = (0, import_core11.useTaskSavedAnnotations)(
8617
8617
  props.taskId !== void 0 && props.taskId !== 0 && savedAnnotations == null ? props.taskId : savedAnnotations == null && evolandStore.currentTask != null && ((_b = evolandStore.currentTask) == null ? void 0 : _b.task_id) !== void 0 && evolandStore.currentTask.saved_annotation !== null ? evolandStore.currentTask.task_id : null
8618
8618
  );
8619
- const { data: latestTaskOnLocation } = (0, import_core10.useLatestTaskOnLocation)(
8619
+ const { data: latestTaskOnLocation } = (0, import_core11.useLatestTaskOnLocation)(
8620
8620
  props.locationId,
8621
8621
  props.projectId,
8622
8622
  evolandStore.referenceDate
@@ -8763,7 +8763,7 @@ var ViewAssets = (props) => {
8763
8763
  (masks == null ? void 0 : masks.length) > 0 && evolandStore.maskAsset && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
8764
8764
  "button",
8765
8765
  {
8766
- className: (0, import_core10.classNames)(
8766
+ className: (0, import_core11.classNames)(
8767
8767
  "border-r border-t border-gray-300",
8768
8768
  !maskTab && "bg-primary"
8769
8769
  ),
@@ -8780,7 +8780,7 @@ var ViewAssets = (props) => {
8780
8780
  ((_d = evolandStore.changeMaskAsset) == null ? void 0 : _d.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
8781
8781
  "button",
8782
8782
  {
8783
- className: (0, import_core10.classNames)(
8783
+ className: (0, import_core11.classNames)(
8784
8784
  "border-r border-t border-gray-300",
8785
8785
  !changeMaskTab && "bg-primary"
8786
8786
  ),
@@ -8797,7 +8797,7 @@ var ViewAssets = (props) => {
8797
8797
  showAnnotationTab && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
8798
8798
  "button",
8799
8799
  {
8800
- className: (0, import_core10.classNames)(
8800
+ className: (0, import_core11.classNames)(
8801
8801
  "border-r border-t border-gray-300 px-1",
8802
8802
  !annotationTab && "bg-primary"
8803
8803
  ),
@@ -8814,7 +8814,7 @@ var ViewAssets = (props) => {
8814
8814
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
8815
8815
  "button",
8816
8816
  {
8817
- className: (0, import_core10.classNames)(
8817
+ className: (0, import_core11.classNames)(
8818
8818
  "border-r border-t border-gray-300 px-1",
8819
8819
  !compositesTab && "bg-primary"
8820
8820
  ),
@@ -9115,40 +9115,40 @@ var ViewAssets = (props) => {
9115
9115
  };
9116
9116
 
9117
9117
  // src/Components/Evoland/SearchAnnotation.tsx
9118
- var import_react20 = require("react");
9119
- var import_core11 = require("@geowiki/core");
9118
+ var import_react19 = require("react");
9119
+ var import_core12 = require("@geowiki/core");
9120
9120
  var import_ui14 = require("@geowiki/ui");
9121
9121
  var import_jsx_runtime32 = require("react/jsx-runtime");
9122
9122
  var SearchAnnotation = (props) => {
9123
- const { data: users, isLoading: IsUsersLoading } = (0, import_core11.useProjectUsers)(
9123
+ const { data: users, isLoading: IsUsersLoading } = (0, import_core12.useProjectUsers)(
9124
9124
  props.projectId
9125
9125
  );
9126
- const { data: taskStatusList, isLoading: IsTaskStatusLoading } = (0, import_core11.useTaskStatusList)();
9127
- const { data: groups, isLoading: IsGroupsLoading } = (0, import_core11.useGroupsInProject)(
9126
+ const { data: taskStatusList, isLoading: IsTaskStatusLoading } = (0, import_core12.useTaskStatusList)();
9127
+ const { data: groups, isLoading: IsGroupsLoading } = (0, import_core12.useGroupsInProject)(
9128
9128
  props.projectId
9129
9129
  );
9130
- const [searchUser, setSearchUser] = (0, import_react20.useState)(
9130
+ const [searchUser, setSearchUser] = (0, import_react19.useState)(
9131
9131
  !localStorage.getItem("searchUser") ? "" : localStorage.getItem("searchUser")
9132
9132
  );
9133
- const [searchGroup, setsearchGroup] = (0, import_react20.useState)(
9133
+ const [searchGroup, setsearchGroup] = (0, import_react19.useState)(
9134
9134
  !localStorage.getItem("searchGroup") ? "" : localStorage.getItem("searchGroup")
9135
9135
  );
9136
- const [searchStatus, setSearchStatus] = (0, import_react20.useState)(
9137
- !localStorage.getItem("searchStatus") ? import_core11.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus")
9136
+ const [searchStatus, setSearchStatus] = (0, import_react19.useState)(
9137
+ !localStorage.getItem("searchStatus") ? import_core12.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus")
9138
9138
  );
9139
- const [fromDate, setFromDate] = (0, import_react20.useState)(
9139
+ const [fromDate, setFromDate] = (0, import_react19.useState)(
9140
9140
  localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : ""
9141
9141
  );
9142
- const [toDate, setToDate] = (0, import_react20.useState)(
9142
+ const [toDate, setToDate] = (0, import_react19.useState)(
9143
9143
  !localStorage.getItem("toDate") ? "" : localStorage.getItem("toDate")
9144
9144
  );
9145
- const { data: tasks } = (0, import_core11.useRandomTasksPerLocation)({
9145
+ const { data: tasks } = (0, import_core12.useRandomTasksPerLocation)({
9146
9146
  taskForReview: props.taskForReview,
9147
9147
  pageIdx: 0,
9148
9148
  pageSize: searchUser == void 0 && searchGroup == void 0 ? 1 : 10,
9149
9149
  locationProjectId: props.projectId,
9150
9150
  groupName: searchGroup || null,
9151
- statusIn: searchUser == void 0 && searchStatus == void 0 ? import_core11.TaskStatus.SUBMITTED : searchStatus,
9151
+ statusIn: searchUser == void 0 && searchStatus == void 0 ? import_core12.TaskStatus.SUBMITTED : searchStatus,
9152
9152
  dateGte: fromDate,
9153
9153
  dateLte: toDate,
9154
9154
  userUserAlias: searchUser || null
@@ -9249,7 +9249,7 @@ var SearchAnnotation = (props) => {
9249
9249
  "option",
9250
9250
  {
9251
9251
  value: x,
9252
- selected: searchStatus === void 0 ? x === import_core11.TaskStatus.SUBMITTED : searchStatus == x,
9252
+ selected: searchStatus === void 0 ? x === import_core12.TaskStatus.SUBMITTED : searchStatus == x,
9253
9253
  children: x
9254
9254
  },
9255
9255
  index
@@ -9337,12 +9337,12 @@ var SearchAnnotation = (props) => {
9337
9337
  onClick: () => {
9338
9338
  setSearchUser("");
9339
9339
  setsearchGroup("");
9340
- setSearchStatus(import_core11.TaskStatus.SUBMITTED);
9340
+ setSearchStatus(import_core12.TaskStatus.SUBMITTED);
9341
9341
  setFromDate("");
9342
9342
  setToDate("");
9343
9343
  localStorage.removeItem("searchUser");
9344
9344
  localStorage.removeItem("searchGroup");
9345
- localStorage.setItem("searchStatus", import_core11.TaskStatus.SUBMITTED);
9345
+ localStorage.setItem("searchStatus", import_core12.TaskStatus.SUBMITTED);
9346
9346
  localStorage.removeItem("fromDate");
9347
9347
  localStorage.removeItem("toDate");
9348
9348
  },
@@ -9363,7 +9363,7 @@ var SearchAnnotation = (props) => {
9363
9363
  };
9364
9364
 
9365
9365
  // src/Components/Evoland/TaskEventLog.tsx
9366
- var import_core12 = require("@geowiki/core");
9366
+ var import_core13 = require("@geowiki/core");
9367
9367
  var import_jsx_runtime33 = require("react/jsx-runtime");
9368
9368
  var TaskEventLog = (props) => {
9369
9369
  return Object.entries(props.taskEventsGrouped).map(
@@ -9371,12 +9371,12 @@ var TaskEventLog = (props) => {
9371
9371
  var _a, _b, _c, _d;
9372
9372
  let tempAnnotationId = "";
9373
9373
  let tempComment = "";
9374
- if (x[1][0].event_type == import_core12.TaskEventType.NEW_ANNOTATION)
9374
+ if (x[1][0].event_type == import_core13.TaskEventType.NEW_ANNOTATION)
9375
9375
  tempAnnotationId = x[1][0].content;
9376
- if (x[1][0].event_type == import_core12.TaskEventType.COMMENT)
9376
+ if (x[1][0].event_type == import_core13.TaskEventType.COMMENT)
9377
9377
  tempComment = x[1][0].content;
9378
9378
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9379
- x[1].length == 1 && (x[1][0].event_type == import_core12.TaskEventType.CREATED ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9379
+ x[1].length == 1 && (x[1][0].event_type == import_core13.TaskEventType.CREATED ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9380
9380
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5", children: [
9381
9381
  "System - ",
9382
9382
  (_a = x[1][0]) == null ? void 0 : _a.event_time
@@ -9387,13 +9387,13 @@ var TaskEventLog = (props) => {
9387
9387
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: (_b = x[1][0]) == null ? void 0 : _b.actor_alias })
9388
9388
  ] })
9389
9389
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-white", children: [
9390
- x[1][0].event_type !== import_core12.TaskEventType.NEW_ANNOTATION && x[1][0].event_type !== import_core12.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
9390
+ x[1][0].event_type !== import_core13.TaskEventType.NEW_ANNOTATION && x[1][0].event_type !== import_core13.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
9391
9391
  (_c = x[1][0]) == null ? void 0 : _c.actor_alias,
9392
9392
  " - ",
9393
9393
  (_d = x[1][0]) == null ? void 0 : _d.event_time
9394
9394
  ] }),
9395
- x[1][0].event_type == import_core12.TaskEventType.REVIEW && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-black text-xs leading-5", children: x[1][0].content }),
9396
- (x[1][0].event_type == import_core12.TaskEventType.STATUS_UPDATED || x[1][0].event_type == import_core12.TaskEventType.COMMENT) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
9395
+ x[1][0].event_type == import_core13.TaskEventType.REVIEW && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-black text-xs leading-5", children: x[1][0].content }),
9396
+ (x[1][0].event_type == import_core13.TaskEventType.STATUS_UPDATED || x[1][0].event_type == import_core13.TaskEventType.COMMENT) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
9397
9397
  tempAnnotationId !== "" && tempComment == "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9398
9398
  " ",
9399
9399
  "Status changed to : ",
@@ -9431,17 +9431,17 @@ var TaskEventLog = (props) => {
9431
9431
  ] })
9432
9432
  ] }, index)),
9433
9433
  x[1].length > 1 && x[1].map((y, yIndex) => {
9434
- if (y.event_type == import_core12.TaskEventType.NEW_ANNOTATION)
9434
+ if (y.event_type == import_core13.TaskEventType.NEW_ANNOTATION)
9435
9435
  tempAnnotationId = y.content;
9436
- if (y.event_type == import_core12.TaskEventType.COMMENT)
9436
+ if (y.event_type == import_core13.TaskEventType.COMMENT)
9437
9437
  tempComment = y.content;
9438
9438
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-white", children: [
9439
- y.event_type !== import_core12.TaskEventType.NEW_ANNOTATION && y.event_type !== import_core12.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
9439
+ y.event_type !== import_core13.TaskEventType.NEW_ANNOTATION && y.event_type !== import_core13.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
9440
9440
  y == null ? void 0 : y.actor_alias,
9441
9441
  " - ",
9442
9442
  y == null ? void 0 : y.event_time
9443
9443
  ] }),
9444
- (y.event_type == import_core12.TaskEventType.STATUS_UPDATED || y.event_type == import_core12.TaskEventType.COMMENT || y.event_type == import_core12.TaskEventType.QUESTIONNAIRE || y.event_type == import_core12.TaskEventType.REVIEW) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
9444
+ (y.event_type == import_core13.TaskEventType.STATUS_UPDATED || y.event_type == import_core13.TaskEventType.COMMENT || y.event_type == import_core13.TaskEventType.QUESTIONNAIRE || y.event_type == import_core13.TaskEventType.REVIEW) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
9445
9445
  tempAnnotationId !== "" && tempComment == "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9446
9446
  " ",
9447
9447
  "Status changed to : ",
@@ -9449,12 +9449,12 @@ var TaskEventLog = (props) => {
9449
9449
  " with new Annotation :",
9450
9450
  tempAnnotationId
9451
9451
  ] }),
9452
- tempAnnotationId == "" && tempComment == "" && y.event_type !== import_core12.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9452
+ tempAnnotationId == "" && tempComment == "" && y.event_type !== import_core13.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
9453
9453
  " ",
9454
9454
  "Status changed to : ",
9455
9455
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: y.content })
9456
9456
  ] }),
9457
- tempAnnotationId == "" && tempComment == "" && y.event_type == import_core12.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: "Questionnaire filled" }),
9457
+ tempAnnotationId == "" && tempComment == "" && y.event_type == import_core13.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: "Questionnaire filled" }),
9458
9458
  tempComment !== "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex", children: [
9459
9459
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9460
9460
  "svg",
@@ -9493,7 +9493,7 @@ var EvolandLeftSideBar = (props) => {
9493
9493
  var locationId = router.query.locationId;
9494
9494
  const projectId = parseInt(router.query.projectId);
9495
9495
  const review = router.query.review;
9496
- const [checkLocation, setCheckLocation] = (0, import_react21.useState)(false);
9496
+ const [checkLocation, setCheckLocation] = (0, import_react20.useState)(false);
9497
9497
  const evolandStore = evoland_default();
9498
9498
  if (review && !evolandStore.task_for_review)
9499
9499
  evolandStore.setTaskForReview(true);
@@ -9501,46 +9501,46 @@ var EvolandLeftSideBar = (props) => {
9501
9501
  setCheckLocation(true);
9502
9502
  alert("Invalid location or project");
9503
9503
  }
9504
- const [masks, setMasks] = (0, import_react21.useState)([]);
9505
- const [changemasks, setChangeMasks] = (0, import_react21.useState)([]);
9506
- const [annotations, setAnnotations] = (0, import_react21.useState)([]);
9507
- const [fetchMasks, setFetchMasks] = (0, import_react21.useState)(false);
9508
- const [fetchChangeMasks, setFetchChangeMasks] = (0, import_react21.useState)(false);
9509
- const { data: latestTaskOnLocation } = (0, import_core13.useLatestTaskOnLocation)(
9504
+ const [masks, setMasks] = (0, import_react20.useState)([]);
9505
+ const [changemasks, setChangeMasks] = (0, import_react20.useState)([]);
9506
+ const [annotations, setAnnotations] = (0, import_react20.useState)([]);
9507
+ const [fetchMasks, setFetchMasks] = (0, import_react20.useState)(false);
9508
+ const [fetchChangeMasks, setFetchChangeMasks] = (0, import_react20.useState)(false);
9509
+ const { data: latestTaskOnLocation } = (0, import_core14.useLatestTaskOnLocation)(
9510
9510
  locationId,
9511
9511
  projectId,
9512
9512
  evolandStore.referenceDate
9513
9513
  );
9514
- const [savedAnnotations] = (0, import_react21.useState)(
9514
+ const [savedAnnotations] = (0, import_react20.useState)(
9515
9515
  evolandStore.savedAnnotations !== null ? evolandStore.savedAnnotations : null
9516
9516
  );
9517
- const [composites, setComposites] = (0, import_react21.useState)([]);
9518
- const [isFetchUserTask, setIsFetchUserTask] = (0, import_react21.useState)(false);
9519
- const [adminTasks, setAdminTasks] = (0, import_react21.useState)();
9520
- const [deleteTask, setDeleteTask] = (0, import_react21.useState)(false);
9517
+ const [composites, setComposites] = (0, import_react20.useState)([]);
9518
+ const [isFetchUserTask, setIsFetchUserTask] = (0, import_react20.useState)(false);
9519
+ const [adminTasks, setAdminTasks] = (0, import_react20.useState)();
9520
+ const [deleteTask, setDeleteTask] = (0, import_react20.useState)(false);
9521
9521
  var taskId = router.query.taskId == void 0 ? (_a = evolandStore.currentTask) == null ? void 0 : _a.task_id : router.query.taskId;
9522
- const { data: taskSavedAnnotation } = (0, import_core13.useTaskSavedAnnotations)(
9522
+ const { data: taskSavedAnnotation } = (0, import_core14.useTaskSavedAnnotations)(
9523
9523
  taskId !== void 0 && parseInt(taskId) !== 0 && savedAnnotations == null ? parseInt(taskId) : savedAnnotations == null && evolandStore.currentTask != null && ((_b = evolandStore.currentTask) == null ? void 0 : _b.task_id) !== void 0 && evolandStore.currentTask.saved_annotation !== null ? evolandStore.currentTask.task_id : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? latestTaskOnLocation.task_id : null
9524
9524
  );
9525
- const { data: TaskDeleted, isLoading: IsTaskDeletedLoading } = (0, import_core13.useTaskDelete)(
9525
+ const { data: TaskDeleted, isLoading: IsTaskDeletedLoading } = (0, import_core14.useTaskDelete)(
9526
9526
  taskId !== void 0 && parseInt(taskId) !== 0 ? parseInt(taskId) : (_c = evolandStore.currentTask) == null ? void 0 : _c.task_id,
9527
9527
  projectId,
9528
9528
  deleteTask
9529
9529
  );
9530
- const { data: tasks } = (0, import_core13.useRandomTasksPerLocation)({
9530
+ const { data: tasks } = (0, import_core14.useRandomTasksPerLocation)({
9531
9531
  taskForReview: evolandStore.task_for_review,
9532
9532
  pageIdx: 0,
9533
9533
  pageSize: 1,
9534
9534
  locationProjectId: projectId,
9535
9535
  groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
9536
9536
  search: null,
9537
- statusIn: !localStorage.getItem("searchStatus") ? import_core13.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
9537
+ statusIn: !localStorage.getItem("searchStatus") ? import_core14.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
9538
9538
  dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
9539
9539
  dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
9540
9540
  userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
9541
9541
  locationLocationId: null
9542
9542
  });
9543
- const [savedAnnotationTime, setSavedAnnotationTime] = (0, import_react21.useState)(
9543
+ const [savedAnnotationTime, setSavedAnnotationTime] = (0, import_react20.useState)(
9544
9544
  null
9545
9545
  );
9546
9546
  const showAnnotationTab = showAnnotation(
@@ -9681,10 +9681,10 @@ var EvolandLeftSideBar = (props) => {
9681
9681
  "div",
9682
9682
  {
9683
9683
  style: {
9684
- backgroundColor: ((_p = evolandStore.currentTask) == null ? void 0 : _p.status) !== null && ((_q = evolandStore.currentTask) == null ? void 0 : _q.status) !== void 0 ? import_core13.TaskStatusColor[(_r = evolandStore.currentTask) == null ? void 0 : _r.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core13.TaskStatusColor[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "white"
9684
+ backgroundColor: ((_p = evolandStore.currentTask) == null ? void 0 : _p.status) !== null && ((_q = evolandStore.currentTask) == null ? void 0 : _q.status) !== void 0 ? import_core14.TaskStatusColor[(_r = evolandStore.currentTask) == null ? void 0 : _r.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core14.TaskStatusColor[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "white"
9685
9685
  },
9686
- className: "pl-2 pr-2 flex rounded-lg text-center " + (((_s = evolandStore.currentTask) == null ? void 0 : _s.status) !== null && ((_t = evolandStore.currentTask) == null ? void 0 : _t.status) !== void 0 ? "bg-" + import_core13.TaskStatusColor[(_u = evolandStore.currentTask) == null ? void 0 : _u.status] + "-500" : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? "bg-" + import_core13.TaskStatusColor[latestTaskOnLocation.task_status] + "-500" : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "bg-white-500"),
9687
- children: ((_v = evolandStore.currentTask) == null ? void 0 : _v.status) !== null && ((_w = evolandStore.currentTask) == null ? void 0 : _w.status) !== void 0 ? import_core13.TaskStatus[(_x = evolandStore.currentTask) == null ? void 0 : _x.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core13.TaskStatus[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.task_id) ? "Not started" : ""
9686
+ className: "pl-2 pr-2 flex rounded-lg text-center " + (((_s = evolandStore.currentTask) == null ? void 0 : _s.status) !== null && ((_t = evolandStore.currentTask) == null ? void 0 : _t.status) !== void 0 ? "bg-" + import_core14.TaskStatusColor[(_u = evolandStore.currentTask) == null ? void 0 : _u.status] + "-500" : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? "bg-" + import_core14.TaskStatusColor[latestTaskOnLocation.task_status] + "-500" : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "bg-white-500"),
9687
+ children: ((_v = evolandStore.currentTask) == null ? void 0 : _v.status) !== null && ((_w = evolandStore.currentTask) == null ? void 0 : _w.status) !== void 0 ? import_core14.TaskStatus[(_x = evolandStore.currentTask) == null ? void 0 : _x.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core14.TaskStatus[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.task_id) ? "Not started" : ""
9688
9688
  }
9689
9689
  ) }),
9690
9690
  locationId && projectId && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_ui15.Popover, { children: [
@@ -9855,10 +9855,10 @@ var EvolandLeftSideBar = (props) => {
9855
9855
  "div",
9856
9856
  {
9857
9857
  style: {
9858
- backgroundColor: import_core13.TaskStatusColor[x.status]
9858
+ backgroundColor: import_core14.TaskStatusColor[x.status]
9859
9859
  },
9860
9860
  className: "pl-2 pr-2 flex rounded-lg text-center",
9861
- children: import_core13.TaskStatus[x.status]
9861
+ children: import_core14.TaskStatus[x.status]
9862
9862
  }
9863
9863
  )
9864
9864
  ] }, index)) })
@@ -9933,8 +9933,8 @@ var EvolandLeftSideBar = (props) => {
9933
9933
  // src/Components/Evoland/Questions.tsx
9934
9934
  var import_ui16 = require("@geowiki/ui");
9935
9935
  var import_router4 = require("next/router");
9936
- var import_core14 = require("@geowiki/core");
9937
- var import_react22 = require("react");
9936
+ var import_core15 = require("@geowiki/core");
9937
+ var import_react21 = require("react");
9938
9938
  var import_evoland_api_proxy5 = require("@geowiki/evoland-api-proxy");
9939
9939
  var import_navigation2 = require("next/navigation");
9940
9940
  var import_jsx_runtime35 = require("react/jsx-runtime");
@@ -9945,23 +9945,23 @@ var Questions = (props) => {
9945
9945
  const searchParams = (0, import_navigation2.useSearchParams)();
9946
9946
  const projectId = searchParams.get("projectId");
9947
9947
  const taskId = searchParams.get("taskId");
9948
- const { data: labels } = (0, import_core14.useEvolandLabels)(parseInt(projectId));
9949
- const [taskChangeDetail, setTaskChangeDetail] = (0, import_react22.useState)(null);
9950
- var { data: questionnaire, isLoading: IsQuestionnaireLoading } = (0, import_core14.useQuestionnaire)(parseInt(projectId));
9951
- const [context, setContext] = (0, import_react22.useState)();
9952
- const [singleChoice, setSingleChoice] = (0, import_react22.useState)();
9953
- const [status, setStatus] = (0, import_react22.useState)();
9954
- const [submitNotification, setSubmitNotification] = (0, import_react22.useState)(false);
9955
- const [noNextLocation, setNoNextLocation] = (0, import_react22.useState)(false);
9956
- const [goToNextTask, setGoToNextTask] = (0, import_react22.useState)(false);
9957
- const [submitNotificationMessage, setSubmitNotificationMessage] = (0, import_react22.useState)("");
9958
- const [disableSubmit, setDisableSubmit] = (0, import_react22.useState)(false);
9959
- const [userAnswers, setUserAnswers] = (0, import_react22.useState)([]);
9948
+ const { data: labels } = (0, import_core15.useEvolandLabels)(parseInt(projectId));
9949
+ const [taskChangeDetail, setTaskChangeDetail] = (0, import_react21.useState)(null);
9950
+ var { data: questionnaire, isLoading: IsQuestionnaireLoading } = (0, import_core15.useQuestionnaire)(parseInt(projectId));
9951
+ const [context, setContext] = (0, import_react21.useState)();
9952
+ const [singleChoice, setSingleChoice] = (0, import_react21.useState)();
9953
+ const [status, setStatus] = (0, import_react21.useState)();
9954
+ const [submitNotification, setSubmitNotification] = (0, import_react21.useState)(false);
9955
+ const [noNextLocation, setNoNextLocation] = (0, import_react21.useState)(false);
9956
+ const [goToNextTask, setGoToNextTask] = (0, import_react21.useState)(false);
9957
+ const [submitNotificationMessage, setSubmitNotificationMessage] = (0, import_react21.useState)("");
9958
+ const [disableSubmit, setDisableSubmit] = (0, import_react21.useState)(false);
9959
+ const [userAnswers, setUserAnswers] = (0, import_react21.useState)([]);
9960
9960
  let requiredUserAnswers = 0;
9961
- const { data: taskAnswers, isLoading: IsTaskAnswerLoading } = (0, import_core14.useTaskAnswers)(
9961
+ const { data: taskAnswers, isLoading: IsTaskAnswerLoading } = (0, import_core15.useTaskAnswers)(
9962
9962
  taskId ? parseInt(taskId) : ((_a = evolandStore.currentTask) == null ? void 0 : _a.task_id) ? (_b = evolandStore.currentTask) == null ? void 0 : _b.task_id : 0
9963
9963
  );
9964
- (0, import_react22.useEffect)(() => {
9964
+ (0, import_react21.useEffect)(() => {
9965
9965
  var _a2, _b2;
9966
9966
  if (evolandStore.currentTask) {
9967
9967
  if (((_a2 = evolandStore.currentTask) == null ? void 0 : _a2.change_id) && !taskChangeDetail)
@@ -10012,14 +10012,14 @@ var Questions = (props) => {
10012
10012
  });
10013
10013
  }
10014
10014
  };
10015
- const { data: tasks } = (0, import_core14.useRandomTasksPerLocation)({
10015
+ const { data: tasks } = (0, import_core15.useRandomTasksPerLocation)({
10016
10016
  taskForReview: evolandStore.task_for_review,
10017
10017
  pageIdx: 0,
10018
10018
  pageSize: 1,
10019
10019
  locationProjectId: parseInt(projectId),
10020
10020
  groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
10021
10021
  search: null,
10022
- statusIn: !localStorage.getItem("searchStatus") ? import_core14.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
10022
+ statusIn: !localStorage.getItem("searchStatus") ? import_core15.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
10023
10023
  dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
10024
10024
  dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
10025
10025
  userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
@@ -10037,7 +10037,7 @@ var Questions = (props) => {
10037
10037
  project_id: parseInt(projectId),
10038
10038
  target_status: taskStatus[0],
10039
10039
  task_type: ((_a2 = evolandStore.projectDetail) == null ? void 0 : _a2.meta_data.QUESTIONNAIRE) ? [import_evoland_api_proxy5.TaskType.QUESTIONNAIRE] : [],
10040
- annotation_time: taskStatus[1] === (import_core14.AnnotationRequired.NOT_REQUIRED || import_core14.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
10040
+ annotation_time: taskStatus[1] === (import_core15.AnnotationRequired.NOT_REQUIRED || import_core15.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
10041
10041
  questionnaire: userAnswers.map((item) => [
10042
10042
  item.question_id,
10043
10043
  item.answer_text
@@ -10047,7 +10047,7 @@ var Questions = (props) => {
10047
10047
  try {
10048
10048
  var response = yield import_evoland_api_proxy5.TaskService.updateTaskUpdatetaskPost(submitReq);
10049
10049
  if (response !== void 0) {
10050
- response ? taskStatus[1] == import_core14.AnnotationRequired.REQUIRED || taskStatus[1] === import_core14.AnnotationRequired.OPTIONAL && ((_c2 = (_b2 = evolandStore.annotationUndoRedo) == null ? void 0 : _b2.past) == null ? void 0 : _c2.pop()) !== void 0 ? setSubmitNotificationMessage(
10050
+ response ? taskStatus[1] == import_core15.AnnotationRequired.REQUIRED || taskStatus[1] === import_core15.AnnotationRequired.OPTIONAL && ((_c2 = (_b2 = evolandStore.annotationUndoRedo) == null ? void 0 : _b2.past) == null ? void 0 : _c2.pop()) !== void 0 ? setSubmitNotificationMessage(
10051
10051
  "Task has been moved to " + taskStatus[0].toUpperCase() + " state successfully with selected answers. Moving to next location, please wait."
10052
10052
  ) : setSubmitNotificationMessage(
10053
10053
  "Task has been moved to " + taskStatus[0].toUpperCase() + " successfully. Moving to next location, please wait."
@@ -10119,11 +10119,11 @@ var Questions = (props) => {
10119
10119
  });
10120
10120
  if (questionnaire && !context)
10121
10121
  setContext(
10122
- questionnaire.filter((x) => x.type == import_core14.QuestionnaireType.CONTEXT).sort((x, y) => x.order_id - y.order_id)
10122
+ questionnaire.filter((x) => x.type == import_core15.QuestionnaireType.CONTEXT).sort((x, y) => x.order_id - y.order_id)
10123
10123
  );
10124
10124
  if (questionnaire && !singleChoice)
10125
10125
  setSingleChoice(
10126
- questionnaire.filter((x) => x.type == import_core14.QuestionnaireType.SINGLE_CHOICE).sort((x, y) => x.order_id - y.order_id)
10126
+ questionnaire.filter((x) => x.type == import_core15.QuestionnaireType.SINGLE_CHOICE).sort((x, y) => x.order_id - y.order_id)
10127
10127
  );
10128
10128
  if (context && taskChangeDetail) {
10129
10129
  context.filter((x) => x.has_dynamic_answers).map((y) => {
@@ -10179,7 +10179,7 @@ var Questions = (props) => {
10179
10179
  });
10180
10180
  }
10181
10181
  if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
10182
- if (status == import_core14.TaskStatus.ACCEPTED || status == import_core14.TaskStatus.DISCARDED || status == import_core14.TaskStatus.TO_FIX) {
10182
+ if (status == import_core15.TaskStatus.ACCEPTED || status == import_core15.TaskStatus.DISCARDED || status == import_core15.TaskStatus.TO_FIX) {
10183
10183
  setGoToNextTask(true);
10184
10184
  if (props.userRole === "admin")
10185
10185
  if (tasks == null ? void 0 : tasks.task)
@@ -10272,7 +10272,7 @@ var Questions = (props) => {
10272
10272
  }
10273
10273
  ),
10274
10274
  evolandStore.currentTask !== null && ((_k = (_j = evolandStore.currentTask) == null ? void 0 : _j.transition_states) == null ? void 0 : _k.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-center", children: [
10275
- ((_l = evolandStore.currentTask) == null ? void 0 : _l.status) !== import_core14.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
10275
+ ((_l = evolandStore.currentTask) == null ? void 0 : _l.status) !== import_core15.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
10276
10276
  import_ui16.Button,
10277
10277
  {
10278
10278
  className: "mb-2 mt-2 mr-2 text-xs -flex-col",
@@ -10328,16 +10328,16 @@ var Questions = (props) => {
10328
10328
  {
10329
10329
  disabled: disableSubmit,
10330
10330
  style: {
10331
- backgroundColor: import_core14.TaskStatusColor[x[0]]
10331
+ backgroundColor: import_core15.TaskStatusColor[x[0]]
10332
10332
  },
10333
10333
  className: "h-6 text-xs p-1 m-1 text-forground-black -px-4 -py-2 w-full",
10334
10334
  onClick: () => {
10335
- if (import_core14.TaskState[x[0]] !== import_core14.TaskState.SKIPPED && import_core14.TaskState[x[0]] !== import_core14.TaskState.DISCARDED && import_core14.TaskState[x[0]] !== import_core14.TaskState.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
10335
+ if (import_core15.TaskState[x[0]] !== import_core15.TaskState.SKIPPED && import_core15.TaskState[x[0]] !== import_core15.TaskState.DISCARDED && import_core15.TaskState[x[0]] !== import_core15.TaskState.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
10336
10336
  alert("Please provide all answers");
10337
10337
  else
10338
10338
  onSubmit(x);
10339
10339
  },
10340
- children: import_core14.TaskState[x[0]]
10340
+ children: import_core15.TaskState[x[0]]
10341
10341
  }
10342
10342
  ) });
10343
10343
  }
@@ -10364,14 +10364,14 @@ var Questions = (props) => {
10364
10364
  };
10365
10365
 
10366
10366
  // src/Components/TimeSeries.tsx
10367
- var import_react23 = require("react");
10367
+ var import_react22 = require("react");
10368
10368
  var turf6 = __toESM(require("@turf/turf"));
10369
10369
  var import_jsx_runtime36 = require("react/jsx-runtime");
10370
10370
  var TimeSeries = () => {
10371
10371
  const evolandStore = useEvolandStore();
10372
- const [detailedImgUrls, setDetailedImgUrls] = (0, import_react23.useState)([]);
10373
- const [taskChangeYears, setTaskChangeYears] = (0, import_react23.useState)([]);
10374
- const [currentTab, setCurrentTab] = (0, import_react23.useState)(0);
10372
+ const [detailedImgUrls, setDetailedImgUrls] = (0, import_react22.useState)([]);
10373
+ const [taskChangeYears, setTaskChangeYears] = (0, import_react22.useState)([]);
10374
+ const [currentTab, setCurrentTab] = (0, import_react22.useState)(0);
10375
10375
  const minDate = evolandStore.referenceDate + "-01-01";
10376
10376
  const maxDate = evolandStore.referenceDate + "-12-31";
10377
10377
  function fetchImages(layerName, changeYears = null) {
@@ -10425,7 +10425,7 @@ var TimeSeries = () => {
10425
10425
  }
10426
10426
  });
10427
10427
  }
10428
- (0, import_react23.useEffect)(() => {
10428
+ (0, import_react22.useEffect)(() => {
10429
10429
  var _a, _b, _c, _d;
10430
10430
  setDetailedImgUrls([]);
10431
10431
  if ((_a = evolandStore.currentTask) == null ? void 0 : _a.change_id)
@@ -10615,13 +10615,13 @@ var TimeSeries = () => {
10615
10615
  };
10616
10616
 
10617
10617
  // src/Components/OverlayLayer.tsx
10618
- var import_core15 = require("@geowiki/core");
10619
- var import_react24 = require("react");
10618
+ var import_core16 = require("@geowiki/core");
10619
+ var import_react23 = require("react");
10620
10620
  var import_jsx_runtime37 = require("react/jsx-runtime");
10621
10621
  var OverlayLayer = () => {
10622
10622
  const layerStore = useMapLayerStore();
10623
- const { data: wmsLayerNames } = (0, import_core15.useEvolandWmsLayers)();
10624
- const [showLayerOpacity, setShowLayerOpacity] = (0, import_react24.useState)(false);
10623
+ const { data: wmsLayerNames } = (0, import_core16.useEvolandWmsLayers)();
10624
+ const [showLayerOpacity, setShowLayerOpacity] = (0, import_react23.useState)(false);
10625
10625
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "w-full items-center mt-2 justify-center text-xs", children: [
10626
10626
  showLayerOpacity && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-2", children: [
10627
10627
  "Overlay Layer's opacity",
@@ -10679,12 +10679,12 @@ var OverlayLayer = () => {
10679
10679
 
10680
10680
  // src/Components/Map/BasicMap.tsx
10681
10681
  var import_leaflet10 = require("leaflet/dist/leaflet.css");
10682
- var import_react37 = require("react");
10682
+ var import_react36 = require("react");
10683
10683
  var import_react_leaflet15 = require("react-leaflet");
10684
- var import_core21 = require("@geowiki/core");
10684
+ var import_core22 = require("@geowiki/core");
10685
10685
 
10686
10686
  // src/Components/Map/LayerList.tsx
10687
- var import_react25 = require("react");
10687
+ var import_react24 = require("react");
10688
10688
 
10689
10689
  // src/store/baseLayerStore.ts
10690
10690
  var import_zustand5 = require("zustand");
@@ -10697,7 +10697,7 @@ var useBaseLayerStore = (0, import_zustand5.create)((set) => ({
10697
10697
  var import_react_leaflet12 = require("react-leaflet");
10698
10698
 
10699
10699
  // src/utils/BingLayer.ts
10700
- var import_core16 = require("@react-leaflet/core");
10700
+ var import_core17 = require("@react-leaflet/core");
10701
10701
 
10702
10702
  // src/utils/LeafletBing.ts
10703
10703
  var L13 = __toESM(require("leaflet"));
@@ -10824,7 +10824,7 @@ var BingLayer = class extends L13.TileLayer {
10824
10824
  };
10825
10825
 
10826
10826
  // src/utils/BingLayer.ts
10827
- var BingLeafletLayer = (0, import_core16.createLayerComponent)(function createBingLayer(_a, context) {
10827
+ var BingLeafletLayer = (0, import_core17.createLayerComponent)(function createBingLayer(_a, context) {
10828
10828
  var _b = _a, { apiKey } = _b, options = __objRest(_b, ["apiKey"]);
10829
10829
  const instance = new BingLayer(apiKey, options);
10830
10830
  return {
@@ -10917,7 +10917,7 @@ var BaseLayer = ({ layerName }) => {
10917
10917
  var import_jsx_runtime39 = require("react/jsx-runtime");
10918
10918
  var LayerList = ({ selectedLayer }) => {
10919
10919
  const storeSelectedLayer = useBaseLayerStore((state) => state.selectedLayer);
10920
- (0, import_react25.useEffect)(() => {
10920
+ (0, import_react24.useEffect)(() => {
10921
10921
  if (selectedLayer) {
10922
10922
  useBaseLayerStore.setState({ selectedLayer });
10923
10923
  }
@@ -10979,10 +10979,10 @@ var useMapControlActions = () => useMapControlStore(
10979
10979
  );
10980
10980
 
10981
10981
  // src/Components/Map/BasicMapControlList.tsx
10982
- var import_react32 = require("react");
10982
+ var import_react31 = require("react");
10983
10983
 
10984
10984
  // src/Components/Controls/Legend.tsx
10985
- var import_react26 = require("react");
10985
+ var import_react25 = require("react");
10986
10986
  var import_ui18 = require("@geowiki/ui");
10987
10987
 
10988
10988
  // src/Components/Basf/GeoServerLegend.tsx
@@ -11315,7 +11315,7 @@ var CustomLegend = ({ layer }) => {
11315
11315
  };
11316
11316
 
11317
11317
  // src/Components/Controls/Legend.tsx
11318
- var import_core17 = require("@dnd-kit/core");
11318
+ var import_core18 = require("@dnd-kit/core");
11319
11319
  var import_sortable2 = require("@dnd-kit/sortable");
11320
11320
  var import_utilities = require("@dnd-kit/utilities");
11321
11321
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
@@ -11324,7 +11324,7 @@ var import_ui20 = require("@geowiki/ui");
11324
11324
  var import_jsx_runtime44 = require("react/jsx-runtime");
11325
11325
  var OpacityControl = ({ layer, onClose }) => {
11326
11326
  const { updateOpacity } = mapLayers_default();
11327
- const [opacity, setOpacity] = (0, import_react26.useState)(layer.opacity || 100);
11327
+ const [opacity, setOpacity] = (0, import_react25.useState)(layer.opacity || 100);
11328
11328
  const handleOpacityChange = (e) => {
11329
11329
  const newOpacity = parseFloat(e.target.value);
11330
11330
  setOpacity(newOpacity);
@@ -11427,7 +11427,7 @@ var SortableLayerItem = ({ layer, id, isOneLegend }) => {
11427
11427
  disabled: isOneLegend || !(layer == null ? void 0 : layer.layerName)
11428
11428
  });
11429
11429
  const { remove } = mapLayers_default();
11430
- const [popoverOpen, setPopoverOpen] = (0, import_react26.useState)(false);
11430
+ const [popoverOpen, setPopoverOpen] = (0, import_react25.useState)(false);
11431
11431
  const style = {
11432
11432
  transform: import_utilities.CSS.Transform.toString(transform),
11433
11433
  transition
@@ -11528,26 +11528,26 @@ var SortableLayerItem = ({ layer, id, isOneLegend }) => {
11528
11528
  };
11529
11529
  var Legend = () => {
11530
11530
  const { layers, reorderLayers } = mapLayers_default();
11531
- const [isLoading, setIsLoading] = (0, import_react26.useState)(true);
11532
- const [isOneLegend, setIsOneLegend] = (0, import_react26.useState)(false);
11533
- const sensors = (0, import_core17.useSensors)(
11534
- (0, import_core17.useSensor)(import_core17.PointerSensor),
11535
- (0, import_core17.useSensor)(import_core17.KeyboardSensor, {
11531
+ const [isLoading, setIsLoading] = (0, import_react25.useState)(true);
11532
+ const [isOneLegend, setIsOneLegend] = (0, import_react25.useState)(false);
11533
+ const sensors = (0, import_core18.useSensors)(
11534
+ (0, import_core18.useSensor)(import_core18.PointerSensor),
11535
+ (0, import_core18.useSensor)(import_core18.KeyboardSensor, {
11536
11536
  coordinateGetter: import_sortable2.sortableKeyboardCoordinates
11537
11537
  }),
11538
- (0, import_core17.useSensor)(import_core17.TouchSensor, {
11538
+ (0, import_core18.useSensor)(import_core18.TouchSensor, {
11539
11539
  activationConstraint: {
11540
11540
  delay: 250,
11541
11541
  tolerance: 10
11542
11542
  }
11543
11543
  })
11544
11544
  );
11545
- (0, import_react26.useEffect)(() => {
11545
+ (0, import_react25.useEffect)(() => {
11546
11546
  if (Array.isArray(layers)) {
11547
11547
  setIsLoading(false);
11548
11548
  }
11549
11549
  }, [layers]);
11550
- (0, import_react26.useEffect)(() => {
11550
+ (0, import_react25.useEffect)(() => {
11551
11551
  if (layers.length === 1) {
11552
11552
  setIsOneLegend(true);
11553
11553
  } else {
@@ -11576,10 +11576,10 @@ var Legend = () => {
11576
11576
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: " text-base font-medium leading-[120%] max-w-[280px]", children: "There are currently no active layers." });
11577
11577
  }
11578
11578
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "max-h-[60vh] overflow-y-auto space-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11579
- import_core17.DndContext,
11579
+ import_core18.DndContext,
11580
11580
  {
11581
11581
  sensors,
11582
- collisionDetection: import_core17.closestCenter,
11582
+ collisionDetection: import_core18.closestCenter,
11583
11583
  onDragEnd: isOneLegend ? void 0 : handleDragEnd,
11584
11584
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11585
11585
  import_sortable2.SortableContext,
@@ -11602,9 +11602,9 @@ var Legend = () => {
11602
11602
  };
11603
11603
 
11604
11604
  // src/Components/Controls/CustomBaseLayerControl.tsx
11605
- var import_react27 = require("react");
11605
+ var import_react26 = require("react");
11606
11606
  var import_image3 = __toESM(require("next/image"));
11607
- var import_core18 = require("@geowiki/core");
11607
+ var import_core19 = require("@geowiki/core");
11608
11608
  var import_jsx_runtime45 = require("react/jsx-runtime");
11609
11609
  var BASE_LAYERS = [
11610
11610
  {
@@ -11658,11 +11658,11 @@ var LayerButton = ({
11658
11658
  );
11659
11659
  var CustomBaseLayerControl = () => {
11660
11660
  const { selectedLayer, setSelectedLayer } = useBaseLayerStore();
11661
- const [showAll, setShowAll] = (0, import_react27.useState)(false);
11661
+ const [showAll, setShowAll] = (0, import_react26.useState)(false);
11662
11662
  const visibleLayers = showAll ? BASE_LAYERS : BASE_LAYERS.slice(0, 3);
11663
11663
  const handleLayerChange = (layerName) => {
11664
11664
  setSelectedLayer(layerName);
11665
- import_core18.trackMapEvent.baseLayerChange(layerName);
11665
+ import_core19.trackMapEvent.baseLayerChange(layerName);
11666
11666
  };
11667
11667
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
11668
11668
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "hidden lg:grid lg:grid-cols-4 lg:gap-x-1 lg:gap-y-2", children: [
@@ -11720,17 +11720,17 @@ var CustomBaseLayerControl = () => {
11720
11720
  };
11721
11721
 
11722
11722
  // src/Components/Controls/LayerSwitcher.tsx
11723
- var import_react28 = require("react");
11724
- var import_core19 = require("@geowiki/core");
11723
+ var import_react27 = require("react");
11724
+ var import_core20 = require("@geowiki/core");
11725
11725
  var import_ui21 = require("@geowiki/ui");
11726
- var import_react29 = require("@headlessui/react");
11727
- var import_react30 = require("react");
11726
+ var import_react28 = require("@headlessui/react");
11727
+ var import_react29 = require("react");
11728
11728
  var import_outline = require("@heroicons/react/24/outline");
11729
- var import_react31 = require("@headlessui/react");
11729
+ var import_react30 = require("@headlessui/react");
11730
11730
  var import_lucide_react3 = require("lucide-react");
11731
11731
  var import_uuid2 = require("uuid");
11732
11732
  var import_jsx_runtime46 = require("react/jsx-runtime");
11733
- var LayerInfoIcon = (0, import_react28.memo)(({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
11733
+ var LayerInfoIcon = (0, import_react27.memo)(({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
11734
11734
  "svg",
11735
11735
  {
11736
11736
  width: "20",
@@ -11755,7 +11755,7 @@ var LayerInfoIcon = (0, import_react28.memo)(({ onClick }) => /* @__PURE__ */ (0
11755
11755
  }
11756
11756
  ));
11757
11757
  LayerInfoIcon.displayName = "LayerInfoIcon";
11758
- var LayerItemInfo = (0, import_react28.memo)(({ layer, open, setOpen }) => {
11758
+ var LayerItemInfo = (0, import_react27.memo)(({ layer, open, setOpen }) => {
11759
11759
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
11760
11760
  const isCustomLayer = "isCustom" in layer && layer.isCustom;
11761
11761
  const mapDetails = [
@@ -11794,11 +11794,11 @@ var LayerItemInfo = (0, import_react28.memo)(({ layer, open, setOpen }) => {
11794
11794
  { label: "Custom Layer", value: "Yes" }
11795
11795
  ] : []
11796
11796
  ];
11797
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react29.Transition.Root, { show: open, as: import_react30.Fragment, "data-component": "ResourceView", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react29.Dialog, { as: "div", className: "relative z-20", onClose: setOpen, children: [
11797
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react28.Transition.Root, { show: open, as: import_react29.Fragment, "data-component": "ResourceView", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react28.Dialog, { as: "div", className: "relative z-20", onClose: setOpen, children: [
11798
11798
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11799
- import_react29.Transition.Child,
11799
+ import_react28.Transition.Child,
11800
11800
  {
11801
- as: import_react30.Fragment,
11801
+ as: import_react29.Fragment,
11802
11802
  enter: "ease-out duration-300",
11803
11803
  enterFrom: "opacity-0",
11804
11804
  enterTo: "opacity-100",
@@ -11809,16 +11809,16 @@ var LayerItemInfo = (0, import_react28.memo)(({ layer, open, setOpen }) => {
11809
11809
  }
11810
11810
  ),
11811
11811
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "fixed z-10 inset-0 overflow-y-auto text-black", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-end sm:items-center justify-center min-h-full text-center lg:p-4", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11812
- import_react29.Transition.Child,
11812
+ import_react28.Transition.Child,
11813
11813
  {
11814
- as: import_react30.Fragment,
11814
+ as: import_react29.Fragment,
11815
11815
  enter: "ease-out duration-300",
11816
11816
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
11817
11817
  enterTo: "opacity-100 translate-y-0 sm:scale-100",
11818
11818
  leave: "ease-in duration-200",
11819
11819
  leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
11820
11820
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
11821
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react29.Dialog.Panel, { className: "w-screen relative bg-white rounded-t-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all lg:rounded-lg sm:my-8 sm:w-[740px] sm:p-10", children: [
11821
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react28.Dialog.Panel, { className: "w-screen relative bg-white rounded-t-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all lg:rounded-lg sm:my-8 sm:w-[740px] sm:p-10", children: [
11822
11822
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "absolute top-0 right-0 pt-3 pr-3 lg:pt-10 lg:pr-10", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
11823
11823
  "button",
11824
11824
  {
@@ -11856,7 +11856,7 @@ var LayerItemInfo = (0, import_react28.memo)(({ layer, open, setOpen }) => {
11856
11856
  ] }) });
11857
11857
  });
11858
11858
  LayerItemInfo.displayName = "LayerItemInfo";
11859
- var LayerItem = (0, import_react28.memo)(
11859
+ var LayerItem = (0, import_react27.memo)(
11860
11860
  ({
11861
11861
  layer,
11862
11862
  isActive,
@@ -11865,7 +11865,7 @@ var LayerItem = (0, import_react28.memo)(
11865
11865
  onInfoClick
11866
11866
  }) => {
11867
11867
  var _a;
11868
- const [open, setOpen] = (0, import_react28.useState)(false);
11868
+ const [open, setOpen] = (0, import_react27.useState)(false);
11869
11869
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("li", { className: "bg-white rounded-xl p-4 lg:w-[310px] lg:p-0", children: [
11870
11870
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-row justify-between items-center", children: [
11871
11871
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-row justify-start items-center space-x-2", children: [
@@ -11915,19 +11915,19 @@ var LayerItem = (0, import_react28.memo)(
11915
11915
  }
11916
11916
  );
11917
11917
  LayerItem.displayName = "LayerItem";
11918
- var LayerSwitcher = (0, import_react28.memo)(() => {
11919
- const { data: mapMenuItems, error, isLoading } = (0, import_core19.useMapMenuItems)();
11918
+ var LayerSwitcher = (0, import_react27.memo)(() => {
11919
+ const { data: mapMenuItems, error, isLoading } = (0, import_core20.useMapMenuItems)();
11920
11920
  const store = mapLayers_default();
11921
11921
  const { customLayers } = useCustomLayerStore();
11922
11922
  console.log("customLayers from layerSwitcher", customLayers);
11923
- const [openHoverCardId, setOpenHoverCardId] = (0, import_react28.useState)(null);
11924
- const handleToggle = (0, import_react28.useCallback)(
11923
+ const [openHoverCardId, setOpenHoverCardId] = (0, import_react27.useState)(null);
11924
+ const handleToggle = (0, import_react27.useCallback)(
11925
11925
  (layer) => {
11926
11926
  store.layers.findIndex((l) => l.id === layer.id) !== -1 ? store.remove(layer) : store.add(layer);
11927
11927
  },
11928
11928
  [store]
11929
11929
  );
11930
- const handleInfoClick = (0, import_react28.useCallback)(
11930
+ const handleInfoClick = (0, import_react27.useCallback)(
11931
11931
  (id) => {
11932
11932
  setOpenHoverCardId(openHoverCardId === id ? null : id);
11933
11933
  },
@@ -11948,14 +11948,14 @@ var LayerSwitcher = (0, import_react28.memo)(() => {
11948
11948
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
11949
11949
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "hidden lg:block", children: [
11950
11950
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11951
- import_react31.Disclosure,
11951
+ import_react30.Disclosure,
11952
11952
  {
11953
11953
  "data-component": menu.title,
11954
11954
  defaultOpen: mapMenus.length === 1,
11955
11955
  children: ({ open }) => {
11956
11956
  var _a2;
11957
11957
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
11958
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react31.Disclosure.Button, { className: "w-[310px] flex-row flex justify-between items-center gap-2 border-zinc-300 ", children: [
11958
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react30.Disclosure.Button, { className: "w-[310px] flex-row flex justify-between items-center gap-2 border-zinc-300 ", children: [
11959
11959
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-normal uppercase text-grey leading-[130%]", children: menu.title }),
11960
11960
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11961
11961
  import_lucide_react3.ChevronDown,
@@ -11965,7 +11965,7 @@ var LayerSwitcher = (0, import_react28.memo)(() => {
11965
11965
  }
11966
11966
  )
11967
11967
  ] }),
11968
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react31.Disclosure.Panel, { className: "space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("ul", { className: "pt-2 space-y-2", children: [
11968
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react30.Disclosure.Panel, { className: "space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("ul", { className: "pt-2 space-y-2", children: [
11969
11969
  index === 0 && hasCustomLayers && customLayers.map((layer) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11970
11970
  LayerItem,
11971
11971
  {
@@ -12038,7 +12038,7 @@ var import_jsx_runtime47 = require("react/jsx-runtime");
12038
12038
  var BasicMapControlList = () => {
12039
12039
  const setControls = useMapControlStore((state) => state.setControls);
12040
12040
  const map = (0, import_react_leaflet14.useMap)();
12041
- (0, import_react32.useEffect)(() => {
12041
+ (0, import_react31.useEffect)(() => {
12042
12042
  setControls([
12043
12043
  {
12044
12044
  id: "basemap",
@@ -12093,13 +12093,13 @@ var BasicMapControlList = () => {
12093
12093
  };
12094
12094
 
12095
12095
  // src/Components/Controls/MapControlContainer.tsx
12096
- var import_react36 = __toESM(require("react"));
12096
+ var import_react35 = __toESM(require("react"));
12097
12097
  var Popover5 = __toESM(require("@radix-ui/react-popover"));
12098
12098
 
12099
12099
  // src/Components/Controls/ControlComponents.tsx
12100
- var import_react33 = __toESM(require("react"));
12100
+ var import_react32 = __toESM(require("react"));
12101
12101
  var Popover4 = __toESM(require("@radix-ui/react-popover"));
12102
- var import_core20 = require("@geowiki/core");
12102
+ var import_core21 = require("@geowiki/core");
12103
12103
  var import_jsx_runtime48 = require("react/jsx-runtime");
12104
12104
  var ControlPanel = ({
12105
12105
  title,
@@ -12123,7 +12123,7 @@ var ControlPanel = ({
12123
12123
  }
12124
12124
  ) });
12125
12125
  };
12126
- var SimpleControlButton = import_react33.default.forwardRef(
12126
+ var SimpleControlButton = import_react32.default.forwardRef(
12127
12127
  ({
12128
12128
  icon: Icon3,
12129
12129
  isActive = false,
@@ -12131,7 +12131,7 @@ var SimpleControlButton = import_react33.default.forwardRef(
12131
12131
  buttonName = "unknown_simple_button"
12132
12132
  }, ref) => {
12133
12133
  const handleClick = (event) => {
12134
- import_core20.trackUserEvent.mapControlClick(
12134
+ import_core21.trackUserEvent.mapControlClick(
12135
12135
  buttonName,
12136
12136
  isActive ? "active" : "inactive"
12137
12137
  );
@@ -12153,8 +12153,8 @@ var SimpleControlButton = import_react33.default.forwardRef(
12153
12153
  SimpleControlButton.displayName = "SimpleControlButton";
12154
12154
 
12155
12155
  // src/Components/Controls/MobileControlPanel.tsx
12156
- var import_react34 = require("react");
12157
- var import_react35 = require("@headlessui/react");
12156
+ var import_react33 = require("react");
12157
+ var import_react34 = require("@headlessui/react");
12158
12158
  var import_ui23 = require("@geowiki/ui");
12159
12159
  var import_jsx_runtime49 = require("react/jsx-runtime");
12160
12160
  var MobileControlPanel = ({
@@ -12165,16 +12165,16 @@ var MobileControlPanel = ({
12165
12165
  isFilter
12166
12166
  }) => {
12167
12167
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
12168
- import_react35.Transition.Root,
12168
+ import_react34.Transition.Root,
12169
12169
  {
12170
12170
  show,
12171
- as: import_react34.Fragment,
12171
+ as: import_react33.Fragment,
12172
12172
  "data-component": "PreviewClusterNews",
12173
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react35.Dialog, { as: "div", className: "relative z-10", onClose, children: [
12173
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react34.Dialog, { as: "div", className: "relative z-10", onClose, children: [
12174
12174
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
12175
- import_react35.Transition.Child,
12175
+ import_react34.Transition.Child,
12176
12176
  {
12177
- as: import_react34.Fragment,
12177
+ as: import_react33.Fragment,
12178
12178
  enter: "ease-out duration-300",
12179
12179
  enterFrom: "opacity-0",
12180
12180
  enterTo: "opacity-100",
@@ -12185,9 +12185,9 @@ var MobileControlPanel = ({
12185
12185
  }
12186
12186
  ),
12187
12187
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "fixed z-10 inset-0 overflow-y-auto text-black", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
12188
- import_react35.Transition.Child,
12188
+ import_react34.Transition.Child,
12189
12189
  {
12190
- as: import_react34.Fragment,
12190
+ as: import_react33.Fragment,
12191
12191
  enter: "ease-out duration-300",
12192
12192
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
12193
12193
  enterTo: "opacity-100 translate-y-0 sm:scale-100",
@@ -12195,7 +12195,7 @@ var MobileControlPanel = ({
12195
12195
  leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
12196
12196
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
12197
12197
  children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
12198
- import_react35.Dialog.Panel,
12198
+ import_react34.Dialog.Panel,
12199
12199
  {
12200
12200
  className: `lg:hidden w-screen absolute bottom-0 pt-5 pb-4 bg-white text-left overflow-hidden shadow-xl transform transition-all ${isFilter ? " bg-grey-lightest max-h-max" : "p-4 rounded-t-lg "} `,
12201
12201
  children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: " overflow-y-auto max-h-[calc(100dvh-2rem)]", children: [
@@ -12278,9 +12278,9 @@ var POSITION_CLASSES2 = {
12278
12278
  topleft: "leaflet-top leaflet-left",
12279
12279
  topright: "leaflet-top leaflet-right"
12280
12280
  };
12281
- var ControlItem = (0, import_react36.memo)(({ control, position }) => {
12281
+ var ControlItem = (0, import_react35.memo)(({ control, position }) => {
12282
12282
  const { toggleControlOpen } = useMapControlActions();
12283
- const handleToggleControl = (0, import_react36.useCallback)(() => {
12283
+ const handleToggleControl = (0, import_react35.useCallback)(() => {
12284
12284
  toggleControlOpen(control.id);
12285
12285
  }, [toggleControlOpen, control.id]);
12286
12286
  if (control.isDisplayOnly) {
@@ -12385,7 +12385,7 @@ var ControlItem = (0, import_react36.memo)(({ control, position }) => {
12385
12385
  ] });
12386
12386
  });
12387
12387
  ControlItem.displayName = "ControlItem";
12388
- var PositionGroup = (0, import_react36.memo)(({ position, className, controls }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "leaflet-control m-4", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex flex-col space-y-2", children: controls.map((control) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: `${control.id}`, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12388
+ var PositionGroup = (0, import_react35.memo)(({ position, className, controls }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "leaflet-control m-4", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex flex-col space-y-2", children: controls.map((control) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: `${control.id}`, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12389
12389
  ControlItem,
12390
12390
  {
12391
12391
  control,
@@ -12393,9 +12393,9 @@ var PositionGroup = (0, import_react36.memo)(({ position, className, controls })
12393
12393
  }
12394
12394
  ) }, control.id)) }) }) }));
12395
12395
  PositionGroup.displayName = "PositionGroup";
12396
- var MapControlContainer = (0, import_react36.memo)(() => {
12396
+ var MapControlContainer = (0, import_react35.memo)(() => {
12397
12397
  const controls = useMapControls();
12398
- const controlsByPosition = import_react36.default.useMemo(() => {
12398
+ const controlsByPosition = import_react35.default.useMemo(() => {
12399
12399
  const grouped = {};
12400
12400
  controls.forEach((control) => {
12401
12401
  if (!grouped[control.position]) {
@@ -12428,13 +12428,13 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
12428
12428
  var BasicMap = () => {
12429
12429
  var _a, _b, _c, _d, _e, _f;
12430
12430
  const { data: mapSettings, isLoading: isSettingsLoading } = (0, import_useMapSettings.default)();
12431
- const mapRef = (0, import_react37.useRef)(null);
12431
+ const mapRef = (0, import_react36.useRef)(null);
12432
12432
  var zoom = ((_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) || 12;
12433
12433
  var center4 = [
12434
12434
  ((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
12435
12435
  ((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
12436
12436
  ];
12437
- (0, import_core21.useRenderInfo)("BasicMap");
12437
+ (0, import_core22.useRenderInfo)("BasicMap");
12438
12438
  if (isSettingsLoading)
12439
12439
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
12440
12440
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
@@ -12466,26 +12466,26 @@ var BasicMap = () => {
12466
12466
 
12467
12467
  // src/Components/Map/BasfMap.tsx
12468
12468
  var import_leaflet14 = require("leaflet/dist/leaflet.css");
12469
- var import_react47 = require("react");
12469
+ var import_react46 = require("react");
12470
12470
  var import_react_leaflet19 = require("react-leaflet");
12471
12471
  var import_useMapSettings2 = __toESM(require("@geowiki/core/src/hooks/useMapSettings"));
12472
12472
  var import_ui33 = require("@geowiki/ui");
12473
12473
 
12474
12474
  // src/Components/Basf/BasfLayerList.tsx
12475
- var import_core23 = require("@geowiki/core");
12475
+ var import_core24 = require("@geowiki/core");
12476
12476
 
12477
12477
  // src/utils/WmsWithFilter.ts
12478
- var import_core22 = require("@react-leaflet/core");
12479
- var WMSWithFilterTileLayer = (0, import_core22.createTileLayerComponent)(
12478
+ var import_core23 = require("@react-leaflet/core");
12479
+ var WMSWithFilterTileLayer = (0, import_core23.createTileLayerComponent)(
12480
12480
  function createWMSTileLayer2(_a, context) {
12481
12481
  var _b = _a, { eventHandlers: _eh, params = {}, url } = _b, props = __objRest(_b, ["eventHandlers", "params", "url"]);
12482
12482
  const layer = new BetterWMS(url, __spreadValues(__spreadProps(__spreadValues({}, params), {
12483
12483
  url
12484
12484
  }), props));
12485
- return (0, import_core22.createElementObject)(layer, context);
12485
+ return (0, import_core23.createElementObject)(layer, context);
12486
12486
  },
12487
12487
  function updateWMSTileLayer2(layer, props, prevProps) {
12488
- (0, import_core22.updateGridLayer)(layer, props, prevProps);
12488
+ (0, import_core23.updateGridLayer)(layer, props, prevProps);
12489
12489
  if (props.params && props.params !== prevProps.params) {
12490
12490
  layer.setParams(props.params);
12491
12491
  }
@@ -12493,7 +12493,7 @@ var WMSWithFilterTileLayer = (0, import_core22.createTileLayerComponent)(
12493
12493
  );
12494
12494
 
12495
12495
  // src/Components/Basf/BasfMapLayer.tsx
12496
- var import_react38 = require("react");
12496
+ var import_react37 = require("react");
12497
12497
 
12498
12498
  // src/store/selectedPixel.ts
12499
12499
  var import_zustand7 = __toESM(require("zustand"));
@@ -12535,14 +12535,14 @@ var BasfMapLayer = (layerInfo) => {
12535
12535
  var geoServerUrl = "https://geoserver.iiasa.ac.at/geoserver/basf/wms?tiled=true";
12536
12536
  var layerName = "basf:BASFwithAreas";
12537
12537
  var cqlFilter = `ITEM='${layerInfo.item}' AND PRODUCT='${layerInfo.product}' AND PRICE='${layerInfo.price}' AND SCENARIO='${layerInfo.scenario}' AND Type='${layerInfo.formType}'`;
12538
- const allowedProperties = (0, import_react38.useMemo)(() => {
12538
+ const allowedProperties = (0, import_react37.useMemo)(() => {
12539
12539
  const properties = [];
12540
12540
  const selectedYear = "Year_" + layerInfo.year;
12541
12541
  properties.push(selectedYear);
12542
12542
  return properties;
12543
12543
  }, [layerInfo.year]);
12544
12544
  const setData = useSelectedPixelStore.getState().setData;
12545
- const memoedMapLayer = (0, import_react38.useMemo)(() => {
12545
+ const memoedMapLayer = (0, import_react37.useMemo)(() => {
12546
12546
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
12547
12547
  WMSWithFilterTileLayer,
12548
12548
  {
@@ -12580,22 +12580,22 @@ var BasfMapLayer = (layerInfo) => {
12580
12580
  // src/Components/Basf/BasfLayerList.tsx
12581
12581
  var import_jsx_runtime53 = require("react/jsx-runtime");
12582
12582
  var BasfLayerList = () => {
12583
- const basfStore = (0, import_core23.useBasfStore)();
12583
+ const basfStore = (0, import_core24.useBasfStore)();
12584
12584
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: basfStore.selectedItems.map((mapItem) => {
12585
12585
  return mapItem.enabled ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BasfMapLayer, __spreadValues({}, mapItem), mapItem.id) : null;
12586
12586
  }) });
12587
12587
  };
12588
12588
 
12589
12589
  // src/Components/Basf/SelectedPixelsLayer.tsx
12590
- var import_react39 = require("react");
12590
+ var import_react38 = require("react");
12591
12591
  var import_react_leaflet16 = require("react-leaflet");
12592
12592
  var import_leaflet11 = __toESM(require("leaflet"));
12593
12593
  var SelectedPixelsLayer = () => {
12594
12594
  const { data } = useSelectedPixelStore();
12595
- const layerRef = (0, import_react39.useRef)(null);
12595
+ const layerRef = (0, import_react38.useRef)(null);
12596
12596
  const map = (0, import_react_leaflet16.useMap)();
12597
- const prevDataRef = (0, import_react39.useRef)(data);
12598
- (0, import_react39.useEffect)(() => {
12597
+ const prevDataRef = (0, import_react38.useRef)(data);
12598
+ (0, import_react38.useEffect)(() => {
12599
12599
  if (!layerRef.current) {
12600
12600
  layerRef.current = import_leaflet11.default.layerGroup().addTo(map);
12601
12601
  }
@@ -12622,14 +12622,14 @@ var SelectedPixelsLayer = () => {
12622
12622
  // src/Components/Map/BasfControlList.tsx
12623
12623
  var import_react_leaflet18 = require("react-leaflet");
12624
12624
  var import_lucide_react4 = require("lucide-react");
12625
- var import_react46 = require("react");
12625
+ var import_react45 = require("react");
12626
12626
 
12627
12627
  // src/Components/Basf/BasfLegend.tsx
12628
- var import_core24 = require("@geowiki/core");
12628
+ var import_core25 = require("@geowiki/core");
12629
12629
 
12630
12630
  // src/Components/Basf/BasfItemCard.tsx
12631
12631
  var import_ui26 = require("@geowiki/ui");
12632
- var import_react40 = require("react");
12632
+ var import_react39 = require("react");
12633
12633
  var import_jsx_runtime54 = require("react/jsx-runtime");
12634
12634
  var BasfItemCard = ({
12635
12635
  item,
@@ -12639,12 +12639,12 @@ var BasfItemCard = ({
12639
12639
  formatDisplayValue: formatDisplayValue2
12640
12640
  }) => {
12641
12641
  const { data, latesData, clearData } = useSelectedPixelStore();
12642
- const [sumValues, setSumValues] = (0, import_react40.useState)(0);
12643
- const [value, setValue] = (0, import_react40.useState)(null);
12644
- const [area, setArea] = (0, import_react40.useState)(null);
12645
- const [sumAreas, setSumAreas] = (0, import_react40.useState)(0);
12642
+ const [sumValues, setSumValues] = (0, import_react39.useState)(0);
12643
+ const [value, setValue] = (0, import_react39.useState)(null);
12644
+ const [area, setArea] = (0, import_react39.useState)(null);
12645
+ const [sumAreas, setSumAreas] = (0, import_react39.useState)(0);
12646
12646
  const coefficient = 1e3;
12647
- (0, import_react40.useEffect)(() => {
12647
+ (0, import_react39.useEffect)(() => {
12648
12648
  const total = data.reduce((acc, geoJson) => {
12649
12649
  var _a;
12650
12650
  const properties = (_a = geoJson.features[0]) == null ? void 0 : _a.properties;
@@ -12670,7 +12670,7 @@ var BasfItemCard = ({
12670
12670
  }, 0);
12671
12671
  setSumAreas(totalArea);
12672
12672
  }, [data]);
12673
- (0, import_react40.useEffect)(() => {
12673
+ (0, import_react39.useEffect)(() => {
12674
12674
  var _a;
12675
12675
  if (latesData) {
12676
12676
  const properties = (_a = latesData.features[0]) == null ? void 0 : _a.properties;
@@ -12786,10 +12786,10 @@ var formatDisplayValue = (value) => value.replace(/[_-]/g, " ").replace(
12786
12786
  (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
12787
12787
  );
12788
12788
  var BasfLegend = () => {
12789
- const removeItem = (0, import_core24.useBasfStore)((state) => state.removeItem);
12790
- const updateItemOpacity = (0, import_core24.useBasfStore)((state) => state.updateItemOpacity);
12791
- const updateItemEnabled = (0, import_core24.useBasfStore)((state) => state.updateItemEnabled);
12792
- const selectedItems = (0, import_core24.useBasfStore)((state) => state.selectedItems);
12789
+ const removeItem = (0, import_core25.useBasfStore)((state) => state.removeItem);
12790
+ const updateItemOpacity = (0, import_core25.useBasfStore)((state) => state.updateItemOpacity);
12791
+ const updateItemEnabled = (0, import_core25.useBasfStore)((state) => state.updateItemEnabled);
12792
+ const selectedItems = (0, import_core25.useBasfStore)((state) => state.selectedItems);
12793
12793
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12794
12794
  "div",
12795
12795
  {
@@ -12812,27 +12812,27 @@ var BasfLegend = () => {
12812
12812
  var BasfLegend_default = BasfLegend;
12813
12813
 
12814
12814
  // src/Components/Basf/BasfSelect.tsx
12815
- var import_react44 = require("react");
12815
+ var import_react43 = require("react");
12816
12816
  var import_ui30 = require("@geowiki/ui");
12817
12817
  var import_react_hook_form3 = require("react-hook-form");
12818
12818
  var z = __toESM(require("zod"));
12819
12819
  var import_uuid3 = require("uuid");
12820
12820
  var import_zod = require("@hookform/resolvers/zod");
12821
- var import_core25 = require("@geowiki/core");
12821
+ var import_core26 = require("@geowiki/core");
12822
12822
 
12823
12823
  // src/Components/Basf/basf-form.tsx
12824
- var import_react43 = require("react");
12824
+ var import_react42 = require("react");
12825
12825
  var import_ui29 = require("@geowiki/ui");
12826
12826
  var import_react_hook_form2 = require("react-hook-form");
12827
12827
 
12828
12828
  // src/Components/Basf/form-select.tsx
12829
- var import_react41 = require("react");
12829
+ var import_react40 = require("react");
12830
12830
  var import_ui27 = require("@geowiki/ui");
12831
12831
  var import_react_hook_form = require("react-hook-form");
12832
12832
  var import_jsx_runtime56 = require("react/jsx-runtime");
12833
- var ForwardedSelect = (0, import_react41.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_ui27.Select, __spreadProps(__spreadValues({}, props), { ref })));
12833
+ var ForwardedSelect = (0, import_react40.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_ui27.Select, __spreadProps(__spreadValues({}, props), { ref })));
12834
12834
  ForwardedSelect.displayName = "ForwardedSelect";
12835
- var FormSelect = (0, import_react41.memo)(
12835
+ var FormSelect = (0, import_react40.memo)(
12836
12836
  ({ name, control, label, options, placeholder, errors }) => {
12837
12837
  var _a;
12838
12838
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2", children: [
@@ -12864,14 +12864,14 @@ FormSelect.displayName = "FormSelect";
12864
12864
  var form_select_default = FormSelect;
12865
12865
 
12866
12866
  // src/Components/Basf/price-slider.tsx
12867
- var import_react42 = require("react");
12867
+ var import_react41 = require("react");
12868
12868
  var import_ui28 = require("@geowiki/ui");
12869
12869
  var import_jsx_runtime57 = require("react/jsx-runtime");
12870
- var PriceSlider = (0, import_react42.memo)(({ value, onChange, errors }) => {
12870
+ var PriceSlider = (0, import_react41.memo)(({ value, onChange, errors }) => {
12871
12871
  var _a;
12872
- const steps = (0, import_react42.useMemo)(() => [20, 50, 100], []);
12872
+ const steps = (0, import_react41.useMemo)(() => [20, 50, 100], []);
12873
12873
  const valueIndex = steps.indexOf(Number(value));
12874
- const handleValueChange = (0, import_react42.useCallback)(
12874
+ const handleValueChange = (0, import_react41.useCallback)(
12875
12875
  (val) => {
12876
12876
  const newValue = steps[val[0]].toString();
12877
12877
  onChange(newValue);
@@ -12923,7 +12923,7 @@ var BIOMASS_ITEMS = [
12923
12923
  { value: "economic_potential", label: "Economic potential" },
12924
12924
  { value: "un-used_economic_potential", label: "Un-used economic potential" }
12925
12925
  ];
12926
- var BasfForm = (0, import_react43.memo)(
12926
+ var BasfForm = (0, import_react42.memo)(
12927
12927
  ({
12928
12928
  onSubmit,
12929
12929
  control,
@@ -13115,15 +13115,15 @@ var formSchema = z.object({
13115
13115
  }
13116
13116
  ).default("2020")
13117
13117
  });
13118
- var ForwardedSelect2 = (0, import_react44.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_ui30.Select, __spreadProps(__spreadValues({}, props), { ref })));
13118
+ var ForwardedSelect2 = (0, import_react43.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_ui30.Select, __spreadProps(__spreadValues({}, props), { ref })));
13119
13119
  ForwardedSelect2.displayName = "ForwardedSelect";
13120
13120
  var BasfSelect = () => {
13121
- const [isSubmitting, setIsSubmitting] = (0, import_react44.useState)(false);
13121
+ const [isSubmitting, setIsSubmitting] = (0, import_react43.useState)(false);
13122
13122
  const { clearData } = useSelectedPixelStore();
13123
- const [isReset, setIsReset] = (0, import_react44.useState)(false);
13124
- const addItem = (0, import_core25.useBasfStore)((0, import_react44.useCallback)((state) => state.addItem, []));
13125
- const selectedItems = (0, import_core25.useBasfStore)(
13126
- (0, import_react44.useCallback)((state) => state.selectedItems, [])
13123
+ const [isReset, setIsReset] = (0, import_react43.useState)(false);
13124
+ const addItem = (0, import_core26.useBasfStore)((0, import_react43.useCallback)((state) => state.addItem, []));
13125
+ const selectedItems = (0, import_core26.useBasfStore)(
13126
+ (0, import_react43.useCallback)((state) => state.selectedItems, [])
13127
13127
  );
13128
13128
  const {
13129
13129
  control,
@@ -13156,7 +13156,7 @@ var BasfSelect = () => {
13156
13156
  { key: "selectedItem", value: item },
13157
13157
  { key: "selectedYear", value: year }
13158
13158
  ];
13159
- const checkIfItemExists = (0, import_react44.useCallback)(
13159
+ const checkIfItemExists = (0, import_react43.useCallback)(
13160
13160
  (data) => {
13161
13161
  return selectedItems.some(
13162
13162
  (item2) => item2.formType === data.formType && item2.scenario === data.scenario && item2.price === data.price && item2.product === data.product && item2.item === data.item && item2.year === data.year
@@ -13164,7 +13164,7 @@ var BasfSelect = () => {
13164
13164
  },
13165
13165
  [selectedItems]
13166
13166
  );
13167
- const onSubmit = (0, import_react44.useCallback)(
13167
+ const onSubmit = (0, import_react43.useCallback)(
13168
13168
  (data) => __async(void 0, null, function* () {
13169
13169
  setIsSubmitting(true);
13170
13170
  try {
@@ -13188,7 +13188,7 @@ var BasfSelect = () => {
13188
13188
  }),
13189
13189
  [checkIfItemExists, addItem]
13190
13190
  );
13191
- (0, import_react44.useEffect)(() => {
13191
+ (0, import_react43.useEffect)(() => {
13192
13192
  if (!isReset) {
13193
13193
  if (formType === "CropProduction") {
13194
13194
  reset({
@@ -13212,14 +13212,14 @@ var BasfSelect = () => {
13212
13212
  }
13213
13213
  setIsReset(false);
13214
13214
  }, [formType]);
13215
- (0, import_react44.useEffect)(() => {
13215
+ (0, import_react43.useEffect)(() => {
13216
13216
  formDataKeys.forEach(({ key, value }) => {
13217
13217
  if (value) {
13218
13218
  localStorage.setItem(key, value);
13219
13219
  }
13220
13220
  });
13221
13221
  }, [formType, product, scenario, price, item, year]);
13222
- (0, import_react44.useEffect)(() => {
13222
+ (0, import_react43.useEffect)(() => {
13223
13223
  const formData = formDataKeys.reduce(
13224
13224
  (acc, { key }) => {
13225
13225
  acc[key] = localStorage.getItem(key) === null ? void 0 : localStorage.getItem(key);
@@ -13257,24 +13257,24 @@ var BasfSelect = () => {
13257
13257
  }
13258
13258
  ) });
13259
13259
  };
13260
- var BasfSelect_default = (0, import_react44.memo)(BasfSelect);
13260
+ var BasfSelect_default = (0, import_react43.memo)(BasfSelect);
13261
13261
 
13262
13262
  // src/Components/Map/BasfControlList.tsx
13263
13263
  var import_ui32 = require("@geowiki/ui");
13264
13264
 
13265
13265
  // src/Components/Controls/MeasureControl.tsx
13266
- var import_react45 = require("react");
13266
+ var import_react44 = require("react");
13267
13267
  var import_react_leaflet17 = require("react-leaflet");
13268
13268
  var import_leaflet12 = __toESM(require("leaflet"));
13269
13269
  var import_leaflet13 = require("leaflet.polylinemeasure");
13270
13270
  var import_ui31 = require("@geowiki/ui");
13271
- var import_core26 = require("@geowiki/core");
13271
+ var import_core27 = require("@geowiki/core");
13272
13272
  var import_jsx_runtime60 = require("react/jsx-runtime");
13273
13273
  function PolylineMeasureControl() {
13274
13274
  const map = (0, import_react_leaflet17.useMap)();
13275
- const controlRef = (0, import_react45.useRef)(null);
13276
- const [active, setActive] = (0, import_react45.useState)(false);
13277
- (0, import_react45.useEffect)(() => {
13275
+ const controlRef = (0, import_react44.useRef)(null);
13276
+ const [active, setActive] = (0, import_react44.useState)(false);
13277
+ (0, import_react44.useEffect)(() => {
13278
13278
  if (!map)
13279
13279
  return;
13280
13280
  controlRef.current = import_leaflet12.default.control.polylineMeasure({
@@ -13306,18 +13306,18 @@ function PolylineMeasureControl() {
13306
13306
  if (active) {
13307
13307
  controlRef.current._toggleMeasure();
13308
13308
  setActive(false);
13309
- import_core26.trackMapEvent.measurementTool("stop");
13309
+ import_core27.trackMapEvent.measurementTool("stop");
13310
13310
  } else {
13311
13311
  controlRef.current._toggleMeasure();
13312
13312
  setActive(true);
13313
- import_core26.trackMapEvent.measurementTool("start");
13313
+ import_core27.trackMapEvent.measurementTool("start");
13314
13314
  }
13315
13315
  };
13316
13316
  const clearMeasurements = () => {
13317
13317
  if (!controlRef.current)
13318
13318
  return;
13319
13319
  controlRef.current._clearAllMeasurements();
13320
- import_core26.trackMapEvent.measurementTool("clear");
13320
+ import_core27.trackMapEvent.measurementTool("clear");
13321
13321
  };
13322
13322
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2", children: [
13323
13323
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_ui31.Button, { onClick: togglePolylineMeasure, children: active ? "Stop" : "Start" }),
@@ -13344,7 +13344,7 @@ var BasfControlList = ({ steps }) => {
13344
13344
  }
13345
13345
  }
13346
13346
  };
13347
- (0, import_react46.useEffect)(() => {
13347
+ (0, import_react45.useEffect)(() => {
13348
13348
  setControls([
13349
13349
  {
13350
13350
  id: "startTour",
@@ -13416,7 +13416,7 @@ var BasfMapComponent = (_a) => {
13416
13416
  ]);
13417
13417
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
13418
13418
  const { data: mapSettings, isLoading: isSettingsLoading } = (0, import_useMapSettings2.default)();
13419
- const mapRef = (0, import_react47.useRef)(null);
13419
+ const mapRef = (0, import_react46.useRef)(null);
13420
13420
  const mapStore = map_default();
13421
13421
  const zoom = (_c = (_b2 = (_a2 = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a2.Zoom) == null ? void 0 : _b2.Value) != null ? _c : 12;
13422
13422
  const center4 = [
@@ -13449,7 +13449,7 @@ var BasfMapComponent = (_a) => {
13449
13449
  })
13450
13450
  ) });
13451
13451
  };
13452
- var BasfMap = (0, import_react47.memo)(BasfMapComponent);
13452
+ var BasfMap = (0, import_react46.memo)(BasfMapComponent);
13453
13453
  BasfMap.displayName = "BasfMap";
13454
13454
 
13455
13455
  // src/Components/Map/GeoTreesMap.tsx
@@ -13457,20 +13457,20 @@ var import_leaflet16 = require("leaflet/dist/leaflet.css");
13457
13457
  var import_react_leaflet23 = require("react-leaflet");
13458
13458
 
13459
13459
  // src/Components/Map/GeoTreesControlList.tsx
13460
- var import_react51 = require("react");
13460
+ var import_react49 = require("react");
13461
13461
 
13462
13462
  // src/Components/Controls/GeoTreesDownloadContent.tsx
13463
- var import_react48 = require("react");
13463
+ var import_react47 = require("react");
13464
13464
  var import_react_hook_form4 = require("react-hook-form");
13465
- var import_react49 = require("next-auth/react");
13466
- var import_core27 = require("@geowiki/core");
13465
+ var import_core28 = require("@geowiki/core");
13466
+ var import_core29 = require("@geowiki/core");
13467
13467
  var import_jsx_runtime63 = require("react/jsx-runtime");
13468
13468
  var GeoTreesDownloadContent = () => {
13469
13469
  var _a, _b;
13470
- const [countries, setCountries] = (0, import_react48.useState)([]);
13471
- const [versions, setVersions] = (0, import_react48.useState)([]);
13470
+ const [countries, setCountries] = (0, import_react47.useState)([]);
13471
+ const [versions, setVersions] = (0, import_react47.useState)([]);
13472
13472
  const baseUrl = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
13473
- const { data: session } = (0, import_react49.useSession)();
13473
+ const { data: session } = (0, import_core28.useSession)();
13474
13474
  const {
13475
13475
  register,
13476
13476
  handleSubmit,
@@ -13488,13 +13488,13 @@ var GeoTreesDownloadContent = () => {
13488
13488
  acknowledgment: false
13489
13489
  }
13490
13490
  });
13491
- (0, import_react48.useEffect)(() => {
13491
+ (0, import_react47.useEffect)(() => {
13492
13492
  if (session == null ? void 0 : session.user) {
13493
13493
  setValue("name", session.user.name || "");
13494
13494
  setValue("email", session.user.email || "");
13495
13495
  }
13496
13496
  }, [session, setValue]);
13497
- (0, import_react48.useEffect)(() => {
13497
+ (0, import_react47.useEffect)(() => {
13498
13498
  const fetchCountries = () => __async(void 0, null, function* () {
13499
13499
  try {
13500
13500
  const response = yield fetch(
@@ -13552,7 +13552,7 @@ var GeoTreesDownloadContent = () => {
13552
13552
  }, [baseUrl, session == null ? void 0 : session.accessToken]);
13553
13553
  const onSubmit = (data) => {
13554
13554
  const { format, purpose, email, name, country, version } = data;
13555
- import_core27.trackDownloadEvent.attempt(
13555
+ import_core29.trackDownloadEvent.attempt(
13556
13556
  format,
13557
13557
  country,
13558
13558
  version,
@@ -13597,10 +13597,10 @@ var GeoTreesDownloadContent = () => {
13597
13597
  link.click();
13598
13598
  document.body.removeChild(link);
13599
13599
  window.URL.revokeObjectURL(url);
13600
- import_core27.trackDownloadEvent.success(filename, purpose, session || void 0);
13600
+ import_core29.trackDownloadEvent.success(filename, purpose, session || void 0);
13601
13601
  }).catch((error) => {
13602
13602
  console.error("Error downloading file:", error);
13603
- import_core27.trackDownloadEvent.failure(
13603
+ import_core29.trackDownloadEvent.failure(
13604
13604
  error.message,
13605
13605
  purpose,
13606
13606
  session || void 0
@@ -13614,8 +13614,8 @@ var GeoTreesDownloadContent = () => {
13614
13614
  "button",
13615
13615
  {
13616
13616
  onClick: () => {
13617
- import_core27.trackDownloadEvent.loginAttempt(session || void 0);
13618
- (0, import_react49.signIn)("openiddict");
13617
+ import_core29.trackDownloadEvent.loginAttempt(session || void 0);
13618
+ (0, import_core28.signIn)();
13619
13619
  },
13620
13620
  className: "w-full py-2 px-4 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors",
13621
13621
  children: "Login"
@@ -13755,15 +13755,15 @@ var GeoTreesDownloadContent = () => {
13755
13755
  var import_react_leaflet21 = require("react-leaflet");
13756
13756
 
13757
13757
  // src/Components/Controls/ScaleControl.tsx
13758
- var import_react50 = require("react");
13758
+ var import_react48 = require("react");
13759
13759
  var import_react_leaflet20 = require("react-leaflet");
13760
13760
  var import_jsx_runtime64 = require("react/jsx-runtime");
13761
13761
  var ScaleControl3 = ({
13762
13762
  className = ""
13763
13763
  }) => {
13764
13764
  const map = (0, import_react_leaflet20.useMap)();
13765
- const [scale, setScale] = (0, import_react50.useState)("");
13766
- (0, import_react50.useEffect)(() => {
13765
+ const [scale, setScale] = (0, import_react48.useState)("");
13766
+ (0, import_react48.useEffect)(() => {
13767
13767
  const updateScale = () => {
13768
13768
  if (!map)
13769
13769
  return;
@@ -13799,7 +13799,7 @@ var import_jsx_runtime65 = require("react/jsx-runtime");
13799
13799
  var GeoTreesControlList = () => {
13800
13800
  const setControls = useMapControlStore((state) => state.setControls);
13801
13801
  const map = (0, import_react_leaflet21.useMap)();
13802
- (0, import_react51.useEffect)(() => {
13802
+ (0, import_react49.useEffect)(() => {
13803
13803
  setControls([
13804
13804
  {
13805
13805
  id: "basemap",
@@ -13871,10 +13871,10 @@ var GeoTreesControlList = () => {
13871
13871
  // src/Components/Map/GeoTreesMap.tsx
13872
13872
  var import_useMapSettings3 = __toESM(require("@geowiki/core/src/hooks/useMapSettings"));
13873
13873
  var import_ui35 = require("@geowiki/ui");
13874
- var import_react54 = require("react");
13874
+ var import_react52 = require("react");
13875
13875
 
13876
13876
  // src/Components/Ifbn/GeoTreesCustomLayer.tsx
13877
- var import_react52 = require("react");
13877
+ var import_react50 = require("react");
13878
13878
  var import_react_leaflet22 = require("react-leaflet");
13879
13879
  var import_leaflet15 = __toESM(require("leaflet"));
13880
13880
  var import_MapPinIcon3 = __toESM(require("@heroicons/react/24/solid/MapPinIcon"));
@@ -14040,8 +14040,8 @@ var GeoTreesCustomLayerComponent = () => {
14040
14040
  const map = (0, import_react_leaflet22.useMap)();
14041
14041
  const layerStore = mapLayers_default();
14042
14042
  const { createLayerFromTemplate } = useCustomLayerStore();
14043
- const [layerCreated, setLayerCreated] = (0, import_react52.useState)(false);
14044
- const [selectedMarker, setSelectedMarker] = (0, import_react52.useState)(null);
14043
+ const [layerCreated, setLayerCreated] = (0, import_react50.useState)(false);
14044
+ const [selectedMarker, setSelectedMarker] = (0, import_react50.useState)(null);
14045
14045
  const currentZoom = map.getZoom();
14046
14046
  const isGeoTreesLayerActive = layerStore.layers.some(
14047
14047
  (layer) => layer.title === "GEO-TREES ALS Data"
@@ -14049,7 +14049,7 @@ var GeoTreesCustomLayerComponent = () => {
14049
14049
  const existingCustomLayer = layerStore.layers.find(
14050
14050
  (layer) => layer.title === "GEO-TREES ALS Data"
14051
14051
  );
14052
- (0, import_react52.useEffect)(() => {
14052
+ (0, import_react50.useEffect)(() => {
14053
14053
  if (isGeoTreesLayerActive && !existingCustomLayer && !layerCreated && TREE_POSITIONS.length > 0) {
14054
14054
  const geoJsonData = {
14055
14055
  type: "FeatureCollection",
@@ -14189,11 +14189,11 @@ var GeoTreesCustomLayerComponent = () => {
14189
14189
  )
14190
14190
  ] });
14191
14191
  };
14192
- var GeoTreesCustomLayer = (0, import_react52.memo)(GeoTreesCustomLayerComponent);
14192
+ var GeoTreesCustomLayer = (0, import_react50.memo)(GeoTreesCustomLayerComponent);
14193
14193
 
14194
14194
  // src/Components/Ifbn/GeoTreesExternalLayer.tsx
14195
14195
  var import_react_query5 = require("@tanstack/react-query");
14196
- var import_react53 = require("react");
14196
+ var import_react51 = require("react");
14197
14197
 
14198
14198
  // src/utils/layerUtils.ts
14199
14199
  var createMarkerClusterLayer = (title, data, options = {}) => ({
@@ -14351,7 +14351,7 @@ var EmptyStateDisplay = () => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("di
14351
14351
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("h4", { className: "font-semibold", children: "No GEO-TREES BRM data available" }),
14352
14352
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "text-sm", children: "Unable to load Biomass Reference Measurement sites data." })
14353
14353
  ] });
14354
- var GeoTreesExternalLayer = (0, import_react53.forwardRef)(
14354
+ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
14355
14355
  ({
14356
14356
  statusFilter = { completed: true, ongoing: true, planned: true },
14357
14357
  autoAdd = false
@@ -14364,8 +14364,8 @@ var GeoTreesExternalLayer = (0, import_react53.forwardRef)(
14364
14364
  syncTrackingWithMapLayers
14365
14365
  } = useCustomLayerStore();
14366
14366
  const { layers } = mapLayers_default();
14367
- const hasAddedLayer = (0, import_react53.useRef)(false);
14368
- (0, import_react53.useEffect)(() => {
14367
+ const hasAddedLayer = (0, import_react51.useRef)(false);
14368
+ (0, import_react51.useEffect)(() => {
14369
14369
  initializeExistingLayers();
14370
14370
  syncTrackingWithMapLayers();
14371
14371
  }, [initializeExistingLayers, syncTrackingWithMapLayers]);
@@ -14403,7 +14403,7 @@ var GeoTreesExternalLayer = (0, import_react53.forwardRef)(
14403
14403
  return layer.id === "geotrees-external-layer" || layer.title === "GEO-TREES External" || layer.title === "GEO-TREES Sites" || layer.title === "GEO-TREES BRM Sites" || layer.title === "GeoTrees External" || layer.title === "GeoTrees Sites" || layer.title === "GeoTrees BRM Sites" || ((_a2 = layer.id) == null ? void 0 : _a2.includes("GEO-TREES-external")) || ((_b = layer.id) == null ? void 0 : _b.includes("GEO-TREES-sites")) || ((_c = layer.id) == null ? void 0 : _c.includes("GEO-TREES-brm-sites")) || ((_d = layer.id) == null ? void 0 : _d.includes("geotrees-external")) || ((_e = layer.id) == null ? void 0 : _e.includes("geotrees-sites")) || ((_f = layer.id) == null ? void 0 : _f.includes("geotrees-brm-sites")) || ((_g = layer.layerInfo) == null ? void 0 : _g.source) === "GeoTrees API";
14404
14404
  }
14405
14405
  );
14406
- const addGeoTreesLayer = (0, import_react53.useCallback)(() => {
14406
+ const addGeoTreesLayer = (0, import_react51.useCallback)(() => {
14407
14407
  var _a2;
14408
14408
  if (!data)
14409
14409
  return;
@@ -14475,14 +14475,14 @@ var GeoTreesExternalLayer = (0, import_react53.forwardRef)(
14475
14475
  addCustomLayer(layerWithInfo);
14476
14476
  hasAddedLayer.current = true;
14477
14477
  }, [data, statusFilter, addCustomLayer, existingLayer, hasLayerBeenAdded]);
14478
- (0, import_react53.useImperativeHandle)(
14478
+ (0, import_react51.useImperativeHandle)(
14479
14479
  ref,
14480
14480
  () => ({
14481
14481
  addLayer: addGeoTreesLayer
14482
14482
  }),
14483
14483
  [addGeoTreesLayer]
14484
14484
  );
14485
- (0, import_react53.useEffect)(() => {
14485
+ (0, import_react51.useEffect)(() => {
14486
14486
  const layerId = "geotrees-external-layer";
14487
14487
  if (autoAdd && data && !hasLayerBeenAdded(layerId) && !hasAddedLayer.current && !existingLayer) {
14488
14488
  addGeoTreesLayer();
@@ -14505,7 +14505,7 @@ var MAX_BOUNDS = [
14505
14505
  [-90, -180],
14506
14506
  [90, 180]
14507
14507
  ];
14508
- var MapContent = (0, import_react54.memo)(({ center: center4, zoom }) => {
14508
+ var MapContent = (0, import_react52.memo)(({ center: center4, zoom }) => {
14509
14509
  return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
14510
14510
  import_react_leaflet23.MapContainer,
14511
14511
  {
@@ -14556,19 +14556,19 @@ var GeoTreesMap = () => {
14556
14556
 
14557
14557
  // src/Components/Canopy/CanopyMap.tsx
14558
14558
  var import_leaflet21 = require("leaflet/dist/leaflet.css");
14559
- var import_react60 = require("react");
14559
+ var import_react58 = require("react");
14560
14560
  var import_react_leaflet27 = require("react-leaflet");
14561
- var import_core28 = require("@geowiki/core");
14561
+ var import_core30 = require("@geowiki/core");
14562
14562
  var import_useMapSettings4 = __toESM(require("@geowiki/core/src/hooks/useMapSettings"));
14563
14563
  var import_ui41 = require("@geowiki/ui");
14564
14564
 
14565
14565
  // src/Components/Canopy/CanopyMapControlList.tsx
14566
- var import_react59 = require("react");
14566
+ var import_react57 = require("react");
14567
14567
  var import_lucide_react8 = require("lucide-react");
14568
14568
  var import_react_leaflet26 = require("react-leaflet");
14569
14569
 
14570
14570
  // src/Components/Map/GenericAreaSelect.tsx
14571
- var import_react55 = require("react");
14571
+ var import_react53 = require("react");
14572
14572
  var import_react_leaflet24 = require("react-leaflet");
14573
14573
  var import_leaflet17 = require("leaflet");
14574
14574
 
@@ -14602,8 +14602,8 @@ var useAreaSelect = ({
14602
14602
  setIsSelectionActive,
14603
14603
  setBbox
14604
14604
  } = useAreaSelectStore();
14605
- const rectangleRef = (0, import_react55.useRef)(null);
14606
- (0, import_react55.useEffect)(() => {
14605
+ const rectangleRef = (0, import_react53.useRef)(null);
14606
+ (0, import_react53.useEffect)(() => {
14607
14607
  var _a;
14608
14608
  if (!map.selectArea)
14609
14609
  return;
@@ -14685,13 +14685,13 @@ var useAreaSelect = ({
14685
14685
  };
14686
14686
 
14687
14687
  // src/Components/Canopy/CanopyAtlasDownload.tsx
14688
- var import_react56 = require("react");
14688
+ var import_react54 = require("react");
14689
14689
  var import_lucide_react5 = require("lucide-react");
14690
14690
  var import_ui36 = require("@geowiki/ui");
14691
14691
  var import_leaflet18 = __toESM(require("leaflet"));
14692
14692
  var import_jsx_runtime70 = require("react/jsx-runtime");
14693
14693
  var CanopyAtlasDownload = () => {
14694
- const [format, setFormat] = (0, import_react56.useState)("shape-zip");
14694
+ const [format, setFormat] = (0, import_react54.useState)("shape-zip");
14695
14695
  const { bbox: bbox4 } = useAreaSelectStore();
14696
14696
  const handleDownload = () => __async(void 0, null, function* () {
14697
14697
  if (!bbox4)
@@ -14758,7 +14758,7 @@ var CanopyAtlasDownload = () => {
14758
14758
  };
14759
14759
 
14760
14760
  // src/Components/Canopy/CanopyFilter.tsx
14761
- var import_react57 = require("react");
14761
+ var import_react55 = require("react");
14762
14762
  var import_ui37 = require("@geowiki/ui");
14763
14763
  var import_lucide_react6 = require("lucide-react");
14764
14764
  var import_leaflet19 = __toESM(require("leaflet"));
@@ -14835,8 +14835,8 @@ var ACCESS_OPTIONS = [
14835
14835
  ];
14836
14836
  var YEAR_MIN = 2005;
14837
14837
  var YEAR_MAX = 2025;
14838
- var CanopyFilter = (0, import_react57.memo)(({ onFilterChange }) => {
14839
- const [format, setFormat] = (0, import_react57.useState)("shape-zip");
14838
+ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
14839
+ const [format, setFormat] = (0, import_react55.useState)("shape-zip");
14840
14840
  const { control, reset, watch } = (0, import_react_hook_form5.useForm)({
14841
14841
  defaultValues: {
14842
14842
  biome: "",
@@ -14849,7 +14849,7 @@ var CanopyFilter = (0, import_react57.memo)(({ onFilterChange }) => {
14849
14849
  }
14850
14850
  });
14851
14851
  const filters = watch();
14852
- (0, import_react57.useEffect)(() => {
14852
+ (0, import_react55.useEffect)(() => {
14853
14853
  const stored = localStorage.getItem(STORAGE_KEY);
14854
14854
  if (stored) {
14855
14855
  const parsed = JSON.parse(stored);
@@ -15134,7 +15134,7 @@ var CanopyFilter = (0, import_react57.memo)(({ onFilterChange }) => {
15134
15134
  CanopyFilter.displayName = "CanopyFilter";
15135
15135
 
15136
15136
  // src/Components/Layers/WfsLayer.tsx
15137
- var import_react58 = require("react");
15137
+ var import_react56 = require("react");
15138
15138
  var import_react_leaflet25 = require("react-leaflet");
15139
15139
  var import_react_query6 = require("@tanstack/react-query");
15140
15140
  var turf7 = __toESM(require("@turf/turf"));
@@ -15416,7 +15416,7 @@ var WfsLayer = ({
15416
15416
  var _a;
15417
15417
  const hideMarkersAboveZoom = (_a = markerOptions.hideMarkersAboveZoom) != null ? _a : 15;
15418
15418
  const mapStore = map_default();
15419
- const [shouldRenderMarkers, setShouldRenderMarkers] = (0, import_react58.useState)(true);
15419
+ const [shouldRenderMarkers, setShouldRenderMarkers] = (0, import_react56.useState)(true);
15420
15420
  const map = (0, import_react_leaflet25.useMapEvents)({
15421
15421
  zoomend: () => {
15422
15422
  const newZoom = map.getZoom();
@@ -15427,19 +15427,19 @@ var WfsLayer = ({
15427
15427
  setShouldRenderMarkers(newZoom <= hideMarkersAboveZoom);
15428
15428
  }
15429
15429
  });
15430
- const stableFilterParams = (0, import_react58.useMemo)(() => {
15430
+ const stableFilterParams = (0, import_react56.useMemo)(() => {
15431
15431
  if (!filterParams)
15432
15432
  return null;
15433
15433
  return JSON.stringify(filterParams);
15434
15434
  }, [filterParams]);
15435
- const queryKey = (0, import_react58.useMemo)(() => {
15435
+ const queryKey = (0, import_react56.useMemo)(() => {
15436
15436
  const key = ["wfsLayer", url, layerName];
15437
15437
  if (useServerFiltering && filterParams && Object.keys(filterParams).length > 0) {
15438
15438
  key.push(stableFilterParams);
15439
15439
  }
15440
15440
  return key;
15441
15441
  }, [url, layerName, useServerFiltering, filterParams, stableFilterParams]);
15442
- const constructWfsUrl = (0, import_react58.useCallback)(() => {
15442
+ const constructWfsUrl = (0, import_react56.useCallback)(() => {
15443
15443
  let wfsUrl = `${url}?service=WFS&version=1.0.0&request=GetFeature&typeName=${layerName}&outputFormat=application/json&maxFeatures=5000`;
15444
15444
  if (useServerFiltering && filterParams && Object.keys(filterParams).length > 0) {
15445
15445
  const cqlFilter = constructCqlFilter(filterParams);
@@ -15497,10 +15497,10 @@ var WfsLayer = ({
15497
15497
  return failureCount < 3;
15498
15498
  }
15499
15499
  });
15500
- const [selectedFeatureId, setSelectedFeatureId] = (0, import_react58.useState)(
15500
+ const [selectedFeatureId, setSelectedFeatureId] = (0, import_react56.useState)(
15501
15501
  null
15502
15502
  );
15503
- const layerRef = (0, import_react58.useRef)({});
15503
+ const layerRef = (0, import_react56.useRef)({});
15504
15504
  const defaultStyle = {
15505
15505
  color: "#3388ff",
15506
15506
  weight: 2,
@@ -15513,7 +15513,7 @@ var WfsLayer = ({
15513
15513
  opacity: 1,
15514
15514
  fillOpacity: 0.4
15515
15515
  };
15516
- const getFeatureStyle = (0, import_react58.useCallback)(
15516
+ const getFeatureStyle = (0, import_react56.useCallback)(
15517
15517
  (feature) => {
15518
15518
  var _a2;
15519
15519
  if (!feature)
@@ -15523,7 +15523,7 @@ var WfsLayer = ({
15523
15523
  },
15524
15524
  [selectedFeatureId]
15525
15525
  );
15526
- const onEachFeature = (0, import_react58.useCallback)(
15526
+ const onEachFeature = (0, import_react56.useCallback)(
15527
15527
  (feature, layer) => {
15528
15528
  var _a2;
15529
15529
  const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
@@ -15558,7 +15558,7 @@ var WfsLayer = ({
15558
15558
  },
15559
15559
  [popupOptions]
15560
15560
  );
15561
- const isPropertyValueMatch = (0, import_react58.useCallback)(
15561
+ const isPropertyValueMatch = (0, import_react56.useCallback)(
15562
15562
  (propertyValue, filterValue) => {
15563
15563
  if (propertyValue === null || propertyValue === void 0) {
15564
15564
  return false;
@@ -15573,7 +15573,7 @@ var WfsLayer = ({
15573
15573
  },
15574
15574
  []
15575
15575
  );
15576
- const filteredGeoJson = (0, import_react58.useMemo)(() => {
15576
+ const filteredGeoJson = (0, import_react56.useMemo)(() => {
15577
15577
  if (!geoJsonData)
15578
15578
  return null;
15579
15579
  if (useServerFiltering || !filterParams || Object.keys(filterParams).length === 0) {
@@ -15670,13 +15670,13 @@ var CanopyMapControlList = () => {
15670
15670
  const setControls = useMapControlStore((state) => state.setControls);
15671
15671
  const currentControls = useMapControlStore((state) => state.controls);
15672
15672
  const map = (0, import_react_leaflet26.useMap)();
15673
- const [filterParams, setFilterParams] = (0, import_react59.useState)({});
15674
- const prevSelectionStateRef = (0, import_react59.useRef)(false);
15673
+ const [filterParams, setFilterParams] = (0, import_react57.useState)({});
15674
+ const prevSelectionStateRef = (0, import_react57.useRef)(false);
15675
15675
  const { enableSelection, disableSelection, isSelectionActive } = useAreaSelect({});
15676
- const handleFilterChange = (0, import_react59.useCallback)((filters) => {
15676
+ const handleFilterChange = (0, import_react57.useCallback)((filters) => {
15677
15677
  setFilterParams(filters);
15678
15678
  }, []);
15679
- const baseControls = (0, import_react59.useMemo)(() => {
15679
+ const baseControls = (0, import_react57.useMemo)(() => {
15680
15680
  var _a, _b, _c, _d, _e, _f;
15681
15681
  const openStates = currentControls.reduce(
15682
15682
  (acc, control) => {
@@ -15752,7 +15752,7 @@ var CanopyMapControlList = () => {
15752
15752
  disableSelection,
15753
15753
  currentControls
15754
15754
  ]);
15755
- (0, import_react59.useEffect)(() => {
15755
+ (0, import_react57.useEffect)(() => {
15756
15756
  if (prevSelectionStateRef.current !== isSelectionActive) {
15757
15757
  const updatedControls = [
15758
15758
  ...baseControls,
@@ -15781,7 +15781,7 @@ var CanopyMapControlList = () => {
15781
15781
  prevSelectionStateRef.current = isSelectionActive;
15782
15782
  }
15783
15783
  }, [baseControls, isSelectionActive, setControls, disableSelection]);
15784
- (0, import_react59.useEffect)(() => {
15784
+ (0, import_react57.useEffect)(() => {
15785
15785
  if (currentControls.length === 0) {
15786
15786
  setControls(baseControls);
15787
15787
  }
@@ -15812,13 +15812,13 @@ var import_jsx_runtime74 = require("react/jsx-runtime");
15812
15812
  var CanopyMap = () => {
15813
15813
  var _a, _b, _c, _d, _e, _f;
15814
15814
  const { data: mapSettings, isLoading: isSettingsLoading } = (0, import_useMapSettings4.default)();
15815
- const mapRef = (0, import_react60.useRef)();
15815
+ const mapRef = (0, import_react58.useRef)();
15816
15816
  const zoom = ((_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) || 5;
15817
15817
  const center4 = [
15818
15818
  ((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
15819
15819
  ((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
15820
15820
  ];
15821
- (0, import_core28.useRenderInfo)("BasicMap");
15821
+ (0, import_core30.useRenderInfo)("BasicMap");
15822
15822
  if (isSettingsLoading)
15823
15823
  return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
15824
15824
  return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
@@ -15849,13 +15849,13 @@ var CanopyMap = () => {
15849
15849
  };
15850
15850
 
15851
15851
  // src/Components/Basf/basf-left-panel.tsx
15852
- var import_react61 = require("react");
15852
+ var import_react59 = require("react");
15853
15853
  var import_ui42 = require("@geowiki/ui");
15854
15854
  var import_react_hook_form6 = require("react-hook-form");
15855
15855
  var z3 = __toESM(require("zod"));
15856
15856
  var import_uuid4 = require("uuid");
15857
15857
  var import_zod2 = require("@hookform/resolvers/zod");
15858
- var import_core29 = require("@geowiki/core");
15858
+ var import_core31 = require("@geowiki/core");
15859
15859
  var import_jsx_runtime75 = require("react/jsx-runtime");
15860
15860
  var formSchema2 = z3.object({
15861
15861
  formType: z3.enum(["Biomass", "CropProduction"], {
@@ -15907,20 +15907,20 @@ var formSchema2 = z3.object({
15907
15907
  }
15908
15908
  ).default("2020")
15909
15909
  });
15910
- var ForwardedSelect3 = (0, import_react61.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_ui42.Select, __spreadProps(__spreadValues({}, props), { ref })));
15910
+ var ForwardedSelect3 = (0, import_react59.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_ui42.Select, __spreadProps(__spreadValues({}, props), { ref })));
15911
15911
  ForwardedSelect3.displayName = "ForwardedSelect";
15912
15912
  var BasfLeftPanel = () => {
15913
- const [isSubmitting, setIsSubmitting] = (0, import_react61.useState)(false);
15913
+ const [isSubmitting, setIsSubmitting] = (0, import_react59.useState)(false);
15914
15914
  const { clearData } = useSelectedPixelStore();
15915
- const isLeftOverlayOpen = (0, import_core29.useBasfStore)(
15916
- (0, import_react61.useCallback)((state) => state.leftPanelOpen, [])
15915
+ const isLeftOverlayOpen = (0, import_core31.useBasfStore)(
15916
+ (0, import_react59.useCallback)((state) => state.leftPanelOpen, [])
15917
15917
  );
15918
- const setIsLeftOverlayOpen = (0, import_core29.useBasfStore)(
15919
- (0, import_react61.useCallback)((state) => state.updateLeftPanelOpen, [])
15918
+ const setIsLeftOverlayOpen = (0, import_core31.useBasfStore)(
15919
+ (0, import_react59.useCallback)((state) => state.updateLeftPanelOpen, [])
15920
15920
  );
15921
- const addItem = (0, import_core29.useBasfStore)((0, import_react61.useCallback)((state) => state.addItem, []));
15922
- const selectedItems = (0, import_core29.useBasfStore)(
15923
- (0, import_react61.useCallback)((state) => state.selectedItems, [])
15921
+ const addItem = (0, import_core31.useBasfStore)((0, import_react59.useCallback)((state) => state.addItem, []));
15922
+ const selectedItems = (0, import_core31.useBasfStore)(
15923
+ (0, import_react59.useCallback)((state) => state.selectedItems, [])
15924
15924
  );
15925
15925
  const {
15926
15926
  control,
@@ -15935,7 +15935,7 @@ var BasfLeftPanel = () => {
15935
15935
  const scenario = watch("scenario");
15936
15936
  const price = watch("price");
15937
15937
  const year = watch("year");
15938
- const checkIfItemExists = (0, import_react61.useCallback)(
15938
+ const checkIfItemExists = (0, import_react59.useCallback)(
15939
15939
  (data) => {
15940
15940
  return selectedItems.some(
15941
15941
  (item) => item.formType === data.formType && item.scenario === data.scenario && item.price === data.price && item.product === data.product && item.item === data.item && item.year === data.year
@@ -15943,7 +15943,7 @@ var BasfLeftPanel = () => {
15943
15943
  },
15944
15944
  [selectedItems]
15945
15945
  );
15946
- const onSubmit = (0, import_react61.useCallback)(
15946
+ const onSubmit = (0, import_react59.useCallback)(
15947
15947
  (data) => __async(void 0, null, function* () {
15948
15948
  setIsSubmitting(true);
15949
15949
  try {
@@ -15967,7 +15967,7 @@ var BasfLeftPanel = () => {
15967
15967
  }),
15968
15968
  [checkIfItemExists, addItem]
15969
15969
  );
15970
- (0, import_react61.useEffect)(() => {
15970
+ (0, import_react59.useEffect)(() => {
15971
15971
  if (formType === "CropProduction") {
15972
15972
  reset({
15973
15973
  formType: "CropProduction",
@@ -15988,7 +15988,7 @@ var BasfLeftPanel = () => {
15988
15988
  });
15989
15989
  }
15990
15990
  }, [formType, reset]);
15991
- const handleTogglePanel = (0, import_react61.useCallback)(() => {
15991
+ const handleTogglePanel = (0, import_react59.useCallback)(() => {
15992
15992
  setIsLeftOverlayOpen(!isLeftOverlayOpen);
15993
15993
  }, [isLeftOverlayOpen, setIsLeftOverlayOpen]);
15994
15994
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
@@ -16019,22 +16019,22 @@ var BasfLeftPanel = () => {
16019
16019
  }
16020
16020
  );
16021
16021
  };
16022
- var basf_left_panel_default = (0, import_react61.memo)(BasfLeftPanel);
16022
+ var basf_left_panel_default = (0, import_react59.memo)(BasfLeftPanel);
16023
16023
 
16024
16024
  // src/Components/Basf/basf-right-panel.tsx
16025
- var import_core30 = require("@geowiki/core");
16025
+ var import_core32 = require("@geowiki/core");
16026
16026
  var import_jsx_runtime76 = require("react/jsx-runtime");
16027
16027
 
16028
16028
  // src/Components/Map/GeoWikiMap.tsx
16029
- var import_react62 = require("react");
16029
+ var import_react60 = require("react");
16030
16030
  var import_react_leaflet28 = require("react-leaflet");
16031
16031
  var import_leaflet23 = require("leaflet/dist/leaflet.css");
16032
16032
  var import_dist = require("@bopen/leaflet-area-selection/dist/index.css");
16033
- var import_core32 = require("@geowiki/core");
16033
+ var import_core34 = require("@geowiki/core");
16034
16034
  var import_ui43 = require("@geowiki/ui");
16035
16035
 
16036
16036
  // ../../apps/geowiki/components/Map/CustomWMS.tsx
16037
- var import_core31 = require("@react-leaflet/core");
16037
+ var import_core33 = require("@react-leaflet/core");
16038
16038
 
16039
16039
  // ../../apps/geowiki/lib/utils/BetterWMS.ts
16040
16040
  var import_leaflet22 = __toESM(require("leaflet"));
@@ -16163,19 +16163,19 @@ var BetterWMS2 = class extends import_leaflet22.default.TileLayer.WMS {
16163
16163
  };
16164
16164
 
16165
16165
  // ../../apps/geowiki/components/Map/CustomWMS.tsx
16166
- var CustomWMSTileLayer2 = (0, import_core31.createTileLayerComponent)(
16166
+ var CustomWMSTileLayer2 = (0, import_core33.createTileLayerComponent)(
16167
16167
  function createWMSTileLayer3(_a, context) {
16168
16168
  var _b = _a, { params = {}, url } = _b, options = __objRest(_b, ["params", "url"]);
16169
16169
  var instance = new BetterWMS2(url, __spreadValues(__spreadProps(__spreadValues({}, params), {
16170
16170
  url
16171
- }), (0, import_core31.withPane)(options, context)));
16171
+ }), (0, import_core33.withPane)(options, context)));
16172
16172
  return {
16173
16173
  instance,
16174
16174
  context
16175
16175
  };
16176
16176
  },
16177
16177
  function updateWMSTileLayer3(layer, props, prevProps) {
16178
- (0, import_core31.updateGridLayer)(layer, props, prevProps);
16178
+ (0, import_core33.updateGridLayer)(layer, props, prevProps);
16179
16179
  if (props.params != null && props.params !== prevProps.params) {
16180
16180
  layer.setParams(props.params);
16181
16181
  }
@@ -16188,7 +16188,7 @@ var import_react_hotkeys_hook3 = require("react-hotkeys-hook");
16188
16188
  var import_jsx_runtime77 = require("react/jsx-runtime");
16189
16189
  var GeoWikiMapComponent = ({ mapSettings, session }) => {
16190
16190
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
16191
- const mapRef = (0, import_react62.useRef)();
16191
+ const mapRef = (0, import_react60.useRef)();
16192
16192
  const router = (0, import_router5.useRouter)();
16193
16193
  var projectId = router.query.projectId;
16194
16194
  var locationId = router.query.locationId;
@@ -16196,23 +16196,23 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
16196
16196
  const layerStore = useMapLayerStore();
16197
16197
  const mapStore = useMapStore();
16198
16198
  const evolandStore = useEvolandStore();
16199
- const panelStore = (0, import_core32.usePanelStore)();
16200
- const evolandFeature = (0, import_core32.useFeature)("GeoWiki.EvoLand");
16201
- var userRole = (0, import_core32.tokenData)((_a = session.data) == null ? void 0 : _a.accessToken, "role");
16202
- var userId = (0, import_core32.tokenData)((_b = session.data) == null ? void 0 : _b.accessToken, "sub");
16203
- const { data: wmsLayerNames } = (0, import_core32.useEvolandWmsLayers)();
16204
- const { data: geoWikiSettings } = (0, import_core32.useGeoWikiSettings)();
16205
- const { data: introTourSteps } = (0, import_core32.useIntroTourSettings)();
16206
- const [showAsset, setShowAsset] = (0, import_react62.useState)(false);
16207
- const [fetchLocationMetaData, setFetchLocationMetaData] = (0, import_react62.useState)(false);
16208
- const [defaultActivityView, setDefaultActivityView] = (0, import_react62.useState)("");
16199
+ const panelStore = (0, import_core34.usePanelStore)();
16200
+ const evolandFeature = (0, import_core34.useFeature)("GeoWiki.EvoLand");
16201
+ var userRole = (0, import_core34.tokenData)((_a = session.data) == null ? void 0 : _a.accessToken, "role");
16202
+ var userId = (0, import_core34.tokenData)((_b = session.data) == null ? void 0 : _b.accessToken, "sub");
16203
+ const { data: wmsLayerNames } = (0, import_core34.useEvolandWmsLayers)();
16204
+ const { data: geoWikiSettings } = (0, import_core34.useGeoWikiSettings)();
16205
+ const { data: introTourSteps } = (0, import_core34.useIntroTourSettings)();
16206
+ const [showAsset, setShowAsset] = (0, import_react60.useState)(false);
16207
+ const [fetchLocationMetaData, setFetchLocationMetaData] = (0, import_react60.useState)(false);
16208
+ const [defaultActivityView, setDefaultActivityView] = (0, import_react60.useState)("");
16209
16209
  let accordionData = [];
16210
16210
  var zoom = ((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Zoom) == null ? void 0 : _d.Value) || 12;
16211
16211
  var center4 = [
16212
16212
  ((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Latitude) == null ? void 0 : _f.Text) || 48.2082,
16213
16213
  ((_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) || 16.3738
16214
16214
  ];
16215
- (0, import_core32.useRenderInfo)("GeoWikiMap");
16215
+ (0, import_core34.useRenderInfo)("GeoWikiMap");
16216
16216
  if (!fetchLocationMetaData && (evolandStore.referenceDate || evolandStore.reference_dates)) {
16217
16217
  evolandStore.getLocationMetaData(locationId, parseInt(projectId), taskId);
16218
16218
  setFetchLocationMetaData(true);
@@ -16266,9 +16266,9 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
16266
16266
  return JSON.parse(introTourSteps.LiquidPart.Liquid.toString()).mainPanel;
16267
16267
  }
16268
16268
  };
16269
- (0, import_react62.useEffect)(() => {
16269
+ (0, import_react60.useEffect)(() => {
16270
16270
  var _a2;
16271
- if ((0, import_core32.IsTokenExpired)((_a2 = session.data) == null ? void 0 : _a2.expires)) {
16271
+ if ((0, import_core34.IsTokenExpired)((_a2 = session.data) == null ? void 0 : _a2.expires)) {
16272
16272
  evolandStore.setSessionTimeOut(true);
16273
16273
  }
16274
16274
  }, [evolandStore.sessionTimeOut, (_l = session.data) == null ? void 0 : _l.expires]);
@@ -16291,7 +16291,7 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
16291
16291
  {
16292
16292
  variant: "outline",
16293
16293
  className: "flex ml-20",
16294
- onClick: () => (0, import_core32.showIntroTour)(selectIntroTourSteps()),
16294
+ onClick: () => (0, import_core34.showIntroTour)(selectIntroTourSteps()),
16295
16295
  children: "Guide"
16296
16296
  }
16297
16297
  ) }),
@@ -16570,21 +16570,21 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
16570
16570
  ] }) })
16571
16571
  ] });
16572
16572
  };
16573
- var GeoWikiMap = (0, import_react62.memo)(GeoWikiMapComponent);
16573
+ var GeoWikiMap = (0, import_react60.memo)(GeoWikiMapComponent);
16574
16574
 
16575
16575
  // src/Components/Map/WaybackTimelineMap.tsx
16576
- var import_react63 = require("react");
16576
+ var import_react61 = require("react");
16577
16577
  var import_react_leaflet29 = require("react-leaflet");
16578
- var import_core33 = require("@geowiki/core");
16578
+ var import_core35 = require("@geowiki/core");
16579
16579
  var import_navigation3 = require("next/navigation");
16580
16580
  var import_jsx_runtime78 = require("react/jsx-runtime");
16581
16581
  var WaybackTimelineMap = (props) => {
16582
16582
  var _a;
16583
- const mapRef = (0, import_react63.useRef)(null);
16583
+ const mapRef = (0, import_react61.useRef)(null);
16584
16584
  const searchParams = (0, import_navigation3.useSearchParams)();
16585
16585
  var center4 = [48.2082, 16.3738];
16586
- (0, import_core33.useRenderInfo)("WaybackTimelineMap");
16587
- const [WAYBACK_SNAPSHOTS, setWAYBACK_SNAPSHOTS] = (0, import_react63.useState)(null);
16586
+ (0, import_core35.useRenderInfo)("WaybackTimelineMap");
16587
+ const [WAYBACK_SNAPSHOTS, setWAYBACK_SNAPSHOTS] = (0, import_react61.useState)(null);
16588
16588
  function MapZoomEvents() {
16589
16589
  const mapEvents = (0, import_react_leaflet29.useMapEvents)({
16590
16590
  zoomend: () => {
@@ -16593,7 +16593,7 @@ var WaybackTimelineMap = (props) => {
16593
16593
  });
16594
16594
  return null;
16595
16595
  }
16596
- (0, import_react63.useEffect)(() => {
16596
+ (0, import_react61.useEffect)(() => {
16597
16597
  if (props.mapping)
16598
16598
  setWAYBACK_SNAPSHOTS(props.mapping);
16599
16599
  }, [props.mapping]);