datastake-daf 0.6.816 → 0.6.817

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/index.js +1196 -1285
  2. package/dist/pages/index.js +1315 -579
  3. package/dist/services/index.js +202 -0
  4. package/dist/utils/index.js +28 -0
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/Charts/RadarChart/index.jsx +3 -12
  7. package/src/@daf/core/components/Charts/style.js +1 -2
  8. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +123 -104
  9. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx +4 -0
  10. package/src/@daf/core/components/Table/index.jsx +11 -6
  11. package/src/@daf/pages/Events/Activities/columns.js +15 -11
  12. package/src/@daf/pages/Events/Incidents/columns.js +15 -11
  13. package/src/@daf/pages/Events/Testimonials/columns.js +173 -0
  14. package/src/@daf/pages/Events/Testimonials/config.js +175 -0
  15. package/src/@daf/pages/Events/columns.js +7 -3
  16. package/src/@daf/pages/Locations/ConflictAreas/columns.js +140 -0
  17. package/src/@daf/pages/Locations/ConflictAreas/config.js +41 -0
  18. package/src/@daf/pages/Locations/MineSite/columns.js +21 -12
  19. package/src/@daf/pages/Locations/MineSite/config.js +2 -1
  20. package/src/@daf/pages/Locations/columns.js +7 -3
  21. package/src/@daf/pages/Stakeholders/ArmedGroups/columns.js +110 -0
  22. package/src/@daf/pages/Stakeholders/ArmedGroups/config.js +41 -0
  23. package/src/@daf/pages/Stakeholders/Operators/columns.js +30 -14
  24. package/src/@daf/pages/Stakeholders/Workers/columns.js +23 -13
  25. package/src/@daf/pages/Stakeholders/columns.js +8 -4
  26. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/ObservedFauna.jsx +11 -6
  27. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/PlantedSpecies.jsx +10 -25
  28. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/SeedlingsHeight.jsx +13 -10
  29. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/VegetationHealth.jsx +4 -19
  30. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/SoilType.jsx +10 -22
  31. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/WaterQuality.jsx +10 -26
  32. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/chartHelpers.js +0 -74
  33. package/src/@daf/pages/TablePage/config.js +1 -1
  34. package/src/@daf/pages/TablePage/helper.js +45 -0
  35. package/src/@daf/services/EventsService.js +115 -0
  36. package/src/@daf/services/LinkedSubjects.js +1 -0
  37. package/src/@daf/services/WorkersService.js +80 -0
  38. package/src/helpers/errorHandling.js +142 -74
  39. package/src/services.js +3 -1
  40. package/src/utils.js +1 -1
  41. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -16,6 +16,7 @@ var L$1 = require('leaflet');
16
16
  var reactCollapsed = require('react-collapsed');
17
17
  var countryCityLocation = require('country-city-location');
18
18
  var client = require('react-dom/client');
19
+ var reactDom = require('react-dom');
19
20
  require('@elfalem/leaflet-curve');
20
21
  var dot = require('dot-object');
21
22
  var ReactHtmlParser = require('react-html-parser');
@@ -4816,7 +4817,7 @@ const config$2 = {
4816
4817
  AddDocument: config$3
4817
4818
  };
4818
4819
 
4819
- const _excluded$G = ["width", "height", "size", "name", "fill"];
4820
+ const _excluded$H = ["width", "height", "size", "name", "fill"];
4820
4821
  const CustomIcon = _ref => {
4821
4822
  let {
4822
4823
  width = 14,
@@ -4825,7 +4826,7 @@ const CustomIcon = _ref => {
4825
4826
  name = "",
4826
4827
  fill = "none"
4827
4828
  } = _ref,
4828
- props = _objectWithoutProperties(_ref, _excluded$G);
4829
+ props = _objectWithoutProperties(_ref, _excluded$H);
4829
4830
  const conf = config$2[name];
4830
4831
  if (conf) {
4831
4832
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5114,7 +5115,7 @@ createCommonjsModule(function (module, exports) {
5114
5115
  !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
5115
5116
  });
5116
5117
 
5117
- const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5118
+ const _excluded$G = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5118
5119
  dayjs__default["default"].extend(customParseFormat);
5119
5120
  dayjs__default["default"].extend(utc);
5120
5121
  dayjs__default["default"].extend(utc);
@@ -5490,7 +5491,7 @@ const filterCreateData = data => {
5490
5491
  createdAt,
5491
5492
  updatedAt
5492
5493
  } = data,
5493
- rest = _objectWithoutProperties(data, _excluded$F);
5494
+ rest = _objectWithoutProperties(data, _excluded$G);
5494
5495
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5495
5496
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5496
5497
  meta: _meta
@@ -6022,7 +6023,7 @@ SelectFilters.propTypes = {
6022
6023
  apiUrl: PropTypes__default["default"].string
6023
6024
  };
6024
6025
 
6025
- const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
6026
+ const _excluded$F = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
6026
6027
  function DAFTable(_ref) {
6027
6028
  let {
6028
6029
  columns = [],
@@ -6053,8 +6054,13 @@ function DAFTable(_ref) {
6053
6054
  app,
6054
6055
  doEmptyRows
6055
6056
  } = _ref,
6056
- rest = _objectWithoutProperties(_ref, _excluded$E);
6057
- const [source, setSource] = React.useState([]);
6057
+ rest = _objectWithoutProperties(_ref, _excluded$F);
6058
+ const source = React.useMemo(() => {
6059
+ if (data && Array.isArray(data)) {
6060
+ return data;
6061
+ }
6062
+ return [];
6063
+ }, [data]);
6058
6064
  const projectData = (projects || []).find(p => p.id === selectedProject);
6059
6065
  const [filtersInit, setFiltersInit] = React.useState(!loading);
6060
6066
  React.useEffect(() => {
@@ -6098,11 +6104,13 @@ function DAFTable(_ref) {
6098
6104
  }
6099
6105
  }) : filtersConfig;
6100
6106
  }, [sourcesKey, sources, filtersConfig, t]);
6101
- React.useEffect(() => {
6102
- if (data && Array.isArray(data)) {
6103
- setSource(data);
6104
- }
6105
- }, [data, data.length]);
6107
+
6108
+ // useEffect(() => {
6109
+ // if (data && Array.isArray(data)) {
6110
+ // setSource(data);
6111
+ // }
6112
+ // }, [data, data.length]);
6113
+
6106
6114
  const paginationPageSize = pagination === null || pagination === void 0 ? void 0 : pagination.pageSize;
6107
6115
  const dataSource = React.useMemo(() => {
6108
6116
  const pageSize = paginationPageSize ? paginationPageSize : source.length > 10 ? source.length : 10;
@@ -6871,7 +6879,7 @@ function ComponentWithFocus(_ref) {
6871
6879
  }
6872
6880
 
6873
6881
  var _templateObject$h;
6874
- const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6882
+ const _excluded$E = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6875
6883
  function StickyTable(_ref) {
6876
6884
  let {
6877
6885
  size = "small",
@@ -6882,7 +6890,7 @@ function StickyTable(_ref) {
6882
6890
  pagination = false,
6883
6891
  doEmptyRows = true
6884
6892
  } = _ref,
6885
- props = _objectWithoutProperties(_ref, _excluded$D);
6893
+ props = _objectWithoutProperties(_ref, _excluded$E);
6886
6894
  const data = React__default["default"].useMemo(() => {
6887
6895
  if (!doEmptyRows) {
6888
6896
  return dataSource;
@@ -7410,7 +7418,7 @@ const BTN_SIZE = {
7410
7418
  LG: 'large'
7411
7419
  };
7412
7420
 
7413
- const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7421
+ const _excluded$D = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7414
7422
  function DafButton(_ref) {
7415
7423
  let {
7416
7424
  content = '',
@@ -7424,7 +7432,7 @@ function DafButton(_ref) {
7424
7432
  style = {},
7425
7433
  className = ''
7426
7434
  } = _ref,
7427
- restProps = _objectWithoutProperties(_ref, _excluded$C);
7435
+ restProps = _objectWithoutProperties(_ref, _excluded$D);
7428
7436
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7429
7437
  icon: icon,
7430
7438
  type: type,
@@ -7543,12 +7551,12 @@ const Style$R = styled__default["default"].div`
7543
7551
  }
7544
7552
  `;
7545
7553
 
7546
- const _excluded$B = ["children"];
7554
+ const _excluded$C = ["children"];
7547
7555
  const BorderedButton = _ref => {
7548
7556
  let {
7549
7557
  children
7550
7558
  } = _ref,
7551
- props = _objectWithoutProperties(_ref, _excluded$B);
7559
+ props = _objectWithoutProperties(_ref, _excluded$C);
7552
7560
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7553
7561
  className: "d-btn-cont",
7554
7562
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7688,12 +7696,12 @@ Badge.propTypes = {
7688
7696
  props: PropTypes__default["default"].object
7689
7697
  };
7690
7698
 
7691
- const _excluded$A = ["icon"];
7699
+ const _excluded$B = ["icon"];
7692
7700
  function GetIcon(_ref) {
7693
7701
  let {
7694
7702
  icon
7695
7703
  } = _ref,
7696
- props = _objectWithoutProperties(_ref, _excluded$A);
7704
+ props = _objectWithoutProperties(_ref, _excluded$B);
7697
7705
  let Icon = Icons__namespace.CloseOutlined;
7698
7706
  if (Icons__namespace[icon]) {
7699
7707
  Icon = Icons__namespace[icon];
@@ -8023,7 +8031,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8023
8031
  }
8024
8032
  `;
8025
8033
 
8026
- const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8034
+ const _excluded$A = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8027
8035
  const {
8028
8036
  useToken: useToken$n
8029
8037
  } = antd.theme;
@@ -8116,7 +8124,7 @@ function Multiselect(_ref) {
8116
8124
  isSingle = false,
8117
8125
  selectionType = SELECTION_TYPES.DEFAULT
8118
8126
  } = _ref,
8119
- restProps = _objectWithoutProperties(_ref, _excluded$z);
8127
+ restProps = _objectWithoutProperties(_ref, _excluded$A);
8120
8128
  const {
8121
8129
  token
8122
8130
  } = useToken$n();
@@ -8836,7 +8844,7 @@ DAFHeader.propTypes = {
8836
8844
  filtersConfig: PropTypes__default["default"].any
8837
8845
  };
8838
8846
 
8839
- const _excluded$y = ["tabs", "onChange", "value", "className"];
8847
+ const _excluded$z = ["tabs", "onChange", "value", "className"];
8840
8848
  function TabsHeader(_ref) {
8841
8849
  let {
8842
8850
  tabs = [],
@@ -8844,7 +8852,7 @@ function TabsHeader(_ref) {
8844
8852
  value = '',
8845
8853
  className = 'mt-2'
8846
8854
  } = _ref,
8847
- rest = _objectWithoutProperties(_ref, _excluded$y);
8855
+ rest = _objectWithoutProperties(_ref, _excluded$z);
8848
8856
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8849
8857
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8850
8858
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8941,7 +8949,7 @@ DrawerHeader.propTypes = {
8941
8949
  tabsConfig: PropTypes__default["default"].any
8942
8950
  };
8943
8951
 
8944
- const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8952
+ const _excluded$y = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8945
8953
  const useFooter = _ref => {
8946
8954
  let {
8947
8955
  leftContent,
@@ -8976,7 +8984,7 @@ const useFooter = _ref => {
8976
8984
  style = {},
8977
8985
  className = ""
8978
8986
  } = button,
8979
- restProps = _objectWithoutProperties(button, _excluded$x);
8987
+ restProps = _objectWithoutProperties(button, _excluded$y);
8980
8988
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8981
8989
  content: label,
8982
8990
  type: type,
@@ -11857,7 +11865,7 @@ Widget.propTypes = {
11857
11865
  };
11858
11866
  Widget.displayName = 'Widget';
11859
11867
 
11860
- const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11868
+ const _excluded$x = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11861
11869
  function ImageWidget(_ref) {
11862
11870
  let {
11863
11871
  loading = false,
@@ -11868,7 +11876,7 @@ function ImageWidget(_ref) {
11868
11876
  noDescriptionText,
11869
11877
  isPdf = false
11870
11878
  } = _ref,
11871
- props = _objectWithoutProperties(_ref, _excluded$w);
11879
+ props = _objectWithoutProperties(_ref, _excluded$x);
11872
11880
  const expandable = isPdf ? false : props.expandable;
11873
11881
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11874
11882
  loading: loading,
@@ -11928,7 +11936,7 @@ function ImageWidget(_ref) {
11928
11936
  ImageWidget.displayName = 'ImageWidget';
11929
11937
 
11930
11938
  var _templateObject$e;
11931
- const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11939
+ const _excluded$w = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11932
11940
  function FlowWidget(_ref) {
11933
11941
  let {
11934
11942
  title,
@@ -11940,7 +11948,7 @@ function FlowWidget(_ref) {
11940
11948
  className,
11941
11949
  direction = "horizontal"
11942
11950
  } = _ref,
11943
- rest = _objectWithoutProperties(_ref, _excluded$v);
11951
+ rest = _objectWithoutProperties(_ref, _excluded$w);
11944
11952
  const [activeTab, setActiveTab] = React.useState();
11945
11953
  React.useEffect(() => {
11946
11954
  if (defaultActiveTab) {
@@ -13924,8 +13932,8 @@ function LocationIcon({
13924
13932
  activeMarker,
13925
13933
  setActiveMarker
13926
13934
  }) {
13927
- const rootsMapRef = React.useRef(new Map());
13928
13935
  const markersRef = React.useRef([]);
13936
+ const [portalContainers, setPortalContainers] = React.useState([]);
13929
13937
  const isSelected = selectedMarkersId.includes(data.datastakeId);
13930
13938
  const Marker = React.useMemo(() => {
13931
13939
  if (isMineSite(data.type)) {
@@ -13933,7 +13941,7 @@ function LocationIcon({
13933
13941
  }
13934
13942
  return VillageMarker;
13935
13943
  }, [data.type]);
13936
- const [isHovering, setIsHovering] = React.useState(false);
13944
+ React.useState(false);
13937
13945
  const linkedNodesData = React.useMemo(() => {
13938
13946
  const nodes = [];
13939
13947
  const links = data.links || [];
@@ -13998,31 +14006,32 @@ function LocationIcon({
13998
14006
  return nodes;
13999
14007
  }, [JSON.stringify(allData), JSON.stringify(data.links), JSON.stringify(data.stakeholders), zoom]);
14000
14008
  const stakeholdersOfLocation = React.useMemo(() => {
14001
- return data?.stakeholders || [];
14002
- }, [data.stakeholders, zoom]);
14009
+ return (data?.stakeholders || []).filter(stakeholder => {
14010
+ if (!stakeholder.links || stakeholder.links.length === 0) {
14011
+ return true;
14012
+ }
14013
+ const locationsWithThisStakeholder = allData.filter(loc => loc.stakeholders?.some(s => s.datastakeId === stakeholder.datastakeId)).map(loc => loc.datastakeId);
14014
+ const primaryLocation = locationsWithThisStakeholder.sort()[0];
14015
+ return data.datastakeId === primaryLocation;
14016
+ });
14017
+ }, [data.stakeholders, data.datastakeId, allData, zoom]);
14003
14018
  React.useEffect(() => {
14004
- const currentRoots = rootsMapRef.current;
14005
- const currentMarkers = markersRef.current;
14006
- currentMarkers.forEach(marker => {
14007
- if (mapRef.hasLayer(marker)) {
14019
+ markersRef.current.forEach(marker => {
14020
+ if (mapRef && mapRef.hasLayer(marker)) {
14008
14021
  mapRef.removeLayer(marker);
14009
14022
  }
14010
14023
  });
14011
- currentRoots.forEach(root => {
14012
- root.unmount();
14013
- });
14014
- currentRoots.clear();
14015
14024
  markersRef.current = [];
14016
-
14017
- // Only create stakeholder markers if this location or any of its stakeholders are selected
14025
+ setPortalContainers([]);
14018
14026
  const shouldShowStakeholders = isSelected || stakeholdersOfLocation.some(stk => selectedMarkersId.includes(stk.datastakeId));
14019
14027
  if (!shouldShowStakeholders || selectedMarkersId.length === 0) {
14020
14028
  return;
14021
14029
  }
14022
14030
 
14023
- // Create new markers only when selected
14031
+ // Create markers and store their container references
14032
+ const containers = [];
14024
14033
  stakeholdersOfLocation.forEach((stakeholder, index) => {
14025
- const markerId = `${stakeholder.datastakeId}`;
14034
+ const markerId = `${data.datastakeId}-${stakeholder.datastakeId}`;
14026
14035
  const {
14027
14036
  x,
14028
14037
  y,
@@ -14045,41 +14054,29 @@ function LocationIcon({
14045
14054
  const pathLocLatLng = mapRef.layerPointToLatLng(pathLocPoint);
14046
14055
  const isForceOpen = activeMarker?.datastakeId === data.datastakeId;
14047
14056
  const iconSize = isSmallMarker(zoom) || isExtraSmallMarker(zoom) ? [11, 11] : [25, 25];
14057
+
14058
+ // Create container div
14059
+ const containerDiv = document.createElement('div');
14060
+ containerDiv.id = markerId;
14048
14061
  const marker = L__namespace.marker(stakeholderLatLng, {
14049
14062
  icon: L__namespace.divIcon({
14050
- html: `<div id="${markerId}"></div>`,
14063
+ html: containerDiv.outerHTML,
14051
14064
  className: "marker-chain",
14052
14065
  iconSize: iconSize
14053
14066
  })
14054
14067
  }).addTo(mapRef);
14055
14068
  markersRef.current.push(marker);
14056
- setTimeout(() => {
14057
- const div = document.getElementById(markerId);
14058
- if (div && !rootsMapRef.current.has(markerId)) {
14059
- const root = client.createRoot(div);
14060
- rootsMapRef.current.set(markerId, root);
14061
- root.render( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
14062
- data: stakeholder,
14063
- zoom: zoom,
14064
- allData: allData,
14065
- link: link,
14066
- parentId: data.datastakeId,
14067
- renderTooltip: renderTooltip,
14068
- onClickLink: onClickLink,
14069
- selectedMarkersId: selectedMarkersId,
14070
- handleSelectMarker: handleSelectMarker,
14071
- mapRef: mapRef,
14072
- radius: radius,
14073
- index: index,
14074
- x: x,
14075
- y: y,
14076
- openPopupIdRef: openPopupIdRef,
14077
- polylinesRef: polylinesRef,
14078
- isForceOpen: isForceOpen,
14079
- activeMarker: activeMarker
14080
- }));
14081
- }
14082
- }, 0);
14069
+
14070
+ // Store container info for portal rendering
14071
+ containers.push({
14072
+ markerId,
14073
+ stakeholder,
14074
+ x,
14075
+ y,
14076
+ radius,
14077
+ index,
14078
+ isForceOpen
14079
+ });
14083
14080
  setMapMarkers(prev => {
14084
14081
  const array = [...prev, {
14085
14082
  id: marker._leaflet_id,
@@ -14111,17 +14108,19 @@ function LocationIcon({
14111
14108
  animated: true
14112
14109
  });
14113
14110
  });
14111
+
14112
+ // Update portal containers after markers are created
14113
+ setTimeout(() => {
14114
+ setPortalContainers(containers);
14115
+ }, 0);
14114
14116
  return () => {
14115
14117
  markersRef.current.forEach(marker => {
14116
- if (mapRef.hasLayer(marker)) {
14118
+ if (mapRef && mapRef.hasLayer(marker)) {
14117
14119
  mapRef.removeLayer(marker);
14118
14120
  }
14119
14121
  });
14120
- rootsMapRef.current.forEach(root => {
14121
- root.unmount();
14122
- });
14123
- rootsMapRef.current.clear();
14124
14122
  markersRef.current = [];
14123
+ setPortalContainers([]);
14125
14124
  };
14126
14125
  }, [stakeholdersOfLocation, selectedMarkersId, activeMarker, zoom]);
14127
14126
 
@@ -14205,57 +14204,81 @@ function LocationIcon({
14205
14204
  });
14206
14205
  });
14207
14206
  }, [linkedNodesData, selectedMarkersId, zoom, stakeholdersOfLocation, isSelected]);
14208
- return /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
14209
- content: renderTooltipJsx({
14210
- title: data.name,
14211
- subTitle: data.subTitle,
14212
- total: data.sources,
14213
- className: "pt-0 pb-0",
14214
- items: renderTooltip(data),
14215
- link,
14216
- onClickLink: () => onClickLink(data),
14217
- isNewTab: true
14218
- })
14219
- // open={
14220
- // (!openPopupIdRef.current || openPopupIdRef.current === data.datastakeId) &&
14221
- // isHovering
14222
- // }
14223
- ,
14224
- getPopupContainer: triggerNode => {
14225
- const mapElement = document.getElementById("map");
14226
- return mapElement || triggerNode.parentElement || document.body;
14227
- },
14228
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
14229
- style: {
14230
- position: "relative",
14231
- display: "inline-block"
14207
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
14208
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
14209
+ content: renderTooltipJsx({
14210
+ title: data.name,
14211
+ subTitle: data.subTitle,
14212
+ total: data.sources,
14213
+ className: "pt-0 pb-0",
14214
+ items: renderTooltip(data),
14215
+ link,
14216
+ onClickLink: () => onClickLink(data),
14217
+ isNewTab: true
14218
+ }),
14219
+ getPopupContainer: triggerNode => {
14220
+ const mapElement = document.getElementById("map");
14221
+ return mapElement || triggerNode.parentElement || document.body;
14232
14222
  },
14233
- children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
14223
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
14234
14224
  style: {
14235
- position: "absolute",
14236
- bottom: "0",
14237
- left: "50%",
14238
- transform: "translateX(-50%)",
14239
- width: "12px",
14240
- height: "6px",
14241
- background: "rgba(0,0,0,0.15)",
14242
- borderRadius: "50%",
14243
- filter: "blur(3px)"
14244
- }
14245
- }), /*#__PURE__*/jsxRuntime.jsx(Marker, {
14246
- isSelected: isSelected,
14247
- onClick: () => {
14248
- handleSelectMarker(data);
14249
- setActiveMarker(isSelected ? null : data);
14225
+ position: "relative",
14226
+ display: "inline-block"
14250
14227
  },
14228
+ children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
14229
+ style: {
14230
+ position: "absolute",
14231
+ bottom: "0",
14232
+ left: "50%",
14233
+ transform: "translateX(-50%)",
14234
+ width: "12px",
14235
+ height: "6px",
14236
+ background: "rgba(0,0,0,0.15)",
14237
+ borderRadius: "50%",
14238
+ filter: "blur(3px)"
14239
+ }
14240
+ }), /*#__PURE__*/jsxRuntime.jsx(Marker, {
14241
+ isSelected: isSelected,
14242
+ onClick: () => {
14243
+ handleSelectMarker(data);
14244
+ setActiveMarker(isSelected ? null : data);
14245
+ },
14246
+ zoom: zoom,
14247
+ selectedMarkersId: selectedMarkersId
14248
+ })]
14249
+ })
14250
+ }), portalContainers.map(({
14251
+ markerId,
14252
+ stakeholder,
14253
+ x,
14254
+ y,
14255
+ radius,
14256
+ index,
14257
+ isForceOpen
14258
+ }) => {
14259
+ const container = document.getElementById(markerId);
14260
+ if (!container) return null;
14261
+ return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
14262
+ data: stakeholder,
14251
14263
  zoom: zoom,
14252
- onMouseEnter: () => setIsHovering(true),
14253
- onMouseLeave: () => {
14254
- setIsHovering(false);
14255
- },
14256
- selectedMarkersId: selectedMarkersId
14257
- })]
14258
- })
14264
+ allData: allData,
14265
+ link: link,
14266
+ parentId: data.datastakeId,
14267
+ renderTooltip: renderTooltip,
14268
+ onClickLink: onClickLink,
14269
+ selectedMarkersId: selectedMarkersId,
14270
+ handleSelectMarker: handleSelectMarker,
14271
+ mapRef: mapRef,
14272
+ radius: radius,
14273
+ index: index,
14274
+ x: x,
14275
+ y: y,
14276
+ openPopupIdRef: openPopupIdRef,
14277
+ polylinesRef: polylinesRef,
14278
+ isForceOpen: isForceOpen,
14279
+ activeMarker: activeMarker
14280
+ }, markerId), container);
14281
+ })]
14259
14282
  });
14260
14283
  }
14261
14284
 
@@ -15656,7 +15679,7 @@ Map$3.propTypes = {
15656
15679
  link: PropTypes__default["default"].any
15657
15680
  };
15658
15681
 
15659
- const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15682
+ const _excluded$v = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15660
15683
  function InExpandableWidgetMap(_ref) {
15661
15684
  let {
15662
15685
  isExpanded,
@@ -15670,7 +15693,7 @@ function InExpandableWidgetMap(_ref) {
15670
15693
  height,
15671
15694
  widgetConfig
15672
15695
  } = _ref,
15673
- rest = _objectWithoutProperties(_ref, _excluded$u);
15696
+ rest = _objectWithoutProperties(_ref, _excluded$v);
15674
15697
  const [mapKey, setMapKey] = React.useState(0);
15675
15698
  const [isMapReady, setIsMapReady] = React.useState(false);
15676
15699
  React.useEffect(() => {
@@ -17870,14 +17893,14 @@ const MapConfig = ({
17870
17893
  });
17871
17894
  };
17872
17895
 
17873
- const _excluded$t = ["config", "title", "loading"];
17896
+ const _excluded$u = ["config", "title", "loading"];
17874
17897
  const Details = _ref => {
17875
17898
  let {
17876
17899
  config = [],
17877
17900
  title,
17878
17901
  loading = false
17879
17902
  } = _ref,
17880
- rest = _objectWithoutProperties(_ref, _excluded$t);
17903
+ rest = _objectWithoutProperties(_ref, _excluded$u);
17881
17904
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17882
17905
  className: "with-border-header h-w-btn-header card",
17883
17906
  loading: loading,
@@ -17893,14 +17916,14 @@ const Details = _ref => {
17893
17916
  }));
17894
17917
  };
17895
17918
 
17896
- const _excluded$s = ["config", "title", "loading"];
17919
+ const _excluded$t = ["config", "title", "loading"];
17897
17920
  const KeyIndicatorsDetails = _ref => {
17898
17921
  let {
17899
17922
  config,
17900
17923
  title,
17901
17924
  loading = false
17902
17925
  } = _ref,
17903
- rest = _objectWithoutProperties(_ref, _excluded$s);
17926
+ rest = _objectWithoutProperties(_ref, _excluded$t);
17904
17927
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17905
17928
  className: "with-border-header h-w-btn-header",
17906
17929
  title: title,
@@ -17930,7 +17953,7 @@ const Style$G = styled__default["default"].div`
17930
17953
  }
17931
17954
  `;
17932
17955
 
17933
- const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
17956
+ const _excluded$s = ["children", "config", "detailsTitle", "firstColumnWidth"];
17934
17957
  const DetailsSection = _ref => {
17935
17958
  let {
17936
17959
  children,
@@ -17938,7 +17961,7 @@ const DetailsSection = _ref => {
17938
17961
  detailsTitle,
17939
17962
  firstColumnWidth = "250px"
17940
17963
  } = _ref,
17941
- rest = _objectWithoutProperties(_ref, _excluded$r);
17964
+ rest = _objectWithoutProperties(_ref, _excluded$s);
17942
17965
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17943
17966
  firstColumnWidth: firstColumnWidth,
17944
17967
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18114,14 +18137,14 @@ const getGoalConfig = () => {
18114
18137
  };
18115
18138
 
18116
18139
  var _templateObject$c;
18117
- const _excluded$q = ["title", "activeSdgGoals", "t"];
18140
+ const _excluded$r = ["title", "activeSdgGoals", "t"];
18118
18141
  function SDGWidget(_ref) {
18119
18142
  let {
18120
18143
  title = "Sustainable Development Goals",
18121
18144
  activeSdgGoals = [],
18122
18145
  t = key => key
18123
18146
  } = _ref,
18124
- props = _objectWithoutProperties(_ref, _excluded$q);
18147
+ props = _objectWithoutProperties(_ref, _excluded$r);
18125
18148
  const sdgConfig = getGoalConfig();
18126
18149
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18127
18150
  title: title,
@@ -18419,7 +18442,7 @@ function SdgList({
18419
18442
  });
18420
18443
  }
18421
18444
 
18422
- const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18445
+ const _excluded$q = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18423
18446
  const {
18424
18447
  Meta
18425
18448
  } = antd.Card;
@@ -18439,7 +18462,7 @@ function ProjectWidget(_ref) {
18439
18462
  hideSDGList = false,
18440
18463
  t = x => x
18441
18464
  } = _ref,
18442
- props = _objectWithoutProperties(_ref, _excluded$p);
18465
+ props = _objectWithoutProperties(_ref, _excluded$q);
18443
18466
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18444
18467
  const {
18445
18468
  token
@@ -18711,13 +18734,13 @@ const WidgetCard = _ref => {
18711
18734
  });
18712
18735
  };
18713
18736
 
18714
- const _excluded$o = ["title", "children"];
18737
+ const _excluded$p = ["title", "children"];
18715
18738
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18716
18739
  let {
18717
18740
  title,
18718
18741
  children
18719
18742
  } = _ref,
18720
- rest = _objectWithoutProperties(_ref, _excluded$o);
18743
+ rest = _objectWithoutProperties(_ref, _excluded$p);
18721
18744
  /**
18722
18745
  * Handles carousel slide change events
18723
18746
  * @param {number} currentSlide - The index of the current slide after change
@@ -18881,7 +18904,7 @@ const EmptyStateContainer = styled__default["default"].div`
18881
18904
  }
18882
18905
  `;
18883
18906
 
18884
- const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18907
+ const _excluded$o = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18885
18908
  function ImageCarousel(_ref) {
18886
18909
  let {
18887
18910
  title,
@@ -18896,7 +18919,7 @@ function ImageCarousel(_ref) {
18896
18919
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18897
18920
  emptyText = "No Image"
18898
18921
  } = _ref,
18899
- rest = _objectWithoutProperties(_ref, _excluded$n);
18922
+ rest = _objectWithoutProperties(_ref, _excluded$o);
18900
18923
  const [previewVisible, setPreviewVisible] = React.useState(false);
18901
18924
  const [current, setCurrent] = React.useState(0);
18902
18925
  const carouselRef = React.useRef(null);
@@ -19265,7 +19288,7 @@ const getVegetationConfig = () => {
19265
19288
  };
19266
19289
 
19267
19290
  var _templateObject$a, _templateObject2$3;
19268
- const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19291
+ const _excluded$n = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19269
19292
  function VegetationWidget(_ref) {
19270
19293
  let {
19271
19294
  title = "Vegetation Health",
@@ -19277,12 +19300,19 @@ function VegetationWidget(_ref) {
19277
19300
  growthObservations = [],
19278
19301
  t = key => key
19279
19302
  } = _ref,
19280
- props = _objectWithoutProperties(_ref, _excluded$m);
19303
+ props = _objectWithoutProperties(_ref, _excluded$n);
19281
19304
  let vegetationConfig = getVegetationConfig();
19305
+
19306
+ // Get all VEGETATION_KEYS values before filtering (needed for mapping check)
19282
19307
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19308
+
19309
+ // Filter to show only specific keys if filterKeys is provided
19283
19310
  if (filterKeys && Array.isArray(filterKeys)) {
19284
19311
  vegetationConfig = vegetationConfig.filter(item => filterKeys.includes(item.key));
19285
19312
  }
19313
+
19314
+ // Map growthObservations to VEGETATION_KEYS
19315
+ // Handle both formats: growthObservations keys (e.g., "yellowing_leaves") and VEGETATION_KEYS (e.g., "yellowing")
19286
19316
  const mappedGrowthObservations = Array.isArray(growthObservations) ? growthObservations.map(obs => {
19287
19317
  // First try to map from growthObservations format
19288
19318
  const mapped = GROWTH_OBSERVATIONS_TO_VEGETATION_KEYS[obs];
@@ -19393,7 +19423,7 @@ const getFaunaConfig = () => {
19393
19423
  };
19394
19424
 
19395
19425
  var _templateObject$9, _templateObject2$2;
19396
- const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19426
+ const _excluded$m = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19397
19427
  function FaunaWidget(_ref) {
19398
19428
  let {
19399
19429
  title = "Observed Fauna",
@@ -19404,7 +19434,7 @@ function FaunaWidget(_ref) {
19404
19434
  itemHeight = 100,
19405
19435
  t = key => key
19406
19436
  } = _ref,
19407
- props = _objectWithoutProperties(_ref, _excluded$l);
19437
+ props = _objectWithoutProperties(_ref, _excluded$m);
19408
19438
  let faunaConfig = getFaunaConfig();
19409
19439
 
19410
19440
  // Filter to show only specific keys if filterKeys is provided
@@ -19469,7 +19499,7 @@ const getInvasiveSpeciesConfig = () => {
19469
19499
  };
19470
19500
 
19471
19501
  var _templateObject$8, _templateObject2$1;
19472
- const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19502
+ const _excluded$l = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19473
19503
  function InvasiveSpeciesWidget(_ref) {
19474
19504
  let {
19475
19505
  title = "Invasive Species",
@@ -19481,7 +19511,7 @@ function InvasiveSpeciesWidget(_ref) {
19481
19511
  itemHeight = 100,
19482
19512
  t = key => key
19483
19513
  } = _ref,
19484
- props = _objectWithoutProperties(_ref, _excluded$k);
19514
+ props = _objectWithoutProperties(_ref, _excluded$l);
19485
19515
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19486
19516
 
19487
19517
  // Filter to show only specific keys if filterKeys is provided
@@ -24904,8 +24934,8 @@ const RepeatableModals = ({
24904
24934
  }) : null;
24905
24935
  };
24906
24936
 
24907
- const _excluded$j = ["viewGroup"],
24908
- _excluded2$1 = ["label", "icon", "position"];
24937
+ const _excluded$k = ["viewGroup"],
24938
+ _excluded2$2 = ["label", "icon", "position"];
24909
24939
  const Content$1 = _ref => {
24910
24940
  let {
24911
24941
  style = {},
@@ -24976,7 +25006,7 @@ const Content$1 = _ref => {
24976
25006
  if (groups[gKey].viewGroup === key) {
24977
25007
  // eslint-disable-next-line no-unused-vars
24978
25008
  const _groups$gKey = groups[gKey],
24979
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
25009
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
24980
25010
  items[gKey] = gCfg;
24981
25011
  }
24982
25012
  return items;
@@ -25204,7 +25234,7 @@ const Content$1 = _ref => {
25204
25234
  showIcon: true
25205
25235
  });
25206
25236
  }
25207
- let groups = _objectWithoutProperties(f, _excluded2$1);
25237
+ let groups = _objectWithoutProperties(f, _excluded2$2);
25208
25238
  groups = Object.keys(groups).reduce((items, key) => {
25209
25239
  var _groups$key2;
25210
25240
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -25256,7 +25286,7 @@ const Content$1 = _ref => {
25256
25286
  });
25257
25287
  };
25258
25288
 
25259
- const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25289
+ const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25260
25290
  function Modal(_ref) {
25261
25291
  let {
25262
25292
  t = text => text,
@@ -25272,7 +25302,7 @@ function Modal(_ref) {
25272
25302
  disabled = false,
25273
25303
  withModalFormWrapper = true
25274
25304
  } = _ref,
25275
- props = _objectWithoutProperties(_ref, _excluded$i);
25305
+ props = _objectWithoutProperties(_ref, _excluded$j);
25276
25306
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25277
25307
  width: 650,
25278
25308
  footer: null,
@@ -35921,11 +35951,13 @@ const beforeUpload = allowedExtensions => file => {
35921
35951
  };
35922
35952
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35923
35953
 
35924
- /* eslint-disable no-case-declarations */
35954
+ const _excluded$i = ["placeholder"],
35955
+ _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35925
35956
  dayjs__default["default"].extend(utc);
35926
35957
  dayjs__default["default"].extend(timezone);
35927
35958
  dayjs__default["default"].tz.setDefault("UTC");
35928
- const getDefaultInputValue = (input = {}) => {
35959
+ const getDefaultInputValue = function () {
35960
+ let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35929
35961
  let value = undefined;
35930
35962
  if (input.type === "multiselect") {
35931
35963
  value = [];
@@ -35943,33 +35975,30 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35943
35975
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35944
35976
  return isShown;
35945
35977
  };
35946
- const renderDataLinkGroup = ({
35947
- input,
35948
- groupFormId,
35949
- name,
35950
- formsValue,
35951
- form,
35952
- onValuesChange,
35953
- setValues,
35954
- changeLinking,
35955
- isHighlighted
35956
- }) => {
35957
- const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35958
- const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35959
- const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35960
- all[key] = input?.inputs[key];
35978
+ const renderDataLinkGroup = _ref2 => {
35979
+ var _input$meta, _formsValue$meta, _input$meta2;
35980
+ let {
35981
+ input,
35982
+ groupFormId,
35983
+ name,
35984
+ formsValue,
35985
+ form,
35986
+ onValuesChange,
35987
+ setValues,
35988
+ changeLinking,
35989
+ isHighlighted
35990
+ } = _ref2;
35991
+ const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35992
+ var _input$inputs$k;
35993
+ return (input === null || input === void 0 || (_input$inputs$k = input.inputs[k]) === null || _input$inputs$k === void 0 ? void 0 : _input$inputs$k.type) === "dataLink";
35994
+ });
35995
+ const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35996
+ const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35997
+ all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35961
35998
  return all;
35962
35999
  }, {});
35963
- const isSingle = input?.meta?.maxRepeat === 1;
35964
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35965
- ...(formsValue[groupFormId] || {})[name]
35966
- }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35967
- ...v
35968
- })) : isSingle ? formsValue[name] ? [{
35969
- ...formsValue[name]
35970
- }] : [] : getArray(formsValue[name] || []).map(v => ({
35971
- ...v
35972
- }));
36000
+ const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
36001
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : getArray(formsValue[name] || []).map(v => _objectSpread2({}, v));
35973
36002
  const onUpdate = (val, i) => {
35974
36003
  const _val = isSingle ? {
35975
36004
  [name]: val
@@ -35977,31 +36006,20 @@ const renderDataLinkGroup = ({
35977
36006
  [name]: formData.map((d, j) => i === j ? val : d)
35978
36007
  };
35979
36008
  if (groupFormId) {
35980
- const _defaultData = form?.getFieldValue(groupFormId) || {};
35981
- const _newData = {
35982
- ..._defaultData,
35983
- ..._val
35984
- };
35985
- onValuesChange(_newData, {
35986
- ...formsValue,
36009
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36010
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36011
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35987
36012
  [groupFormId]: _newData
35988
- });
35989
- form?.setFieldValue(groupFormId, _newData);
35990
- setValues({
35991
- ...formsValue,
36013
+ }));
36014
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36015
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35992
36016
  [groupFormId]: _newData
35993
- });
36017
+ }));
35994
36018
  return;
35995
36019
  }
35996
- onValuesChange(_val, {
35997
- ...formsValue,
35998
- ..._val
35999
- });
36000
- form?.setFieldValue(name, _val[name]);
36001
- setValues({
36002
- ...formsValue,
36003
- ..._val
36004
- });
36020
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36021
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36022
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36005
36023
  };
36006
36024
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
36007
36025
  form: input,
@@ -36012,102 +36030,79 @@ const renderDataLinkGroup = ({
36012
36030
  isHighlighted: isHighlighted,
36013
36031
  dataLinkInput: dataLinkInput,
36014
36032
  formsValue: formsValue,
36015
- values: groupFormId ? {
36016
- ...(formsValue[groupFormId] || {}),
36033
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36017
36034
  meta: {
36018
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36035
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
36019
36036
  }
36020
- } : formsValue,
36037
+ }) : formsValue,
36021
36038
  name: name,
36022
36039
  groupFormId: groupFormId,
36023
- maxRepeat: input?.meta?.maxRepeat,
36024
- remove: ({
36025
- key
36026
- }) => {
36040
+ maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
36041
+ remove: _ref3 => {
36042
+ let {
36043
+ key
36044
+ } = _ref3;
36027
36045
  const _val = isSingle ? {
36028
36046
  [name]: null
36029
36047
  } : {
36030
36048
  [name]: formData.filter((v, j) => j !== key)
36031
36049
  };
36032
36050
  if (groupFormId) {
36033
- const _defaultData = form?.getFieldValue(groupFormId) || {};
36034
- const _newData = {
36035
- ..._defaultData,
36036
- ..._val
36037
- };
36038
- onValuesChange(_newData, {
36039
- ...formsValue,
36051
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36052
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36053
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36040
36054
  [groupFormId]: _newData
36041
- });
36042
- form?.setFieldValue(groupFormId, _newData);
36043
- setValues({
36044
- ...formsValue,
36055
+ }));
36056
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36057
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36045
36058
  [groupFormId]: _newData
36046
- });
36059
+ }));
36047
36060
  return;
36048
36061
  }
36049
- onValuesChange(_val, {
36050
- ...formsValue,
36051
- ..._val
36052
- });
36053
- form?.setFieldValue(name, _val[name]);
36054
- setValues({
36055
- ...formsValue,
36056
- ..._val
36057
- });
36062
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36063
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36064
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36058
36065
  },
36059
36066
  add: val => {
36060
36067
  const _val = isSingle ? {
36061
36068
  [name]: val
36062
36069
  } : {
36063
- [name]: [...formData, {
36064
- ...val
36065
- }]
36070
+ [name]: [...formData, _objectSpread2({}, val)]
36066
36071
  };
36067
36072
  if (groupFormId) {
36068
- const _defaultData = form?.getFieldValue(groupFormId) || {};
36069
- const _newData = {
36070
- ..._defaultData,
36071
- ..._val
36072
- };
36073
- form?.setFieldValue(groupFormId, _newData);
36074
- onValuesChange(_newData, {
36075
- ...formsValue,
36073
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36074
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36075
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36076
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36076
36077
  [groupFormId]: _newData
36077
- });
36078
- setValues({
36079
- ...formsValue,
36078
+ }));
36079
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36080
36080
  [groupFormId]: _newData
36081
- });
36081
+ }));
36082
36082
  return;
36083
36083
  }
36084
- form?.setFieldValue(name, _val[name]);
36085
- onValuesChange(_val, {
36086
- ...formsValue,
36087
- ..._val
36088
- });
36089
- setValues({
36090
- ...formsValue,
36091
- ..._val
36092
- });
36084
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36085
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36086
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36093
36087
  },
36094
36088
  k: name,
36095
36089
  formData: formData
36096
36090
  });
36097
36091
  };
36098
36092
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
36099
- if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
36093
+ var _input$meta3, _data$meta;
36094
+ if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
36100
36095
  return false;
36101
36096
  }
36102
- if (typeof input?.meta?.excludeFromEdit === "boolean") {
36103
- return !input?.meta?.excludeFromEdit;
36097
+ if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
36098
+ var _input$meta4;
36099
+ return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
36104
36100
  }
36105
- const formsValue = {
36106
- ...data
36107
- };
36108
- Object.keys(data?.meta?.inputs || {}).forEach(key => {
36109
- const input = data?.meta?.inputs[key];
36110
- if (input?.notApplicable || input?.notAvailable) {
36101
+ const formsValue = _objectSpread2({}, data);
36102
+ Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
36103
+ var _data$meta2;
36104
+ const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
36105
+ if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
36111
36106
  formsValue[key] = undefined;
36112
36107
  delete formsValue[key];
36113
36108
  }
@@ -36166,35 +36161,35 @@ function getInputHeadLines$1(type, i, input, values) {
36166
36161
  switch (type) {
36167
36162
  case "h2":
36168
36163
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36169
- className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36164
+ className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36170
36165
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36171
36166
  children: getInputLabel$1(input, values)
36172
36167
  })
36173
36168
  });
36174
36169
  case "h3":
36175
36170
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36176
- className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36171
+ className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36177
36172
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36178
36173
  children: getInputLabel$1(input, values)
36179
36174
  })
36180
36175
  });
36181
36176
  case "h4":
36182
36177
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36183
- className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36178
+ className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36184
36179
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36185
36180
  children: getInputLabel$1(input, values)
36186
36181
  })
36187
36182
  });
36188
36183
  case "h5":
36189
36184
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36190
- className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36185
+ className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36191
36186
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36192
36187
  children: getInputLabel$1(input, values)
36193
36188
  })
36194
36189
  });
36195
36190
  case "h6":
36196
36191
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36197
- className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36192
+ className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36198
36193
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36199
36194
  children: getInputLabel$1(input, values)
36200
36195
  })
@@ -36203,15 +36198,16 @@ function getInputHeadLines$1(type, i, input, values) {
36203
36198
  return null;
36204
36199
  }
36205
36200
  }
36206
- function getInputProp(prop, formsValue = {}, scope) {
36201
+ function getInputProp(prop) {
36202
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36203
+ let scope = arguments.length > 2 ? arguments[2] : undefined;
36207
36204
  if (prop && typeof prop === "object") {
36208
36205
  const validations = Object.keys(prop);
36209
36206
  const key = validations.find(v => {
36210
36207
  let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
36211
- const value = dot__default["default"].pick(path, {
36212
- ...formsValue,
36208
+ const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36213
36209
  scope
36214
- });
36210
+ }));
36215
36211
  return _checkValue(wantedValue, match, value);
36216
36212
  });
36217
36213
  const label = key ? prop[key] : prop[validations[0]];
@@ -36220,29 +36216,33 @@ function getInputProp(prop, formsValue = {}, scope) {
36220
36216
  return prop;
36221
36217
  }
36222
36218
  }
36223
- function getInputLabel$1(input, formsValue = {}, asText = false) {
36219
+ function getInputLabel$1(input) {
36220
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36221
+ let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
36224
36222
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
36225
36223
  input: input,
36226
36224
  formsValue: formsValue,
36227
36225
  asText: asText
36228
36226
  });
36229
36227
  }
36230
- const InputLabel = ({
36231
- input,
36232
- formsValue,
36233
- asText
36234
- }) => {
36228
+ const InputLabel = _ref4 => {
36229
+ var _input$meta5, _input$meta6, _input$meta7;
36230
+ let {
36231
+ input,
36232
+ formsValue,
36233
+ asText
36234
+ } = _ref4;
36235
36235
  const {
36236
36236
  t,
36237
36237
  evaluationConfig,
36238
36238
  scope
36239
36239
  } = useEditContext();
36240
36240
  const label = getInputProp(input.label, formsValue, scope);
36241
- return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36241
+ return input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36242
36242
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
36243
36243
  className: "flex",
36244
36244
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
36245
- content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36245
+ content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36246
36246
  t: t,
36247
36247
  evaluationConfig: evaluationConfig
36248
36248
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36250,7 +36250,7 @@ const InputLabel = ({
36250
36250
  children: ReactHtmlParser__default["default"](input.description)
36251
36251
  }),
36252
36252
  placement: "top",
36253
- children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36253
+ children: !(input !== null && input !== void 0 && (_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.isEvaluation) || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36254
36254
  className: "flex flex-column justify-content-center ml-1",
36255
36255
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
36256
36256
  fontSize: 13
@@ -36272,7 +36272,9 @@ function getSectionLabel$1(labels, values) {
36272
36272
  }
36273
36273
  return labels;
36274
36274
  }
36275
- function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
36275
+ function getSubtitles$1(subtitles, position) {
36276
+ let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36277
+ let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36276
36278
  let subtitle = subtitles && subtitles[position];
36277
36279
  if (subtitle && typeof subtitle === "object") {
36278
36280
  let newSubtitle = subtitle.default || "";
@@ -36316,14 +36318,12 @@ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repea
36316
36318
  function getFormTitles$1(titles, key, position) {
36317
36319
  let tilte = titles && titles[key];
36318
36320
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
36319
- className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
36321
+ className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36320
36322
  children: tilte
36321
36323
  }) : null;
36322
36324
  }
36323
36325
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
36324
- formsValue = Object.assign(formsValue, {
36325
- ...mainForm.getFieldsValue(true)
36326
- });
36326
+ formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36327
36327
  if (typeof repeatIndex === "number" && repeatValues) {
36328
36328
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
36329
36329
  repeatValues[inputName] = value;
@@ -36358,14 +36358,16 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
36358
36358
  };
36359
36359
  const inputOnBlur = [];
36360
36360
  const inputTypeComponent$1 = {
36361
- text: ({
36362
- props,
36363
- rules
36364
- }, {
36365
- inputMeta = {},
36366
- t,
36367
- isHighlighted
36368
- }) => {
36361
+ text: (_ref5, _ref6) => {
36362
+ let {
36363
+ props,
36364
+ rules
36365
+ } = _ref5;
36366
+ let {
36367
+ inputMeta = {},
36368
+ t,
36369
+ isHighlighted
36370
+ } = _ref6;
36369
36371
  const maxRule = rules.find(r => r.max);
36370
36372
  const maxProps = {
36371
36373
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36373,26 +36375,28 @@ const inputTypeComponent$1 = {
36373
36375
  if (maxRule) {
36374
36376
  maxProps.maxLength = maxRule.max;
36375
36377
  }
36376
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36377
- size: "large",
36378
- ...maxProps,
36378
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36379
+ size: "large"
36380
+ }, maxProps), {}, {
36379
36381
  allowClear: true,
36380
36382
  autoComplete: "new-password",
36381
- type: "text",
36382
- ...props,
36383
+ type: "text"
36384
+ }, props), {}, {
36383
36385
  className: formatClassname([isHighlighted && "highlighted-input"]),
36384
36386
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36385
36387
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36386
- });
36388
+ }));
36387
36389
  },
36388
- link: ({
36389
- props,
36390
- rules
36391
- }, {
36392
- inputMeta = {},
36393
- t,
36394
- isHighlighted
36395
- }) => {
36390
+ link: (_ref7, _ref8) => {
36391
+ let {
36392
+ props,
36393
+ rules
36394
+ } = _ref7;
36395
+ let {
36396
+ inputMeta = {},
36397
+ t,
36398
+ isHighlighted
36399
+ } = _ref8;
36396
36400
  const maxRule = rules.find(r => r.max);
36397
36401
  const maxProps = {
36398
36402
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36400,29 +36404,32 @@ const inputTypeComponent$1 = {
36400
36404
  if (maxRule) {
36401
36405
  maxProps.maxLength = maxRule.max;
36402
36406
  }
36403
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36404
- size: "large",
36405
- ...maxProps,
36407
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36408
+ size: "large"
36409
+ }, maxProps), {}, {
36406
36410
  allowClear: true,
36407
36411
  autoComplete: "new-password",
36408
- type: "text",
36409
- ...props,
36412
+ type: "text"
36413
+ }, props), {}, {
36410
36414
  className: formatClassname([isHighlighted && "highlighted-input"]),
36411
36415
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36412
36416
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36413
- });
36417
+ }));
36414
36418
  },
36415
- number: ({
36416
- props,
36417
- rules,
36418
- input
36419
- }, {
36420
- inputMeta = {},
36421
- t,
36422
- isHighlighted
36423
- }) => {
36419
+ number: (_ref9, _ref10) => {
36420
+ var _input$meta8;
36421
+ let {
36422
+ props,
36423
+ rules,
36424
+ input
36425
+ } = _ref9;
36426
+ let {
36427
+ inputMeta = {},
36428
+ t,
36429
+ isHighlighted
36430
+ } = _ref10;
36424
36431
  const maxRule = rules.find(r => r.max);
36425
- const integerRule = !input?.meta?.isDecimal;
36432
+ const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36426
36433
  const parser = value => {
36427
36434
  if (!value) {
36428
36435
  return "";
@@ -36433,60 +36440,63 @@ const inputTypeComponent$1 = {
36433
36440
  return value.replace(/\$\s?|(,*)/g, "");
36434
36441
  };
36435
36442
  if (maxRule) {
36436
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36443
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36437
36444
  size: "large",
36438
36445
  allowClear: true,
36439
- autoComplete: "new-password",
36440
- ...props,
36446
+ autoComplete: "new-password"
36447
+ }, props), {}, {
36441
36448
  type: "number",
36442
36449
  parser: parser,
36443
36450
  min: 0,
36444
36451
  max: maxRule.max,
36445
36452
  className: formatClassname([isHighlighted && "highlighted-input"])
36446
- });
36453
+ }));
36447
36454
  }
36448
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36455
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36449
36456
  size: "large",
36450
36457
  allowClear: true,
36451
36458
  className: formatClassname([isHighlighted && "highlighted-input"]),
36452
- autoComplete: "new-password",
36453
- ...props,
36459
+ autoComplete: "new-password"
36460
+ }, props), {}, {
36454
36461
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36455
36462
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36456
36463
  min: 0,
36457
36464
  formatter: value => numberWithCommas$1(value),
36458
36465
  parser: parser
36459
- });
36466
+ }));
36460
36467
  },
36461
36468
  // eslint-disable-next-line no-unused-vars
36462
- select: ({
36463
- value,
36464
- options,
36465
- optionGroup,
36466
- props,
36467
- formsValue,
36468
- optionsFilter,
36469
- filterCond,
36470
- repeatValues,
36471
- repeatIndex,
36472
- name,
36473
- inputName,
36474
- address,
36475
- addressData,
36476
- input,
36477
- scope
36478
- }, {
36479
- forms,
36480
- form,
36481
- setAddress,
36482
- inputMeta = {},
36483
- t,
36484
- isHighlighted,
36485
- changeInputMeta,
36486
- groupFormId
36487
- }) => {
36469
+ select: (_ref11, _ref12) => {
36470
+ var _input$meta9, _input$meta10;
36471
+ let {
36472
+ value,
36473
+ options,
36474
+ optionGroup,
36475
+ props,
36476
+ formsValue,
36477
+ optionsFilter,
36478
+ filterCond,
36479
+ repeatValues,
36480
+ repeatIndex,
36481
+ name,
36482
+ inputName,
36483
+ address,
36484
+ addressData,
36485
+ input,
36486
+ scope
36487
+ } = _ref11;
36488
+ let {
36489
+ forms,
36490
+ form,
36491
+ setAddress,
36492
+ inputMeta = {},
36493
+ t,
36494
+ isHighlighted,
36495
+ changeInputMeta,
36496
+ groupFormId
36497
+ } = _ref12;
36488
36498
  let opts;
36489
- const isEvaluation = input?.meta?.isEvaluation;
36499
+ const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36490
36500
  let defaultValue = value;
36491
36501
  if (typeof options === "string") {
36492
36502
  const [formName, key] = options.split(".");
@@ -36511,7 +36521,7 @@ const inputTypeComponent$1 = {
36511
36521
  opts = [];
36512
36522
  }
36513
36523
  } else {
36514
- opts = options?.filter(o => !o.onlyView);
36524
+ opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36515
36525
  }
36516
36526
  opts = JSON.parse(JSON.stringify(opts || []));
36517
36527
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36521,7 +36531,7 @@ const inputTypeComponent$1 = {
36521
36531
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36522
36532
 
36523
36533
  // Handle default value logic
36524
- if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36534
+ if (!propHasValue$1(value) && propHasValue$1(input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.defaultValue)) {
36525
36535
  // If no current value but there's a default value, use the default
36526
36536
  value = input.meta.defaultValue;
36527
36537
  defaultValue = value;
@@ -36554,7 +36564,7 @@ const inputTypeComponent$1 = {
36554
36564
  }
36555
36565
  opts = groupOptions;
36556
36566
  }
36557
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36567
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36558
36568
  size: "large",
36559
36569
  autoComplete: "new-password",
36560
36570
  allowClear: true,
@@ -36563,35 +36573,32 @@ const inputTypeComponent$1 = {
36563
36573
  value: value // Use value instead of defaultValue for controlled behavior
36564
36574
  ,
36565
36575
  filterOption: filterSelectOptions,
36566
- optionFilterProp: "children",
36567
- ...props,
36576
+ optionFilterProp: "children"
36577
+ }, props), {}, {
36568
36578
  className: formatClassname([isHighlighted && "highlighted-select"]),
36569
36579
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36570
36580
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36571
36581
  onChange: (val, selectedValue) => {
36572
36582
  // ONLY FOR SBG EVALUATON !!
36573
36583
  if (isEvaluation && val === "na" && groupFormId) {
36584
+ var _formsValue$meta2;
36574
36585
  changeInputMeta({
36575
36586
  key: groupFormId,
36576
- value: {
36577
- ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36587
+ value: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 || (_formsValue$meta2 = formsValue.meta) === null || _formsValue$meta2 === void 0 || (_formsValue$meta2 = _formsValue$meta2.inputs) === null || _formsValue$meta2 === void 0 ? void 0 : _formsValue$meta2[groupFormId]) || {}), {}, {
36578
36588
  documentation: {
36579
36589
  notApplicable: true
36580
36590
  }
36581
- },
36591
+ }),
36582
36592
  otherValues: {
36583
- [groupFormId]: {
36584
- ...(formsValue?.[groupFormId] || {}),
36593
+ [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36585
36594
  [name]: val
36586
- }
36595
+ })
36587
36596
  }
36588
36597
  });
36589
36598
  }
36590
36599
  if (address && selectedValue) {
36591
36600
  dot__default["default"].str(address, selectedValue.children, addressData);
36592
- setAddress({
36593
- ...addressData
36594
- });
36601
+ setAddress(_objectSpread2({}, addressData));
36595
36602
  }
36596
36603
  if (props.onChange) {
36597
36604
  props.onChange(val);
@@ -36622,15 +36629,15 @@ const inputTypeComponent$1 = {
36622
36629
  if (og.disabled !== undefined) {
36623
36630
  groupOtherProps.disabled = og.disabled;
36624
36631
  }
36625
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36626
- value: og.value,
36627
- ...groupOtherProps,
36632
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36633
+ value: og.value
36634
+ }, groupOtherProps), {}, {
36628
36635
  children: og.label
36629
- }, `${i}${j}`);
36636
+ }), "".concat(i).concat(j));
36630
36637
  })
36631
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36632
- value: option.value,
36633
- ...otherProps,
36638
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36639
+ value: option.value
36640
+ }, otherProps), {}, {
36634
36641
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36635
36642
  className: "flex",
36636
36643
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36638,33 +36645,35 @@ const inputTypeComponent$1 = {
36638
36645
  children: sgbEvaluationIcons[option.value]
36639
36646
  }), option.label]
36640
36647
  }) : option.label
36641
- }, option.value);
36648
+ }), option.value);
36642
36649
  })
36643
- });
36650
+ }));
36644
36651
  },
36645
- multiselect: ({
36646
- value,
36647
- options,
36648
- optionGroup,
36649
- optionsFilter,
36650
- filterCond,
36651
- props,
36652
- formsValue,
36653
- repeatValues,
36654
- repeatIndex,
36655
- inputName,
36656
- name,
36657
- tags,
36658
- maxWidth,
36659
- staticWidth,
36660
- fullWidth
36661
- }, {
36662
- forms,
36663
- form,
36664
- inputMeta = {},
36665
- t,
36666
- isHighlighted
36667
- }) => {
36652
+ multiselect: (_ref13, _ref14) => {
36653
+ let {
36654
+ value,
36655
+ options,
36656
+ optionGroup,
36657
+ optionsFilter,
36658
+ filterCond,
36659
+ props,
36660
+ formsValue,
36661
+ repeatValues,
36662
+ repeatIndex,
36663
+ inputName,
36664
+ name,
36665
+ tags,
36666
+ maxWidth,
36667
+ staticWidth,
36668
+ fullWidth
36669
+ } = _ref13;
36670
+ let {
36671
+ forms,
36672
+ form,
36673
+ inputMeta = {},
36674
+ t,
36675
+ isHighlighted
36676
+ } = _ref14;
36668
36677
  let opts;
36669
36678
  if (typeof options === "string") {
36670
36679
  const [formName, key] = options.split(".");
@@ -36726,17 +36735,17 @@ const inputTypeComponent$1 = {
36726
36735
  staticWidth,
36727
36736
  fullWidth
36728
36737
  });
36729
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36738
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36730
36739
  size: "medium",
36731
36740
  allowClear: true,
36732
36741
  autoComplete: "new-password",
36733
36742
  mode: tags ? "tags" : "multiple",
36734
- optionFilterProp: "children",
36735
- ...(tags ? {
36736
- tokenSeparators: [","]
36737
- } : {}),
36738
- filterOption: filterSelectOptions,
36739
- ...props,
36743
+ optionFilterProp: "children"
36744
+ }, tags ? {
36745
+ tokenSeparators: [","]
36746
+ } : {}), {}, {
36747
+ filterOption: filterSelectOptions
36748
+ }, props), {}, {
36740
36749
  className: formatClassname([isHighlighted && "highlighted-select"]),
36741
36750
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36742
36751
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
@@ -36775,51 +36784,52 @@ const inputTypeComponent$1 = {
36775
36784
  if (og.disabled !== undefined) {
36776
36785
  groupOtherProps.disabled = og.disabled;
36777
36786
  }
36778
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36779
- value: og.value,
36780
- ...groupOtherProps,
36787
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36788
+ value: og.value
36789
+ }, groupOtherProps), {}, {
36781
36790
  children: og.label
36782
- }, `${i}${j}`);
36791
+ }), "".concat(i).concat(j));
36783
36792
  })
36784
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36785
- value: option.value,
36786
- ...otherProps,
36793
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36794
+ value: option.value
36795
+ }, otherProps), {}, {
36787
36796
  children: option.label
36788
- }, i);
36797
+ }), i);
36789
36798
  })
36790
- });
36799
+ }));
36791
36800
  },
36792
- date: ({
36793
- props,
36794
- rules,
36795
- repeatValues,
36796
- formsValue,
36797
- name
36798
- }, {
36799
- setFormValues,
36800
- inputMeta,
36801
- form,
36802
- t,
36803
- isHighlighted,
36804
- groupFormId
36805
- }) => {
36801
+ date: (_ref15, _ref16) => {
36802
+ var _formsValue$groupForm, _value2;
36803
+ let {
36804
+ props,
36805
+ rules,
36806
+ repeatValues,
36807
+ formsValue,
36808
+ name
36809
+ } = _ref15;
36810
+ let {
36811
+ setFormValues,
36812
+ inputMeta,
36813
+ form,
36814
+ t,
36815
+ isHighlighted,
36816
+ groupFormId
36817
+ } = _ref16;
36806
36818
  const lng = localStorage.getItem("datastakeLng") || "en";
36807
36819
  const maxRule = rules.find(r => r.max);
36808
- let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36820
+ let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36809
36821
  const handleDateChange = date => {
36810
36822
  if (date) {
36811
36823
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36812
36824
  const localDate = dayjs__default["default"].utc(date);
36813
36825
  if (groupFormId) {
36814
- const _new = {
36815
- ...(formsValue[groupFormId] || {}),
36826
+ const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36816
36827
  [name]: localDate
36817
- };
36828
+ });
36818
36829
  form.setFieldValue(groupFormId, _new);
36819
- setFormValues({
36820
- ...formsValue,
36830
+ setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36821
36831
  [groupFormId]: _new
36822
- });
36832
+ }));
36823
36833
  } else {
36824
36834
  form.setFieldValue(name, localDate);
36825
36835
  }
@@ -36828,15 +36838,13 @@ const inputTypeComponent$1 = {
36828
36838
  if (groupFormId) {
36829
36839
  if (typeof value === "string" || typeof value === "undefined") {
36830
36840
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36831
- const _new = {
36832
- ...(formsValue[groupFormId] || {}),
36841
+ const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36833
36842
  [name]: value
36834
- };
36843
+ });
36835
36844
  form.setFieldValue(groupFormId, _new);
36836
- setFormValues({
36837
- ...formsValue,
36845
+ setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36838
36846
  [groupFormId]: _new
36839
- });
36847
+ }));
36840
36848
  }
36841
36849
  } else {
36842
36850
  if (typeof value === "string") {
@@ -36852,12 +36860,13 @@ const inputTypeComponent$1 = {
36852
36860
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36853
36861
  }
36854
36862
  if (checkForMax) {
36855
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36863
+ var _value;
36864
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36856
36865
  size: "large",
36857
36866
  allowClear: true,
36858
- autoComplete: "new-password",
36859
- ...props,
36860
- value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36867
+ autoComplete: "new-password"
36868
+ }, props), {}, {
36869
+ value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36861
36870
  onChange: handleDateChange,
36862
36871
  className: formatClassname([isHighlighted && "highlighted-input"]),
36863
36872
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36867,49 +36876,54 @@ const inputTypeComponent$1 = {
36867
36876
  disabledDate: current => {
36868
36877
  return current && current >= dayjs__default["default"]().endOf("day");
36869
36878
  }
36870
- });
36879
+ }));
36871
36880
  }
36872
36881
  }
36873
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36882
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36874
36883
  size: "large",
36875
36884
  allowClear: true,
36876
- autoComplete: "new-password",
36877
- ...props,
36878
- value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36885
+ autoComplete: "new-password"
36886
+ }, props), {}, {
36887
+ value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36879
36888
  onChange: handleDateChange,
36880
36889
  className: formatClassname([isHighlighted && "highlighted-input"]),
36881
36890
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36882
36891
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36883
36892
  format: DATE_FORMATS,
36884
36893
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36885
- });
36894
+ }));
36886
36895
  },
36887
- groupExpandable: ({
36888
- formsValue,
36889
- name,
36890
- input
36891
- }, {
36892
- groupFormId
36893
- }) => {
36894
- const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36896
+ groupExpandable: (_ref17, _ref18) => {
36897
+ var _formsValue$groupForm2;
36898
+ let {
36899
+ formsValue,
36900
+ name,
36901
+ input
36902
+ } = _ref17;
36903
+ let {
36904
+ groupFormId
36905
+ } = _ref18;
36906
+ const data = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm2 = formsValue[groupFormId]) === null || _formsValue$groupForm2 === void 0 ? void 0 : _formsValue$groupForm2[name] : formsValue === null || formsValue === void 0 ? void 0 : formsValue[name];
36895
36907
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36896
36908
  input: input,
36897
36909
  formsValue: formsValue,
36898
36910
  data: data
36899
36911
  });
36900
36912
  },
36901
- comment: ({
36902
- props: {
36903
- placeholder,
36904
- ...props
36905
- },
36906
- commentHint
36907
- }, {
36908
- onChange,
36909
- value,
36910
- isHighlighted
36911
- }) => {
36912
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36913
+ comment: (_ref19, _ref20) => {
36914
+ let {
36915
+ props: {
36916
+ placeholder
36917
+ },
36918
+ commentHint
36919
+ } = _ref19,
36920
+ props = _objectWithoutProperties(_ref19.props, _excluded$i);
36921
+ let {
36922
+ onChange,
36923
+ value,
36924
+ isHighlighted
36925
+ } = _ref20;
36926
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36913
36927
  allowClear: true,
36914
36928
  value: value,
36915
36929
  onChange: e => onChange(e.target.value),
@@ -36920,26 +36934,27 @@ const inputTypeComponent$1 = {
36920
36934
  autoSize: {
36921
36935
  minRows: 5,
36922
36936
  maxRows: 5
36923
- },
36924
- ...props,
36937
+ }
36938
+ }, props), {}, {
36925
36939
  disabled: false
36926
- });
36940
+ }));
36927
36941
  },
36928
- tableComment: ({
36929
- setValues,
36930
- name,
36931
- onValuesChange,
36932
- formsValue
36933
- }, {
36934
- form,
36935
- groupFormId,
36936
- isHighlighted
36937
- }) => {
36938
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36939
- ...v,
36942
+ tableComment: (_ref21, _ref22) => {
36943
+ var _formsValue$meta3;
36944
+ let {
36945
+ setValues,
36946
+ name,
36947
+ onValuesChange,
36948
+ formsValue
36949
+ } = _ref21;
36950
+ let {
36951
+ form,
36952
+ groupFormId,
36953
+ isHighlighted
36954
+ } = _ref22;
36955
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36940
36956
  key: i
36941
- })) : (formsValue[name] || []).map((v, i) => ({
36942
- ...v,
36957
+ })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36943
36958
  key: i
36944
36959
  }));
36945
36960
  const onUpdate = (val, i) => {
@@ -36947,121 +36962,89 @@ const inputTypeComponent$1 = {
36947
36962
  [name]: formData.map((d, j) => i === j ? val : d)
36948
36963
  };
36949
36964
  if (groupFormId) {
36950
- const _defaultData = form?.getFieldValue(groupFormId) || {};
36951
- const _newData = {
36952
- ..._defaultData,
36953
- ..._val
36954
- };
36955
- onValuesChange(_newData, {
36956
- ...formsValue,
36965
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36966
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36967
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36957
36968
  [groupFormId]: _newData
36958
- });
36959
- form?.setFieldValue(groupFormId, _newData);
36960
- setValues({
36961
- ...formsValue,
36969
+ }));
36970
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36971
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36962
36972
  [groupFormId]: _newData
36963
- });
36973
+ }));
36964
36974
  return;
36965
36975
  }
36966
- onValuesChange(_val, {
36967
- ...formsValue,
36968
- ..._val
36969
- });
36970
- form?.setFieldValue(name, _val[name]);
36971
- setValues({
36972
- ...formsValue,
36973
- ..._val
36974
- });
36976
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36977
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36978
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36975
36979
  };
36976
36980
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36977
36981
  onUpdate: onUpdate,
36978
36982
  isHighlighted: isHighlighted,
36979
36983
  form: form,
36980
- values: groupFormId ? {
36981
- ...(formsValue[groupFormId] || {}),
36984
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36982
36985
  meta: {
36983
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36986
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
36984
36987
  }
36985
- } : formsValue,
36988
+ }) : formsValue,
36986
36989
  name: name,
36987
- remove: ({
36988
- key
36989
- }) => {
36990
+ remove: _ref23 => {
36991
+ let {
36992
+ key
36993
+ } = _ref23;
36990
36994
  const _val = {
36991
36995
  [name]: formData.filter(v => v.key !== key)
36992
36996
  };
36993
36997
  if (groupFormId) {
36994
- const _defaultData = form?.getFieldValue(groupFormId) || {};
36995
- const _newData = {
36996
- ..._defaultData,
36997
- ..._val
36998
- };
36999
- onValuesChange(_newData, {
37000
- ...formsValue,
36998
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36999
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37000
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37001
37001
  [groupFormId]: _newData
37002
- });
37003
- form?.setFieldValue(groupFormId, _newData);
37004
- setValues({
37005
- ...formsValue,
37002
+ }));
37003
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37004
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37006
37005
  [groupFormId]: _newData
37007
- });
37006
+ }));
37008
37007
  return;
37009
37008
  }
37010
- onValuesChange(_val, {
37011
- ...formsValue,
37012
- ..._val
37013
- });
37014
- form?.setFieldValue(name, _val[name]);
37015
- setValues({
37016
- ...formsValue,
37017
- ..._val
37018
- });
37009
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37010
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37011
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37019
37012
  },
37020
37013
  add: val => {
37021
37014
  const _val = {
37022
- [name]: [...formData, {
37023
- ...val,
37015
+ [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
37024
37016
  key: formData.length
37025
- }]
37017
+ })]
37026
37018
  };
37027
37019
  if (groupFormId) {
37028
- const _defaultData = form?.getFieldValue(groupFormId) || {};
37029
- const _newData = {
37030
- ..._defaultData,
37031
- ..._val
37032
- };
37033
- form?.setFieldValue(groupFormId, _newData);
37034
- onValuesChange(_newData, {
37035
- ...formsValue,
37020
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37021
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37022
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37023
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37036
37024
  [groupFormId]: _newData
37037
- });
37038
- setValues({
37039
- ...formsValue,
37025
+ }));
37026
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37040
37027
  [groupFormId]: _newData
37041
- });
37028
+ }));
37042
37029
  return;
37043
37030
  }
37044
- form?.setFieldValue(name, _val[name]);
37045
- onValuesChange(_val, {
37046
- ...formsValue,
37047
- ..._val
37048
- });
37049
- setValues({
37050
- ...formsValue,
37051
- ..._val
37052
- });
37031
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37032
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37033
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37053
37034
  },
37054
37035
  k: name
37055
37036
  });
37056
37037
  },
37057
- textarea: ({
37058
- props,
37059
- rules
37060
- }, {
37061
- inputMeta,
37062
- t,
37063
- isHighlighted
37064
- }) => {
37038
+ textarea: (_ref24, _ref25) => {
37039
+ let {
37040
+ props,
37041
+ rules
37042
+ } = _ref24;
37043
+ let {
37044
+ inputMeta,
37045
+ t,
37046
+ isHighlighted
37047
+ } = _ref25;
37065
37048
  const maxRule = rules.find(r => r.max);
37066
37049
  let maxLength = MAX_TEXT_AREA_LENGTH;
37067
37050
  let rows = 5;
@@ -37088,7 +37071,7 @@ const inputTypeComponent$1 = {
37088
37071
  // rows = 14;
37089
37072
  // }
37090
37073
  }
37091
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
37074
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
37092
37075
  allowClear: true,
37093
37076
  autoComplete: "new-password",
37094
37077
  maxLength: maxLength,
@@ -37096,35 +37079,37 @@ const inputTypeComponent$1 = {
37096
37079
  autoSize: {
37097
37080
  minRows: rows,
37098
37081
  maxRows: rows
37099
- },
37100
- ...props,
37082
+ }
37083
+ }, props), {}, {
37101
37084
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37102
37085
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
37103
- });
37086
+ }));
37104
37087
  },
37105
- phoneNumber: ({
37106
- name,
37107
- inputName,
37108
- props,
37109
- value,
37110
- repeatIndex,
37111
- repeatValues,
37112
- formsValue
37113
- }, {
37114
- setFormValues,
37115
- inputMeta,
37116
- t,
37117
- isHighlighted
37118
- }) => {
37119
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
37088
+ phoneNumber: (_ref26, _ref27) => {
37089
+ let {
37090
+ name,
37091
+ inputName,
37092
+ props,
37093
+ value,
37094
+ repeatIndex,
37095
+ repeatValues,
37096
+ formsValue
37097
+ } = _ref26;
37098
+ let {
37099
+ setFormValues,
37100
+ inputMeta,
37101
+ t,
37102
+ isHighlighted
37103
+ } = _ref27;
37104
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
37120
37105
  customSelectWidthPercentage: "20%",
37121
37106
  t: t,
37122
37107
  size: "large",
37123
37108
  allowClear: true,
37124
- country: formsValue?.country,
37109
+ country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
37125
37110
  initialValue: value,
37126
- name: name,
37127
- ...props,
37111
+ name: name
37112
+ }, props), {}, {
37128
37113
  className: formatClassname([isHighlighted && "highlighted-input"]),
37129
37114
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37130
37115
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -37145,26 +37130,27 @@ const inputTypeComponent$1 = {
37145
37130
  }
37146
37131
  return val;
37147
37132
  }
37148
- });
37133
+ }));
37149
37134
  },
37150
- switch: ({
37151
- props,
37152
- value,
37153
- restricted,
37154
- autocomplete,
37155
- formsValue,
37156
- repeatValues,
37157
- repeatIndex,
37158
- name,
37159
- inputName,
37160
- replace: replaceInput,
37161
- unique
37162
- }, {
37163
- form,
37164
- isHighlighted
37165
- }) => {
37166
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
37167
- ...props,
37135
+ switch: (_ref28, _ref29) => {
37136
+ let {
37137
+ props,
37138
+ value,
37139
+ restricted,
37140
+ autocomplete,
37141
+ formsValue,
37142
+ repeatValues,
37143
+ repeatIndex,
37144
+ name,
37145
+ inputName,
37146
+ replace: replaceInput,
37147
+ unique
37148
+ } = _ref28;
37149
+ let {
37150
+ form,
37151
+ isHighlighted
37152
+ } = _ref29;
37153
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
37168
37154
  size: "default",
37169
37155
  defaultChecked: value || false,
37170
37156
  checked: value || false,
@@ -37192,9 +37178,7 @@ const inputTypeComponent$1 = {
37192
37178
  const [formName, replaceInputName] = replaceTo.split(".");
37193
37179
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
37194
37180
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
37195
- formsValue = Object.assign(formsValue, {
37196
- ...form.getFieldsValue(true)
37197
- });
37181
+ formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
37198
37182
  if (oldId) {
37199
37183
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
37200
37184
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -37235,20 +37219,22 @@ const inputTypeComponent$1 = {
37235
37219
  }
37236
37220
  }
37237
37221
  }
37238
- });
37222
+ }));
37239
37223
  },
37240
- radioGroup: ({
37241
- props,
37242
- value,
37243
- options,
37244
- isRisk
37245
- }, {
37246
- isHighlighted
37247
- }) => {
37224
+ radioGroup: (_ref30, _ref31) => {
37225
+ let {
37226
+ props,
37227
+ value,
37228
+ options,
37229
+ isRisk
37230
+ } = _ref30;
37231
+ let {
37232
+ isHighlighted
37233
+ } = _ref31;
37248
37234
  if (isRisk) {
37249
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37250
- value: value,
37251
- ...props,
37235
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37236
+ value: value
37237
+ }, props), {}, {
37252
37238
  className: "is-risk-radio",
37253
37239
  children: (options || []).map(o => {
37254
37240
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37262,11 +37248,11 @@ const inputTypeComponent$1 = {
37262
37248
  }) : null]
37263
37249
  }, o.value);
37264
37250
  })
37265
- });
37251
+ }));
37266
37252
  }
37267
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37268
- value: value,
37269
- ...props,
37253
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37254
+ value: value
37255
+ }, props), {}, {
37270
37256
  className: formatClassname([isHighlighted && "highlighted-input"]),
37271
37257
  children: (options || []).map(o => {
37272
37258
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37280,18 +37266,20 @@ const inputTypeComponent$1 = {
37280
37266
  }) : null]
37281
37267
  }, o.value);
37282
37268
  })
37283
- });
37269
+ }));
37284
37270
  },
37285
- checkboxGroup: ({
37286
- props,
37287
- value,
37288
- options
37289
- }, {
37290
- isHighlighted
37291
- }) => {
37292
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37293
- value: value,
37294
- ...props,
37271
+ checkboxGroup: (_ref32, _ref33) => {
37272
+ let {
37273
+ props,
37274
+ value,
37275
+ options
37276
+ } = _ref32;
37277
+ let {
37278
+ isHighlighted
37279
+ } = _ref33;
37280
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
37281
+ value: value
37282
+ }, props), {}, {
37295
37283
  className: formatClassname([isHighlighted && "highlighted-input"]),
37296
37284
  style: {
37297
37285
  display: "grid",
@@ -37315,16 +37303,18 @@ const inputTypeComponent$1 = {
37315
37303
  }) : null]
37316
37304
  }, o.value);
37317
37305
  })
37318
- });
37306
+ }));
37319
37307
  },
37320
- total100: ({
37321
- props,
37322
- name,
37323
- options,
37324
- value
37325
- }, {
37326
- isHighlighted
37327
- }) => {
37308
+ total100: (_ref34, _ref35) => {
37309
+ let {
37310
+ props,
37311
+ name,
37312
+ options,
37313
+ value
37314
+ } = _ref34;
37315
+ let {
37316
+ isHighlighted
37317
+ } = _ref35;
37328
37318
  value = value ? Array.isArray(value) ? value : [value] : [];
37329
37319
  function totalValue() {
37330
37320
  let total = 0;
@@ -37348,10 +37338,11 @@ const inputTypeComponent$1 = {
37348
37338
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
37349
37339
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
37350
37340
  name: name,
37351
- children: (fields, {
37352
- add,
37353
- remove
37354
- }) => {
37341
+ children: (fields, _ref36) => {
37342
+ let {
37343
+ add,
37344
+ remove
37345
+ } = _ref36;
37355
37346
  if (fields.length === 0) {
37356
37347
  const formData = value || [];
37357
37348
  if (formData.length) {
@@ -37370,27 +37361,27 @@ const inputTypeComponent$1 = {
37370
37361
  const v = value[field.name] || {};
37371
37362
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
37372
37363
  className: "total",
37373
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37374
- noStyle: true,
37375
- ...field,
37364
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37365
+ noStyle: true
37366
+ }, field), {}, {
37376
37367
  name: [field.name, "type"],
37377
37368
  fieldKey: [field.fieldKey, "type"],
37378
37369
  initialValue: v.type || null,
37379
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
37370
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37380
37371
  size: "large",
37381
37372
  allowClear: true,
37382
37373
  showSearch: true,
37383
37374
  filterOption: filterSelectOptions,
37384
- optionFilterProp: "children",
37385
- ...props,
37375
+ optionFilterProp: "children"
37376
+ }, props), {}, {
37386
37377
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
37387
37378
  value: option.value,
37388
37379
  children: option.label
37389
37380
  }, i))
37390
- })
37391
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37392
- noStyle: true,
37393
- ...field,
37381
+ }))
37382
+ })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37383
+ noStyle: true
37384
+ }, field), {}, {
37394
37385
  name: [field.name, "value"],
37395
37386
  fieldKey: [field.fieldKey, "value"],
37396
37387
  initialValue: v.value,
@@ -37399,14 +37390,14 @@ const inputTypeComponent$1 = {
37399
37390
  allowClear: true,
37400
37391
  name: "value",
37401
37392
  formatter: value => {
37402
- return value ? `${value}%` : "";
37393
+ return value ? "".concat(value, "%") : "";
37403
37394
  },
37404
37395
  disabled: !v.type || null,
37405
37396
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
37406
37397
  min: 1,
37407
37398
  max: 100 - siblingTotal(v.type || 0)
37408
37399
  })
37409
- }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37400
+ })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37410
37401
  disabled: !v.value || !v.type || totalValue() >= 100,
37411
37402
  type: "primary",
37412
37403
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -37438,19 +37429,22 @@ const inputTypeComponent$1 = {
37438
37429
  }) : null]
37439
37430
  });
37440
37431
  },
37441
- percentage: ({
37442
- name,
37443
- inputName,
37444
- totalMax,
37445
- repeatIndex,
37446
- props,
37447
- formsValue,
37448
- input
37449
- }, {
37450
- inputMeta,
37451
- t,
37452
- isHighlighted
37453
- }) => {
37432
+ percentage: (_ref37, _ref38) => {
37433
+ var _input$meta11;
37434
+ let {
37435
+ name,
37436
+ inputName,
37437
+ totalMax,
37438
+ repeatIndex,
37439
+ props,
37440
+ formsValue,
37441
+ input
37442
+ } = _ref37;
37443
+ let {
37444
+ inputMeta,
37445
+ t,
37446
+ isHighlighted
37447
+ } = _ref38;
37454
37448
  const isRepeatable = Array.isArray(formsValue[name]);
37455
37449
  let totalSiblings = 0;
37456
37450
  if (isRepeatable && totalMax) {
@@ -37458,45 +37452,47 @@ const inputTypeComponent$1 = {
37458
37452
  totl = totl + (grp[inputName] || 0);
37459
37453
  return totl;
37460
37454
  }, 0);
37461
- } else if (Array.isArray(input?.meta?.siblings)) {
37455
+ } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37462
37456
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
37463
37457
  totl = totl + (formsValue[key] || 0);
37464
37458
  return totl;
37465
37459
  }, 0);
37466
37460
  }
37467
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37461
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37468
37462
  size: "large",
37469
- allowClear: true,
37470
- ...props,
37463
+ allowClear: true
37464
+ }, props), {}, {
37471
37465
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37472
37466
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37473
37467
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37474
37468
  min: 0,
37475
37469
  max: 100 - totalSiblings,
37476
37470
  formatter: value => {
37477
- return value ? `${value}` : "";
37471
+ return value ? "".concat(value) : "";
37478
37472
  },
37479
37473
  parser: value => value.replace("%", ""),
37480
37474
  addonAfter: "%"
37481
- });
37475
+ }));
37482
37476
  },
37483
- drawTerritory: ({
37484
- formsValue,
37485
- name,
37486
- addressData
37487
- }, {
37488
- setFormValues
37489
- }) => {
37477
+ drawTerritory: (_ref39, _ref40) => {
37478
+ let {
37479
+ formsValue,
37480
+ name,
37481
+ addressData
37482
+ } = _ref39;
37483
+ let {
37484
+ setFormValues
37485
+ } = _ref40;
37490
37486
  let search = formsValue.country;
37491
37487
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37492
37488
  if (addressData.address.country) {
37493
37489
  search = addressData.address.country;
37494
37490
  }
37495
37491
  if (addressData.address.level1) {
37496
- search = `${addressData.address.level1}, ${addressData.address.country}`;
37492
+ search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37497
37493
  }
37498
37494
  if (addressData.address.level2) {
37499
- search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37495
+ search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37500
37496
  }
37501
37497
  } else {
37502
37498
  const country = countriesList.countries[formsValue.country] || {};
@@ -37504,10 +37500,10 @@ const inputTypeComponent$1 = {
37504
37500
  search = country.name;
37505
37501
  }
37506
37502
  if (formsValue.administrativeLevel1Name) {
37507
- search = `${search} ${formsValue.administrativeLevel1Name}`;
37503
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37508
37504
  }
37509
37505
  if (formsValue.administrativeLevel2Name) {
37510
- search = `${search} ${formsValue.administrativeLevel2Name}`;
37506
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37511
37507
  }
37512
37508
  }
37513
37509
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37519,32 +37515,36 @@ const inputTypeComponent$1 = {
37519
37515
  searchValue: search
37520
37516
  });
37521
37517
  },
37522
- year: ({
37523
- props
37524
- }, {
37525
- isHighlighted
37526
- }) => {
37518
+ year: (_ref41, _ref42) => {
37519
+ let {
37520
+ props
37521
+ } = _ref41;
37522
+ let {
37523
+ isHighlighted
37524
+ } = _ref42;
37527
37525
  const lng = localStorage.getItem("datastakeLng") || "en";
37528
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37526
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37529
37527
  size: "large",
37530
37528
  allowClear: true,
37531
37529
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37532
- picker: "year",
37533
- ...props,
37530
+ picker: "year"
37531
+ }, props), {}, {
37534
37532
  className: formatClassname([isHighlighted && "highlighted-input"]),
37535
37533
  format: "YYYY"
37536
- });
37534
+ }));
37537
37535
  },
37538
- upload: ({
37539
- rules,
37540
- value
37541
- }, {
37542
- setLoading = () => {},
37543
- getApiBaseUrl,
37544
- getAppHeader,
37545
- t,
37546
- isHighlighted
37547
- }) => {
37536
+ upload: (_ref43, _ref44) => {
37537
+ let {
37538
+ rules,
37539
+ value
37540
+ } = _ref43;
37541
+ let {
37542
+ setLoading = () => {},
37543
+ getApiBaseUrl,
37544
+ getAppHeader,
37545
+ t,
37546
+ isHighlighted
37547
+ } = _ref44;
37548
37548
  const apiURL = getApiBaseUrl();
37549
37549
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37550
37550
  const values = (Array.isArray(value) ? value : value && typeof value === "object" && value.fileList && Array.isArray(value.fileList) ? value.fileList.map(f => f.response).filter(f => f) : []) || [];
@@ -37557,13 +37557,12 @@ const inputTypeComponent$1 = {
37557
37557
  maxProps.multiple = true;
37558
37558
  }
37559
37559
  }
37560
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37561
- ...maxProps,
37560
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37562
37561
  accept: accept,
37563
- action: `${apiURL}/upload`,
37562
+ action: "".concat(apiURL, "/upload"),
37564
37563
  beforeUpload: beforeUpload(allowedExtensions),
37565
37564
  onChange: val => {
37566
- if (val?.file && typeof setLoading === "function") {
37565
+ if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37567
37566
  if (val.file.percent !== 100) {
37568
37567
  setLoading(true);
37569
37568
  } else {
@@ -37571,10 +37570,9 @@ const inputTypeComponent$1 = {
37571
37570
  }
37572
37571
  }
37573
37572
  },
37574
- headers: {
37575
- Authorization: `Bearer ${getToken()}`,
37576
- ...getAppHeader()
37577
- },
37573
+ headers: _objectSpread2({
37574
+ Authorization: "Bearer ".concat(getToken())
37575
+ }, getAppHeader()),
37578
37576
  defaultFileList: values,
37579
37577
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37580
37578
  style: {
@@ -37585,18 +37583,20 @@ const inputTypeComponent$1 = {
37585
37583
  children: t("Upload")
37586
37584
  })]
37587
37585
  })
37588
- });
37586
+ }));
37589
37587
  },
37590
- imageUpload: ({
37591
- rules,
37592
- value
37593
- }, {
37594
- setLoading = () => {},
37595
- getApiBaseUrl,
37596
- getAppHeader,
37597
- t,
37598
- isHighlighted
37599
- }) => {
37588
+ imageUpload: (_ref45, _ref46) => {
37589
+ let {
37590
+ rules,
37591
+ value
37592
+ } = _ref45;
37593
+ let {
37594
+ setLoading = () => {},
37595
+ getApiBaseUrl,
37596
+ getAppHeader,
37597
+ t,
37598
+ isHighlighted
37599
+ } = _ref46;
37600
37600
  const apiURL = getApiBaseUrl();
37601
37601
  const values = getImageUploadEditValue(value);
37602
37602
  const maxRule = rules.find(r => r.max);
@@ -37607,17 +37607,18 @@ const inputTypeComponent$1 = {
37607
37607
  maxProps.multiple = true;
37608
37608
  }
37609
37609
  }
37610
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37611
- beforeUpload: beforeUpload(allowedImageExtensions),
37612
- ...maxProps,
37610
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37611
+ beforeUpload: beforeUpload(allowedImageExtensions)
37612
+ }, maxProps), {}, {
37613
37613
  accept: "image/*",
37614
37614
  classList: !values || !values.length ? "empty" : "",
37615
37615
  listType: "picture",
37616
- action: `${apiURL}/upload`,
37616
+ action: "".concat(apiURL, "/upload"),
37617
37617
  onChange: val => {
37618
37618
  if (typeof setLoading === "function") {
37619
- if (val?.file) {
37620
- if (val?.file?.status === "removed") {
37619
+ if (val !== null && val !== void 0 && val.file) {
37620
+ var _val$file;
37621
+ if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37621
37622
  setLoading(false);
37622
37623
  return;
37623
37624
  }
@@ -37629,10 +37630,9 @@ const inputTypeComponent$1 = {
37629
37630
  setLoading(false);
37630
37631
  }
37631
37632
  },
37632
- headers: {
37633
- Authorization: `Bearer ${getToken()}`,
37634
- ...getAppHeader()
37635
- },
37633
+ headers: _objectSpread2({
37634
+ Authorization: "Bearer ".concat(getToken())
37635
+ }, getAppHeader()),
37636
37636
  defaultFileList: values,
37637
37637
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37638
37638
  style: {
@@ -37643,18 +37643,20 @@ const inputTypeComponent$1 = {
37643
37643
  children: t("Upload")
37644
37644
  })]
37645
37645
  })
37646
- });
37646
+ }));
37647
37647
  },
37648
- videoUpload: ({
37649
- rules,
37650
- value
37651
- }, {
37652
- setLoading = () => {},
37653
- getApiBaseUrl,
37654
- getAppHeader,
37655
- t,
37656
- isHighlighted
37657
- }) => {
37648
+ videoUpload: (_ref47, _ref48) => {
37649
+ let {
37650
+ rules,
37651
+ value
37652
+ } = _ref47;
37653
+ let {
37654
+ setLoading = () => {},
37655
+ getApiBaseUrl,
37656
+ getAppHeader,
37657
+ t,
37658
+ isHighlighted
37659
+ } = _ref48;
37658
37660
  const apiURL = getApiBaseUrl();
37659
37661
  const values = getImageUploadEditValue(value);
37660
37662
  const maxRule = rules.find(r => r.max);
@@ -37665,21 +37667,25 @@ const inputTypeComponent$1 = {
37665
37667
  maxProps.multiple = true;
37666
37668
  }
37667
37669
  }
37668
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37669
- itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37670
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37671
- url: fileList?.response?.url || fileList?.url
37672
- }), item]
37673
- }),
37674
- ...maxProps,
37670
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37671
+ itemRender: (item, fileList) => {
37672
+ var _fileList$response;
37673
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37674
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37675
+ url: (fileList === null || fileList === void 0 || (_fileList$response = fileList.response) === null || _fileList$response === void 0 ? void 0 : _fileList$response.url) || (fileList === null || fileList === void 0 ? void 0 : fileList.url)
37676
+ }), item]
37677
+ });
37678
+ }
37679
+ }, maxProps), {}, {
37675
37680
  accept: "video/*",
37676
37681
  classList: !values || !values.length ? "empty" : "",
37677
37682
  listType: "picture",
37678
- action: `${apiURL}/upload`,
37683
+ action: "".concat(apiURL, "/upload"),
37679
37684
  onChange: val => {
37680
37685
  if (typeof setLoading === "function") {
37681
- if (val?.file) {
37682
- if (val?.file?.status === "removed") {
37686
+ if (val !== null && val !== void 0 && val.file) {
37687
+ var _val$file2;
37688
+ if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37683
37689
  setLoading(false);
37684
37690
  return;
37685
37691
  }
@@ -37691,10 +37697,9 @@ const inputTypeComponent$1 = {
37691
37697
  setLoading(false);
37692
37698
  }
37693
37699
  },
37694
- headers: {
37695
- Authorization: `Bearer ${getToken()}`,
37696
- ...getAppHeader()
37697
- },
37700
+ headers: _objectSpread2({
37701
+ Authorization: "Bearer ".concat(getToken())
37702
+ }, getAppHeader()),
37698
37703
  fileList: values,
37699
37704
  defaultFileList: values,
37700
37705
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37706,28 +37711,30 @@ const inputTypeComponent$1 = {
37706
37711
  children: t("Upload")
37707
37712
  })]
37708
37713
  })
37709
- });
37714
+ }));
37710
37715
  },
37711
- geolocation: ({
37712
- value,
37713
- name,
37714
- props,
37715
- formsValue,
37716
- addressData
37717
- }, {
37718
- inputMeta,
37719
- isHighlighted
37720
- }) => {
37716
+ geolocation: (_ref49, _ref50) => {
37717
+ let {
37718
+ value,
37719
+ name,
37720
+ props,
37721
+ formsValue,
37722
+ addressData
37723
+ } = _ref49;
37724
+ let {
37725
+ inputMeta,
37726
+ isHighlighted
37727
+ } = _ref50;
37721
37728
  let search = formsValue.country;
37722
37729
  if (addressData && Object.keys(addressData).length > 0) {
37723
37730
  if (addressData.country) {
37724
37731
  search = addressData.country;
37725
37732
  }
37726
37733
  if (addressData.level1) {
37727
- search = `${addressData.level1}, ${addressData.country}`;
37734
+ search = "".concat(addressData.level1, ", ").concat(addressData.country);
37728
37735
  }
37729
37736
  if (addressData.level2) {
37730
- search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37737
+ search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37731
37738
  }
37732
37739
  } else {
37733
37740
  const country = countriesList.countries[formsValue.country] || {};
@@ -37735,10 +37742,10 @@ const inputTypeComponent$1 = {
37735
37742
  search = country.name;
37736
37743
  }
37737
37744
  if (formsValue.administrativeLevel1Name) {
37738
- search = `${search} ${formsValue.administrativeLevel1Name}`;
37745
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37739
37746
  }
37740
37747
  if (formsValue.administrativeLevel2Name) {
37741
- search = `${search} ${formsValue.administrativeLevel2Name}`;
37748
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37742
37749
  }
37743
37750
  }
37744
37751
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37752,34 +37759,36 @@ const inputTypeComponent$1 = {
37752
37759
  searchValue: search
37753
37760
  });
37754
37761
  },
37755
- ajaxSelect: ({
37756
- call,
37757
- automaticallyLink,
37758
- name,
37759
- inputName,
37760
- props,
37761
- formsValue,
37762
- onNewSetValue,
37763
- multiple,
37764
- updateOptions,
37765
- repeatValues,
37766
- repeatIndex,
37767
- value,
37768
- unique,
37769
- address,
37770
- addressData = {},
37771
- getFromLinking,
37772
- input
37773
- }, {
37774
- form,
37775
- forms,
37776
- setAddress,
37777
- changeInputMeta,
37778
- inputMeta,
37779
- meta,
37780
- isHighlighted,
37781
- groupFormId
37782
- }) => {
37762
+ ajaxSelect: (_ref51, _ref52) => {
37763
+ let {
37764
+ call,
37765
+ automaticallyLink,
37766
+ name,
37767
+ inputName,
37768
+ props,
37769
+ formsValue,
37770
+ onNewSetValue,
37771
+ multiple,
37772
+ updateOptions,
37773
+ repeatValues,
37774
+ repeatIndex,
37775
+ value,
37776
+ unique,
37777
+ address,
37778
+ addressData = {},
37779
+ getFromLinking,
37780
+ input
37781
+ } = _ref51;
37782
+ let {
37783
+ form,
37784
+ forms,
37785
+ setAddress,
37786
+ changeInputMeta,
37787
+ inputMeta,
37788
+ meta,
37789
+ isHighlighted,
37790
+ groupFormId
37791
+ } = _ref52;
37783
37792
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37784
37793
  size: "medium",
37785
37794
  input: input,
@@ -37816,9 +37825,7 @@ const inputTypeComponent$1 = {
37816
37825
  const selectedValue = data.find(v => v.value === ev);
37817
37826
  if (address && selectedValue) {
37818
37827
  dot__default["default"].str(address, selectedValue.label, addressData);
37819
- setAddress({
37820
- ...addressData
37821
- });
37828
+ setAddress(_objectSpread2({}, addressData));
37822
37829
  }
37823
37830
  }
37824
37831
  },
@@ -37827,10 +37834,11 @@ const inputTypeComponent$1 = {
37827
37834
  address: true
37828
37835
  });
37829
37836
  },
37830
- tag: ({
37831
- value,
37832
- repeatLabel
37833
- }) => {
37837
+ tag: _ref53 => {
37838
+ let {
37839
+ value,
37840
+ repeatLabel
37841
+ } = _ref53;
37834
37842
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37835
37843
  size: "large",
37836
37844
  allowClear: true,
@@ -37838,26 +37846,28 @@ const inputTypeComponent$1 = {
37838
37846
  newPlaceholder: repeatLabel
37839
37847
  });
37840
37848
  },
37841
- modal: ({
37842
- call,
37843
- automaticallyLink,
37844
- name,
37845
- inputName,
37846
- props,
37847
- formsValue,
37848
- allFormsValue,
37849
- onNewSetValue,
37850
- repeatValues,
37851
- repeatIndex,
37852
- value,
37853
- modalTitle,
37854
- totalInputs,
37855
- shownInputs,
37856
- allowDupplicates
37857
- }, {
37858
- form,
37859
- add
37860
- }) => {
37849
+ modal: (_ref54, _ref55) => {
37850
+ let {
37851
+ call,
37852
+ automaticallyLink,
37853
+ name,
37854
+ inputName,
37855
+ props,
37856
+ formsValue,
37857
+ allFormsValue,
37858
+ onNewSetValue,
37859
+ repeatValues,
37860
+ repeatIndex,
37861
+ value,
37862
+ modalTitle,
37863
+ totalInputs,
37864
+ shownInputs,
37865
+ allowDupplicates
37866
+ } = _ref54;
37867
+ let {
37868
+ form,
37869
+ add
37870
+ } = _ref55;
37861
37871
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37862
37872
  allowClear: true,
37863
37873
  call: call,
@@ -37880,40 +37890,44 @@ const inputTypeComponent$1 = {
37880
37890
  allowDupplicates: allowDupplicates
37881
37891
  });
37882
37892
  },
37883
- dataLink: ({
37884
- setValues,
37885
- name,
37886
- onValuesChange,
37887
- changeLinking,
37888
- formsValue,
37889
- input,
37890
- call,
37891
- automaticallyLink,
37892
- inputName,
37893
- props,
37894
- onNewSetValue,
37895
- multiple,
37896
- updateOptions,
37897
- repeatValues,
37898
- repeatIndex,
37899
- value,
37900
- unique,
37901
- address,
37902
- addressData = {},
37903
- getFromLinking
37904
- }, {
37905
- form,
37906
- forms,
37907
- setAddress,
37908
- changeInputMeta,
37909
- inputMeta,
37910
- meta,
37911
- isHighlighted,
37912
- groupFormId
37913
- }) => {
37914
- if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37915
- const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37916
- input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37893
+ dataLink: (_ref56, _ref57) => {
37894
+ var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37895
+ let {
37896
+ setValues,
37897
+ name,
37898
+ onValuesChange,
37899
+ changeLinking,
37900
+ formsValue,
37901
+ input,
37902
+ call,
37903
+ automaticallyLink,
37904
+ inputName,
37905
+ props,
37906
+ onNewSetValue,
37907
+ multiple,
37908
+ updateOptions,
37909
+ repeatValues,
37910
+ repeatIndex,
37911
+ value,
37912
+ unique,
37913
+ address,
37914
+ addressData = {},
37915
+ getFromLinking
37916
+ } = _ref56;
37917
+ let {
37918
+ form,
37919
+ forms,
37920
+ setAddress,
37921
+ changeInputMeta,
37922
+ inputMeta,
37923
+ meta,
37924
+ isHighlighted,
37925
+ groupFormId
37926
+ } = _ref57;
37927
+ if ((input === null || input === void 0 || (_input$meta12 = input.meta) === null || _input$meta12 === void 0 || (_input$meta12 = _input$meta12.optionsView) === null || _input$meta12 === void 0 ? void 0 : _input$meta12.editInputType) === "ajaxSelect") {
37928
+ var _formsValue$groupForm3, _input$meta13, _input$meta14;
37929
+ const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37930
+ (input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 || (_input$meta13 = _input$meta13.optionsView) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.call) || (input === null || input === void 0 || (_input$meta14 = input.meta) === null || _input$meta14 === void 0 ? void 0 : _input$meta14.call) || "default::list()::::";
37917
37931
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37918
37932
  size: "medium",
37919
37933
  input: input,
@@ -37950,9 +37964,7 @@ const inputTypeComponent$1 = {
37950
37964
  const selectedValue = data.find(v => v.value === ev);
37951
37965
  if (address && selectedValue) {
37952
37966
  dot__default["default"].str(address, selectedValue.label, addressData);
37953
- setAddress({
37954
- ...addressData
37955
- });
37967
+ setAddress(_objectSpread2({}, addressData));
37956
37968
  }
37957
37969
  }
37958
37970
  },
@@ -37962,138 +37974,93 @@ const inputTypeComponent$1 = {
37962
37974
  isDataLink: true
37963
37975
  });
37964
37976
  }
37965
- const isSingle = input?.meta?.maxRepeat === 1;
37966
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37967
- ...(formsValue[groupFormId] || {})[name]
37968
- }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
37969
- ...v
37970
- })) : isSingle ? formsValue[name] ? [{
37971
- ...formsValue[name]
37972
- }] : [] : (formsValue[name] || []).map(v => ({
37973
- ...v
37974
- }));
37977
+ const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37978
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : (formsValue[name] || []).map(v => _objectSpread2({}, v));
37975
37979
  const onUpdate = (editData, i) => {
37976
- const val = {
37977
- ...formData[i],
37978
- ...editData
37979
- };
37980
+ const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
37980
37981
  const _val = isSingle ? {
37981
37982
  [name]: val
37982
37983
  } : {
37983
- [name]: formData?.map((d, j) => i === j ? val : d)
37984
+ [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
37984
37985
  };
37985
37986
  if (groupFormId) {
37986
- const _defaultData = form?.getFieldValue(groupFormId) || {};
37987
- const _newData = {
37988
- ..._defaultData,
37989
- ..._val
37990
- };
37991
- onValuesChange(_newData, {
37992
- ...formsValue,
37987
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37988
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37989
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37993
37990
  [groupFormId]: _newData
37994
- });
37995
- form?.setFieldValue(groupFormId, _newData);
37996
- setValues({
37997
- ...formsValue,
37991
+ }));
37992
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37993
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37998
37994
  [groupFormId]: _newData
37999
- });
37995
+ }));
38000
37996
  return;
38001
37997
  }
38002
- onValuesChange(_val, {
38003
- ...formsValue,
38004
- ..._val
38005
- });
38006
- form?.setFieldValue(name, _val[name]);
38007
- setValues({
38008
- ...formsValue,
38009
- ..._val
38010
- });
37998
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37999
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38000
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38011
38001
  };
38012
- if (input?.meta?.flat) {
38002
+ if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
38003
+ var _formsValue$meta4, _input$meta17;
38013
38004
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
38014
38005
  form: input,
38015
38006
  changeLinking: changeLinking,
38016
38007
  onUpdate: onUpdate,
38017
38008
  isHighlighted: isHighlighted,
38018
38009
  formsValue: formsValue,
38019
- values: groupFormId ? {
38020
- ...(formsValue[groupFormId] || {}),
38010
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38021
38011
  meta: {
38022
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38012
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
38023
38013
  }
38024
- } : formsValue,
38014
+ }) : formsValue,
38025
38015
  name: name,
38026
38016
  groupFormId: groupFormId,
38027
- maxRepeat: input?.meta?.maxRepeat,
38028
- remove: ({
38029
- key
38030
- }) => {
38017
+ maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
38018
+ remove: _ref58 => {
38019
+ let {
38020
+ key
38021
+ } = _ref58;
38031
38022
  const _val = isSingle ? {
38032
38023
  [name]: null
38033
38024
  } : {
38034
38025
  [name]: formData.filter((v, i) => i !== key)
38035
38026
  };
38036
38027
  if (groupFormId) {
38037
- const _defaultData = form?.getFieldValue(groupFormId) || {};
38038
- const _newData = {
38039
- ..._defaultData,
38040
- ..._val
38041
- };
38042
- onValuesChange(_newData, {
38043
- ...formsValue,
38028
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38029
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38030
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38044
38031
  [groupFormId]: _newData
38045
- });
38046
- form?.setFieldValue(groupFormId, _newData);
38047
- setValues({
38048
- ...formsValue,
38032
+ }));
38033
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38034
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38049
38035
  [groupFormId]: _newData
38050
- });
38036
+ }));
38051
38037
  return;
38052
38038
  }
38053
- onValuesChange(_val, {
38054
- ...formsValue,
38055
- ..._val
38056
- });
38057
- form?.setFieldValue(name, _val[name]);
38058
- setValues({
38059
- ...formsValue,
38060
- ..._val
38061
- });
38039
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38040
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38041
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38062
38042
  },
38063
38043
  add: val => {
38064
38044
  const _val = isSingle ? {
38065
38045
  [name]: val
38066
38046
  } : {
38067
- [name]: [...formData, {
38068
- ...val
38069
- }]
38047
+ [name]: [...formData, _objectSpread2({}, val)]
38070
38048
  };
38071
38049
  if (groupFormId) {
38072
- const _defaultData = form?.getFieldValue(groupFormId) || {};
38073
- const _newData = {
38074
- ..._defaultData,
38075
- ..._val
38076
- };
38077
- form?.setFieldValue(groupFormId, _newData);
38078
- onValuesChange(_newData, {
38079
- ...formsValue,
38050
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38051
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38052
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38053
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38080
38054
  [groupFormId]: _newData
38081
- });
38082
- setValues({
38083
- ...formsValue,
38055
+ }));
38056
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38084
38057
  [groupFormId]: _newData
38085
- });
38058
+ }));
38086
38059
  return;
38087
38060
  }
38088
- form?.setFieldValue(name, _val[name]);
38089
- onValuesChange(_val, {
38090
- ...formsValue,
38091
- ..._val
38092
- });
38093
- setValues({
38094
- ...formsValue,
38095
- ..._val
38096
- });
38061
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38062
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38063
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38097
38064
  },
38098
38065
  k: name,
38099
38066
  formData: formData
@@ -38105,101 +38072,79 @@ const inputTypeComponent$1 = {
38105
38072
  onUpdate: onUpdate,
38106
38073
  isHighlighted: isHighlighted,
38107
38074
  formsValue: formsValue,
38108
- values: groupFormId ? {
38109
- ...(formsValue[groupFormId] || {}),
38075
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38110
38076
  meta: {
38111
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38077
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
38112
38078
  }
38113
- } : formsValue,
38079
+ }) : formsValue,
38114
38080
  name: name,
38115
38081
  groupFormId: groupFormId,
38116
- maxRepeat: input?.meta?.maxRepeat,
38117
- remove: ({
38118
- key
38119
- }) => {
38082
+ maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
38083
+ remove: _ref59 => {
38084
+ let {
38085
+ key
38086
+ } = _ref59;
38120
38087
  const _val = isSingle ? {
38121
38088
  [name]: null
38122
38089
  } : {
38123
38090
  [name]: formData.filter((v, i) => i !== key)
38124
38091
  };
38125
38092
  if (groupFormId) {
38126
- const _defaultData = form?.getFieldValue(groupFormId) || {};
38127
- const _newData = {
38128
- ..._defaultData,
38129
- ..._val
38130
- };
38131
- onValuesChange(_newData, {
38132
- ...formsValue,
38093
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38094
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38095
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38133
38096
  [groupFormId]: _newData
38134
- });
38135
- form?.setFieldValue(groupFormId, _newData);
38136
- setValues({
38137
- ...formsValue,
38097
+ }));
38098
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38099
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38138
38100
  [groupFormId]: _newData
38139
- });
38101
+ }));
38140
38102
  return;
38141
38103
  }
38142
- onValuesChange(_val, {
38143
- ...formsValue,
38144
- ..._val
38145
- });
38146
- form?.setFieldValue(name, _val[name]);
38147
- setValues({
38148
- ...formsValue,
38149
- ..._val
38150
- });
38104
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38105
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38106
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38151
38107
  },
38152
38108
  add: val => {
38153
38109
  const _val = isSingle ? {
38154
38110
  [name]: val
38155
38111
  } : {
38156
- [name]: [...formData, {
38157
- ...val
38158
- }]
38112
+ [name]: [...formData, _objectSpread2({}, val)]
38159
38113
  };
38160
38114
  if (groupFormId) {
38161
- const _defaultData = form?.getFieldValue(groupFormId) || {};
38162
- const _newData = {
38163
- ..._defaultData,
38164
- ..._val
38165
- };
38166
- form?.setFieldValue(groupFormId, _newData);
38167
- onValuesChange(_newData, {
38168
- ...formsValue,
38115
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38116
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38117
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38118
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38169
38119
  [groupFormId]: _newData
38170
- });
38171
- setValues({
38172
- ...formsValue,
38120
+ }));
38121
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38173
38122
  [groupFormId]: _newData
38174
- });
38123
+ }));
38175
38124
  return;
38176
38125
  }
38177
- form?.setFieldValue(name, _val[name]);
38178
- onValuesChange(_val, {
38179
- ...formsValue,
38180
- ..._val
38181
- });
38182
- setValues({
38183
- ...formsValue,
38184
- ..._val
38185
- });
38126
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38127
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38128
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38186
38129
  },
38187
38130
  k: name,
38188
38131
  formData: formData
38189
38132
  });
38190
38133
  },
38191
- dataLinkGroup: ({
38192
- setValues,
38193
- name,
38194
- onValuesChange,
38195
- changeLinking,
38196
- formsValue,
38197
- input
38198
- }, {
38199
- form,
38200
- groupFormId,
38201
- isHighlighted
38202
- }) => {
38134
+ dataLinkGroup: (_ref60, _ref61) => {
38135
+ let {
38136
+ setValues,
38137
+ name,
38138
+ onValuesChange,
38139
+ changeLinking,
38140
+ formsValue,
38141
+ input
38142
+ } = _ref60;
38143
+ let {
38144
+ form,
38145
+ groupFormId,
38146
+ isHighlighted
38147
+ } = _ref61;
38203
38148
  return renderDataLinkGroup({
38204
38149
  input,
38205
38150
  name,
@@ -38212,51 +38157,41 @@ const inputTypeComponent$1 = {
38212
38157
  isHighlighted
38213
38158
  });
38214
38159
  },
38215
- groupCheckbox: ({
38216
- setValues,
38217
- name,
38218
- onValuesChange,
38219
- formsValue,
38220
- input
38221
- }, {
38222
- form,
38223
- groupFormId,
38224
- isHighlighted
38225
- }) => {
38160
+ groupCheckbox: (_ref62, _ref63) => {
38161
+ let {
38162
+ setValues,
38163
+ name,
38164
+ onValuesChange,
38165
+ formsValue,
38166
+ input
38167
+ } = _ref62;
38168
+ let {
38169
+ form,
38170
+ groupFormId,
38171
+ isHighlighted
38172
+ } = _ref63;
38226
38173
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
38227
38174
  const onUpdate = (val, key) => {
38228
38175
  const _val = {
38229
- [name]: {
38230
- ...formData,
38176
+ [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
38231
38177
  [key]: val
38232
- }
38178
+ })
38233
38179
  };
38234
38180
  if (groupFormId) {
38235
- const _defaultData = form?.getFieldValue(groupFormId) || {};
38236
- const _newData = {
38237
- ..._defaultData,
38238
- ..._val
38239
- };
38240
- onValuesChange(_newData, {
38241
- ...formsValue,
38181
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38182
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38183
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38242
38184
  [groupFormId]: _newData
38243
- });
38244
- form?.setFieldValue(groupFormId, _newData);
38245
- setValues({
38246
- ...formsValue,
38185
+ }));
38186
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38187
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38247
38188
  [groupFormId]: _newData
38248
- });
38189
+ }));
38249
38190
  return;
38250
38191
  }
38251
- onValuesChange(_val, {
38252
- ...formsValue,
38253
- ..._val
38254
- });
38255
- form?.setFieldValue(name, _val[name]);
38256
- setValues({
38257
- ...formsValue,
38258
- ..._val
38259
- });
38192
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38193
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38194
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38260
38195
  };
38261
38196
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
38262
38197
  form: input,
@@ -38265,96 +38200,91 @@ const inputTypeComponent$1 = {
38265
38200
  isHighlighted: isHighlighted
38266
38201
  });
38267
38202
  },
38268
- website: ({
38269
- name,
38270
- inputName,
38271
- props,
38272
- value,
38273
- repeatIndex,
38274
- repeatValues,
38275
- formsValue
38276
- }, {
38277
- form,
38278
- isHighlighted,
38279
- inputMeta = {},
38280
- t
38281
- }) => {
38282
- return /*#__PURE__*/jsxRuntime.jsx(Website, {
38203
+ website: (_ref64, _ref65) => {
38204
+ let {
38205
+ name,
38206
+ inputName,
38207
+ props,
38208
+ value,
38209
+ repeatIndex,
38210
+ repeatValues,
38211
+ formsValue
38212
+ } = _ref64;
38213
+ let {
38214
+ form,
38215
+ isHighlighted,
38216
+ inputMeta = {},
38217
+ t
38218
+ } = _ref65;
38219
+ return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38283
38220
  size: "large",
38284
38221
  allowClear: true,
38285
- initialValue: value,
38286
- ...props,
38222
+ initialValue: value
38223
+ }, props), {}, {
38287
38224
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
38288
38225
  className: formatClassname([isHighlighted && "highlighted-cont"]),
38289
38226
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
38290
38227
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
38291
- });
38228
+ }));
38292
38229
  },
38293
- group: ({
38294
- props,
38295
- groupInputs,
38296
- formsValue
38297
- }, {
38298
- inputMeta,
38299
- isHighlighted
38300
- }) => {
38301
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38230
+ group: (_ref66, _ref67) => {
38231
+ let {
38232
+ props,
38233
+ groupInputs,
38234
+ formsValue
38235
+ } = _ref66;
38236
+ let {
38237
+ inputMeta,
38238
+ isHighlighted
38239
+ } = _ref67;
38240
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38302
38241
  formsValue: formsValue,
38303
38242
  isHighlighted: isHighlighted,
38304
38243
  groupInputs: groupInputs,
38305
- inputMeta: inputMeta,
38306
- ...props
38307
- });
38244
+ inputMeta: inputMeta
38245
+ }, props));
38308
38246
  },
38309
- groupInputs: ({
38310
- props,
38311
- groupInputs,
38312
- formsValue
38313
- }, {
38314
- inputMeta,
38315
- isHighlighted
38316
- }) => {
38317
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38247
+ groupInputs: (_ref68, _ref69) => {
38248
+ let {
38249
+ props,
38250
+ groupInputs,
38251
+ formsValue
38252
+ } = _ref68;
38253
+ let {
38254
+ inputMeta,
38255
+ isHighlighted
38256
+ } = _ref69;
38257
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38318
38258
  formsValue: formsValue,
38319
38259
  isHighlighted: isHighlighted,
38320
38260
  groupInputs: groupInputs,
38321
- inputMeta: inputMeta,
38322
- ...props
38323
- });
38261
+ inputMeta: inputMeta
38262
+ }, props));
38324
38263
  },
38325
- smartHelp: ({
38326
- name,
38327
- inputName,
38328
- props,
38329
- value,
38330
- repeatIndex,
38331
- repeatValues,
38332
- formsValue
38333
- }, {
38334
- form,
38335
- isHighlighted,
38336
- inputMeta = {},
38337
- t
38338
- }) => {
38264
+ smartHelp: (_ref70, _ref71) => {
38339
38265
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
38340
38266
  }
38341
38267
  };
38342
38268
  const filterForm = (f, d) => {
38343
38269
  return f && (f.showFormIf ? showHideForm(f, d) : true);
38344
38270
  };
38345
- const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38271
+ const checkFormHasSubsections = function () {
38272
+ let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38273
+ return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38274
+ };
38346
38275
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
38347
- const {
38348
- label,
38349
- description = "",
38350
- excludeFromEdit,
38351
- showFormIf,
38352
- icon = "",
38353
- position = 0,
38354
- template,
38355
- formClass,
38356
- ...fc
38357
- } = f[key] || {};
38276
+ const _ref72 = f[key] || {},
38277
+ {
38278
+ label,
38279
+ description = "",
38280
+ excludeFromEdit,
38281
+ showFormIf,
38282
+ icon = "",
38283
+ position = 0,
38284
+ template,
38285
+ formClass
38286
+ } = _ref72,
38287
+ fc = _objectWithoutProperties(_ref72, _excluded2$1);
38358
38288
  const fConf = {
38359
38289
  id: key,
38360
38290
  label,
@@ -38413,11 +38343,14 @@ const groupSubForms = (fConf, d) => {
38413
38343
  return f;
38414
38344
  }, {});
38415
38345
  };
38416
- const inputIsEmpty = (input = {}, values, inputMeta) => {
38417
- if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
38346
+ const inputIsEmpty = function () {
38347
+ let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38348
+ let values = arguments.length > 1 ? arguments[1] : undefined;
38349
+ let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
38350
+ if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38418
38351
  return false;
38419
38352
  }
38420
- if (input?.type === "groupInputs") {
38353
+ if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38421
38354
  return true;
38422
38355
  }
38423
38356
  const value = values[input.dataId];
@@ -38429,26 +38362,28 @@ const inputIsEmpty = (input = {}, values, inputMeta) => {
38429
38362
  }
38430
38363
  return !value;
38431
38364
  };
38432
- const GetFormItem$1 = ({
38433
- highlightMandatory,
38434
- inputData,
38435
- inputId,
38436
- input,
38437
- values,
38438
- MainForm,
38439
- options,
38440
- plainForms,
38441
- setValues,
38442
- setAddress,
38443
- i,
38444
- inputKey,
38445
- onValuesChange = () => {},
38446
- setLoading = () => {},
38447
- inputMeta = {},
38448
- changeInputMeta = () => {},
38449
- changeLinking = () => {},
38450
- namespace
38451
- }) => {
38365
+ const GetFormItem$1 = _ref73 => {
38366
+ var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
38367
+ let {
38368
+ highlightMandatory,
38369
+ inputData,
38370
+ inputId,
38371
+ input,
38372
+ values,
38373
+ MainForm,
38374
+ options,
38375
+ plainForms,
38376
+ setValues,
38377
+ setAddress,
38378
+ i,
38379
+ inputKey,
38380
+ onValuesChange = () => {},
38381
+ setLoading = () => {},
38382
+ inputMeta = {},
38383
+ changeInputMeta = () => {},
38384
+ changeLinking = () => {},
38385
+ namespace
38386
+ } = _ref73;
38452
38387
  const {
38453
38388
  t,
38454
38389
  user,
@@ -38463,44 +38398,42 @@ const GetFormItem$1 = ({
38463
38398
  staticWidth,
38464
38399
  fullWidth
38465
38400
  } = useEditContext();
38466
- const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
38401
+ const lastReview = ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || [])[((inputMeta === null || inputMeta === void 0 || (_inputMeta$reviews = inputMeta.reviews) === null || _inputMeta$reviews === void 0 ? void 0 : _inputMeta$reviews.length) || 0) - 1];
38467
38402
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
38468
38403
  const inputLabel = getInputLabel$1(input, values);
38469
38404
  const onClickReviewSuccess = () => {
38470
38405
  if (!isReview) {
38471
38406
  return;
38472
38407
  }
38473
- const reviewSuccess = lastReview?.reviewSuccess;
38408
+ const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38474
38409
  changeInputMeta({
38475
38410
  key: inputId,
38476
38411
  type: input.type,
38477
- value: {
38478
- ...inputMeta,
38412
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38479
38413
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38480
38414
  reviewer: user,
38481
38415
  createdAt: new Date().toISOString(),
38482
38416
  reviewSuccess: true
38483
38417
  }]
38484
- }
38418
+ })
38485
38419
  });
38486
38420
  };
38487
38421
  const onClickReviewError = () => {
38488
38422
  if (!isReview) {
38489
38423
  return;
38490
38424
  }
38491
- const reviewError = lastReview?.reviewError;
38425
+ const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38492
38426
  changeInputMeta({
38493
38427
  key: inputId,
38494
38428
  type: input.type,
38495
- value: {
38496
- ...inputMeta,
38429
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38497
38430
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38498
38431
  reviewer: user,
38499
38432
  createdAt: new Date().toISOString(),
38500
38433
  reviewError: true,
38501
38434
  comment: ""
38502
38435
  }]
38503
- }
38436
+ })
38504
38437
  });
38505
38438
  };
38506
38439
  switch (input.type) {
@@ -38514,12 +38447,12 @@ const GetFormItem$1 = ({
38514
38447
  case "header":
38515
38448
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
38516
38449
  className: "daf-title with-subtitle",
38517
- style: input?.meta?.style,
38450
+ style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38518
38451
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38519
38452
  className: "flex",
38520
38453
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
38521
38454
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
38522
- }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38455
+ }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38523
38456
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
38524
38457
  className: "tooltip-popover-cont",
38525
38458
  children: ReactHtmlParser__default["default"](input.description)
@@ -38546,7 +38479,7 @@ const GetFormItem$1 = ({
38546
38479
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38547
38480
 
38548
38481
  // eslint-disable-next-line no-case-declarations
38549
- let maxRule = rules.find(rule => rule.max)?.max;
38482
+ let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38550
38483
  if (!maxRule && input.type === "textarea") {
38551
38484
  maxRule = MAX_TEXT_AREA_LENGTH;
38552
38485
  }
@@ -38559,27 +38492,30 @@ const GetFormItem$1 = ({
38559
38492
  message: requiredRule.message || ""
38560
38493
  });
38561
38494
  }
38562
- const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38495
+ const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta21 = input.meta) === null || _input$meta21 === void 0 ? void 0 : _input$meta21.mandatory) && inputIsEmpty(input, values, inputMeta);
38563
38496
  if (requiredRule || specialCharsRule) {
38564
38497
  if (input.type === "groupInputs") {
38565
38498
  rules = rules.map(r => {
38566
38499
  if (r.required) {
38567
- return ({
38568
- getFieldValue
38569
- }) => ({
38570
- validator() {
38571
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38572
- return Promise.resolve();
38573
- }
38574
- const keys = Object.keys(input.inputs);
38575
- for (let i = 0; i < keys.length; i++) {
38576
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38577
- return Promise.reject(r.message);
38500
+ return _ref74 => {
38501
+ let {
38502
+ getFieldValue
38503
+ } = _ref74;
38504
+ return {
38505
+ validator() {
38506
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38507
+ return Promise.resolve();
38578
38508
  }
38509
+ const keys = Object.keys(input.inputs);
38510
+ for (let i = 0; i < keys.length; i++) {
38511
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38512
+ return Promise.reject(r.message);
38513
+ }
38514
+ }
38515
+ return Promise.resolve();
38579
38516
  }
38580
- return Promise.resolve();
38581
- }
38582
- });
38517
+ };
38518
+ };
38583
38519
  }
38584
38520
  return r;
38585
38521
  });
@@ -38617,12 +38553,13 @@ const GetFormItem$1 = ({
38617
38553
  }
38618
38554
  }
38619
38555
  if (input && typeof input === "object") {
38556
+ var _input$meta22, _input$meta23, _input$meta24, _input$meta25, _values$parent, _input$meta26, _input$meta27, _inputData$value, _input$meta28, _input$meta29, _inputData$commentVal, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
38620
38557
  // check if input is valid
38621
38558
  const hideComment = namespace === "project-readiness";
38622
38559
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38623
38560
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38624
38561
  className: "flex-row input-cont",
38625
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38562
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38626
38563
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38627
38564
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38628
38565
  className: formatClassname(["ml-4 input-actions"]),
@@ -38632,7 +38569,7 @@ const GetFormItem$1 = ({
38632
38569
  title: t("Add review note"),
38633
38570
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38634
38571
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38635
- className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38572
+ className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38636
38573
  type: "link",
38637
38574
  onClick: onClickReviewError,
38638
38575
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38648,7 +38585,7 @@ const GetFormItem$1 = ({
38648
38585
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38649
38586
  type: "link",
38650
38587
  onClick: onClickReviewSuccess,
38651
- className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38588
+ className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38652
38589
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38653
38590
  name: "CheckSquare",
38654
38591
  width: 16,
@@ -38685,7 +38622,7 @@ const GetFormItem$1 = ({
38685
38622
  }
38686
38623
  });
38687
38624
  },
38688
- disabled: !input.meta?.notApplicable,
38625
+ disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38689
38626
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38690
38627
  name: "NotApplicable",
38691
38628
  width: 16,
@@ -38699,7 +38636,7 @@ const GetFormItem$1 = ({
38699
38636
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38700
38637
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38701
38638
  type: "link",
38702
- disabled: !input.meta?.notAvailable,
38639
+ disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38703
38640
  onClick: () => {
38704
38641
  const value = getDefaultInputValue(input);
38705
38642
  MainForm.setFields([{
@@ -38731,14 +38668,14 @@ const GetFormItem$1 = ({
38731
38668
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38732
38669
  title: t("Add comment"),
38733
38670
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38734
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38671
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38735
38672
  type: "link",
38736
- disabled: !input.meta?.comment,
38737
- ...(!isShown ? {
38738
- className: "default p-0"
38739
- } : {
38740
- className: "p-0 primary"
38741
- }),
38673
+ disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38674
+ }, !isShown ? {
38675
+ className: "default p-0"
38676
+ } : {
38677
+ className: "p-0 primary"
38678
+ }), {}, {
38742
38679
  onClick: () => {
38743
38680
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38744
38681
  return;
@@ -38757,7 +38694,7 @@ const GetFormItem$1 = ({
38757
38694
  width: 16,
38758
38695
  height: 16
38759
38696
  })
38760
- })
38697
+ }))
38761
38698
  })
38762
38699
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38763
38700
  title: t("Project Readiness"),
@@ -38776,36 +38713,34 @@ const GetFormItem$1 = ({
38776
38713
  }) : null]
38777
38714
  }) : null
38778
38715
  }),
38779
- initialValue: inputMeta?.defaultValue,
38780
- ...(inputOnBlur.includes(input.type) ? {
38781
- trigger: "onBlur"
38782
- } : {}),
38783
- ...(["total100", "group"].includes(input.type) ? {} : {
38784
- name: inputId,
38785
- fieldKey: inputId,
38786
- initialValue: inputData.value
38787
- }),
38788
- ...(["upload"].includes(input.type) ? {
38789
- valuePropName: "fileList",
38790
- getValueFromEvent: e => {
38791
- if (Array.isArray(e)) {
38792
- return e;
38793
- }
38794
- return e && e.fileList && e.fileList.map(f => {
38795
- if (f.response) {
38796
- return f.response;
38797
- }
38798
- return f;
38799
- });
38716
+ initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38717
+ }, inputOnBlur.includes(input.type) ? {
38718
+ trigger: "onBlur"
38719
+ } : {}), ["total100", "group"].includes(input.type) ? {} : {
38720
+ name: inputId,
38721
+ fieldKey: inputId,
38722
+ initialValue: inputData.value
38723
+ }), ["upload"].includes(input.type) ? {
38724
+ valuePropName: "fileList",
38725
+ getValueFromEvent: e => {
38726
+ if (Array.isArray(e)) {
38727
+ return e;
38800
38728
  }
38801
- } : {}),
38802
- className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38729
+ return e && e.fileList && e.fileList.map(f => {
38730
+ if (f.response) {
38731
+ return f.response;
38732
+ }
38733
+ return f;
38734
+ });
38735
+ }
38736
+ } : {}), {}, {
38737
+ className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38803
38738
  "data-id": inputData.name,
38804
38739
  rules: rules,
38805
38740
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38806
38741
  labelCol: 12,
38807
38742
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38808
- className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38743
+ className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38809
38744
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38810
38745
  className: "mr-1",
38811
38746
  children: getInputLabel$1(input, values)
@@ -38818,7 +38753,7 @@ const GetFormItem$1 = ({
38818
38753
  config: input,
38819
38754
  t: t,
38820
38755
  ajaxForms: ajaxForms,
38821
- linkingData: values?.linking || values?.parent?.linking,
38756
+ linkingData: (values === null || values === void 0 ? void 0 : values.linking) || (values === null || values === void 0 || (_values$parent = values.parent) === null || _values$parent === void 0 ? void 0 : _values$parent.linking),
38822
38757
  changeAjaxForms: changeAjaxForms,
38823
38758
  getApiBaseUrl: getApiBaseUrl,
38824
38759
  getAppHeader: getAppHeader,
@@ -38826,12 +38761,11 @@ const GetFormItem$1 = ({
38826
38761
  getToken: getToken,
38827
38762
  app: app,
38828
38763
  valueOnlyString: true
38829
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38830
- ...inputData,
38764
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
38831
38765
  maxWidth,
38832
38766
  staticWidth,
38833
38767
  fullWidth
38834
- }, {
38768
+ }), {
38835
38769
  form: MainForm,
38836
38770
  forms: options,
38837
38771
  allForms: plainForms,
@@ -38852,10 +38786,10 @@ const GetFormItem$1 = ({
38852
38786
  staticWidth,
38853
38787
  fullWidth
38854
38788
  }) : console.log(input)
38855
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38789
+ })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38856
38790
  className: "code",
38857
38791
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38858
- children: input.meta?.code
38792
+ children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38859
38793
  })
38860
38794
  }) : null]
38861
38795
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38875,10 +38809,10 @@ const GetFormItem$1 = ({
38875
38809
  className: "max-char-span",
38876
38810
  children: t("max-char", {
38877
38811
  chars: maxRule,
38878
- filled: inputData?.value?.length || 0
38812
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38879
38813
  })
38880
38814
  })
38881
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38815
+ }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38882
38816
  className: "input-content",
38883
38817
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38884
38818
  className: "comment-textarea",
@@ -38904,7 +38838,7 @@ const GetFormItem$1 = ({
38904
38838
  },
38905
38839
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38906
38840
  type: "link",
38907
- disabled: !input.meta?.comment,
38841
+ disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38908
38842
  className: "p-0",
38909
38843
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38910
38844
  width: 16,
@@ -38913,12 +38847,11 @@ const GetFormItem$1 = ({
38913
38847
  })
38914
38848
  })]
38915
38849
  }),
38916
- children: inputTypeComponent$1.comment({
38917
- ...inputData,
38850
+ children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38918
38851
  maxWidth,
38919
38852
  staticWidth,
38920
38853
  fullWidth
38921
- }, {
38854
+ }), {
38922
38855
  form: MainForm,
38923
38856
  forms: options,
38924
38857
  setFormValues: setValues,
@@ -38943,16 +38876,16 @@ const GetFormItem$1 = ({
38943
38876
  className: "max-char-span",
38944
38877
  children: t("max-char", {
38945
38878
  chars: MAX_COMMENTS_LENGTH,
38946
- filled: inputData?.commentValue?.length || 0
38879
+ filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38947
38880
  })
38948
38881
  })]
38949
- }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38882
+ }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38950
38883
  className: "input-content",
38951
38884
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38952
38885
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38953
38886
  className: "comment-textarea",
38954
- initialValue: lastReview?.comment || "",
38955
- name: `${inputId}-reviewErrorComment`,
38887
+ initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38888
+ name: "".concat(inputId, "-reviewErrorComment"),
38956
38889
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38957
38890
  className: "flex w-100",
38958
38891
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38960,31 +38893,28 @@ const GetFormItem$1 = ({
38960
38893
  children: t("Review note")
38961
38894
  })
38962
38895
  }),
38963
- children: inputTypeComponent$1.comment({
38964
- ...inputData,
38896
+ children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38965
38897
  maxWidth,
38966
38898
  staticWidth,
38967
38899
  fullWidth
38968
- }, {
38900
+ }), {
38969
38901
  form: MainForm,
38970
38902
  forms: options,
38971
- value: lastReview?.comment || "",
38903
+ value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38972
38904
  onChange: val => {
38973
38905
  changeInputMeta({
38974
38906
  key: inputId,
38975
38907
  type: input.type,
38976
- value: {
38977
- ...inputMeta,
38978
- reviews: (inputMeta?.reviews || []).map(v => {
38908
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38909
+ reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
38979
38910
  if (v.createdAt === lastReview.createdAt) {
38980
- return {
38981
- ...v,
38911
+ return _objectSpread2(_objectSpread2({}, v), {}, {
38982
38912
  comment: val
38983
- };
38913
+ });
38984
38914
  }
38985
38915
  return v;
38986
38916
  })
38987
- }
38917
+ })
38988
38918
  });
38989
38919
  },
38990
38920
  t,
@@ -38998,7 +38928,7 @@ const GetFormItem$1 = ({
38998
38928
  className: "max-char-span",
38999
38929
  children: t("max-char", {
39000
38930
  chars: MAX_COMMENTS_LENGTH,
39001
- filled: lastReview.comment?.length || 0
38931
+ filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
39002
38932
  })
39003
38933
  })]
39004
38934
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -39019,7 +38949,7 @@ const GetFormItem$1 = ({
39019
38949
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
39020
38950
  className: "flex flex-column justify-center mr-1",
39021
38951
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39022
- children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38952
+ children: (lastReview === null || lastReview === void 0 || (_lastReview$reviewer = lastReview.reviewer) === null || _lastReview$reviewer === void 0 ? void 0 : _lastReview$reviewer.firstName) + " " + (lastReview === null || lastReview === void 0 || (_lastReview$reviewer2 = lastReview.reviewer) === null || _lastReview$reviewer2 === void 0 ? void 0 : _lastReview$reviewer2.lastName) + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
39023
38953
  })
39024
38954
  })]
39025
38955
  })]
@@ -39030,13 +38960,14 @@ const GetFormItem$1 = ({
39030
38960
  return null;
39031
38961
  }
39032
38962
  };
39033
- const editErrorHandler = ({
39034
- errorFields,
39035
- t = s => s
39036
- }) => {
38963
+ const editErrorHandler = _ref76 => {
38964
+ let {
38965
+ errorFields,
38966
+ t = s => s
38967
+ } = _ref76;
39037
38968
  if (Array.isArray(errorFields) && errorFields.length) {
39038
38969
  const name = errorFields[0].name.join(".");
39039
- const element = document.querySelector(`[data-id="${name}"]`);
38970
+ const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
39040
38971
  if (element) {
39041
38972
  element.scrollIntoView();
39042
38973
  antd.message.error(t("errors::please-correct-invalid-inputs"));
@@ -47970,8 +47901,7 @@ function AvatarGroup(_ref) {
47970
47901
 
47971
47902
  const Container$1 = styled__default["default"].div`
47972
47903
  height: ${props => props.height || '300px'};
47973
- width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
47974
- overflow: ${props => props.style?.overflow || 'visible'};
47904
+ width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
47975
47905
  `;
47976
47906
 
47977
47907
  const _excluded$9 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "isPercentage", "seriesField", "formattedYAxis", "formattedXAxis", "color", "height", "t", "isPdf", "legendConfig", "width", "xAxisConfig"];
@@ -49532,17 +49462,9 @@ const RadarChart = _ref => {
49532
49462
  showMarkers: true
49533
49463
  }, tooltipConfig),
49534
49464
  color: color || token.colorPrimary7,
49535
- paddingX: 60,
49536
- paddingY: 60,
49537
49465
  xAxis: {
49538
49466
  label: {
49539
- formatter: formattedXAxis,
49540
- offset: 15,
49541
- style: {
49542
- fontSize: 12,
49543
- fill: '#666',
49544
- textAlign: 'center'
49545
- }
49467
+ formatter: formattedXAxis
49546
49468
  },
49547
49469
  line: null,
49548
49470
  tickLine: null,
@@ -49608,23 +49530,12 @@ const RadarChart = _ref => {
49608
49530
  }, []);
49609
49531
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
49610
49532
  className: "flex flex-1 flex-column justify-content-center",
49611
- style: {
49612
- overflow: 'visible'
49613
- },
49614
49533
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
49615
49534
  className: "flex justify-content-center",
49616
- style: {
49617
- paddingX: '30px',
49618
- overflow: 'visible',
49619
- width: '100%'
49620
- },
49621
49535
  children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
49622
49536
  ref: containerRef,
49623
49537
  height: height,
49624
- isPdf: isPdf,
49625
- style: {
49626
- paddingX: '30px'
49627
- }
49538
+ isPdf: isPdf
49628
49539
  })
49629
49540
  }), legendEnabled && legendPosition === 'bottom' && /*#__PURE__*/jsxRuntime.jsx(CustomLegend, {
49630
49541
  items: legendItems,