datastake-daf 0.6.830 → 0.6.832

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 (39) hide show
  1. package/dist/components/index.js +1538 -1478
  2. package/dist/hooks/index.js +40 -1
  3. package/dist/layouts/index.js +2 -2
  4. package/dist/pages/index.js +1890 -171
  5. package/dist/services/index.js +121 -0
  6. package/dist/utils/index.js +15 -1
  7. package/package.json +1 -1
  8. package/src/@daf/core/components/EditForm/storyConfig2.js +1176 -728
  9. package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/config.js +106 -0
  10. package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/index.js +47 -0
  11. package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/helper.js +3 -0
  12. package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/index.js +218 -0
  13. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/hook.js +32 -0
  14. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +73 -0
  15. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/hook.js +86 -0
  16. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/index.js +102 -0
  17. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/config.js +34 -0
  18. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/index.js +107 -0
  19. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/config.js +5 -0
  20. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/index.js +77 -0
  21. package/src/@daf/core/components/Screens/ConflictManagement/index.js +136 -0
  22. package/src/@daf/hooks/useWidgetFetch.js +7 -0
  23. package/src/@daf/layouts/AppLayout/components/MobileDrawer/index.js +1 -1
  24. package/src/@daf/pages/Events/Testimonials/columns.js +1 -1
  25. package/src/@daf/pages/Events/columns.js +2 -3
  26. package/src/@daf/pages/Locations/columns.js +1 -1
  27. package/src/@daf/pages/Summary/hook.js +52 -19
  28. package/src/@daf/services/DashboardService.js +9 -0
  29. package/src/@daf/services/MineSiteService.js +104 -0
  30. package/src/constants/locales/en/translation.js +1 -0
  31. package/src/helpers/user.js +16 -1
  32. package/src/pages.js +4 -1
  33. package/src/services.js +2 -1
  34. package/src/utils.js +1 -1
  35. package/build/favicon.ico +0 -0
  36. package/build/logo192.png +0 -0
  37. package/build/logo512.png +0 -0
  38. package/build/manifest.json +0 -25
  39. package/build/robots.txt +0 -3
@@ -4827,7 +4827,7 @@ const config$2 = {
4827
4827
  AddDocument: config$3
4828
4828
  };
4829
4829
 
4830
- const _excluded$F = ["width", "height", "size", "name", "fill"];
4830
+ const _excluded$E = ["width", "height", "size", "name", "fill"];
4831
4831
  const CustomIcon = _ref => {
4832
4832
  let {
4833
4833
  width = 14,
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
4836
4836
  name = "",
4837
4837
  fill = "none"
4838
4838
  } = _ref,
4839
- props = _objectWithoutProperties(_ref, _excluded$F);
4839
+ props = _objectWithoutProperties(_ref, _excluded$E);
4840
4840
  const conf = config$2[name];
4841
4841
  if (conf) {
4842
4842
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
5125
5125
  !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])+"]"}}}));
5126
5126
  });
5127
5127
 
5128
- const _excluded$E = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5128
+ const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5129
5129
  dayjs__default["default"].extend(customParseFormat);
5130
5130
  dayjs__default["default"].extend(utc);
5131
5131
  dayjs__default["default"].extend(utc);
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
5501
5501
  createdAt,
5502
5502
  updatedAt
5503
5503
  } = data,
5504
- rest = _objectWithoutProperties(data, _excluded$E);
5504
+ rest = _objectWithoutProperties(data, _excluded$D);
5505
5505
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5506
5506
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5507
5507
  meta: _meta
@@ -6033,7 +6033,7 @@ SelectFilters.propTypes = {
6033
6033
  apiUrl: PropTypes__default["default"].string
6034
6034
  };
6035
6035
 
6036
- const _excluded$D = ["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"];
6036
+ const _excluded$C = ["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"];
6037
6037
  function DAFTable(_ref) {
6038
6038
  let {
6039
6039
  columns = [],
@@ -6064,7 +6064,7 @@ function DAFTable(_ref) {
6064
6064
  app,
6065
6065
  doEmptyRows
6066
6066
  } = _ref,
6067
- rest = _objectWithoutProperties(_ref, _excluded$D);
6067
+ rest = _objectWithoutProperties(_ref, _excluded$C);
6068
6068
  const source = React.useMemo(() => {
6069
6069
  if (data && Array.isArray(data)) {
6070
6070
  return data;
@@ -6889,7 +6889,7 @@ function ComponentWithFocus(_ref) {
6889
6889
  }
6890
6890
 
6891
6891
  var _templateObject$h;
6892
- const _excluded$C = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6892
+ const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6893
6893
  function StickyTable(_ref) {
6894
6894
  let {
6895
6895
  size = "small",
@@ -6900,7 +6900,7 @@ function StickyTable(_ref) {
6900
6900
  pagination = false,
6901
6901
  doEmptyRows = true
6902
6902
  } = _ref,
6903
- props = _objectWithoutProperties(_ref, _excluded$C);
6903
+ props = _objectWithoutProperties(_ref, _excluded$B);
6904
6904
  const data = React__default["default"].useMemo(() => {
6905
6905
  if (!doEmptyRows) {
6906
6906
  return dataSource;
@@ -7428,7 +7428,7 @@ const BTN_SIZE = {
7428
7428
  LG: 'large'
7429
7429
  };
7430
7430
 
7431
- const _excluded$B = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7431
+ const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7432
7432
  function DafButton(_ref) {
7433
7433
  let {
7434
7434
  content = '',
@@ -7442,7 +7442,7 @@ function DafButton(_ref) {
7442
7442
  style = {},
7443
7443
  className = ''
7444
7444
  } = _ref,
7445
- restProps = _objectWithoutProperties(_ref, _excluded$B);
7445
+ restProps = _objectWithoutProperties(_ref, _excluded$A);
7446
7446
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7447
7447
  icon: icon,
7448
7448
  type: type,
@@ -7561,12 +7561,12 @@ const Style$R = styled__default["default"].div`
7561
7561
  }
7562
7562
  `;
7563
7563
 
7564
- const _excluded$A = ["children"];
7564
+ const _excluded$z = ["children"];
7565
7565
  const BorderedButton = _ref => {
7566
7566
  let {
7567
7567
  children
7568
7568
  } = _ref,
7569
- props = _objectWithoutProperties(_ref, _excluded$A);
7569
+ props = _objectWithoutProperties(_ref, _excluded$z);
7570
7570
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7571
7571
  className: "d-btn-cont",
7572
7572
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7706,12 +7706,12 @@ Badge.propTypes = {
7706
7706
  props: PropTypes__default["default"].object
7707
7707
  };
7708
7708
 
7709
- const _excluded$z = ["icon"];
7709
+ const _excluded$y = ["icon"];
7710
7710
  function GetIcon(_ref) {
7711
7711
  let {
7712
7712
  icon
7713
7713
  } = _ref,
7714
- props = _objectWithoutProperties(_ref, _excluded$z);
7714
+ props = _objectWithoutProperties(_ref, _excluded$y);
7715
7715
  let Icon = Icons__namespace.CloseOutlined;
7716
7716
  if (Icons__namespace[icon]) {
7717
7717
  Icon = Icons__namespace[icon];
@@ -8041,7 +8041,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8041
8041
  }
8042
8042
  `;
8043
8043
 
8044
- const _excluded$y = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8044
+ const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8045
8045
  const {
8046
8046
  useToken: useToken$p
8047
8047
  } = antd.theme;
@@ -8134,7 +8134,7 @@ function Multiselect(_ref) {
8134
8134
  isSingle = false,
8135
8135
  selectionType = SELECTION_TYPES.DEFAULT
8136
8136
  } = _ref,
8137
- restProps = _objectWithoutProperties(_ref, _excluded$y);
8137
+ restProps = _objectWithoutProperties(_ref, _excluded$x);
8138
8138
  const {
8139
8139
  token
8140
8140
  } = useToken$p();
@@ -8854,7 +8854,7 @@ DAFHeader.propTypes = {
8854
8854
  filtersConfig: PropTypes__default["default"].any
8855
8855
  };
8856
8856
 
8857
- const _excluded$x = ["tabs", "onChange", "value", "className"];
8857
+ const _excluded$w = ["tabs", "onChange", "value", "className"];
8858
8858
  function TabsHeader(_ref) {
8859
8859
  let {
8860
8860
  tabs = [],
@@ -8862,7 +8862,7 @@ function TabsHeader(_ref) {
8862
8862
  value = '',
8863
8863
  className = 'mt-2'
8864
8864
  } = _ref,
8865
- rest = _objectWithoutProperties(_ref, _excluded$x);
8865
+ rest = _objectWithoutProperties(_ref, _excluded$w);
8866
8866
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8867
8867
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8868
8868
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8959,7 +8959,7 @@ DrawerHeader.propTypes = {
8959
8959
  tabsConfig: PropTypes__default["default"].any
8960
8960
  };
8961
8961
 
8962
- const _excluded$w = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8962
+ const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8963
8963
  const useFooter = _ref => {
8964
8964
  let {
8965
8965
  leftContent,
@@ -8994,7 +8994,7 @@ const useFooter = _ref => {
8994
8994
  style = {},
8995
8995
  className = ""
8996
8996
  } = button,
8997
- restProps = _objectWithoutProperties(button, _excluded$w);
8997
+ restProps = _objectWithoutProperties(button, _excluded$v);
8998
8998
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8999
8999
  content: label,
9000
9000
  type: type,
@@ -11875,7 +11875,7 @@ Widget.propTypes = {
11875
11875
  };
11876
11876
  Widget.displayName = 'Widget';
11877
11877
 
11878
- const _excluded$v = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11878
+ const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11879
11879
  function ImageWidget(_ref) {
11880
11880
  let {
11881
11881
  loading = false,
@@ -11886,7 +11886,7 @@ function ImageWidget(_ref) {
11886
11886
  noDescriptionText,
11887
11887
  isPdf = false
11888
11888
  } = _ref,
11889
- props = _objectWithoutProperties(_ref, _excluded$v);
11889
+ props = _objectWithoutProperties(_ref, _excluded$u);
11890
11890
  const expandable = isPdf ? false : props.expandable;
11891
11891
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11892
11892
  loading: loading,
@@ -11946,7 +11946,7 @@ function ImageWidget(_ref) {
11946
11946
  ImageWidget.displayName = 'ImageWidget';
11947
11947
 
11948
11948
  var _templateObject$e;
11949
- const _excluded$u = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11949
+ const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11950
11950
  function FlowWidget(_ref) {
11951
11951
  let {
11952
11952
  title,
@@ -11958,7 +11958,7 @@ function FlowWidget(_ref) {
11958
11958
  className,
11959
11959
  direction = "horizontal"
11960
11960
  } = _ref,
11961
- rest = _objectWithoutProperties(_ref, _excluded$u);
11961
+ rest = _objectWithoutProperties(_ref, _excluded$t);
11962
11962
  const [activeTab, setActiveTab] = React.useState();
11963
11963
  React.useEffect(() => {
11964
11964
  if (defaultActiveTab) {
@@ -15689,7 +15689,7 @@ Map$3.propTypes = {
15689
15689
  link: PropTypes__default["default"].any
15690
15690
  };
15691
15691
 
15692
- const _excluded$t = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15692
+ const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15693
15693
  function InExpandableWidgetMap(_ref) {
15694
15694
  let {
15695
15695
  isExpanded,
@@ -15703,7 +15703,7 @@ function InExpandableWidgetMap(_ref) {
15703
15703
  height,
15704
15704
  widgetConfig
15705
15705
  } = _ref,
15706
- rest = _objectWithoutProperties(_ref, _excluded$t);
15706
+ rest = _objectWithoutProperties(_ref, _excluded$s);
15707
15707
  const [mapKey, setMapKey] = React.useState(0);
15708
15708
  const [isMapReady, setIsMapReady] = React.useState(false);
15709
15709
  React.useEffect(() => {
@@ -17903,14 +17903,14 @@ const MapConfig = ({
17903
17903
  });
17904
17904
  };
17905
17905
 
17906
- const _excluded$s = ["config", "title", "loading"];
17906
+ const _excluded$r = ["config", "title", "loading"];
17907
17907
  const Details = _ref => {
17908
17908
  let {
17909
17909
  config = [],
17910
17910
  title,
17911
17911
  loading = false
17912
17912
  } = _ref,
17913
- rest = _objectWithoutProperties(_ref, _excluded$s);
17913
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17914
17914
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17915
17915
  className: "with-border-header h-w-btn-header card",
17916
17916
  loading: loading,
@@ -17926,14 +17926,14 @@ const Details = _ref => {
17926
17926
  }));
17927
17927
  };
17928
17928
 
17929
- const _excluded$r = ["config", "title", "loading"];
17929
+ const _excluded$q = ["config", "title", "loading"];
17930
17930
  const KeyIndicatorsDetails = _ref => {
17931
17931
  let {
17932
17932
  config,
17933
17933
  title,
17934
17934
  loading = false
17935
17935
  } = _ref,
17936
- rest = _objectWithoutProperties(_ref, _excluded$r);
17936
+ rest = _objectWithoutProperties(_ref, _excluded$q);
17937
17937
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17938
17938
  className: "with-border-header h-w-btn-header",
17939
17939
  title: title,
@@ -17963,7 +17963,7 @@ const Style$G = styled__default["default"].div`
17963
17963
  }
17964
17964
  `;
17965
17965
 
17966
- const _excluded$q = ["children", "config", "detailsTitle", "firstColumnWidth"];
17966
+ const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
17967
17967
  const DetailsSection = _ref => {
17968
17968
  let {
17969
17969
  children,
@@ -17971,7 +17971,7 @@ const DetailsSection = _ref => {
17971
17971
  detailsTitle,
17972
17972
  firstColumnWidth = "250px"
17973
17973
  } = _ref,
17974
- rest = _objectWithoutProperties(_ref, _excluded$q);
17974
+ rest = _objectWithoutProperties(_ref, _excluded$p);
17975
17975
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17976
17976
  firstColumnWidth: firstColumnWidth,
17977
17977
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18147,14 +18147,14 @@ const getGoalConfig = () => {
18147
18147
  };
18148
18148
 
18149
18149
  var _templateObject$c;
18150
- const _excluded$p = ["title", "activeSdgGoals", "t"];
18150
+ const _excluded$o = ["title", "activeSdgGoals", "t"];
18151
18151
  function SDGWidget(_ref) {
18152
18152
  let {
18153
18153
  title = "Sustainable Development Goals",
18154
18154
  activeSdgGoals = [],
18155
18155
  t = key => key
18156
18156
  } = _ref,
18157
- props = _objectWithoutProperties(_ref, _excluded$p);
18157
+ props = _objectWithoutProperties(_ref, _excluded$o);
18158
18158
  const sdgConfig = getGoalConfig();
18159
18159
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18160
18160
  title: title,
@@ -18452,7 +18452,7 @@ function SdgList({
18452
18452
  });
18453
18453
  }
18454
18454
 
18455
- const _excluded$o = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18455
+ const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18456
18456
  const {
18457
18457
  Meta
18458
18458
  } = antd.Card;
@@ -18472,7 +18472,7 @@ function ProjectWidget(_ref) {
18472
18472
  hideSDGList = false,
18473
18473
  t = x => x
18474
18474
  } = _ref,
18475
- props = _objectWithoutProperties(_ref, _excluded$o);
18475
+ props = _objectWithoutProperties(_ref, _excluded$n);
18476
18476
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18477
18477
  const {
18478
18478
  token
@@ -18744,13 +18744,13 @@ const WidgetCard = _ref => {
18744
18744
  });
18745
18745
  };
18746
18746
 
18747
- const _excluded$n = ["title", "children"];
18747
+ const _excluded$m = ["title", "children"];
18748
18748
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18749
18749
  let {
18750
18750
  title,
18751
18751
  children
18752
18752
  } = _ref,
18753
- rest = _objectWithoutProperties(_ref, _excluded$n);
18753
+ rest = _objectWithoutProperties(_ref, _excluded$m);
18754
18754
  /**
18755
18755
  * Handles carousel slide change events
18756
18756
  * @param {number} currentSlide - The index of the current slide after change
@@ -18914,7 +18914,7 @@ const EmptyStateContainer = styled__default["default"].div`
18914
18914
  }
18915
18915
  `;
18916
18916
 
18917
- const _excluded$m = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18917
+ const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18918
18918
  function ImageCarousel(_ref) {
18919
18919
  let {
18920
18920
  title,
@@ -18929,7 +18929,7 @@ function ImageCarousel(_ref) {
18929
18929
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18930
18930
  emptyText = "No Image"
18931
18931
  } = _ref,
18932
- rest = _objectWithoutProperties(_ref, _excluded$m);
18932
+ rest = _objectWithoutProperties(_ref, _excluded$l);
18933
18933
  const [previewVisible, setPreviewVisible] = React.useState(false);
18934
18934
  const [current, setCurrent] = React.useState(0);
18935
18935
  const carouselRef = React.useRef(null);
@@ -19298,7 +19298,7 @@ const getVegetationConfig = () => {
19298
19298
  };
19299
19299
 
19300
19300
  var _templateObject$a, _templateObject2$3;
19301
- const _excluded$l = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19301
+ const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19302
19302
  function VegetationWidget(_ref) {
19303
19303
  let {
19304
19304
  title = "Vegetation Health",
@@ -19310,7 +19310,7 @@ function VegetationWidget(_ref) {
19310
19310
  growthObservations = [],
19311
19311
  t = key => key
19312
19312
  } = _ref,
19313
- props = _objectWithoutProperties(_ref, _excluded$l);
19313
+ props = _objectWithoutProperties(_ref, _excluded$k);
19314
19314
  let vegetationConfig = getVegetationConfig();
19315
19315
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19316
19316
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19426,7 +19426,7 @@ const getFaunaConfig = () => {
19426
19426
  };
19427
19427
 
19428
19428
  var _templateObject$9, _templateObject2$2;
19429
- const _excluded$k = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19429
+ const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19430
19430
  function FaunaWidget(_ref) {
19431
19431
  let {
19432
19432
  title = "Observed Fauna",
@@ -19437,7 +19437,7 @@ function FaunaWidget(_ref) {
19437
19437
  itemHeight = 100,
19438
19438
  t = key => key
19439
19439
  } = _ref,
19440
- props = _objectWithoutProperties(_ref, _excluded$k);
19440
+ props = _objectWithoutProperties(_ref, _excluded$j);
19441
19441
  let faunaConfig = getFaunaConfig();
19442
19442
 
19443
19443
  // Filter to show only specific keys if filterKeys is provided
@@ -19502,7 +19502,7 @@ const getInvasiveSpeciesConfig = () => {
19502
19502
  };
19503
19503
 
19504
19504
  var _templateObject$8, _templateObject2$1;
19505
- const _excluded$j = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19505
+ const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19506
19506
  function InvasiveSpeciesWidget(_ref) {
19507
19507
  let {
19508
19508
  title = "Invasive Species",
@@ -19514,7 +19514,7 @@ function InvasiveSpeciesWidget(_ref) {
19514
19514
  itemHeight = 100,
19515
19515
  t = key => key
19516
19516
  } = _ref,
19517
- props = _objectWithoutProperties(_ref, _excluded$j);
19517
+ props = _objectWithoutProperties(_ref, _excluded$i);
19518
19518
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19519
19519
 
19520
19520
  // Filter to show only specific keys if filterKeys is provided
@@ -24937,8 +24937,8 @@ const RepeatableModals = ({
24937
24937
  }) : null;
24938
24938
  };
24939
24939
 
24940
- const _excluded$i = ["viewGroup"],
24941
- _excluded2$2 = ["label", "icon", "position"];
24940
+ const _excluded$h = ["viewGroup"],
24941
+ _excluded2$1 = ["label", "icon", "position"];
24942
24942
  const Content$1 = _ref => {
24943
24943
  let {
24944
24944
  style = {},
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
25009
25009
  if (groups[gKey].viewGroup === key) {
25010
25010
  // eslint-disable-next-line no-unused-vars
25011
25011
  const _groups$gKey = groups[gKey],
25012
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$i);
25012
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
25013
25013
  items[gKey] = gCfg;
25014
25014
  }
25015
25015
  return items;
@@ -25237,7 +25237,7 @@ const Content$1 = _ref => {
25237
25237
  showIcon: true
25238
25238
  });
25239
25239
  }
25240
- let groups = _objectWithoutProperties(f, _excluded2$2);
25240
+ let groups = _objectWithoutProperties(f, _excluded2$1);
25241
25241
  groups = Object.keys(groups).reduce((items, key) => {
25242
25242
  var _groups$key2;
25243
25243
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -25289,7 +25289,7 @@ const Content$1 = _ref => {
25289
25289
  });
25290
25290
  };
25291
25291
 
25292
- const _excluded$h = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25292
+ const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25293
25293
  function Modal(_ref) {
25294
25294
  let {
25295
25295
  t = text => text,
@@ -25305,7 +25305,7 @@ function Modal(_ref) {
25305
25305
  disabled = false,
25306
25306
  withModalFormWrapper = true
25307
25307
  } = _ref,
25308
- props = _objectWithoutProperties(_ref, _excluded$h);
25308
+ props = _objectWithoutProperties(_ref, _excluded$g);
25309
25309
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25310
25310
  width: 650,
25311
25311
  footer: null,
@@ -30797,7 +30797,6 @@ function Repeatable({
30797
30797
  });
30798
30798
  }
30799
30799
 
30800
- /* eslint-disable no-eval */
30801
30800
  const isRiskComment = inputData => {
30802
30801
  if (inputData) {
30803
30802
  if (inputData.name === 'assessment') {
@@ -30810,7 +30809,10 @@ const isRiskComment = inputData => {
30810
30809
  };
30811
30810
 
30812
30811
  // options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
30813
- function renderNestedInputs$1(options, k, ...args) {
30812
+ function renderNestedInputs$1(options, k) {
30813
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
30814
+ args[_key - 2] = arguments[_key];
30815
+ }
30814
30816
  if (options[k].repeatable) {
30815
30817
  return renderRepeatable$1(options, k, ...args);
30816
30818
  } else {
@@ -30838,10 +30840,11 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30838
30840
  children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
30839
30841
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
30840
30842
  name: formId,
30841
- children: (fields, {
30842
- add,
30843
- remove
30844
- }) => {
30843
+ children: (fields, _ref) => {
30844
+ let {
30845
+ add,
30846
+ remove
30847
+ } = _ref;
30845
30848
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
30846
30849
  if (fields.length === 0) {
30847
30850
  const formInputs = form.inputs;
@@ -30891,14 +30894,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30891
30894
  const _val = {
30892
30895
  [formId]: formData.map((d, j) => i === j ? val : d)
30893
30896
  };
30894
- onValuesChange(_val, {
30895
- ...values,
30896
- ..._val
30897
- });
30898
- setValues({
30899
- ...values,
30897
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, values), _val));
30898
+ setValues(_objectSpread2(_objectSpread2({}, values), {}, {
30900
30899
  [formId]: formData.map((d, j) => i === j ? val : d)
30901
- });
30900
+ }));
30902
30901
  };
30903
30902
  return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
30904
30903
  form: form,
@@ -30954,154 +30953,156 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
30954
30953
  highlightMandatory
30955
30954
  });
30956
30955
  };
30957
- const GroupContent = ({
30958
- form,
30959
- values = {},
30960
- i,
30961
- formId,
30962
- excludedKeys,
30963
- getData,
30964
- setValues,
30965
- MainForm,
30966
- options,
30967
- plainForms,
30968
- setAddress,
30969
- onValuesChange,
30970
- allData,
30971
- changeInputMeta,
30972
- highlightMandatory
30973
- }) => {
30956
+ const GroupContent = _ref2 => {
30957
+ var _form$meta;
30958
+ let {
30959
+ form,
30960
+ values = {},
30961
+ i,
30962
+ formId,
30963
+ excludedKeys,
30964
+ getData,
30965
+ setValues,
30966
+ MainForm,
30967
+ options,
30968
+ plainForms,
30969
+ setAddress,
30970
+ onValuesChange,
30971
+ allData,
30972
+ changeInputMeta,
30973
+ highlightMandatory
30974
+ } = _ref2;
30974
30975
  const {
30975
30976
  user,
30976
30977
  t
30977
30978
  } = useEditContext();
30978
30979
  const label = getInputLabel$1(form, values);
30979
- const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
30980
+ const notPartOfTheForm = (form === null || form === void 0 ? void 0 : form.type) === 'ajaxSubGroup' ? true : !!(form !== null && form !== void 0 && (_form$meta = form.meta) !== null && _form$meta !== void 0 && _form$meta.isSubGroup);
30980
30981
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
30981
30982
  const formValues = values[form.dataId];
30982
- const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30983
- children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30984
- config: form.meta.groupInfo,
30985
- user: user,
30986
- t: t
30987
- }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30988
- const isAjaxSubGroup = form?.type === "ajaxSubGroup";
30989
- const input = form.inputs[inp];
30990
- const inputId = input.dataId || inp;
30991
- const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30992
- const value = inputValues[inputId];
30993
- const commentValue = inputValues[`${inputId}Comment`];
30994
- const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
30995
- const subtitles = form.subtitles || null;
30996
- const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
30997
- inputData.repeatIndex = undefined;
30998
- inputData.inputName = inputId;
30999
- inputData.repeatValues = inputValues;
31000
- if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31001
- inputData.groupInputs = inputData.groupInputs.map(gpI => {
31002
- gpI.data.inputName = gpI.data.name;
31003
- gpI.data.repeatIndex = undefined;
31004
- gpI.data.name = formId;
31005
- return gpI;
31006
- });
31007
- }
31008
- const isRisk = isRiskComment(inputData);
31009
- const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
31010
- const btnOnClick = () => {
31011
- if (typeof inputData.commentValue === 'string') {
31012
- onValuesChange({}, {
31013
- ...values,
31014
- [`${inputData.inputName}`]: null
30983
+ const renderInputs = () => {
30984
+ var _form$meta2;
30985
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30986
+ children: [form !== null && form !== void 0 && (_form$meta2 = form.meta) !== null && _form$meta2 !== void 0 && _form$meta2.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30987
+ config: form.meta.groupInfo,
30988
+ user: user,
30989
+ t: t
30990
+ }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30991
+ var _ref3, _values$meta, _values$meta2, _input$meta, _inputData$rules, _input$meta2;
30992
+ const isAjaxSubGroup = (form === null || form === void 0 ? void 0 : form.type) === "ajaxSubGroup";
30993
+ const input = form.inputs[inp];
30994
+ const inputId = input.dataId || inp;
30995
+ const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30996
+ const value = inputValues[inputId];
30997
+ const commentValue = inputValues["".concat(inputId, "Comment")];
30998
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
30999
+ const subtitles = form.subtitles || null;
31000
+ const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? ((_ref3 = values[formId] || {}) === null || _ref3 === void 0 || (_ref3 = _ref3.meta) === null || _ref3 === void 0 || (_ref3 = _ref3.inputs) === null || _ref3 === void 0 ? void 0 : _ref3[inputId]) || {} : (((values === null || values === void 0 || (_values$meta = values.meta) === null || _values$meta === void 0 ? void 0 : _values$meta.inputs) || {})[formId] || {})[inputId] || {} : ((values === null || values === void 0 || (_values$meta2 = values.meta) === null || _values$meta2 === void 0 ? void 0 : _values$meta2.inputs) || {})[inputId] || {};
31001
+ inputData.repeatIndex = undefined;
31002
+ inputData.inputName = inputId;
31003
+ inputData.repeatValues = inputValues;
31004
+ if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31005
+ inputData.groupInputs = inputData.groupInputs.map(gpI => {
31006
+ gpI.data.inputName = gpI.data.name;
31007
+ gpI.data.repeatIndex = undefined;
31008
+ gpI.data.name = formId;
31009
+ return gpI;
31015
31010
  });
31016
31011
  }
31017
- const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31018
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31019
- if (Array.isArray(values[formId])) {
31020
- values[formId] = inputValues;
31021
- } else {
31022
- values[formId] = inputValues;
31023
- }
31024
- setValues({
31025
- ...values
31026
- });
31027
- };
31028
- const btnOnClick2 = () => {
31029
- if (typeof inputData.commentValue !== 'string') {
31012
+ const isRisk = isRiskComment(inputData);
31013
+ const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.mandatory) && inputIsEmpty(input, inputValues, inputMeta);
31014
+ const btnOnClick = () => {
31015
+ if (typeof inputData.commentValue === 'string') {
31016
+ onValuesChange({}, _objectSpread2(_objectSpread2({}, values), {}, {
31017
+ ["".concat(inputData.inputName)]: null
31018
+ }));
31019
+ }
31030
31020
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31031
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31021
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31032
31022
  if (Array.isArray(values[formId])) {
31033
31023
  values[formId] = inputValues;
31034
31024
  } else {
31035
31025
  values[formId] = inputValues;
31036
31026
  }
31037
- setValues({
31038
- ...values
31039
- });
31040
- }
31041
- };
31042
- const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
31043
- if (rule.metaIf && typeof rule.metaIf === 'string') {
31044
- const [name, cond, value] = rule.metaIf.split(' ');
31045
- const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
31046
- if (cond === 'is') {
31047
- return !!val?.[value];
31027
+ setValues(_objectSpread2({}, values));
31028
+ };
31029
+ const btnOnClick2 = () => {
31030
+ if (typeof inputData.commentValue !== 'string') {
31031
+ const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31032
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31033
+ if (Array.isArray(values[formId])) {
31034
+ values[formId] = inputValues;
31035
+ } else {
31036
+ values[formId] = inputValues;
31037
+ }
31038
+ setValues(_objectSpread2({}, values));
31048
31039
  }
31049
- }
31050
- return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31051
- });
31052
- const requiredRule = rules.find(r => r.required);
31053
- if (requiredRule && input.type === 'text') {
31054
- rules.push({
31055
- whitespace: true,
31056
- message: requiredRule.message || ''
31040
+ };
31041
+ const rules = inputData !== null && inputData !== void 0 && (_inputData$rules = inputData.rules) !== null && _inputData$rules !== void 0 && _inputData$rules.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.rules) || []).filter(rule => {
31042
+ if (rule.metaIf && typeof rule.metaIf === 'string') {
31043
+ var _values$meta3, _values$meta4;
31044
+ const [name, cond, value] = rule.metaIf.split(' ');
31045
+ const val = name.includes('./') ? values === null || values === void 0 || (_values$meta3 = values.meta) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3.inputs) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3[formId]) === null || _values$meta3 === void 0 ? void 0 : _values$meta3[name.split('./')[1]] : values === null || values === void 0 || (_values$meta4 = values.meta) === null || _values$meta4 === void 0 || (_values$meta4 = _values$meta4.inputs) === null || _values$meta4 === void 0 ? void 0 : _values$meta4[name.split('./')[1]];
31046
+ if (cond === 'is') {
31047
+ return !!(val !== null && val !== void 0 && val[value]);
31048
+ }
31049
+ }
31050
+ return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31057
31051
  });
31058
- }
31059
- return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31060
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31061
- style: {
31062
- position: 'relative'
31063
- },
31064
- children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31065
- input: input,
31066
- inputTypeComponent: inputTypeComponent$1,
31067
- inputData: inputData,
31068
- MainForm: MainForm,
31069
- options: options,
31070
- setValues: setValues,
31071
- formId: formId,
31072
- inputId: inputId,
31073
- inputOnBlur: inputOnBlur,
31074
- values: values,
31075
- getInputLabel: getInputLabel$1,
31076
- plainForms: plainForms,
31077
- setAddress: setAddress,
31078
- btnOnClick: btnOnClick,
31079
- btnOnClick2: btnOnClick2,
31080
- locationName: (allData || {}).locationName,
31081
- subGroupTitle: (allData || {}).subGroupTitle
31082
- }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31083
- values,
31084
- formId,
31085
- setValues,
31086
- MainForm,
31087
- options,
31088
- plainForms,
31089
- setAddress,
31090
- inputData,
31091
- inputId,
31092
- input,
31093
- rules,
31094
- inputMeta,
31095
- changeInputMeta,
31096
- notPartOfTheForm,
31097
- isAjaxSubGroup,
31098
- isHighlighted
31099
- })]
31100
- }, ii)
31101
- }, `${i}${ii}`) : null;
31102
- })]
31103
- });
31104
- const isNa = formValues?.valuation === 'na';
31052
+ const requiredRule = rules.find(r => r.required);
31053
+ if (requiredRule && input.type === 'text') {
31054
+ rules.push({
31055
+ whitespace: true,
31056
+ message: requiredRule.message || ''
31057
+ });
31058
+ }
31059
+ return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31060
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31061
+ style: {
31062
+ position: 'relative'
31063
+ },
31064
+ children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31065
+ input: input,
31066
+ inputTypeComponent: inputTypeComponent$1,
31067
+ inputData: inputData,
31068
+ MainForm: MainForm,
31069
+ options: options,
31070
+ setValues: setValues,
31071
+ formId: formId,
31072
+ inputId: inputId,
31073
+ inputOnBlur: inputOnBlur,
31074
+ values: values,
31075
+ getInputLabel: getInputLabel$1,
31076
+ plainForms: plainForms,
31077
+ setAddress: setAddress,
31078
+ btnOnClick: btnOnClick,
31079
+ btnOnClick2: btnOnClick2,
31080
+ locationName: (allData || {}).locationName,
31081
+ subGroupTitle: (allData || {}).subGroupTitle
31082
+ }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31083
+ values,
31084
+ formId,
31085
+ setValues,
31086
+ MainForm,
31087
+ options,
31088
+ plainForms,
31089
+ setAddress,
31090
+ inputData,
31091
+ inputId,
31092
+ input,
31093
+ rules,
31094
+ inputMeta,
31095
+ changeInputMeta,
31096
+ notPartOfTheForm,
31097
+ isAjaxSubGroup,
31098
+ isHighlighted
31099
+ })]
31100
+ }, ii)
31101
+ }, "".concat(i).concat(ii)) : null;
31102
+ })]
31103
+ });
31104
+ };
31105
+ const isNa = (formValues === null || formValues === void 0 ? void 0 : formValues.valuation) === 'na';
31105
31106
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31106
31107
  children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
31107
31108
  className: "risk-header",
@@ -31109,44 +31110,46 @@ const GroupContent = ({
31109
31110
  children: label
31110
31111
  })
31111
31112
  }) : /*#__PURE__*/jsxRuntime.jsx("h3", {
31112
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
31113
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
31113
31114
  children: label
31114
31115
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
31115
- className: `repeatable ${hasLabel ? "mb-4" : ""}`,
31116
+ className: "repeatable ".concat(hasLabel ? "mb-4" : ""),
31116
31117
  children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
31117
31118
  children: getInputProp(form.titleLabel, values)
31118
- }) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31119
+ }) : null, formValues !== null && formValues !== void 0 && formValues.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31119
31120
  t: t,
31120
31121
  isNa: isNa,
31121
31122
  isSuccess: !isNa
31122
31123
  // TODO: translate
31123
31124
  ,
31124
31125
  config: {
31125
- title: t(`No ${formValues?.stage || 'planning'} required`)
31126
+ title: t("No ".concat((formValues === null || formValues === void 0 ? void 0 : formValues.stage) || 'planning', " required"))
31126
31127
  },
31127
31128
  children: renderInputs()
31128
31129
  }) : renderInputs()]
31129
31130
  })]
31130
31131
  });
31131
31132
  };
31132
- const GroupContentFormItem = ({
31133
- values,
31134
- formId,
31135
- setValues,
31136
- MainForm,
31137
- options,
31138
- plainForms,
31139
- setAddress,
31140
- inputData,
31141
- inputId,
31142
- input,
31143
- rules,
31144
- inputMeta,
31145
- changeInputMeta,
31146
- notPartOfTheForm = true,
31147
- isAjaxSubGroup,
31148
- isHighlighted
31149
- }) => {
31133
+ const GroupContentFormItem = _ref4 => {
31134
+ var _rules$find, _inputMeta$reviews, _input$meta3, _values$formId, _input$meta4, _input$meta7, _input$meta8, _input$meta9, _values$meta10, _values$meta11, _values$parent, _input$meta10, _input$meta11, _inputData$value, _input$meta12, _input$meta13, _inputMeta$comment, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
31135
+ let {
31136
+ values,
31137
+ formId,
31138
+ setValues,
31139
+ MainForm,
31140
+ options,
31141
+ plainForms,
31142
+ setAddress,
31143
+ inputData,
31144
+ inputId,
31145
+ input,
31146
+ rules,
31147
+ inputMeta,
31148
+ changeInputMeta,
31149
+ notPartOfTheForm = true,
31150
+ isAjaxSubGroup,
31151
+ isHighlighted
31152
+ } = _ref4;
31150
31153
  const {
31151
31154
  t,
31152
31155
  user,
@@ -31160,10 +31163,10 @@ const GroupContentFormItem = ({
31160
31163
  staticWidth,
31161
31164
  fullWidth
31162
31165
  } = useEditContext();
31163
- const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
31164
- let maxRule = rules.find(rule => rule.max)?.max;
31166
+ const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
31167
+ let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
31165
31168
  const requiredRule = rules.find(r => r.required);
31166
- const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
31169
+ 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];
31167
31170
  if (!maxRule && input.type === 'textarea') {
31168
31171
  maxRule = MAX_TEXT_AREA_LENGTH;
31169
31172
  }
@@ -31182,38 +31185,35 @@ const GroupContentFormItem = ({
31182
31185
  }
31183
31186
  setIsShown(true);
31184
31187
  if (notPartOfTheForm || isAjaxSubGroup) {
31185
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31188
+ var _values$meta5;
31189
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
31186
31190
  const _defaultData = MainForm.getFieldValue(formId);
31187
31191
  if (isAjaxSubGroup) {
31192
+ var _defaultData$meta, _defaultData$meta2;
31188
31193
  changeInputMeta({
31189
31194
  key: formId,
31190
31195
  type: input.type,
31191
31196
  otherValues: {
31192
- [formId]: {
31193
- ..._defaultData,
31197
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31194
31198
  meta: {
31195
- inputs: {
31196
- ...(_defaultData?.meta?.inputs || {}),
31197
- [inputId]: {
31198
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31199
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta = _defaultData.meta) === null || _defaultData$meta === void 0 ? void 0 : _defaultData$meta.inputs) || {}), {}, {
31200
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta2 = _defaultData.meta) === null || _defaultData$meta2 === void 0 ? void 0 : _defaultData$meta2.inputs) || {})[inputId] || {}), {}, {
31199
31201
  comment: ''
31200
- }
31201
- }
31202
+ })
31203
+ })
31202
31204
  }
31203
- }
31205
+ })
31204
31206
  }
31205
31207
  });
31206
31208
  } else {
31207
31209
  changeInputMeta({
31208
31210
  key: formId,
31209
31211
  type: input.type,
31210
- value: {
31211
- ..._defaultMeta,
31212
- [inputId]: {
31213
- ...(_defaultMeta[inputId] || {}),
31212
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31213
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31214
31214
  comment: ''
31215
- }
31216
- }
31215
+ })
31216
+ })
31217
31217
  });
31218
31218
  }
31219
31219
  } else {
@@ -31230,62 +31230,58 @@ const GroupContentFormItem = ({
31230
31230
  if (!isReview) {
31231
31231
  return;
31232
31232
  }
31233
- const reviewSuccess = lastReview?.reviewSuccess;
31233
+ const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
31234
31234
  if (notPartOfTheForm || isAjaxSubGroup) {
31235
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31235
+ var _values$meta6;
31236
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
31236
31237
  const _defaultData = MainForm.getFieldValue(formId);
31237
31238
  if (isAjaxSubGroup) {
31239
+ var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
31238
31240
  changeInputMeta({
31239
31241
  key: formId,
31240
31242
  type: input.type,
31241
31243
  otherValues: {
31242
- [formId]: {
31243
- ..._defaultData,
31244
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31244
31245
  meta: {
31245
- inputs: {
31246
- ...(_defaultData?.meta?.inputs || {}),
31247
- [inputId]: {
31248
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31249
- reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31246
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta3 = _defaultData.meta) === null || _defaultData$meta3 === void 0 ? void 0 : _defaultData$meta3.inputs) || {}), {}, {
31247
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta4 = _defaultData.meta) === null || _defaultData$meta4 === void 0 ? void 0 : _defaultData$meta4.inputs) || {})[inputId] || {}), {}, {
31248
+ reviews: reviewSuccess ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta5 = _defaultData.meta) === null || _defaultData$meta5 === void 0 ? void 0 : _defaultData$meta5.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta6 = _defaultData.meta) === null || _defaultData$meta6 === void 0 ? void 0 : _defaultData$meta6.inputs) || {})[inputId] || {}).reviews || []), {
31250
31249
  reviewer: user,
31251
31250
  createdAt: new Date().toISOString(),
31252
31251
  reviewSuccess: true
31253
31252
  }]
31254
- }
31255
- }
31253
+ })
31254
+ })
31256
31255
  }
31257
- }
31256
+ })
31258
31257
  }
31259
31258
  });
31260
31259
  } else {
31261
31260
  changeInputMeta({
31262
31261
  key: formId,
31263
31262
  type: input.type,
31264
- value: {
31265
- ..._defaultMeta,
31266
- [inputId]: {
31267
- ...(_defaultMeta[inputId] || {}),
31263
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31264
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31268
31265
  reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31269
31266
  reviewer: user,
31270
31267
  createdAt: new Date().toISOString(),
31271
31268
  reviewSuccess: true
31272
31269
  }]
31273
- }
31274
- }
31270
+ })
31271
+ })
31275
31272
  });
31276
31273
  }
31277
31274
  } else {
31278
31275
  changeInputMeta({
31279
31276
  key: inputId,
31280
31277
  type: input.type,
31281
- value: {
31282
- ...inputMeta,
31278
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31283
31279
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31284
31280
  reviewer: user,
31285
31281
  createdAt: new Date().toISOString(),
31286
31282
  reviewSuccess: true
31287
31283
  }]
31288
- }
31284
+ })
31289
31285
  });
31290
31286
  }
31291
31287
  };
@@ -31293,118 +31289,111 @@ const GroupContentFormItem = ({
31293
31289
  if (!isReview) {
31294
31290
  return;
31295
31291
  }
31296
- const reviewError = lastReview?.reviewError;
31292
+ const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
31297
31293
  if (notPartOfTheForm || isAjaxSubGroup) {
31298
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31294
+ var _values$meta7;
31295
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
31299
31296
  const _defaultData = MainForm.getFieldValue(formId);
31300
31297
  if (isAjaxSubGroup) {
31298
+ var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
31301
31299
  changeInputMeta({
31302
31300
  key: formId,
31303
31301
  type: input.type,
31304
31302
  otherValues: {
31305
- [formId]: {
31306
- ..._defaultData,
31303
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31307
31304
  meta: {
31308
- inputs: {
31309
- ...(_defaultData?.meta?.inputs || {}),
31310
- [inputId]: {
31311
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31312
- reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31305
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta7 = _defaultData.meta) === null || _defaultData$meta7 === void 0 ? void 0 : _defaultData$meta7.inputs) || {}), {}, {
31306
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta8 = _defaultData.meta) === null || _defaultData$meta8 === void 0 ? void 0 : _defaultData$meta8.inputs) || {})[inputId] || {}), {}, {
31307
+ reviews: reviewError ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta9 = _defaultData.meta) === null || _defaultData$meta9 === void 0 ? void 0 : _defaultData$meta9.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta10 = _defaultData.meta) === null || _defaultData$meta10 === void 0 ? void 0 : _defaultData$meta10.inputs) || {})[inputId] || {}).reviews || []), {
31313
31308
  reviewer: user,
31314
31309
  createdAt: new Date().toISOString(),
31315
31310
  reviewError: true,
31316
31311
  comment: ''
31317
31312
  }]
31318
- }
31319
- }
31313
+ })
31314
+ })
31320
31315
  }
31321
- }
31316
+ })
31322
31317
  }
31323
31318
  });
31324
31319
  } else {
31325
31320
  changeInputMeta({
31326
31321
  key: formId,
31327
31322
  type: input.type,
31328
- value: {
31329
- ..._defaultMeta,
31330
- [inputId]: {
31331
- ...(_defaultMeta[inputId] || {}),
31323
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31324
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31332
31325
  reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31333
31326
  reviewer: user,
31334
31327
  createdAt: new Date().toISOString(),
31335
31328
  reviewError: true,
31336
31329
  comment: ''
31337
31330
  }]
31338
- }
31339
- }
31331
+ })
31332
+ })
31340
31333
  });
31341
31334
  }
31342
31335
  } else {
31343
31336
  changeInputMeta({
31344
31337
  key: inputId,
31345
31338
  type: input.type,
31346
- value: {
31347
- ...inputMeta,
31339
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31348
31340
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31349
31341
  reviewer: user,
31350
31342
  createdAt: new Date().toISOString(),
31351
31343
  reviewError: true,
31352
31344
  comment: ''
31353
31345
  }]
31354
- }
31346
+ })
31355
31347
  });
31356
31348
  }
31357
31349
  };
31358
- const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
31350
+ const requiredComment = (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.notApplicable) && (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.requiredCommentOnNotApplicable) && (values === null || values === void 0 || (_values$formId = values[formId]) === null || _values$formId === void 0 ? void 0 : _values$formId.valuation) !== 'na';
31359
31351
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31360
31352
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
31361
31353
  className: "flex input-cont",
31362
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31363
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
31364
- ...(['total100', 'group'].includes(input.type) ? {} : {
31365
- name: notPartOfTheForm ? [formId, inputId] : inputId,
31366
- fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31367
- initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31368
- }),
31369
- ...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31370
- valuePropName: "fileList",
31371
- getValueFromEvent: e => {
31372
- if (Array.isArray(e)) {
31373
- return e;
31374
- }
31375
- return e && e.fileList && e.fileList.map(f => {
31376
- if (f.response) {
31377
- return f.response;
31378
- }
31379
- return f;
31380
- });
31354
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
31355
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
31356
+ }, ['total100', 'group'].includes(input.type) ? {} : {
31357
+ name: notPartOfTheForm ? [formId, inputId] : inputId,
31358
+ fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31359
+ initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31360
+ }), ['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31361
+ valuePropName: "fileList",
31362
+ getValueFromEvent: e => {
31363
+ if (Array.isArray(e)) {
31364
+ return e;
31381
31365
  }
31382
- } : {}),
31383
- ...(inputOnBlur.includes(input.type) ? {
31384
- trigger: "onBlur"
31385
- } : {}),
31366
+ return e && e.fileList && e.fileList.map(f => {
31367
+ if (f.response) {
31368
+ return f.response;
31369
+ }
31370
+ return f;
31371
+ });
31372
+ }
31373
+ } : {}), inputOnBlur.includes(input.type) ? {
31374
+ trigger: "onBlur"
31375
+ } : {}), {}, {
31386
31376
  style: input.showOnView === false ? {
31387
31377
  display: 'none'
31388
- } : {},
31389
- ...(['switch'].includes(input.type) ? {
31390
- labelCol: {
31391
- span: 20
31392
- },
31393
- style: {
31394
- ...(input.showOnView === false ? {
31395
- display: 'none'
31396
- } : {}),
31397
- flexDirection: 'row',
31398
- justifyContent: 'space-between'
31399
- }
31400
- } : {}),
31378
+ } : {}
31379
+ }, ['switch'].includes(input.type) ? {
31380
+ labelCol: {
31381
+ span: 20
31382
+ },
31383
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
31384
+ display: 'none'
31385
+ } : {}), {}, {
31386
+ flexDirection: 'row',
31387
+ justifyContent: 'space-between'
31388
+ })
31389
+ } : {}), {}, {
31401
31390
  label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
31402
- className: input?.meta?.code && "mr-10",
31391
+ className: (input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.code) && "mr-10",
31403
31392
  children: getInputLabel$1(input, values)
31404
31393
  }) : null,
31405
31394
  rules: rules,
31406
- className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
31407
- "data-id": `${formId}.${inputId}`,
31395
+ className: formatClassname([input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1 "), noActionsInputs.includes(input.type) && 'no-actions-input']),
31396
+ "data-id": "".concat(formId, ".").concat(inputId),
31408
31397
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
31409
31398
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31410
31399
  className: formatClassname(["ml-4 input-actions"]),
@@ -31414,7 +31403,7 @@ const GroupContentFormItem = ({
31414
31403
  title: t('Add review note'),
31415
31404
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31416
31405
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31417
- className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
31406
+ className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && 'primary']),
31418
31407
  type: "link",
31419
31408
  onClick: onClickReviewError,
31420
31409
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -31430,7 +31419,7 @@ const GroupContentFormItem = ({
31430
31419
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31431
31420
  type: "link",
31432
31421
  onClick: onClickReviewSuccess,
31433
- className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
31422
+ className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && 'primary']),
31434
31423
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31435
31424
  name: "CheckSquare",
31436
31425
  width: 16,
@@ -31447,65 +31436,59 @@ const GroupContentFormItem = ({
31447
31436
  className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
31448
31437
  type: "link",
31449
31438
  onClick: () => {
31439
+ var _input$meta5, _input$meta6;
31450
31440
  const value = getDefaultInputValue(input);
31451
- const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
31441
+ const commentMeta = input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.requiredCommentOnNotApplicable ? {
31452
31442
  comment: ''
31453
31443
  } : {};
31454
- if (input?.meta?.requiredCommentOnNotApplicable) {
31444
+ if (input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.requiredCommentOnNotApplicable) {
31455
31445
  setIsShown(true);
31456
31446
  }
31457
31447
  if (notPartOfTheForm || isAjaxSubGroup) {
31448
+ var _values$meta8;
31458
31449
  const _defaultData = MainForm.getFieldValue(formId);
31459
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31450
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta8 = values.meta) === null || _values$meta8 === void 0 ? void 0 : _values$meta8.inputs) || {})[formId] || {};
31460
31451
  if (isAjaxSubGroup) {
31452
+ var _defaultData$meta11;
31461
31453
  changeInputMeta({
31462
31454
  key: formId,
31463
31455
  type: input.type,
31464
31456
  otherValues: {
31465
- [formId]: {
31466
- ..._defaultData,
31457
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31467
31458
  [inputId]: value,
31468
31459
  meta: {
31469
- inputs: {
31470
- ...(_defaultData?.meta?.inputs || {}),
31471
- [inputId]: inputMeta.notApplicable ? {
31460
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta11 = _defaultData.meta) === null || _defaultData$meta11 === void 0 ? void 0 : _defaultData$meta11.inputs) || {}), {}, {
31461
+ [inputId]: inputMeta.notApplicable ? _objectSpread2({
31472
31462
  notApplicable: false,
31473
- notAvailable: false,
31474
- ...commentMeta
31475
- } : {
31463
+ notAvailable: false
31464
+ }, commentMeta) : _objectSpread2({
31476
31465
  notApplicable: true,
31477
- notAvailable: false,
31478
- ...commentMeta
31479
- }
31480
- }
31466
+ notAvailable: false
31467
+ }, commentMeta)
31468
+ })
31481
31469
  }
31482
- }
31470
+ })
31483
31471
  }
31484
31472
  });
31485
31473
  } else {
31486
31474
  changeInputMeta({
31487
31475
  key: formId,
31488
31476
  type: input.type,
31489
- value: inputMeta.notApplicable ? {
31490
- ..._defaultMeta,
31491
- [inputId]: {
31477
+ value: inputMeta.notApplicable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31478
+ [inputId]: _objectSpread2({
31492
31479
  notApplicable: false,
31493
- notAvailable: false,
31494
- ...commentMeta
31495
- }
31496
- } : {
31497
- ..._defaultMeta,
31498
- [inputId]: {
31480
+ notAvailable: false
31481
+ }, commentMeta)
31482
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31483
+ [inputId]: _objectSpread2({
31499
31484
  notApplicable: true,
31500
- notAvailable: false,
31501
- ...commentMeta
31502
- }
31503
- },
31485
+ notAvailable: false
31486
+ }, commentMeta)
31487
+ }),
31504
31488
  otherValues: {
31505
- [formId]: {
31506
- ..._defaultData,
31489
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31507
31490
  [inputId]: value
31508
- }
31491
+ })
31509
31492
  }
31510
31493
  });
31511
31494
  }
@@ -31526,7 +31509,7 @@ const GroupContentFormItem = ({
31526
31509
  });
31527
31510
  }
31528
31511
  },
31529
- disabled: !input.meta?.notApplicable,
31512
+ disabled: !((_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.notApplicable),
31530
31513
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31531
31514
  name: "NotApplicable",
31532
31515
  width: 16,
@@ -31540,24 +31523,24 @@ const GroupContentFormItem = ({
31540
31523
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31541
31524
  className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
31542
31525
  type: "link",
31543
- disabled: !input.meta?.notAvailable,
31526
+ disabled: !((_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.notAvailable),
31544
31527
  onClick: () => {
31545
31528
  const value = getDefaultInputValue(input);
31546
31529
  if (notPartOfTheForm || isAjaxSubGroup) {
31530
+ var _values$meta9;
31547
31531
  const _defaultData = MainForm.getFieldValue(formId);
31548
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31532
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta9 = values.meta) === null || _values$meta9 === void 0 ? void 0 : _values$meta9.inputs) || {})[formId] || {};
31549
31533
  if (isAjaxSubGroup) {
31550
31534
  if (isAjaxSubGroup) {
31535
+ var _defaultData$meta12;
31551
31536
  changeInputMeta({
31552
31537
  key: formId,
31553
31538
  type: input.type,
31554
31539
  otherValues: {
31555
- [formId]: {
31556
- ..._defaultData,
31540
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31557
31541
  [inputId]: value,
31558
31542
  meta: {
31559
- inputs: {
31560
- ...(_defaultData?.meta?.inputs || {}),
31543
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta12 = _defaultData.meta) === null || _defaultData$meta12 === void 0 ? void 0 : _defaultData$meta12.inputs) || {}), {}, {
31561
31544
  [inputId]: inputMeta.notAvailable ? {
31562
31545
  notApplicable: false,
31563
31546
  notAvailable: false
@@ -31565,9 +31548,9 @@ const GroupContentFormItem = ({
31565
31548
  notApplicable: false,
31566
31549
  notAvailable: true
31567
31550
  }
31568
- }
31551
+ })
31569
31552
  }
31570
- }
31553
+ })
31571
31554
  }
31572
31555
  });
31573
31556
  }
@@ -31575,24 +31558,21 @@ const GroupContentFormItem = ({
31575
31558
  changeInputMeta({
31576
31559
  key: formId,
31577
31560
  type: input.type,
31578
- value: inputMeta.notAvailable ? {
31579
- ..._defaultMeta,
31561
+ value: inputMeta.notAvailable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31580
31562
  [inputId]: {
31581
31563
  notApplicable: false,
31582
31564
  notAvailable: false
31583
31565
  }
31584
- } : {
31585
- ..._defaultMeta,
31566
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31586
31567
  [inputId]: {
31587
31568
  notApplicable: false,
31588
31569
  notAvailable: true
31589
31570
  }
31590
- },
31571
+ }),
31591
31572
  otherValues: {
31592
- [formId]: {
31593
- ..._defaultData,
31573
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31594
31574
  [inputId]: value
31595
- }
31575
+ })
31596
31576
  }
31597
31577
  });
31598
31578
  }
@@ -31623,38 +31603,33 @@ const GroupContentFormItem = ({
31623
31603
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
31624
31604
  title: t('Add comment'),
31625
31605
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31626
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31606
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
31627
31607
  type: "link",
31628
- disabled: !input.meta?.comment,
31629
- ...(!isShown ? {
31630
- className: 'default p-0'
31631
- } : {
31632
- className: 'p-0 primary'
31633
- }),
31608
+ disabled: !((_input$meta9 = input.meta) !== null && _input$meta9 !== void 0 && _input$meta9.comment)
31609
+ }, !isShown ? {
31610
+ className: 'default p-0'
31611
+ } : {
31612
+ className: 'p-0 primary'
31613
+ }), {}, {
31634
31614
  onClick: onClickComment,
31635
31615
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31636
31616
  name: "AddComment",
31637
31617
  width: 16,
31638
31618
  height: 16
31639
31619
  })
31640
- })
31620
+ }))
31641
31621
  })
31642
31622
  })]
31643
31623
  }) : null]
31644
31624
  }) : null
31645
31625
  }),
31646
31626
  children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
31647
- data: {
31648
- ...(values[formId] || {}),
31649
- meta: {
31650
- ...(values?.meta || {}),
31651
- inputs: {
31652
- ...(values?.meta?.inputs || {}),
31653
- ...((values?.meta?.inputs || {})[formId] || {})
31654
- }
31655
- }
31656
- },
31657
- linkingData: values?.linking || values?.parent?.linking,
31627
+ data: _objectSpread2(_objectSpread2({}, values[formId] || {}), {}, {
31628
+ meta: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 ? void 0 : values.meta) || {}), {}, {
31629
+ inputs: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 || (_values$meta10 = values.meta) === null || _values$meta10 === void 0 ? void 0 : _values$meta10.inputs) || {}), ((values === null || values === void 0 || (_values$meta11 = values.meta) === null || _values$meta11 === void 0 ? void 0 : _values$meta11.inputs) || {})[formId] || {})
31630
+ })
31631
+ }),
31632
+ 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),
31658
31633
  name: input.dataId,
31659
31634
  config: input,
31660
31635
  t: t,
@@ -31666,13 +31641,12 @@ const GroupContentFormItem = ({
31666
31641
  getToken: getToken,
31667
31642
  app: app,
31668
31643
  valueOnlyString: true
31669
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
31670
- ...inputData,
31644
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31671
31645
  name: inputId,
31672
31646
  maxWidth,
31673
31647
  staticWidth,
31674
31648
  fullWidth
31675
- }, {
31649
+ }), {
31676
31650
  form: MainForm,
31677
31651
  forms: options,
31678
31652
  allForms: plainForms,
@@ -31690,10 +31664,10 @@ const GroupContentFormItem = ({
31690
31664
  staticWidth,
31691
31665
  fullWidth
31692
31666
  }) : console.log(input)
31693
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31667
+ })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31694
31668
  className: "code",
31695
31669
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31696
- children: input.meta?.code
31670
+ children: (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.code
31697
31671
  })
31698
31672
  }) : null]
31699
31673
  }), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31713,16 +31687,16 @@ const GroupContentFormItem = ({
31713
31687
  className: "max-char-span",
31714
31688
  children: t('max-char', {
31715
31689
  chars: maxRule,
31716
- filled: inputData?.value?.length || 0
31690
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
31717
31691
  })
31718
31692
  })
31719
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31693
+ }) : null, (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31720
31694
  className: "input-content",
31721
31695
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31722
31696
  className: "comment-textarea",
31723
- initialValue: inputMeta?.comment || '',
31697
+ initialValue: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31724
31698
  hidden: !isShown,
31725
- name: `${formId}-${inputId}-comment`,
31699
+ name: "".concat(formId, "-").concat(inputId, "-comment"),
31726
31700
  required: requiredComment,
31727
31701
  rules: requiredComment ? [{
31728
31702
  required: true,
@@ -31739,38 +31713,35 @@ const GroupContentFormItem = ({
31739
31713
  onConfirm: () => {
31740
31714
  setIsShown(false);
31741
31715
  if (notPartOfTheForm) {
31742
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31716
+ var _values$meta12;
31717
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
31743
31718
  const _defaultData = MainForm.getFieldValue(formId);
31744
31719
  if (isAjaxSubGroup) {
31720
+ var _defaultData$meta13, _defaultData$meta14;
31745
31721
  changeInputMeta({
31746
31722
  key: formId,
31747
31723
  type: input.type,
31748
31724
  otherValues: {
31749
- [formId]: {
31750
- ..._defaultData,
31725
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31751
31726
  meta: {
31752
- inputs: {
31753
- ...(_defaultData?.meta?.inputs || {}),
31754
- [inputId]: {
31755
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31727
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta13 = _defaultData.meta) === null || _defaultData$meta13 === void 0 ? void 0 : _defaultData$meta13.inputs) || {}), {}, {
31728
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta14 = _defaultData.meta) === null || _defaultData$meta14 === void 0 ? void 0 : _defaultData$meta14.inputs) || {})[inputId] || {}), {}, {
31756
31729
  comment: null
31757
- }
31758
- }
31730
+ })
31731
+ })
31759
31732
  }
31760
- }
31733
+ })
31761
31734
  }
31762
31735
  });
31763
31736
  } else {
31764
31737
  changeInputMeta({
31765
31738
  key: formId,
31766
31739
  type: input.type,
31767
- value: {
31768
- ..._defaultMeta,
31769
- [inputId]: {
31770
- ...(_defaultMeta[inputId] || {}),
31740
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31741
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31771
31742
  comment: null
31772
- }
31773
- }
31743
+ })
31744
+ })
31774
31745
  });
31775
31746
  }
31776
31747
  } else {
@@ -31785,7 +31756,7 @@ const GroupContentFormItem = ({
31785
31756
  },
31786
31757
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31787
31758
  type: "link",
31788
- disabled: !input.meta?.comment,
31759
+ disabled: !((_input$meta13 = input.meta) !== null && _input$meta13 !== void 0 && _input$meta13.comment),
31789
31760
  className: "p-0",
31790
31761
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
31791
31762
  width: 16,
@@ -31797,44 +31768,41 @@ const GroupContentFormItem = ({
31797
31768
  children: inputTypeComponent$1.comment(inputData, {
31798
31769
  form: MainForm,
31799
31770
  forms: options,
31800
- value: inputMeta?.comment || '',
31771
+ value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31801
31772
  maxWidth,
31802
31773
  staticWidth,
31803
31774
  fullWidth,
31804
31775
  onChange: val => {
31805
31776
  if (notPartOfTheForm) {
31806
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31777
+ var _values$meta13;
31778
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
31807
31779
  const _defaultData = MainForm.getFieldValue(formId);
31808
31780
  if (isAjaxSubGroup) {
31781
+ var _defaultData$meta15, _defaultData$meta16;
31809
31782
  changeInputMeta({
31810
31783
  key: formId,
31811
31784
  type: input.type,
31812
31785
  otherValues: {
31813
- [formId]: {
31814
- ..._defaultData,
31786
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31815
31787
  meta: {
31816
- inputs: {
31817
- ...(_defaultData?.meta?.inputs || {}),
31818
- [inputId]: {
31819
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31788
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta15 = _defaultData.meta) === null || _defaultData$meta15 === void 0 ? void 0 : _defaultData$meta15.inputs) || {}), {}, {
31789
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta16 = _defaultData.meta) === null || _defaultData$meta16 === void 0 ? void 0 : _defaultData$meta16.inputs) || {})[inputId] || {}), {}, {
31820
31790
  comment: val
31821
- }
31822
- }
31791
+ })
31792
+ })
31823
31793
  }
31824
- }
31794
+ })
31825
31795
  }
31826
31796
  });
31827
31797
  } else {
31828
31798
  changeInputMeta({
31829
31799
  key: formId,
31830
31800
  type: input.type,
31831
- value: {
31832
- ..._defaultMeta,
31833
- [inputId]: {
31834
- ...(_defaultMeta[inputId] || {}),
31801
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31802
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31835
31803
  comment: val
31836
- }
31837
- }
31804
+ })
31805
+ })
31838
31806
  });
31839
31807
  }
31840
31808
  } else {
@@ -31855,16 +31823,16 @@ const GroupContentFormItem = ({
31855
31823
  className: "max-char-span",
31856
31824
  children: t('max-char', {
31857
31825
  chars: MAX_COMMENTS_LENGTH,
31858
- filled: inputMeta?.comment?.length || 0
31826
+ filled: (inputMeta === null || inputMeta === void 0 || (_inputMeta$comment = inputMeta.comment) === null || _inputMeta$comment === void 0 ? void 0 : _inputMeta$comment.length) || 0
31859
31827
  })
31860
31828
  })]
31861
- }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31829
+ }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31862
31830
  className: "input-content",
31863
31831
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31864
31832
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31865
31833
  className: "comment-textarea",
31866
- initialValue: lastReview?.comment || '',
31867
- name: `${formId}-${inputId}-reviewErrorComment`,
31834
+ initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31835
+ name: "".concat(formId, "-").concat(inputId, "-reviewErrorComment"),
31868
31836
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
31869
31837
  className: "flex w-100",
31870
31838
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31875,78 +31843,71 @@ const GroupContentFormItem = ({
31875
31843
  children: inputTypeComponent$1.comment(inputData, {
31876
31844
  form: MainForm,
31877
31845
  forms: options,
31878
- value: lastReview?.comment || '',
31846
+ value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31879
31847
  maxWidth,
31880
31848
  staticWidth,
31881
31849
  fullWidth,
31882
31850
  onChange: val => {
31883
31851
  if (notPartOfTheForm) {
31884
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31852
+ var _values$meta14;
31853
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
31885
31854
  const _defaultData = MainForm.getFieldValue(formId);
31886
31855
  if (isAjaxSubGroup) {
31856
+ var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
31887
31857
  changeInputMeta({
31888
31858
  key: formId,
31889
31859
  type: input.type,
31890
31860
  otherValues: {
31891
- [formId]: {
31892
- ..._defaultData,
31861
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31893
31862
  meta: {
31894
- inputs: {
31895
- ...(_defaultData?.meta?.inputs || {}),
31896
- [inputId]: {
31897
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31898
- reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
31863
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta17 = _defaultData.meta) === null || _defaultData$meta17 === void 0 ? void 0 : _defaultData$meta17.inputs) || {}), {}, {
31864
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta18 = _defaultData.meta) === null || _defaultData$meta18 === void 0 ? void 0 : _defaultData$meta18.inputs) || {})[inputId] || {}), {}, {
31865
+ reviews: ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta19 = _defaultData.meta) === null || _defaultData$meta19 === void 0 ? void 0 : _defaultData$meta19.inputs) || {})[inputId] || {}).reviews || []).map(v => {
31899
31866
  if (v.createdAt === lastReview.createdAt) {
31900
- return {
31901
- ...v,
31867
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31902
31868
  comment: val
31903
- };
31869
+ });
31904
31870
  }
31905
31871
  return v;
31906
31872
  })
31907
- }
31908
- }
31873
+ })
31874
+ })
31909
31875
  }
31910
- }
31876
+ })
31911
31877
  }
31912
31878
  });
31913
31879
  } else {
31914
31880
  changeInputMeta({
31915
31881
  key: formId,
31916
31882
  type: input.type,
31917
- value: {
31918
- ..._defaultMeta,
31919
- [inputId]: {
31920
- ...(_defaultMeta[inputId] || {}),
31883
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31884
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31921
31885
  reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
31922
31886
  if (v.createdAt === lastReview.createdAt) {
31923
- return {
31924
- ...v,
31887
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31925
31888
  comment: val
31926
- };
31889
+ });
31927
31890
  }
31928
31891
  return v;
31929
31892
  })
31930
- }
31931
- }
31893
+ })
31894
+ })
31932
31895
  });
31933
31896
  }
31934
31897
  } else {
31935
31898
  changeInputMeta({
31936
31899
  key: inputId,
31937
31900
  type: input.type,
31938
- value: {
31939
- ...inputMeta,
31940
- reviews: (inputMeta?.reviews || []).map(v => {
31901
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31902
+ reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
31941
31903
  if (v.createdAt === lastReview.createdAt) {
31942
- return {
31943
- ...v,
31904
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31944
31905
  comment: val
31945
- };
31906
+ });
31946
31907
  }
31947
31908
  return v;
31948
31909
  })
31949
- }
31910
+ })
31950
31911
  });
31951
31912
  }
31952
31913
  },
@@ -31958,7 +31919,7 @@ const GroupContentFormItem = ({
31958
31919
  className: "max-char-span",
31959
31920
  children: t('max-char', {
31960
31921
  chars: MAX_COMMENTS_LENGTH,
31961
- filled: lastReview.comment?.length || 0
31922
+ filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
31962
31923
  })
31963
31924
  })]
31964
31925
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -31979,7 +31940,7 @@ const GroupContentFormItem = ({
31979
31940
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
31980
31941
  className: "flex flex-column justify-center mr-1",
31981
31942
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31982
- children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31943
+ 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')
31983
31944
  })
31984
31945
  })]
31985
31946
  })]
@@ -35952,13 +35913,11 @@ const beforeUpload = allowedExtensions => file => {
35952
35913
  };
35953
35914
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35954
35915
 
35955
- const _excluded$g = ["placeholder"],
35956
- _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35916
+ /* eslint-disable no-case-declarations */
35957
35917
  dayjs__default["default"].extend(utc);
35958
35918
  dayjs__default["default"].extend(timezone);
35959
35919
  dayjs__default["default"].tz.setDefault("UTC");
35960
- const getDefaultInputValue = function () {
35961
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35920
+ const getDefaultInputValue = (input = {}) => {
35962
35921
  let value = undefined;
35963
35922
  if (input.type === "multiselect") {
35964
35923
  value = [];
@@ -35976,30 +35935,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35976
35935
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35977
35936
  return isShown;
35978
35937
  };
35979
- const renderDataLinkGroup = _ref2 => {
35980
- var _input$meta, _formsValue$meta, _input$meta2;
35981
- let {
35982
- input,
35983
- groupFormId,
35984
- name,
35985
- formsValue,
35986
- form,
35987
- onValuesChange,
35988
- setValues,
35989
- changeLinking,
35990
- isHighlighted
35991
- } = _ref2;
35992
- const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35993
- var _input$inputs$k;
35994
- 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";
35995
- });
35996
- const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35997
- const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35998
- all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35938
+ const renderDataLinkGroup = ({
35939
+ input,
35940
+ groupFormId,
35941
+ name,
35942
+ formsValue,
35943
+ form,
35944
+ onValuesChange,
35945
+ setValues,
35946
+ changeLinking,
35947
+ isHighlighted
35948
+ }) => {
35949
+ const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35950
+ const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35951
+ const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35952
+ all[key] = input?.inputs[key];
35999
35953
  return all;
36000
35954
  }, {});
36001
- const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
36002
- 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));
35955
+ const isSingle = input?.meta?.maxRepeat === 1;
35956
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35957
+ ...(formsValue[groupFormId] || {})[name]
35958
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35959
+ ...v
35960
+ })) : isSingle ? formsValue[name] ? [{
35961
+ ...formsValue[name]
35962
+ }] : [] : getArray(formsValue[name] || []).map(v => ({
35963
+ ...v
35964
+ }));
36003
35965
  const onUpdate = (val, i) => {
36004
35966
  const _val = isSingle ? {
36005
35967
  [name]: val
@@ -36007,20 +35969,31 @@ const renderDataLinkGroup = _ref2 => {
36007
35969
  [name]: formData.map((d, j) => i === j ? val : d)
36008
35970
  };
36009
35971
  if (groupFormId) {
36010
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36011
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36012
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35972
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
35973
+ const _newData = {
35974
+ ..._defaultData,
35975
+ ..._val
35976
+ };
35977
+ onValuesChange(_newData, {
35978
+ ...formsValue,
36013
35979
  [groupFormId]: _newData
36014
- }));
36015
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36016
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35980
+ });
35981
+ form?.setFieldValue(groupFormId, _newData);
35982
+ setValues({
35983
+ ...formsValue,
36017
35984
  [groupFormId]: _newData
36018
- }));
35985
+ });
36019
35986
  return;
36020
35987
  }
36021
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36022
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36023
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
35988
+ onValuesChange(_val, {
35989
+ ...formsValue,
35990
+ ..._val
35991
+ });
35992
+ form?.setFieldValue(name, _val[name]);
35993
+ setValues({
35994
+ ...formsValue,
35995
+ ..._val
35996
+ });
36024
35997
  };
36025
35998
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
36026
35999
  form: input,
@@ -36031,79 +36004,102 @@ const renderDataLinkGroup = _ref2 => {
36031
36004
  isHighlighted: isHighlighted,
36032
36005
  dataLinkInput: dataLinkInput,
36033
36006
  formsValue: formsValue,
36034
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36007
+ values: groupFormId ? {
36008
+ ...(formsValue[groupFormId] || {}),
36035
36009
  meta: {
36036
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
36010
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36037
36011
  }
36038
- }) : formsValue,
36012
+ } : formsValue,
36039
36013
  name: name,
36040
36014
  groupFormId: groupFormId,
36041
- maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
36042
- remove: _ref3 => {
36043
- let {
36044
- key
36045
- } = _ref3;
36015
+ maxRepeat: input?.meta?.maxRepeat,
36016
+ remove: ({
36017
+ key
36018
+ }) => {
36046
36019
  const _val = isSingle ? {
36047
36020
  [name]: null
36048
36021
  } : {
36049
36022
  [name]: formData.filter((v, j) => j !== key)
36050
36023
  };
36051
36024
  if (groupFormId) {
36052
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36053
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36054
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36025
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36026
+ const _newData = {
36027
+ ..._defaultData,
36028
+ ..._val
36029
+ };
36030
+ onValuesChange(_newData, {
36031
+ ...formsValue,
36055
36032
  [groupFormId]: _newData
36056
- }));
36057
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36058
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36033
+ });
36034
+ form?.setFieldValue(groupFormId, _newData);
36035
+ setValues({
36036
+ ...formsValue,
36059
36037
  [groupFormId]: _newData
36060
- }));
36038
+ });
36061
36039
  return;
36062
36040
  }
36063
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36064
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36065
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36041
+ onValuesChange(_val, {
36042
+ ...formsValue,
36043
+ ..._val
36044
+ });
36045
+ form?.setFieldValue(name, _val[name]);
36046
+ setValues({
36047
+ ...formsValue,
36048
+ ..._val
36049
+ });
36066
36050
  },
36067
36051
  add: val => {
36068
36052
  const _val = isSingle ? {
36069
36053
  [name]: val
36070
36054
  } : {
36071
- [name]: [...formData, _objectSpread2({}, val)]
36055
+ [name]: [...formData, {
36056
+ ...val
36057
+ }]
36072
36058
  };
36073
36059
  if (groupFormId) {
36074
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36075
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36076
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36077
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36060
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36061
+ const _newData = {
36062
+ ..._defaultData,
36063
+ ..._val
36064
+ };
36065
+ form?.setFieldValue(groupFormId, _newData);
36066
+ onValuesChange(_newData, {
36067
+ ...formsValue,
36078
36068
  [groupFormId]: _newData
36079
- }));
36080
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36069
+ });
36070
+ setValues({
36071
+ ...formsValue,
36081
36072
  [groupFormId]: _newData
36082
- }));
36073
+ });
36083
36074
  return;
36084
36075
  }
36085
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36086
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36087
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36076
+ form?.setFieldValue(name, _val[name]);
36077
+ onValuesChange(_val, {
36078
+ ...formsValue,
36079
+ ..._val
36080
+ });
36081
+ setValues({
36082
+ ...formsValue,
36083
+ ..._val
36084
+ });
36088
36085
  },
36089
36086
  k: name,
36090
36087
  formData: formData
36091
36088
  });
36092
36089
  };
36093
36090
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
36094
- var _input$meta3, _data$meta;
36095
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
36091
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
36096
36092
  return false;
36097
36093
  }
36098
- if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
36099
- var _input$meta4;
36100
- return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
36094
+ if (typeof input?.meta?.excludeFromEdit === "boolean") {
36095
+ return !input?.meta?.excludeFromEdit;
36101
36096
  }
36102
- const formsValue = _objectSpread2({}, data);
36103
- Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
36104
- var _data$meta2;
36105
- const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
36106
- if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
36097
+ const formsValue = {
36098
+ ...data
36099
+ };
36100
+ Object.keys(data?.meta?.inputs || {}).forEach(key => {
36101
+ const input = data?.meta?.inputs[key];
36102
+ if (input?.notApplicable || input?.notAvailable) {
36107
36103
  formsValue[key] = undefined;
36108
36104
  delete formsValue[key];
36109
36105
  }
@@ -36162,35 +36158,35 @@ function getInputHeadLines$1(type, i, input, values) {
36162
36158
  switch (type) {
36163
36159
  case "h2":
36164
36160
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36165
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36161
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36166
36162
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36167
36163
  children: getInputLabel$1(input, values)
36168
36164
  })
36169
36165
  });
36170
36166
  case "h3":
36171
36167
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36172
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36168
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36173
36169
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36174
36170
  children: getInputLabel$1(input, values)
36175
36171
  })
36176
36172
  });
36177
36173
  case "h4":
36178
36174
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36179
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36175
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36180
36176
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36181
36177
  children: getInputLabel$1(input, values)
36182
36178
  })
36183
36179
  });
36184
36180
  case "h5":
36185
36181
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36186
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36182
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36187
36183
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36188
36184
  children: getInputLabel$1(input, values)
36189
36185
  })
36190
36186
  });
36191
36187
  case "h6":
36192
36188
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36193
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36189
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36194
36190
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36195
36191
  children: getInputLabel$1(input, values)
36196
36192
  })
@@ -36199,16 +36195,15 @@ function getInputHeadLines$1(type, i, input, values) {
36199
36195
  return null;
36200
36196
  }
36201
36197
  }
36202
- function getInputProp(prop) {
36203
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36204
- let scope = arguments.length > 2 ? arguments[2] : undefined;
36198
+ function getInputProp(prop, formsValue = {}, scope) {
36205
36199
  if (prop && typeof prop === "object") {
36206
36200
  const validations = Object.keys(prop);
36207
36201
  const key = validations.find(v => {
36208
36202
  let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
36209
- const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36203
+ const value = dot__default["default"].pick(path, {
36204
+ ...formsValue,
36210
36205
  scope
36211
- }));
36206
+ });
36212
36207
  return _checkValue(wantedValue, match, value);
36213
36208
  });
36214
36209
  const label = key ? prop[key] : prop[validations[0]];
@@ -36217,33 +36212,29 @@ function getInputProp(prop) {
36217
36212
  return prop;
36218
36213
  }
36219
36214
  }
36220
- function getInputLabel$1(input) {
36221
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36222
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
36215
+ function getInputLabel$1(input, formsValue = {}, asText = false) {
36223
36216
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
36224
36217
  input: input,
36225
36218
  formsValue: formsValue,
36226
36219
  asText: asText
36227
36220
  });
36228
36221
  }
36229
- const InputLabel = _ref4 => {
36230
- var _input$meta5, _input$meta6, _input$meta7;
36231
- let {
36232
- input,
36233
- formsValue,
36234
- asText
36235
- } = _ref4;
36222
+ const InputLabel = ({
36223
+ input,
36224
+ formsValue,
36225
+ asText
36226
+ }) => {
36236
36227
  const {
36237
36228
  t,
36238
36229
  evaluationConfig,
36239
36230
  scope
36240
36231
  } = useEditContext();
36241
36232
  const label = getInputProp(input.label, formsValue, scope);
36242
- 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, {
36233
+ return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36243
36234
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
36244
36235
  className: "flex",
36245
36236
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
36246
- content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36237
+ content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36247
36238
  t: t,
36248
36239
  evaluationConfig: evaluationConfig
36249
36240
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36251,7 +36242,7 @@ const InputLabel = _ref4 => {
36251
36242
  children: ReactHtmlParser__default["default"](input.description)
36252
36243
  }),
36253
36244
  placement: "top",
36254
- 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", {
36245
+ children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36255
36246
  className: "flex flex-column justify-content-center ml-1",
36256
36247
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
36257
36248
  fontSize: 13
@@ -36273,9 +36264,7 @@ function getSectionLabel$1(labels, values) {
36273
36264
  }
36274
36265
  return labels;
36275
36266
  }
36276
- function getSubtitles$1(subtitles, position) {
36277
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36278
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36267
+ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
36279
36268
  let subtitle = subtitles && subtitles[position];
36280
36269
  if (subtitle && typeof subtitle === "object") {
36281
36270
  let newSubtitle = subtitle.default || "";
@@ -36319,12 +36308,14 @@ function getSubtitles$1(subtitles, position) {
36319
36308
  function getFormTitles$1(titles, key, position) {
36320
36309
  let tilte = titles && titles[key];
36321
36310
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
36322
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36311
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
36323
36312
  children: tilte
36324
36313
  }) : null;
36325
36314
  }
36326
36315
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
36327
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36316
+ formsValue = Object.assign(formsValue, {
36317
+ ...mainForm.getFieldsValue(true)
36318
+ });
36328
36319
  if (typeof repeatIndex === "number" && repeatValues) {
36329
36320
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
36330
36321
  repeatValues[inputName] = value;
@@ -36359,16 +36350,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
36359
36350
  };
36360
36351
  const inputOnBlur = [];
36361
36352
  const inputTypeComponent$1 = {
36362
- text: (_ref5, _ref6) => {
36363
- let {
36364
- props,
36365
- rules
36366
- } = _ref5;
36367
- let {
36368
- inputMeta = {},
36369
- t,
36370
- isHighlighted
36371
- } = _ref6;
36353
+ text: ({
36354
+ props,
36355
+ rules
36356
+ }, {
36357
+ inputMeta = {},
36358
+ t,
36359
+ isHighlighted
36360
+ }) => {
36372
36361
  const maxRule = rules.find(r => r.max);
36373
36362
  const maxProps = {
36374
36363
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36376,28 +36365,26 @@ const inputTypeComponent$1 = {
36376
36365
  if (maxRule) {
36377
36366
  maxProps.maxLength = maxRule.max;
36378
36367
  }
36379
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36380
- size: "large"
36381
- }, maxProps), {}, {
36368
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36369
+ size: "large",
36370
+ ...maxProps,
36382
36371
  allowClear: true,
36383
36372
  autoComplete: "new-password",
36384
- type: "text"
36385
- }, props), {}, {
36373
+ type: "text",
36374
+ ...props,
36386
36375
  className: formatClassname([isHighlighted && "highlighted-input"]),
36387
36376
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36388
36377
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36389
- }));
36378
+ });
36390
36379
  },
36391
- link: (_ref7, _ref8) => {
36392
- let {
36393
- props,
36394
- rules
36395
- } = _ref7;
36396
- let {
36397
- inputMeta = {},
36398
- t,
36399
- isHighlighted
36400
- } = _ref8;
36380
+ link: ({
36381
+ props,
36382
+ rules
36383
+ }, {
36384
+ inputMeta = {},
36385
+ t,
36386
+ isHighlighted
36387
+ }) => {
36401
36388
  const maxRule = rules.find(r => r.max);
36402
36389
  const maxProps = {
36403
36390
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36405,32 +36392,29 @@ const inputTypeComponent$1 = {
36405
36392
  if (maxRule) {
36406
36393
  maxProps.maxLength = maxRule.max;
36407
36394
  }
36408
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36409
- size: "large"
36410
- }, maxProps), {}, {
36395
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36396
+ size: "large",
36397
+ ...maxProps,
36411
36398
  allowClear: true,
36412
36399
  autoComplete: "new-password",
36413
- type: "text"
36414
- }, props), {}, {
36400
+ type: "text",
36401
+ ...props,
36415
36402
  className: formatClassname([isHighlighted && "highlighted-input"]),
36416
36403
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36417
36404
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36418
- }));
36405
+ });
36419
36406
  },
36420
- number: (_ref9, _ref10) => {
36421
- var _input$meta8;
36422
- let {
36423
- props,
36424
- rules,
36425
- input
36426
- } = _ref9;
36427
- let {
36428
- inputMeta = {},
36429
- t,
36430
- isHighlighted
36431
- } = _ref10;
36407
+ number: ({
36408
+ props,
36409
+ rules,
36410
+ input
36411
+ }, {
36412
+ inputMeta = {},
36413
+ t,
36414
+ isHighlighted
36415
+ }) => {
36432
36416
  const maxRule = rules.find(r => r.max);
36433
- const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36417
+ const integerRule = !input?.meta?.isDecimal;
36434
36418
  const parser = value => {
36435
36419
  if (!value) {
36436
36420
  return "";
@@ -36441,63 +36425,60 @@ const inputTypeComponent$1 = {
36441
36425
  return value.replace(/\$\s?|(,*)/g, "");
36442
36426
  };
36443
36427
  if (maxRule) {
36444
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36428
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36445
36429
  size: "large",
36446
36430
  allowClear: true,
36447
- autoComplete: "new-password"
36448
- }, props), {}, {
36431
+ autoComplete: "new-password",
36432
+ ...props,
36449
36433
  type: "number",
36450
36434
  parser: parser,
36451
36435
  min: 0,
36452
36436
  max: maxRule.max,
36453
36437
  className: formatClassname([isHighlighted && "highlighted-input"])
36454
- }));
36438
+ });
36455
36439
  }
36456
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36440
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36457
36441
  size: "large",
36458
36442
  allowClear: true,
36459
36443
  className: formatClassname([isHighlighted && "highlighted-input"]),
36460
- autoComplete: "new-password"
36461
- }, props), {}, {
36444
+ autoComplete: "new-password",
36445
+ ...props,
36462
36446
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36463
36447
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36464
36448
  min: 0,
36465
36449
  formatter: value => numberWithCommas$1(value),
36466
36450
  parser: parser
36467
- }));
36451
+ });
36468
36452
  },
36469
36453
  // eslint-disable-next-line no-unused-vars
36470
- select: (_ref11, _ref12) => {
36471
- var _input$meta9, _input$meta10;
36472
- let {
36473
- value,
36474
- options,
36475
- optionGroup,
36476
- props,
36477
- formsValue,
36478
- optionsFilter,
36479
- filterCond,
36480
- repeatValues,
36481
- repeatIndex,
36482
- name,
36483
- inputName,
36484
- address,
36485
- addressData,
36486
- input,
36487
- scope
36488
- } = _ref11;
36489
- let {
36490
- forms,
36491
- form,
36492
- setAddress,
36493
- inputMeta = {},
36494
- t,
36495
- isHighlighted,
36496
- changeInputMeta,
36497
- groupFormId
36498
- } = _ref12;
36454
+ select: ({
36455
+ value,
36456
+ options,
36457
+ optionGroup,
36458
+ props,
36459
+ formsValue,
36460
+ optionsFilter,
36461
+ filterCond,
36462
+ repeatValues,
36463
+ repeatIndex,
36464
+ name,
36465
+ inputName,
36466
+ address,
36467
+ addressData,
36468
+ input,
36469
+ scope
36470
+ }, {
36471
+ forms,
36472
+ form,
36473
+ setAddress,
36474
+ inputMeta = {},
36475
+ t,
36476
+ isHighlighted,
36477
+ changeInputMeta,
36478
+ groupFormId
36479
+ }) => {
36499
36480
  let opts;
36500
- const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36481
+ const isEvaluation = input?.meta?.isEvaluation;
36501
36482
  let defaultValue = value;
36502
36483
  if (typeof options === "string") {
36503
36484
  const [formName, key] = options.split(".");
@@ -36522,7 +36503,7 @@ const inputTypeComponent$1 = {
36522
36503
  opts = [];
36523
36504
  }
36524
36505
  } else {
36525
- opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36506
+ opts = options?.filter(o => !o.onlyView);
36526
36507
  }
36527
36508
  opts = JSON.parse(JSON.stringify(opts || []));
36528
36509
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36532,7 +36513,7 @@ const inputTypeComponent$1 = {
36532
36513
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36533
36514
 
36534
36515
  // Handle default value logic
36535
- 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)) {
36516
+ if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36536
36517
  // If no current value but there's a default value, use the default
36537
36518
  value = input.meta.defaultValue;
36538
36519
  defaultValue = value;
@@ -36565,7 +36546,7 @@ const inputTypeComponent$1 = {
36565
36546
  }
36566
36547
  opts = groupOptions;
36567
36548
  }
36568
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36549
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36569
36550
  size: "large",
36570
36551
  autoComplete: "new-password",
36571
36552
  allowClear: true,
@@ -36574,32 +36555,35 @@ const inputTypeComponent$1 = {
36574
36555
  value: value // Use value instead of defaultValue for controlled behavior
36575
36556
  ,
36576
36557
  filterOption: filterSelectOptions,
36577
- optionFilterProp: "children"
36578
- }, props), {}, {
36558
+ optionFilterProp: "children",
36559
+ ...props,
36579
36560
  className: formatClassname([isHighlighted && "highlighted-select"]),
36580
36561
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36581
36562
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36582
36563
  onChange: (val, selectedValue) => {
36583
36564
  // ONLY FOR SBG EVALUATON !!
36584
36565
  if (isEvaluation && val === "na" && groupFormId) {
36585
- var _formsValue$meta2;
36586
36566
  changeInputMeta({
36587
36567
  key: groupFormId,
36588
- 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]) || {}), {}, {
36568
+ value: {
36569
+ ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36589
36570
  documentation: {
36590
36571
  notApplicable: true
36591
36572
  }
36592
- }),
36573
+ },
36593
36574
  otherValues: {
36594
- [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36575
+ [groupFormId]: {
36576
+ ...(formsValue?.[groupFormId] || {}),
36595
36577
  [name]: val
36596
- })
36578
+ }
36597
36579
  }
36598
36580
  });
36599
36581
  }
36600
36582
  if (address && selectedValue) {
36601
36583
  dot__default["default"].str(address, selectedValue.children, addressData);
36602
- setAddress(_objectSpread2({}, addressData));
36584
+ setAddress({
36585
+ ...addressData
36586
+ });
36603
36587
  }
36604
36588
  if (props.onChange) {
36605
36589
  props.onChange(val);
@@ -36630,15 +36614,15 @@ const inputTypeComponent$1 = {
36630
36614
  if (og.disabled !== undefined) {
36631
36615
  groupOtherProps.disabled = og.disabled;
36632
36616
  }
36633
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36634
- value: og.value
36635
- }, groupOtherProps), {}, {
36617
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36618
+ value: og.value,
36619
+ ...groupOtherProps,
36636
36620
  children: og.label
36637
- }), "".concat(i).concat(j));
36621
+ }, `${i}${j}`);
36638
36622
  })
36639
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36640
- value: option.value
36641
- }, otherProps), {}, {
36623
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36624
+ value: option.value,
36625
+ ...otherProps,
36642
36626
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36643
36627
  className: "flex",
36644
36628
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36646,35 +36630,33 @@ const inputTypeComponent$1 = {
36646
36630
  children: sgbEvaluationIcons[option.value]
36647
36631
  }), option.label]
36648
36632
  }) : option.label
36649
- }), option.value);
36633
+ }, option.value);
36650
36634
  })
36651
- }));
36635
+ });
36652
36636
  },
36653
- multiselect: (_ref13, _ref14) => {
36654
- let {
36655
- value,
36656
- options,
36657
- optionGroup,
36658
- optionsFilter,
36659
- filterCond,
36660
- props,
36661
- formsValue,
36662
- repeatValues,
36663
- repeatIndex,
36664
- inputName,
36665
- name,
36666
- tags,
36667
- maxWidth,
36668
- staticWidth,
36669
- fullWidth
36670
- } = _ref13;
36671
- let {
36672
- forms,
36673
- form,
36674
- inputMeta = {},
36675
- t,
36676
- isHighlighted
36677
- } = _ref14;
36637
+ multiselect: ({
36638
+ value,
36639
+ options,
36640
+ optionGroup,
36641
+ optionsFilter,
36642
+ filterCond,
36643
+ props,
36644
+ formsValue,
36645
+ repeatValues,
36646
+ repeatIndex,
36647
+ inputName,
36648
+ name,
36649
+ tags,
36650
+ maxWidth,
36651
+ staticWidth,
36652
+ fullWidth
36653
+ }, {
36654
+ forms,
36655
+ form,
36656
+ inputMeta = {},
36657
+ t,
36658
+ isHighlighted
36659
+ }) => {
36678
36660
  let opts;
36679
36661
  if (typeof options === "string") {
36680
36662
  const [formName, key] = options.split(".");
@@ -36736,17 +36718,17 @@ const inputTypeComponent$1 = {
36736
36718
  staticWidth,
36737
36719
  fullWidth
36738
36720
  });
36739
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36721
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36740
36722
  size: "medium",
36741
36723
  allowClear: true,
36742
36724
  autoComplete: "new-password",
36743
36725
  mode: tags ? "tags" : "multiple",
36744
- optionFilterProp: "children"
36745
- }, tags ? {
36746
- tokenSeparators: [","]
36747
- } : {}), {}, {
36748
- filterOption: filterSelectOptions
36749
- }, props), {}, {
36726
+ optionFilterProp: "children",
36727
+ ...(tags ? {
36728
+ tokenSeparators: [","]
36729
+ } : {}),
36730
+ filterOption: filterSelectOptions,
36731
+ ...props,
36750
36732
  className: formatClassname([isHighlighted && "highlighted-select"]),
36751
36733
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36752
36734
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
@@ -36785,52 +36767,51 @@ const inputTypeComponent$1 = {
36785
36767
  if (og.disabled !== undefined) {
36786
36768
  groupOtherProps.disabled = og.disabled;
36787
36769
  }
36788
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36789
- value: og.value
36790
- }, groupOtherProps), {}, {
36770
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36771
+ value: og.value,
36772
+ ...groupOtherProps,
36791
36773
  children: og.label
36792
- }), "".concat(i).concat(j));
36774
+ }, `${i}${j}`);
36793
36775
  })
36794
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36795
- value: option.value
36796
- }, otherProps), {}, {
36776
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36777
+ value: option.value,
36778
+ ...otherProps,
36797
36779
  children: option.label
36798
- }), i);
36780
+ }, i);
36799
36781
  })
36800
- }));
36782
+ });
36801
36783
  },
36802
- date: (_ref15, _ref16) => {
36803
- var _formsValue$groupForm, _value2;
36804
- let {
36805
- props,
36806
- rules,
36807
- repeatValues,
36808
- formsValue,
36809
- name
36810
- } = _ref15;
36811
- let {
36812
- setFormValues,
36813
- inputMeta,
36814
- form,
36815
- t,
36816
- isHighlighted,
36817
- groupFormId
36818
- } = _ref16;
36784
+ date: ({
36785
+ props,
36786
+ rules,
36787
+ repeatValues,
36788
+ formsValue,
36789
+ name
36790
+ }, {
36791
+ setFormValues,
36792
+ inputMeta,
36793
+ form,
36794
+ t,
36795
+ isHighlighted,
36796
+ groupFormId
36797
+ }) => {
36819
36798
  const lng = localStorage.getItem("datastakeLng") || "en";
36820
36799
  const maxRule = rules.find(r => r.max);
36821
- let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36800
+ let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36822
36801
  const handleDateChange = date => {
36823
36802
  if (date) {
36824
36803
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36825
36804
  const localDate = dayjs__default["default"].utc(date);
36826
36805
  if (groupFormId) {
36827
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36806
+ const _new = {
36807
+ ...(formsValue[groupFormId] || {}),
36828
36808
  [name]: localDate
36829
- });
36809
+ };
36830
36810
  form.setFieldValue(groupFormId, _new);
36831
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36811
+ setFormValues({
36812
+ ...formsValue,
36832
36813
  [groupFormId]: _new
36833
- }));
36814
+ });
36834
36815
  } else {
36835
36816
  form.setFieldValue(name, localDate);
36836
36817
  }
@@ -36839,13 +36820,15 @@ const inputTypeComponent$1 = {
36839
36820
  if (groupFormId) {
36840
36821
  if (typeof value === "string" || typeof value === "undefined") {
36841
36822
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36842
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36823
+ const _new = {
36824
+ ...(formsValue[groupFormId] || {}),
36843
36825
  [name]: value
36844
- });
36826
+ };
36845
36827
  form.setFieldValue(groupFormId, _new);
36846
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36828
+ setFormValues({
36829
+ ...formsValue,
36847
36830
  [groupFormId]: _new
36848
- }));
36831
+ });
36849
36832
  }
36850
36833
  } else {
36851
36834
  if (typeof value === "string") {
@@ -36861,13 +36844,12 @@ const inputTypeComponent$1 = {
36861
36844
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36862
36845
  }
36863
36846
  if (checkForMax) {
36864
- var _value;
36865
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36847
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36866
36848
  size: "large",
36867
36849
  allowClear: true,
36868
- autoComplete: "new-password"
36869
- }, props), {}, {
36870
- value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36850
+ autoComplete: "new-password",
36851
+ ...props,
36852
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36871
36853
  onChange: handleDateChange,
36872
36854
  className: formatClassname([isHighlighted && "highlighted-input"]),
36873
36855
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36877,54 +36859,49 @@ const inputTypeComponent$1 = {
36877
36859
  disabledDate: current => {
36878
36860
  return current && current >= dayjs__default["default"]().endOf("day");
36879
36861
  }
36880
- }));
36862
+ });
36881
36863
  }
36882
36864
  }
36883
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36865
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36884
36866
  size: "large",
36885
36867
  allowClear: true,
36886
- autoComplete: "new-password"
36887
- }, props), {}, {
36888
- value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36868
+ autoComplete: "new-password",
36869
+ ...props,
36870
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36889
36871
  onChange: handleDateChange,
36890
36872
  className: formatClassname([isHighlighted && "highlighted-input"]),
36891
36873
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36892
36874
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36893
36875
  format: DATE_FORMATS,
36894
36876
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36895
- }));
36877
+ });
36896
36878
  },
36897
- groupExpandable: (_ref17, _ref18) => {
36898
- var _formsValue$groupForm2;
36899
- let {
36900
- formsValue,
36901
- name,
36902
- input
36903
- } = _ref17;
36904
- let {
36905
- groupFormId
36906
- } = _ref18;
36907
- 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];
36879
+ groupExpandable: ({
36880
+ formsValue,
36881
+ name,
36882
+ input
36883
+ }, {
36884
+ groupFormId
36885
+ }) => {
36886
+ const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36908
36887
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36909
36888
  input: input,
36910
36889
  formsValue: formsValue,
36911
36890
  data: data
36912
36891
  });
36913
36892
  },
36914
- comment: (_ref19, _ref20) => {
36915
- let {
36916
- props: {
36917
- placeholder
36918
- },
36919
- commentHint
36920
- } = _ref19,
36921
- props = _objectWithoutProperties(_ref19.props, _excluded$g);
36922
- let {
36923
- onChange,
36924
- value,
36925
- isHighlighted
36926
- } = _ref20;
36927
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36893
+ comment: ({
36894
+ props: {
36895
+ placeholder,
36896
+ ...props
36897
+ },
36898
+ commentHint
36899
+ }, {
36900
+ onChange,
36901
+ value,
36902
+ isHighlighted
36903
+ }) => {
36904
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36928
36905
  allowClear: true,
36929
36906
  value: value,
36930
36907
  onChange: e => onChange(e.target.value),
@@ -36935,27 +36912,26 @@ const inputTypeComponent$1 = {
36935
36912
  autoSize: {
36936
36913
  minRows: 5,
36937
36914
  maxRows: 5
36938
- }
36939
- }, props), {}, {
36915
+ },
36916
+ ...props,
36940
36917
  disabled: false
36941
- }));
36918
+ });
36942
36919
  },
36943
- tableComment: (_ref21, _ref22) => {
36944
- var _formsValue$meta3;
36945
- let {
36946
- setValues,
36947
- name,
36948
- onValuesChange,
36949
- formsValue
36950
- } = _ref21;
36951
- let {
36952
- form,
36953
- groupFormId,
36954
- isHighlighted
36955
- } = _ref22;
36956
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36920
+ tableComment: ({
36921
+ setValues,
36922
+ name,
36923
+ onValuesChange,
36924
+ formsValue
36925
+ }, {
36926
+ form,
36927
+ groupFormId,
36928
+ isHighlighted
36929
+ }) => {
36930
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36931
+ ...v,
36957
36932
  key: i
36958
- })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36933
+ })) : (formsValue[name] || []).map((v, i) => ({
36934
+ ...v,
36959
36935
  key: i
36960
36936
  }));
36961
36937
  const onUpdate = (val, i) => {
@@ -36963,89 +36939,121 @@ const inputTypeComponent$1 = {
36963
36939
  [name]: formData.map((d, j) => i === j ? val : d)
36964
36940
  };
36965
36941
  if (groupFormId) {
36966
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36967
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36968
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36942
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36943
+ const _newData = {
36944
+ ..._defaultData,
36945
+ ..._val
36946
+ };
36947
+ onValuesChange(_newData, {
36948
+ ...formsValue,
36969
36949
  [groupFormId]: _newData
36970
- }));
36971
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36972
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36950
+ });
36951
+ form?.setFieldValue(groupFormId, _newData);
36952
+ setValues({
36953
+ ...formsValue,
36973
36954
  [groupFormId]: _newData
36974
- }));
36955
+ });
36975
36956
  return;
36976
36957
  }
36977
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36978
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36979
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36958
+ onValuesChange(_val, {
36959
+ ...formsValue,
36960
+ ..._val
36961
+ });
36962
+ form?.setFieldValue(name, _val[name]);
36963
+ setValues({
36964
+ ...formsValue,
36965
+ ..._val
36966
+ });
36980
36967
  };
36981
36968
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36982
36969
  onUpdate: onUpdate,
36983
36970
  isHighlighted: isHighlighted,
36984
36971
  form: form,
36985
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36972
+ values: groupFormId ? {
36973
+ ...(formsValue[groupFormId] || {}),
36986
36974
  meta: {
36987
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
36975
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36988
36976
  }
36989
- }) : formsValue,
36977
+ } : formsValue,
36990
36978
  name: name,
36991
- remove: _ref23 => {
36992
- let {
36993
- key
36994
- } = _ref23;
36979
+ remove: ({
36980
+ key
36981
+ }) => {
36995
36982
  const _val = {
36996
36983
  [name]: formData.filter(v => v.key !== key)
36997
36984
  };
36998
36985
  if (groupFormId) {
36999
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37000
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37001
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36986
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36987
+ const _newData = {
36988
+ ..._defaultData,
36989
+ ..._val
36990
+ };
36991
+ onValuesChange(_newData, {
36992
+ ...formsValue,
37002
36993
  [groupFormId]: _newData
37003
- }));
37004
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37005
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36994
+ });
36995
+ form?.setFieldValue(groupFormId, _newData);
36996
+ setValues({
36997
+ ...formsValue,
37006
36998
  [groupFormId]: _newData
37007
- }));
36999
+ });
37008
37000
  return;
37009
37001
  }
37010
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37011
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37012
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37002
+ onValuesChange(_val, {
37003
+ ...formsValue,
37004
+ ..._val
37005
+ });
37006
+ form?.setFieldValue(name, _val[name]);
37007
+ setValues({
37008
+ ...formsValue,
37009
+ ..._val
37010
+ });
37013
37011
  },
37014
37012
  add: val => {
37015
37013
  const _val = {
37016
- [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
37014
+ [name]: [...formData, {
37015
+ ...val,
37017
37016
  key: formData.length
37018
- })]
37017
+ }]
37019
37018
  };
37020
37019
  if (groupFormId) {
37021
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37022
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37023
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37024
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37020
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37021
+ const _newData = {
37022
+ ..._defaultData,
37023
+ ..._val
37024
+ };
37025
+ form?.setFieldValue(groupFormId, _newData);
37026
+ onValuesChange(_newData, {
37027
+ ...formsValue,
37025
37028
  [groupFormId]: _newData
37026
- }));
37027
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37029
+ });
37030
+ setValues({
37031
+ ...formsValue,
37028
37032
  [groupFormId]: _newData
37029
- }));
37033
+ });
37030
37034
  return;
37031
37035
  }
37032
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37033
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37034
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37036
+ form?.setFieldValue(name, _val[name]);
37037
+ onValuesChange(_val, {
37038
+ ...formsValue,
37039
+ ..._val
37040
+ });
37041
+ setValues({
37042
+ ...formsValue,
37043
+ ..._val
37044
+ });
37035
37045
  },
37036
37046
  k: name
37037
37047
  });
37038
37048
  },
37039
- textarea: (_ref24, _ref25) => {
37040
- let {
37041
- props,
37042
- rules
37043
- } = _ref24;
37044
- let {
37045
- inputMeta,
37046
- t,
37047
- isHighlighted
37048
- } = _ref25;
37049
+ textarea: ({
37050
+ props,
37051
+ rules
37052
+ }, {
37053
+ inputMeta,
37054
+ t,
37055
+ isHighlighted
37056
+ }) => {
37049
37057
  const maxRule = rules.find(r => r.max);
37050
37058
  let maxLength = MAX_TEXT_AREA_LENGTH;
37051
37059
  let rows = 5;
@@ -37072,7 +37080,7 @@ const inputTypeComponent$1 = {
37072
37080
  // rows = 14;
37073
37081
  // }
37074
37082
  }
37075
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
37083
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
37076
37084
  allowClear: true,
37077
37085
  autoComplete: "new-password",
37078
37086
  maxLength: maxLength,
@@ -37080,37 +37088,35 @@ const inputTypeComponent$1 = {
37080
37088
  autoSize: {
37081
37089
  minRows: rows,
37082
37090
  maxRows: rows
37083
- }
37084
- }, props), {}, {
37091
+ },
37092
+ ...props,
37085
37093
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37086
37094
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
37087
- }));
37095
+ });
37088
37096
  },
37089
- phoneNumber: (_ref26, _ref27) => {
37090
- let {
37091
- name,
37092
- inputName,
37093
- props,
37094
- value,
37095
- repeatIndex,
37096
- repeatValues,
37097
- formsValue
37098
- } = _ref26;
37099
- let {
37100
- setFormValues,
37101
- inputMeta,
37102
- t,
37103
- isHighlighted
37104
- } = _ref27;
37105
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
37097
+ phoneNumber: ({
37098
+ name,
37099
+ inputName,
37100
+ props,
37101
+ value,
37102
+ repeatIndex,
37103
+ repeatValues,
37104
+ formsValue
37105
+ }, {
37106
+ setFormValues,
37107
+ inputMeta,
37108
+ t,
37109
+ isHighlighted
37110
+ }) => {
37111
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
37106
37112
  customSelectWidthPercentage: "20%",
37107
37113
  t: t,
37108
37114
  size: "large",
37109
37115
  allowClear: true,
37110
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
37116
+ country: formsValue?.country,
37111
37117
  initialValue: value,
37112
- name: name
37113
- }, props), {}, {
37118
+ name: name,
37119
+ ...props,
37114
37120
  className: formatClassname([isHighlighted && "highlighted-input"]),
37115
37121
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37116
37122
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -37131,27 +37137,26 @@ const inputTypeComponent$1 = {
37131
37137
  }
37132
37138
  return val;
37133
37139
  }
37134
- }));
37140
+ });
37135
37141
  },
37136
- switch: (_ref28, _ref29) => {
37137
- let {
37138
- props,
37139
- value,
37140
- restricted,
37141
- autocomplete,
37142
- formsValue,
37143
- repeatValues,
37144
- repeatIndex,
37145
- name,
37146
- inputName,
37147
- replace: replaceInput,
37148
- unique
37149
- } = _ref28;
37150
- let {
37151
- form,
37152
- isHighlighted
37153
- } = _ref29;
37154
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
37142
+ switch: ({
37143
+ props,
37144
+ value,
37145
+ restricted,
37146
+ autocomplete,
37147
+ formsValue,
37148
+ repeatValues,
37149
+ repeatIndex,
37150
+ name,
37151
+ inputName,
37152
+ replace: replaceInput,
37153
+ unique
37154
+ }, {
37155
+ form,
37156
+ isHighlighted
37157
+ }) => {
37158
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
37159
+ ...props,
37155
37160
  size: "default",
37156
37161
  defaultChecked: value || false,
37157
37162
  checked: value || false,
@@ -37179,7 +37184,9 @@ const inputTypeComponent$1 = {
37179
37184
  const [formName, replaceInputName] = replaceTo.split(".");
37180
37185
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
37181
37186
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
37182
- formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
37187
+ formsValue = Object.assign(formsValue, {
37188
+ ...form.getFieldsValue(true)
37189
+ });
37183
37190
  if (oldId) {
37184
37191
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
37185
37192
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -37220,22 +37227,20 @@ const inputTypeComponent$1 = {
37220
37227
  }
37221
37228
  }
37222
37229
  }
37223
- }));
37230
+ });
37224
37231
  },
37225
- radioGroup: (_ref30, _ref31) => {
37226
- let {
37227
- props,
37228
- value,
37229
- options,
37230
- isRisk
37231
- } = _ref30;
37232
- let {
37233
- isHighlighted
37234
- } = _ref31;
37232
+ radioGroup: ({
37233
+ props,
37234
+ value,
37235
+ options,
37236
+ isRisk
37237
+ }, {
37238
+ isHighlighted
37239
+ }) => {
37235
37240
  if (isRisk) {
37236
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37237
- value: value
37238
- }, props), {}, {
37241
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37242
+ value: value,
37243
+ ...props,
37239
37244
  className: "is-risk-radio",
37240
37245
  children: (options || []).map(o => {
37241
37246
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37249,11 +37254,11 @@ const inputTypeComponent$1 = {
37249
37254
  }) : null]
37250
37255
  }, o.value);
37251
37256
  })
37252
- }));
37257
+ });
37253
37258
  }
37254
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37255
- value: value
37256
- }, props), {}, {
37259
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37260
+ value: value,
37261
+ ...props,
37257
37262
  className: formatClassname([isHighlighted && "highlighted-input"]),
37258
37263
  children: (options || []).map(o => {
37259
37264
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37267,20 +37272,18 @@ const inputTypeComponent$1 = {
37267
37272
  }) : null]
37268
37273
  }, o.value);
37269
37274
  })
37270
- }));
37275
+ });
37271
37276
  },
37272
- checkboxGroup: (_ref32, _ref33) => {
37273
- let {
37274
- props,
37275
- value,
37276
- options
37277
- } = _ref32;
37278
- let {
37279
- isHighlighted
37280
- } = _ref33;
37281
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
37282
- value: value
37283
- }, props), {}, {
37277
+ checkboxGroup: ({
37278
+ props,
37279
+ value,
37280
+ options
37281
+ }, {
37282
+ isHighlighted
37283
+ }) => {
37284
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37285
+ value: value,
37286
+ ...props,
37284
37287
  className: formatClassname([isHighlighted && "highlighted-input"]),
37285
37288
  style: {
37286
37289
  display: "grid",
@@ -37304,18 +37307,16 @@ const inputTypeComponent$1 = {
37304
37307
  }) : null]
37305
37308
  }, o.value);
37306
37309
  })
37307
- }));
37310
+ });
37308
37311
  },
37309
- total100: (_ref34, _ref35) => {
37310
- let {
37311
- props,
37312
- name,
37313
- options,
37314
- value
37315
- } = _ref34;
37316
- let {
37317
- isHighlighted
37318
- } = _ref35;
37312
+ total100: ({
37313
+ props,
37314
+ name,
37315
+ options,
37316
+ value
37317
+ }, {
37318
+ isHighlighted
37319
+ }) => {
37319
37320
  value = value ? Array.isArray(value) ? value : [value] : [];
37320
37321
  function totalValue() {
37321
37322
  let total = 0;
@@ -37339,11 +37340,10 @@ const inputTypeComponent$1 = {
37339
37340
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
37340
37341
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
37341
37342
  name: name,
37342
- children: (fields, _ref36) => {
37343
- let {
37344
- add,
37345
- remove
37346
- } = _ref36;
37343
+ children: (fields, {
37344
+ add,
37345
+ remove
37346
+ }) => {
37347
37347
  if (fields.length === 0) {
37348
37348
  const formData = value || [];
37349
37349
  if (formData.length) {
@@ -37362,27 +37362,27 @@ const inputTypeComponent$1 = {
37362
37362
  const v = value[field.name] || {};
37363
37363
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
37364
37364
  className: "total",
37365
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37366
- noStyle: true
37367
- }, field), {}, {
37365
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37366
+ noStyle: true,
37367
+ ...field,
37368
37368
  name: [field.name, "type"],
37369
37369
  fieldKey: [field.fieldKey, "type"],
37370
37370
  initialValue: v.type || null,
37371
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37371
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
37372
37372
  size: "large",
37373
37373
  allowClear: true,
37374
37374
  showSearch: true,
37375
37375
  filterOption: filterSelectOptions,
37376
- optionFilterProp: "children"
37377
- }, props), {}, {
37376
+ optionFilterProp: "children",
37377
+ ...props,
37378
37378
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
37379
37379
  value: option.value,
37380
37380
  children: option.label
37381
37381
  }, i))
37382
- }))
37383
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37384
- noStyle: true
37385
- }, field), {}, {
37382
+ })
37383
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37384
+ noStyle: true,
37385
+ ...field,
37386
37386
  name: [field.name, "value"],
37387
37387
  fieldKey: [field.fieldKey, "value"],
37388
37388
  initialValue: v.value,
@@ -37391,14 +37391,14 @@ const inputTypeComponent$1 = {
37391
37391
  allowClear: true,
37392
37392
  name: "value",
37393
37393
  formatter: value => {
37394
- return value ? "".concat(value, "%") : "";
37394
+ return value ? `${value}%` : "";
37395
37395
  },
37396
37396
  disabled: !v.type || null,
37397
37397
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
37398
37398
  min: 1,
37399
37399
  max: 100 - siblingTotal(v.type || 0)
37400
37400
  })
37401
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37401
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37402
37402
  disabled: !v.value || !v.type || totalValue() >= 100,
37403
37403
  type: "primary",
37404
37404
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -37430,22 +37430,19 @@ const inputTypeComponent$1 = {
37430
37430
  }) : null]
37431
37431
  });
37432
37432
  },
37433
- percentage: (_ref37, _ref38) => {
37434
- var _input$meta11;
37435
- let {
37436
- name,
37437
- inputName,
37438
- totalMax,
37439
- repeatIndex,
37440
- props,
37441
- formsValue,
37442
- input
37443
- } = _ref37;
37444
- let {
37445
- inputMeta,
37446
- t,
37447
- isHighlighted
37448
- } = _ref38;
37433
+ percentage: ({
37434
+ name,
37435
+ inputName,
37436
+ totalMax,
37437
+ repeatIndex,
37438
+ props,
37439
+ formsValue,
37440
+ input
37441
+ }, {
37442
+ inputMeta,
37443
+ t,
37444
+ isHighlighted
37445
+ }) => {
37449
37446
  const isRepeatable = Array.isArray(formsValue[name]);
37450
37447
  let totalSiblings = 0;
37451
37448
  if (isRepeatable && totalMax) {
@@ -37453,47 +37450,45 @@ const inputTypeComponent$1 = {
37453
37450
  totl = totl + (grp[inputName] || 0);
37454
37451
  return totl;
37455
37452
  }, 0);
37456
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37453
+ } else if (Array.isArray(input?.meta?.siblings)) {
37457
37454
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
37458
37455
  totl = totl + (formsValue[key] || 0);
37459
37456
  return totl;
37460
37457
  }, 0);
37461
37458
  }
37462
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37459
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37463
37460
  size: "large",
37464
- allowClear: true
37465
- }, props), {}, {
37461
+ allowClear: true,
37462
+ ...props,
37466
37463
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37467
37464
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37468
37465
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37469
37466
  min: 0,
37470
37467
  max: 100 - totalSiblings,
37471
37468
  formatter: value => {
37472
- return value ? "".concat(value) : "";
37469
+ return value ? `${value}` : "";
37473
37470
  },
37474
37471
  parser: value => value.replace("%", ""),
37475
37472
  addonAfter: "%"
37476
- }));
37473
+ });
37477
37474
  },
37478
- drawTerritory: (_ref39, _ref40) => {
37479
- let {
37480
- formsValue,
37481
- name,
37482
- addressData
37483
- } = _ref39;
37484
- let {
37485
- setFormValues
37486
- } = _ref40;
37475
+ drawTerritory: ({
37476
+ formsValue,
37477
+ name,
37478
+ addressData
37479
+ }, {
37480
+ setFormValues
37481
+ }) => {
37487
37482
  let search = formsValue.country;
37488
37483
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37489
37484
  if (addressData.address.country) {
37490
37485
  search = addressData.address.country;
37491
37486
  }
37492
37487
  if (addressData.address.level1) {
37493
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37488
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
37494
37489
  }
37495
37490
  if (addressData.address.level2) {
37496
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37491
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37497
37492
  }
37498
37493
  } else {
37499
37494
  const country = countriesList.countries[formsValue.country] || {};
@@ -37501,10 +37496,10 @@ const inputTypeComponent$1 = {
37501
37496
  search = country.name;
37502
37497
  }
37503
37498
  if (formsValue.administrativeLevel1Name) {
37504
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37499
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37505
37500
  }
37506
37501
  if (formsValue.administrativeLevel2Name) {
37507
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37502
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37508
37503
  }
37509
37504
  }
37510
37505
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37516,36 +37511,32 @@ const inputTypeComponent$1 = {
37516
37511
  searchValue: search
37517
37512
  });
37518
37513
  },
37519
- year: (_ref41, _ref42) => {
37520
- let {
37521
- props
37522
- } = _ref41;
37523
- let {
37524
- isHighlighted
37525
- } = _ref42;
37514
+ year: ({
37515
+ props
37516
+ }, {
37517
+ isHighlighted
37518
+ }) => {
37526
37519
  const lng = localStorage.getItem("datastakeLng") || "en";
37527
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37520
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37528
37521
  size: "large",
37529
37522
  allowClear: true,
37530
37523
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37531
- picker: "year"
37532
- }, props), {}, {
37524
+ picker: "year",
37525
+ ...props,
37533
37526
  className: formatClassname([isHighlighted && "highlighted-input"]),
37534
37527
  format: "YYYY"
37535
- }));
37528
+ });
37536
37529
  },
37537
- upload: (_ref43, _ref44) => {
37538
- let {
37539
- rules,
37540
- value
37541
- } = _ref43;
37542
- let {
37543
- setLoading = () => {},
37544
- getApiBaseUrl,
37545
- getAppHeader,
37546
- t,
37547
- isHighlighted
37548
- } = _ref44;
37530
+ upload: ({
37531
+ rules,
37532
+ value
37533
+ }, {
37534
+ setLoading = () => {},
37535
+ getApiBaseUrl,
37536
+ getAppHeader,
37537
+ t,
37538
+ isHighlighted
37539
+ }) => {
37549
37540
  const apiURL = getApiBaseUrl();
37550
37541
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37551
37542
  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) : []) || [];
@@ -37558,12 +37549,13 @@ const inputTypeComponent$1 = {
37558
37549
  maxProps.multiple = true;
37559
37550
  }
37560
37551
  }
37561
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37552
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37553
+ ...maxProps,
37562
37554
  accept: accept,
37563
- action: "".concat(apiURL, "/upload"),
37555
+ action: `${apiURL}/upload`,
37564
37556
  beforeUpload: beforeUpload(allowedExtensions),
37565
37557
  onChange: val => {
37566
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37558
+ if (val?.file && typeof setLoading === "function") {
37567
37559
  if (val.file.percent !== 100) {
37568
37560
  setLoading(true);
37569
37561
  } else {
@@ -37571,9 +37563,10 @@ const inputTypeComponent$1 = {
37571
37563
  }
37572
37564
  }
37573
37565
  },
37574
- headers: _objectSpread2({
37575
- Authorization: "Bearer ".concat(getToken())
37576
- }, getAppHeader()),
37566
+ headers: {
37567
+ Authorization: `Bearer ${getToken()}`,
37568
+ ...getAppHeader()
37569
+ },
37577
37570
  defaultFileList: values,
37578
37571
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37579
37572
  style: {
@@ -37584,20 +37577,18 @@ const inputTypeComponent$1 = {
37584
37577
  children: t("Upload")
37585
37578
  })]
37586
37579
  })
37587
- }));
37580
+ });
37588
37581
  },
37589
- imageUpload: (_ref45, _ref46) => {
37590
- let {
37591
- rules,
37592
- value
37593
- } = _ref45;
37594
- let {
37595
- setLoading = () => {},
37596
- getApiBaseUrl,
37597
- getAppHeader,
37598
- t,
37599
- isHighlighted
37600
- } = _ref46;
37582
+ imageUpload: ({
37583
+ rules,
37584
+ value
37585
+ }, {
37586
+ setLoading = () => {},
37587
+ getApiBaseUrl,
37588
+ getAppHeader,
37589
+ t,
37590
+ isHighlighted
37591
+ }) => {
37601
37592
  const apiURL = getApiBaseUrl();
37602
37593
  const values = getImageUploadEditValue(value);
37603
37594
  const maxRule = rules.find(r => r.max);
@@ -37608,18 +37599,17 @@ const inputTypeComponent$1 = {
37608
37599
  maxProps.multiple = true;
37609
37600
  }
37610
37601
  }
37611
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37612
- beforeUpload: beforeUpload(allowedImageExtensions)
37613
- }, maxProps), {}, {
37602
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37603
+ beforeUpload: beforeUpload(allowedImageExtensions),
37604
+ ...maxProps,
37614
37605
  accept: "image/*",
37615
37606
  classList: !values || !values.length ? "empty" : "",
37616
37607
  listType: "picture",
37617
- action: "".concat(apiURL, "/upload"),
37608
+ action: `${apiURL}/upload`,
37618
37609
  onChange: val => {
37619
37610
  if (typeof setLoading === "function") {
37620
- if (val !== null && val !== void 0 && val.file) {
37621
- var _val$file;
37622
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37611
+ if (val?.file) {
37612
+ if (val?.file?.status === "removed") {
37623
37613
  setLoading(false);
37624
37614
  return;
37625
37615
  }
@@ -37631,9 +37621,10 @@ const inputTypeComponent$1 = {
37631
37621
  setLoading(false);
37632
37622
  }
37633
37623
  },
37634
- headers: _objectSpread2({
37635
- Authorization: "Bearer ".concat(getToken())
37636
- }, getAppHeader()),
37624
+ headers: {
37625
+ Authorization: `Bearer ${getToken()}`,
37626
+ ...getAppHeader()
37627
+ },
37637
37628
  defaultFileList: values,
37638
37629
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37639
37630
  style: {
@@ -37644,20 +37635,18 @@ const inputTypeComponent$1 = {
37644
37635
  children: t("Upload")
37645
37636
  })]
37646
37637
  })
37647
- }));
37638
+ });
37648
37639
  },
37649
- videoUpload: (_ref47, _ref48) => {
37650
- let {
37651
- rules,
37652
- value
37653
- } = _ref47;
37654
- let {
37655
- setLoading = () => {},
37656
- getApiBaseUrl,
37657
- getAppHeader,
37658
- t,
37659
- isHighlighted
37660
- } = _ref48;
37640
+ videoUpload: ({
37641
+ rules,
37642
+ value
37643
+ }, {
37644
+ setLoading = () => {},
37645
+ getApiBaseUrl,
37646
+ getAppHeader,
37647
+ t,
37648
+ isHighlighted
37649
+ }) => {
37661
37650
  const apiURL = getApiBaseUrl();
37662
37651
  const values = getImageUploadEditValue(value);
37663
37652
  const maxRule = rules.find(r => r.max);
@@ -37668,25 +37657,21 @@ const inputTypeComponent$1 = {
37668
37657
  maxProps.multiple = true;
37669
37658
  }
37670
37659
  }
37671
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37672
- itemRender: (item, fileList) => {
37673
- var _fileList$response;
37674
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37675
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37676
- 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)
37677
- }), item]
37678
- });
37679
- }
37680
- }, maxProps), {}, {
37660
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37661
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37662
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37663
+ url: fileList?.response?.url || fileList?.url
37664
+ }), item]
37665
+ }),
37666
+ ...maxProps,
37681
37667
  accept: "video/*",
37682
37668
  classList: !values || !values.length ? "empty" : "",
37683
37669
  listType: "picture",
37684
- action: "".concat(apiURL, "/upload"),
37670
+ action: `${apiURL}/upload`,
37685
37671
  onChange: val => {
37686
37672
  if (typeof setLoading === "function") {
37687
- if (val !== null && val !== void 0 && val.file) {
37688
- var _val$file2;
37689
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37673
+ if (val?.file) {
37674
+ if (val?.file?.status === "removed") {
37690
37675
  setLoading(false);
37691
37676
  return;
37692
37677
  }
@@ -37698,9 +37683,10 @@ const inputTypeComponent$1 = {
37698
37683
  setLoading(false);
37699
37684
  }
37700
37685
  },
37701
- headers: _objectSpread2({
37702
- Authorization: "Bearer ".concat(getToken())
37703
- }, getAppHeader()),
37686
+ headers: {
37687
+ Authorization: `Bearer ${getToken()}`,
37688
+ ...getAppHeader()
37689
+ },
37704
37690
  fileList: values,
37705
37691
  defaultFileList: values,
37706
37692
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37712,30 +37698,28 @@ const inputTypeComponent$1 = {
37712
37698
  children: t("Upload")
37713
37699
  })]
37714
37700
  })
37715
- }));
37701
+ });
37716
37702
  },
37717
- geolocation: (_ref49, _ref50) => {
37718
- let {
37719
- value,
37720
- name,
37721
- props,
37722
- formsValue,
37723
- addressData
37724
- } = _ref49;
37725
- let {
37726
- inputMeta,
37727
- isHighlighted
37728
- } = _ref50;
37703
+ geolocation: ({
37704
+ value,
37705
+ name,
37706
+ props,
37707
+ formsValue,
37708
+ addressData
37709
+ }, {
37710
+ inputMeta,
37711
+ isHighlighted
37712
+ }) => {
37729
37713
  let search = formsValue.country;
37730
37714
  if (addressData && Object.keys(addressData).length > 0) {
37731
37715
  if (addressData.country) {
37732
37716
  search = addressData.country;
37733
37717
  }
37734
37718
  if (addressData.level1) {
37735
- search = "".concat(addressData.level1, ", ").concat(addressData.country);
37719
+ search = `${addressData.level1}, ${addressData.country}`;
37736
37720
  }
37737
37721
  if (addressData.level2) {
37738
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37722
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37739
37723
  }
37740
37724
  } else {
37741
37725
  const country = countriesList.countries[formsValue.country] || {};
@@ -37743,10 +37727,10 @@ const inputTypeComponent$1 = {
37743
37727
  search = country.name;
37744
37728
  }
37745
37729
  if (formsValue.administrativeLevel1Name) {
37746
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37730
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37747
37731
  }
37748
37732
  if (formsValue.administrativeLevel2Name) {
37749
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37733
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37750
37734
  }
37751
37735
  }
37752
37736
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37760,36 +37744,34 @@ const inputTypeComponent$1 = {
37760
37744
  searchValue: search
37761
37745
  });
37762
37746
  },
37763
- ajaxSelect: (_ref51, _ref52) => {
37764
- let {
37765
- call,
37766
- automaticallyLink,
37767
- name,
37768
- inputName,
37769
- props,
37770
- formsValue,
37771
- onNewSetValue,
37772
- multiple,
37773
- updateOptions,
37774
- repeatValues,
37775
- repeatIndex,
37776
- value,
37777
- unique,
37778
- address,
37779
- addressData = {},
37780
- getFromLinking,
37781
- input
37782
- } = _ref51;
37783
- let {
37784
- form,
37785
- forms,
37786
- setAddress,
37787
- changeInputMeta,
37788
- inputMeta,
37789
- meta,
37790
- isHighlighted,
37791
- groupFormId
37792
- } = _ref52;
37747
+ ajaxSelect: ({
37748
+ call,
37749
+ automaticallyLink,
37750
+ name,
37751
+ inputName,
37752
+ props,
37753
+ formsValue,
37754
+ onNewSetValue,
37755
+ multiple,
37756
+ updateOptions,
37757
+ repeatValues,
37758
+ repeatIndex,
37759
+ value,
37760
+ unique,
37761
+ address,
37762
+ addressData = {},
37763
+ getFromLinking,
37764
+ input
37765
+ }, {
37766
+ form,
37767
+ forms,
37768
+ setAddress,
37769
+ changeInputMeta,
37770
+ inputMeta,
37771
+ meta,
37772
+ isHighlighted,
37773
+ groupFormId
37774
+ }) => {
37793
37775
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37794
37776
  size: "medium",
37795
37777
  input: input,
@@ -37826,7 +37808,9 @@ const inputTypeComponent$1 = {
37826
37808
  const selectedValue = data.find(v => v.value === ev);
37827
37809
  if (address && selectedValue) {
37828
37810
  dot__default["default"].str(address, selectedValue.label, addressData);
37829
- setAddress(_objectSpread2({}, addressData));
37811
+ setAddress({
37812
+ ...addressData
37813
+ });
37830
37814
  }
37831
37815
  }
37832
37816
  },
@@ -37835,11 +37819,10 @@ const inputTypeComponent$1 = {
37835
37819
  address: true
37836
37820
  });
37837
37821
  },
37838
- tag: _ref53 => {
37839
- let {
37840
- value,
37841
- repeatLabel
37842
- } = _ref53;
37822
+ tag: ({
37823
+ value,
37824
+ repeatLabel
37825
+ }) => {
37843
37826
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37844
37827
  size: "large",
37845
37828
  allowClear: true,
@@ -37847,28 +37830,26 @@ const inputTypeComponent$1 = {
37847
37830
  newPlaceholder: repeatLabel
37848
37831
  });
37849
37832
  },
37850
- modal: (_ref54, _ref55) => {
37851
- let {
37852
- call,
37853
- automaticallyLink,
37854
- name,
37855
- inputName,
37856
- props,
37857
- formsValue,
37858
- allFormsValue,
37859
- onNewSetValue,
37860
- repeatValues,
37861
- repeatIndex,
37862
- value,
37863
- modalTitle,
37864
- totalInputs,
37865
- shownInputs,
37866
- allowDupplicates
37867
- } = _ref54;
37868
- let {
37869
- form,
37870
- add
37871
- } = _ref55;
37833
+ modal: ({
37834
+ call,
37835
+ automaticallyLink,
37836
+ name,
37837
+ inputName,
37838
+ props,
37839
+ formsValue,
37840
+ allFormsValue,
37841
+ onNewSetValue,
37842
+ repeatValues,
37843
+ repeatIndex,
37844
+ value,
37845
+ modalTitle,
37846
+ totalInputs,
37847
+ shownInputs,
37848
+ allowDupplicates
37849
+ }, {
37850
+ form,
37851
+ add
37852
+ }) => {
37872
37853
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37873
37854
  allowClear: true,
37874
37855
  call: call,
@@ -37891,44 +37872,40 @@ const inputTypeComponent$1 = {
37891
37872
  allowDupplicates: allowDupplicates
37892
37873
  });
37893
37874
  },
37894
- dataLink: (_ref56, _ref57) => {
37895
- var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37896
- let {
37897
- setValues,
37898
- name,
37899
- onValuesChange,
37900
- changeLinking,
37901
- formsValue,
37902
- input,
37903
- call,
37904
- automaticallyLink,
37905
- inputName,
37906
- props,
37907
- onNewSetValue,
37908
- multiple,
37909
- updateOptions,
37910
- repeatValues,
37911
- repeatIndex,
37912
- value,
37913
- unique,
37914
- address,
37915
- addressData = {},
37916
- getFromLinking
37917
- } = _ref56;
37918
- let {
37919
- form,
37920
- forms,
37921
- setAddress,
37922
- changeInputMeta,
37923
- inputMeta,
37924
- meta,
37925
- isHighlighted,
37926
- groupFormId
37927
- } = _ref57;
37928
- 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") {
37929
- var _formsValue$groupForm3, _input$meta13, _input$meta14;
37930
- const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37931
- (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()::::";
37875
+ dataLink: ({
37876
+ setValues,
37877
+ name,
37878
+ onValuesChange,
37879
+ changeLinking,
37880
+ formsValue,
37881
+ input,
37882
+ call,
37883
+ automaticallyLink,
37884
+ inputName,
37885
+ props,
37886
+ onNewSetValue,
37887
+ multiple,
37888
+ updateOptions,
37889
+ repeatValues,
37890
+ repeatIndex,
37891
+ value,
37892
+ unique,
37893
+ address,
37894
+ addressData = {},
37895
+ getFromLinking
37896
+ }, {
37897
+ form,
37898
+ forms,
37899
+ setAddress,
37900
+ changeInputMeta,
37901
+ inputMeta,
37902
+ meta,
37903
+ isHighlighted,
37904
+ groupFormId
37905
+ }) => {
37906
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37907
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37908
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37932
37909
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37933
37910
  size: "medium",
37934
37911
  input: input,
@@ -37965,7 +37942,9 @@ const inputTypeComponent$1 = {
37965
37942
  const selectedValue = data.find(v => v.value === ev);
37966
37943
  if (address && selectedValue) {
37967
37944
  dot__default["default"].str(address, selectedValue.label, addressData);
37968
- setAddress(_objectSpread2({}, addressData));
37945
+ setAddress({
37946
+ ...addressData
37947
+ });
37969
37948
  }
37970
37949
  }
37971
37950
  },
@@ -37975,93 +37954,138 @@ const inputTypeComponent$1 = {
37975
37954
  isDataLink: true
37976
37955
  });
37977
37956
  }
37978
- const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37979
- 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));
37957
+ const isSingle = input?.meta?.maxRepeat === 1;
37958
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37959
+ ...(formsValue[groupFormId] || {})[name]
37960
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
37961
+ ...v
37962
+ })) : isSingle ? formsValue[name] ? [{
37963
+ ...formsValue[name]
37964
+ }] : [] : (formsValue[name] || []).map(v => ({
37965
+ ...v
37966
+ }));
37980
37967
  const onUpdate = (editData, i) => {
37981
- const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
37968
+ const val = {
37969
+ ...formData[i],
37970
+ ...editData
37971
+ };
37982
37972
  const _val = isSingle ? {
37983
37973
  [name]: val
37984
37974
  } : {
37985
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
37975
+ [name]: formData?.map((d, j) => i === j ? val : d)
37986
37976
  };
37987
37977
  if (groupFormId) {
37988
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37989
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37990
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37978
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37979
+ const _newData = {
37980
+ ..._defaultData,
37981
+ ..._val
37982
+ };
37983
+ onValuesChange(_newData, {
37984
+ ...formsValue,
37991
37985
  [groupFormId]: _newData
37992
- }));
37993
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37994
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37986
+ });
37987
+ form?.setFieldValue(groupFormId, _newData);
37988
+ setValues({
37989
+ ...formsValue,
37995
37990
  [groupFormId]: _newData
37996
- }));
37991
+ });
37997
37992
  return;
37998
37993
  }
37999
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38000
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38001
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37994
+ onValuesChange(_val, {
37995
+ ...formsValue,
37996
+ ..._val
37997
+ });
37998
+ form?.setFieldValue(name, _val[name]);
37999
+ setValues({
38000
+ ...formsValue,
38001
+ ..._val
38002
+ });
38002
38003
  };
38003
- if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
38004
- var _formsValue$meta4, _input$meta17;
38004
+ if (input?.meta?.flat) {
38005
38005
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
38006
38006
  form: input,
38007
38007
  changeLinking: changeLinking,
38008
38008
  onUpdate: onUpdate,
38009
38009
  isHighlighted: isHighlighted,
38010
38010
  formsValue: formsValue,
38011
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38011
+ values: groupFormId ? {
38012
+ ...(formsValue[groupFormId] || {}),
38012
38013
  meta: {
38013
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
38014
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38014
38015
  }
38015
- }) : formsValue,
38016
+ } : formsValue,
38016
38017
  name: name,
38017
38018
  groupFormId: groupFormId,
38018
- maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
38019
- remove: _ref58 => {
38020
- let {
38021
- key
38022
- } = _ref58;
38019
+ maxRepeat: input?.meta?.maxRepeat,
38020
+ remove: ({
38021
+ key
38022
+ }) => {
38023
38023
  const _val = isSingle ? {
38024
38024
  [name]: null
38025
38025
  } : {
38026
38026
  [name]: formData.filter((v, i) => i !== key)
38027
38027
  };
38028
38028
  if (groupFormId) {
38029
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38030
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38031
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38029
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38030
+ const _newData = {
38031
+ ..._defaultData,
38032
+ ..._val
38033
+ };
38034
+ onValuesChange(_newData, {
38035
+ ...formsValue,
38032
38036
  [groupFormId]: _newData
38033
- }));
38034
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38035
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38037
+ });
38038
+ form?.setFieldValue(groupFormId, _newData);
38039
+ setValues({
38040
+ ...formsValue,
38036
38041
  [groupFormId]: _newData
38037
- }));
38042
+ });
38038
38043
  return;
38039
38044
  }
38040
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38041
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38042
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38045
+ onValuesChange(_val, {
38046
+ ...formsValue,
38047
+ ..._val
38048
+ });
38049
+ form?.setFieldValue(name, _val[name]);
38050
+ setValues({
38051
+ ...formsValue,
38052
+ ..._val
38053
+ });
38043
38054
  },
38044
38055
  add: val => {
38045
38056
  const _val = isSingle ? {
38046
38057
  [name]: val
38047
38058
  } : {
38048
- [name]: [...formData, _objectSpread2({}, val)]
38059
+ [name]: [...formData, {
38060
+ ...val
38061
+ }]
38049
38062
  };
38050
38063
  if (groupFormId) {
38051
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38052
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38053
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38054
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38064
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38065
+ const _newData = {
38066
+ ..._defaultData,
38067
+ ..._val
38068
+ };
38069
+ form?.setFieldValue(groupFormId, _newData);
38070
+ onValuesChange(_newData, {
38071
+ ...formsValue,
38055
38072
  [groupFormId]: _newData
38056
- }));
38057
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38073
+ });
38074
+ setValues({
38075
+ ...formsValue,
38058
38076
  [groupFormId]: _newData
38059
- }));
38077
+ });
38060
38078
  return;
38061
38079
  }
38062
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38063
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38064
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38080
+ form?.setFieldValue(name, _val[name]);
38081
+ onValuesChange(_val, {
38082
+ ...formsValue,
38083
+ ..._val
38084
+ });
38085
+ setValues({
38086
+ ...formsValue,
38087
+ ..._val
38088
+ });
38065
38089
  },
38066
38090
  k: name,
38067
38091
  formData: formData
@@ -38073,79 +38097,101 @@ const inputTypeComponent$1 = {
38073
38097
  onUpdate: onUpdate,
38074
38098
  isHighlighted: isHighlighted,
38075
38099
  formsValue: formsValue,
38076
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38100
+ values: groupFormId ? {
38101
+ ...(formsValue[groupFormId] || {}),
38077
38102
  meta: {
38078
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
38103
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38079
38104
  }
38080
- }) : formsValue,
38105
+ } : formsValue,
38081
38106
  name: name,
38082
38107
  groupFormId: groupFormId,
38083
- maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
38084
- remove: _ref59 => {
38085
- let {
38086
- key
38087
- } = _ref59;
38108
+ maxRepeat: input?.meta?.maxRepeat,
38109
+ remove: ({
38110
+ key
38111
+ }) => {
38088
38112
  const _val = isSingle ? {
38089
38113
  [name]: null
38090
38114
  } : {
38091
38115
  [name]: formData.filter((v, i) => i !== key)
38092
38116
  };
38093
38117
  if (groupFormId) {
38094
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38095
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38096
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38118
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38119
+ const _newData = {
38120
+ ..._defaultData,
38121
+ ..._val
38122
+ };
38123
+ onValuesChange(_newData, {
38124
+ ...formsValue,
38097
38125
  [groupFormId]: _newData
38098
- }));
38099
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38100
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38126
+ });
38127
+ form?.setFieldValue(groupFormId, _newData);
38128
+ setValues({
38129
+ ...formsValue,
38101
38130
  [groupFormId]: _newData
38102
- }));
38131
+ });
38103
38132
  return;
38104
38133
  }
38105
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38106
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38107
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38134
+ onValuesChange(_val, {
38135
+ ...formsValue,
38136
+ ..._val
38137
+ });
38138
+ form?.setFieldValue(name, _val[name]);
38139
+ setValues({
38140
+ ...formsValue,
38141
+ ..._val
38142
+ });
38108
38143
  },
38109
38144
  add: val => {
38110
38145
  const _val = isSingle ? {
38111
38146
  [name]: val
38112
38147
  } : {
38113
- [name]: [...formData, _objectSpread2({}, val)]
38148
+ [name]: [...formData, {
38149
+ ...val
38150
+ }]
38114
38151
  };
38115
38152
  if (groupFormId) {
38116
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38117
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38118
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38119
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38153
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38154
+ const _newData = {
38155
+ ..._defaultData,
38156
+ ..._val
38157
+ };
38158
+ form?.setFieldValue(groupFormId, _newData);
38159
+ onValuesChange(_newData, {
38160
+ ...formsValue,
38120
38161
  [groupFormId]: _newData
38121
- }));
38122
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38162
+ });
38163
+ setValues({
38164
+ ...formsValue,
38123
38165
  [groupFormId]: _newData
38124
- }));
38166
+ });
38125
38167
  return;
38126
38168
  }
38127
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38128
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38129
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38169
+ form?.setFieldValue(name, _val[name]);
38170
+ onValuesChange(_val, {
38171
+ ...formsValue,
38172
+ ..._val
38173
+ });
38174
+ setValues({
38175
+ ...formsValue,
38176
+ ..._val
38177
+ });
38130
38178
  },
38131
38179
  k: name,
38132
38180
  formData: formData
38133
38181
  });
38134
38182
  },
38135
- dataLinkGroup: (_ref60, _ref61) => {
38136
- let {
38137
- setValues,
38138
- name,
38139
- onValuesChange,
38140
- changeLinking,
38141
- formsValue,
38142
- input
38143
- } = _ref60;
38144
- let {
38145
- form,
38146
- groupFormId,
38147
- isHighlighted
38148
- } = _ref61;
38183
+ dataLinkGroup: ({
38184
+ setValues,
38185
+ name,
38186
+ onValuesChange,
38187
+ changeLinking,
38188
+ formsValue,
38189
+ input
38190
+ }, {
38191
+ form,
38192
+ groupFormId,
38193
+ isHighlighted
38194
+ }) => {
38149
38195
  return renderDataLinkGroup({
38150
38196
  input,
38151
38197
  name,
@@ -38158,41 +38204,51 @@ const inputTypeComponent$1 = {
38158
38204
  isHighlighted
38159
38205
  });
38160
38206
  },
38161
- groupCheckbox: (_ref62, _ref63) => {
38162
- let {
38163
- setValues,
38164
- name,
38165
- onValuesChange,
38166
- formsValue,
38167
- input
38168
- } = _ref62;
38169
- let {
38170
- form,
38171
- groupFormId,
38172
- isHighlighted
38173
- } = _ref63;
38207
+ groupCheckbox: ({
38208
+ setValues,
38209
+ name,
38210
+ onValuesChange,
38211
+ formsValue,
38212
+ input
38213
+ }, {
38214
+ form,
38215
+ groupFormId,
38216
+ isHighlighted
38217
+ }) => {
38174
38218
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
38175
38219
  const onUpdate = (val, key) => {
38176
38220
  const _val = {
38177
- [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
38221
+ [name]: {
38222
+ ...formData,
38178
38223
  [key]: val
38179
- })
38224
+ }
38180
38225
  };
38181
38226
  if (groupFormId) {
38182
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38183
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38184
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38227
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38228
+ const _newData = {
38229
+ ..._defaultData,
38230
+ ..._val
38231
+ };
38232
+ onValuesChange(_newData, {
38233
+ ...formsValue,
38185
38234
  [groupFormId]: _newData
38186
- }));
38187
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38188
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38235
+ });
38236
+ form?.setFieldValue(groupFormId, _newData);
38237
+ setValues({
38238
+ ...formsValue,
38189
38239
  [groupFormId]: _newData
38190
- }));
38240
+ });
38191
38241
  return;
38192
38242
  }
38193
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38194
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38195
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38243
+ onValuesChange(_val, {
38244
+ ...formsValue,
38245
+ ..._val
38246
+ });
38247
+ form?.setFieldValue(name, _val[name]);
38248
+ setValues({
38249
+ ...formsValue,
38250
+ ..._val
38251
+ });
38196
38252
  };
38197
38253
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
38198
38254
  form: input,
@@ -38201,91 +38257,96 @@ const inputTypeComponent$1 = {
38201
38257
  isHighlighted: isHighlighted
38202
38258
  });
38203
38259
  },
38204
- website: (_ref64, _ref65) => {
38205
- let {
38206
- name,
38207
- inputName,
38208
- props,
38209
- value,
38210
- repeatIndex,
38211
- repeatValues,
38212
- formsValue
38213
- } = _ref64;
38214
- let {
38215
- form,
38216
- isHighlighted,
38217
- inputMeta = {},
38218
- t
38219
- } = _ref65;
38220
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38260
+ website: ({
38261
+ name,
38262
+ inputName,
38263
+ props,
38264
+ value,
38265
+ repeatIndex,
38266
+ repeatValues,
38267
+ formsValue
38268
+ }, {
38269
+ form,
38270
+ isHighlighted,
38271
+ inputMeta = {},
38272
+ t
38273
+ }) => {
38274
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
38221
38275
  size: "large",
38222
38276
  allowClear: true,
38223
- initialValue: value
38224
- }, props), {}, {
38277
+ initialValue: value,
38278
+ ...props,
38225
38279
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
38226
38280
  className: formatClassname([isHighlighted && "highlighted-cont"]),
38227
38281
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
38228
38282
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
38229
- }));
38283
+ });
38230
38284
  },
38231
- group: (_ref66, _ref67) => {
38232
- let {
38233
- props,
38234
- groupInputs,
38235
- formsValue
38236
- } = _ref66;
38237
- let {
38238
- inputMeta,
38239
- isHighlighted
38240
- } = _ref67;
38241
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38285
+ group: ({
38286
+ props,
38287
+ groupInputs,
38288
+ formsValue
38289
+ }, {
38290
+ inputMeta,
38291
+ isHighlighted
38292
+ }) => {
38293
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38242
38294
  formsValue: formsValue,
38243
38295
  isHighlighted: isHighlighted,
38244
38296
  groupInputs: groupInputs,
38245
- inputMeta: inputMeta
38246
- }, props));
38297
+ inputMeta: inputMeta,
38298
+ ...props
38299
+ });
38247
38300
  },
38248
- groupInputs: (_ref68, _ref69) => {
38249
- let {
38250
- props,
38251
- groupInputs,
38252
- formsValue
38253
- } = _ref68;
38254
- let {
38255
- inputMeta,
38256
- isHighlighted
38257
- } = _ref69;
38258
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38301
+ groupInputs: ({
38302
+ props,
38303
+ groupInputs,
38304
+ formsValue
38305
+ }, {
38306
+ inputMeta,
38307
+ isHighlighted
38308
+ }) => {
38309
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38259
38310
  formsValue: formsValue,
38260
38311
  isHighlighted: isHighlighted,
38261
38312
  groupInputs: groupInputs,
38262
- inputMeta: inputMeta
38263
- }, props));
38313
+ inputMeta: inputMeta,
38314
+ ...props
38315
+ });
38264
38316
  },
38265
- smartHelp: (_ref70, _ref71) => {
38317
+ smartHelp: ({
38318
+ name,
38319
+ inputName,
38320
+ props,
38321
+ value,
38322
+ repeatIndex,
38323
+ repeatValues,
38324
+ formsValue
38325
+ }, {
38326
+ form,
38327
+ isHighlighted,
38328
+ inputMeta = {},
38329
+ t
38330
+ }) => {
38266
38331
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
38267
38332
  }
38268
38333
  };
38269
38334
  const filterForm = (f, d) => {
38270
38335
  return f && (f.showFormIf ? showHideForm(f, d) : true);
38271
38336
  };
38272
- const checkFormHasSubsections = function () {
38273
- let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38274
- return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38275
- };
38337
+ const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38276
38338
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
38277
- const _ref72 = f[key] || {},
38278
- {
38279
- label,
38280
- description = "",
38281
- excludeFromEdit,
38282
- showFormIf,
38283
- icon = "",
38284
- position = 0,
38285
- template,
38286
- formClass
38287
- } = _ref72,
38288
- fc = _objectWithoutProperties(_ref72, _excluded2$1);
38339
+ const {
38340
+ label,
38341
+ description = "",
38342
+ excludeFromEdit,
38343
+ showFormIf,
38344
+ icon = "",
38345
+ position = 0,
38346
+ template,
38347
+ formClass,
38348
+ ...fc
38349
+ } = f[key] || {};
38289
38350
  const fConf = {
38290
38351
  id: key,
38291
38352
  label,
@@ -38344,14 +38405,11 @@ const groupSubForms = (fConf, d) => {
38344
38405
  return f;
38345
38406
  }, {});
38346
38407
  };
38347
- const inputIsEmpty = function () {
38348
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38349
- let values = arguments.length > 1 ? arguments[1] : undefined;
38350
- let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
38351
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38408
+ const inputIsEmpty = (input = {}, values, inputMeta) => {
38409
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
38352
38410
  return false;
38353
38411
  }
38354
- if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38412
+ if (input?.type === "groupInputs") {
38355
38413
  return true;
38356
38414
  }
38357
38415
  const value = values[input.dataId];
@@ -38363,28 +38421,26 @@ const inputIsEmpty = function () {
38363
38421
  }
38364
38422
  return !value;
38365
38423
  };
38366
- const GetFormItem$1 = _ref73 => {
38367
- var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
38368
- let {
38369
- highlightMandatory,
38370
- inputData,
38371
- inputId,
38372
- input,
38373
- values,
38374
- MainForm,
38375
- options,
38376
- plainForms,
38377
- setValues,
38378
- setAddress,
38379
- i,
38380
- inputKey,
38381
- onValuesChange = () => {},
38382
- setLoading = () => {},
38383
- inputMeta = {},
38384
- changeInputMeta = () => {},
38385
- changeLinking = () => {},
38386
- namespace
38387
- } = _ref73;
38424
+ const GetFormItem$1 = ({
38425
+ highlightMandatory,
38426
+ inputData,
38427
+ inputId,
38428
+ input,
38429
+ values,
38430
+ MainForm,
38431
+ options,
38432
+ plainForms,
38433
+ setValues,
38434
+ setAddress,
38435
+ i,
38436
+ inputKey,
38437
+ onValuesChange = () => {},
38438
+ setLoading = () => {},
38439
+ inputMeta = {},
38440
+ changeInputMeta = () => {},
38441
+ changeLinking = () => {},
38442
+ namespace
38443
+ }) => {
38388
38444
  const {
38389
38445
  t,
38390
38446
  user,
@@ -38399,42 +38455,44 @@ const GetFormItem$1 = _ref73 => {
38399
38455
  staticWidth,
38400
38456
  fullWidth
38401
38457
  } = useEditContext();
38402
- 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];
38458
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
38403
38459
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
38404
38460
  const inputLabel = getInputLabel$1(input, values);
38405
38461
  const onClickReviewSuccess = () => {
38406
38462
  if (!isReview) {
38407
38463
  return;
38408
38464
  }
38409
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38465
+ const reviewSuccess = lastReview?.reviewSuccess;
38410
38466
  changeInputMeta({
38411
38467
  key: inputId,
38412
38468
  type: input.type,
38413
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38469
+ value: {
38470
+ ...inputMeta,
38414
38471
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38415
38472
  reviewer: user,
38416
38473
  createdAt: new Date().toISOString(),
38417
38474
  reviewSuccess: true
38418
38475
  }]
38419
- })
38476
+ }
38420
38477
  });
38421
38478
  };
38422
38479
  const onClickReviewError = () => {
38423
38480
  if (!isReview) {
38424
38481
  return;
38425
38482
  }
38426
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38483
+ const reviewError = lastReview?.reviewError;
38427
38484
  changeInputMeta({
38428
38485
  key: inputId,
38429
38486
  type: input.type,
38430
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38487
+ value: {
38488
+ ...inputMeta,
38431
38489
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38432
38490
  reviewer: user,
38433
38491
  createdAt: new Date().toISOString(),
38434
38492
  reviewError: true,
38435
38493
  comment: ""
38436
38494
  }]
38437
- })
38495
+ }
38438
38496
  });
38439
38497
  };
38440
38498
  switch (input.type) {
@@ -38448,12 +38506,12 @@ const GetFormItem$1 = _ref73 => {
38448
38506
  case "header":
38449
38507
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
38450
38508
  className: "daf-title with-subtitle",
38451
- style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38509
+ style: input?.meta?.style,
38452
38510
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38453
38511
  className: "flex",
38454
38512
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
38455
38513
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
38456
- }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38514
+ }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38457
38515
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
38458
38516
  className: "tooltip-popover-cont",
38459
38517
  children: ReactHtmlParser__default["default"](input.description)
@@ -38480,7 +38538,7 @@ const GetFormItem$1 = _ref73 => {
38480
38538
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38481
38539
 
38482
38540
  // eslint-disable-next-line no-case-declarations
38483
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38541
+ let maxRule = rules.find(rule => rule.max)?.max;
38484
38542
  if (!maxRule && input.type === "textarea") {
38485
38543
  maxRule = MAX_TEXT_AREA_LENGTH;
38486
38544
  }
@@ -38493,30 +38551,27 @@ const GetFormItem$1 = _ref73 => {
38493
38551
  message: requiredRule.message || ""
38494
38552
  });
38495
38553
  }
38496
- 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);
38554
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38497
38555
  if (requiredRule || specialCharsRule) {
38498
38556
  if (input.type === "groupInputs") {
38499
38557
  rules = rules.map(r => {
38500
38558
  if (r.required) {
38501
- return _ref74 => {
38502
- let {
38503
- getFieldValue
38504
- } = _ref74;
38505
- return {
38506
- validator() {
38507
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38508
- return Promise.resolve();
38509
- }
38510
- const keys = Object.keys(input.inputs);
38511
- for (let i = 0; i < keys.length; i++) {
38512
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38513
- return Promise.reject(r.message);
38514
- }
38515
- }
38559
+ return ({
38560
+ getFieldValue
38561
+ }) => ({
38562
+ validator() {
38563
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38516
38564
  return Promise.resolve();
38517
38565
  }
38518
- };
38519
- };
38566
+ const keys = Object.keys(input.inputs);
38567
+ for (let i = 0; i < keys.length; i++) {
38568
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38569
+ return Promise.reject(r.message);
38570
+ }
38571
+ }
38572
+ return Promise.resolve();
38573
+ }
38574
+ });
38520
38575
  }
38521
38576
  return r;
38522
38577
  });
@@ -38554,13 +38609,12 @@ const GetFormItem$1 = _ref73 => {
38554
38609
  }
38555
38610
  }
38556
38611
  if (input && typeof input === "object") {
38557
- 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;
38558
38612
  // check if input is valid
38559
38613
  const hideComment = namespace === "project-readiness";
38560
38614
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38561
38615
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38562
38616
  className: "flex-row input-cont",
38563
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38617
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38564
38618
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38565
38619
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38566
38620
  className: formatClassname(["ml-4 input-actions"]),
@@ -38570,7 +38624,7 @@ const GetFormItem$1 = _ref73 => {
38570
38624
  title: t("Add review note"),
38571
38625
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38572
38626
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38573
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38627
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38574
38628
  type: "link",
38575
38629
  onClick: onClickReviewError,
38576
38630
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38586,7 +38640,7 @@ const GetFormItem$1 = _ref73 => {
38586
38640
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38587
38641
  type: "link",
38588
38642
  onClick: onClickReviewSuccess,
38589
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38643
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38590
38644
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38591
38645
  name: "CheckSquare",
38592
38646
  width: 16,
@@ -38623,7 +38677,7 @@ const GetFormItem$1 = _ref73 => {
38623
38677
  }
38624
38678
  });
38625
38679
  },
38626
- disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38680
+ disabled: !input.meta?.notApplicable,
38627
38681
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38628
38682
  name: "NotApplicable",
38629
38683
  width: 16,
@@ -38637,7 +38691,7 @@ const GetFormItem$1 = _ref73 => {
38637
38691
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38638
38692
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38639
38693
  type: "link",
38640
- disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38694
+ disabled: !input.meta?.notAvailable,
38641
38695
  onClick: () => {
38642
38696
  const value = getDefaultInputValue(input);
38643
38697
  MainForm.setFields([{
@@ -38669,14 +38723,14 @@ const GetFormItem$1 = _ref73 => {
38669
38723
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38670
38724
  title: t("Add comment"),
38671
38725
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38672
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38726
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38673
38727
  type: "link",
38674
- disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38675
- }, !isShown ? {
38676
- className: "default p-0"
38677
- } : {
38678
- className: "p-0 primary"
38679
- }), {}, {
38728
+ disabled: !input.meta?.comment,
38729
+ ...(!isShown ? {
38730
+ className: "default p-0"
38731
+ } : {
38732
+ className: "p-0 primary"
38733
+ }),
38680
38734
  onClick: () => {
38681
38735
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38682
38736
  return;
@@ -38695,7 +38749,7 @@ const GetFormItem$1 = _ref73 => {
38695
38749
  width: 16,
38696
38750
  height: 16
38697
38751
  })
38698
- }))
38752
+ })
38699
38753
  })
38700
38754
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38701
38755
  title: t("Project Readiness"),
@@ -38714,34 +38768,36 @@ const GetFormItem$1 = _ref73 => {
38714
38768
  }) : null]
38715
38769
  }) : null
38716
38770
  }),
38717
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38718
- }, inputOnBlur.includes(input.type) ? {
38719
- trigger: "onBlur"
38720
- } : {}), ["total100", "group"].includes(input.type) ? {} : {
38721
- name: inputId,
38722
- fieldKey: inputId,
38723
- initialValue: inputData.value
38724
- }), ["upload"].includes(input.type) ? {
38725
- valuePropName: "fileList",
38726
- getValueFromEvent: e => {
38727
- if (Array.isArray(e)) {
38728
- return e;
38729
- }
38730
- return e && e.fileList && e.fileList.map(f => {
38731
- if (f.response) {
38732
- return f.response;
38771
+ initialValue: inputMeta?.defaultValue,
38772
+ ...(inputOnBlur.includes(input.type) ? {
38773
+ trigger: "onBlur"
38774
+ } : {}),
38775
+ ...(["total100", "group"].includes(input.type) ? {} : {
38776
+ name: inputId,
38777
+ fieldKey: inputId,
38778
+ initialValue: inputData.value
38779
+ }),
38780
+ ...(["upload"].includes(input.type) ? {
38781
+ valuePropName: "fileList",
38782
+ getValueFromEvent: e => {
38783
+ if (Array.isArray(e)) {
38784
+ return e;
38733
38785
  }
38734
- return f;
38735
- });
38736
- }
38737
- } : {}), {}, {
38738
- className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38786
+ return e && e.fileList && e.fileList.map(f => {
38787
+ if (f.response) {
38788
+ return f.response;
38789
+ }
38790
+ return f;
38791
+ });
38792
+ }
38793
+ } : {}),
38794
+ className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38739
38795
  "data-id": inputData.name,
38740
38796
  rules: rules,
38741
38797
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38742
38798
  labelCol: 12,
38743
38799
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38744
- className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38800
+ className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38745
38801
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38746
38802
  className: "mr-1",
38747
38803
  children: getInputLabel$1(input, values)
@@ -38754,7 +38810,7 @@ const GetFormItem$1 = _ref73 => {
38754
38810
  config: input,
38755
38811
  t: t,
38756
38812
  ajaxForms: ajaxForms,
38757
- 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),
38813
+ linkingData: values?.linking || values?.parent?.linking,
38758
38814
  changeAjaxForms: changeAjaxForms,
38759
38815
  getApiBaseUrl: getApiBaseUrl,
38760
38816
  getAppHeader: getAppHeader,
@@ -38762,11 +38818,12 @@ const GetFormItem$1 = _ref73 => {
38762
38818
  getToken: getToken,
38763
38819
  app: app,
38764
38820
  valueOnlyString: true
38765
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
38821
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38822
+ ...inputData,
38766
38823
  maxWidth,
38767
38824
  staticWidth,
38768
38825
  fullWidth
38769
- }), {
38826
+ }, {
38770
38827
  form: MainForm,
38771
38828
  forms: options,
38772
38829
  allForms: plainForms,
@@ -38787,10 +38844,10 @@ const GetFormItem$1 = _ref73 => {
38787
38844
  staticWidth,
38788
38845
  fullWidth
38789
38846
  }) : console.log(input)
38790
- })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38847
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38791
38848
  className: "code",
38792
38849
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38793
- children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38850
+ children: input.meta?.code
38794
38851
  })
38795
38852
  }) : null]
38796
38853
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38810,10 +38867,10 @@ const GetFormItem$1 = _ref73 => {
38810
38867
  className: "max-char-span",
38811
38868
  children: t("max-char", {
38812
38869
  chars: maxRule,
38813
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38870
+ filled: inputData?.value?.length || 0
38814
38871
  })
38815
38872
  })
38816
- }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38873
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38817
38874
  className: "input-content",
38818
38875
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38819
38876
  className: "comment-textarea",
@@ -38839,7 +38896,7 @@ const GetFormItem$1 = _ref73 => {
38839
38896
  },
38840
38897
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38841
38898
  type: "link",
38842
- disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38899
+ disabled: !input.meta?.comment,
38843
38900
  className: "p-0",
38844
38901
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38845
38902
  width: 16,
@@ -38848,11 +38905,12 @@ const GetFormItem$1 = _ref73 => {
38848
38905
  })
38849
38906
  })]
38850
38907
  }),
38851
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38908
+ children: inputTypeComponent$1.comment({
38909
+ ...inputData,
38852
38910
  maxWidth,
38853
38911
  staticWidth,
38854
38912
  fullWidth
38855
- }), {
38913
+ }, {
38856
38914
  form: MainForm,
38857
38915
  forms: options,
38858
38916
  setFormValues: setValues,
@@ -38877,16 +38935,16 @@ const GetFormItem$1 = _ref73 => {
38877
38935
  className: "max-char-span",
38878
38936
  children: t("max-char", {
38879
38937
  chars: MAX_COMMENTS_LENGTH,
38880
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38938
+ filled: inputData?.commentValue?.length || 0
38881
38939
  })
38882
38940
  })]
38883
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38941
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38884
38942
  className: "input-content",
38885
38943
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38886
38944
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38887
38945
  className: "comment-textarea",
38888
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38889
- name: "".concat(inputId, "-reviewErrorComment"),
38946
+ initialValue: lastReview?.comment || "",
38947
+ name: `${inputId}-reviewErrorComment`,
38890
38948
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38891
38949
  className: "flex w-100",
38892
38950
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38894,28 +38952,31 @@ const GetFormItem$1 = _ref73 => {
38894
38952
  children: t("Review note")
38895
38953
  })
38896
38954
  }),
38897
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38955
+ children: inputTypeComponent$1.comment({
38956
+ ...inputData,
38898
38957
  maxWidth,
38899
38958
  staticWidth,
38900
38959
  fullWidth
38901
- }), {
38960
+ }, {
38902
38961
  form: MainForm,
38903
38962
  forms: options,
38904
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38963
+ value: lastReview?.comment || "",
38905
38964
  onChange: val => {
38906
38965
  changeInputMeta({
38907
38966
  key: inputId,
38908
38967
  type: input.type,
38909
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38910
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
38968
+ value: {
38969
+ ...inputMeta,
38970
+ reviews: (inputMeta?.reviews || []).map(v => {
38911
38971
  if (v.createdAt === lastReview.createdAt) {
38912
- return _objectSpread2(_objectSpread2({}, v), {}, {
38972
+ return {
38973
+ ...v,
38913
38974
  comment: val
38914
- });
38975
+ };
38915
38976
  }
38916
38977
  return v;
38917
38978
  })
38918
- })
38979
+ }
38919
38980
  });
38920
38981
  },
38921
38982
  t,
@@ -38929,7 +38990,7 @@ const GetFormItem$1 = _ref73 => {
38929
38990
  className: "max-char-span",
38930
38991
  children: t("max-char", {
38931
38992
  chars: MAX_COMMENTS_LENGTH,
38932
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
38993
+ filled: lastReview.comment?.length || 0
38933
38994
  })
38934
38995
  })]
38935
38996
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -38950,7 +39011,7 @@ const GetFormItem$1 = _ref73 => {
38950
39011
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38951
39012
  className: "flex flex-column justify-center mr-1",
38952
39013
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38953
- 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")
39014
+ children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38954
39015
  })
38955
39016
  })]
38956
39017
  })]
@@ -38961,14 +39022,13 @@ const GetFormItem$1 = _ref73 => {
38961
39022
  return null;
38962
39023
  }
38963
39024
  };
38964
- const editErrorHandler = _ref76 => {
38965
- let {
38966
- errorFields,
38967
- t = s => s
38968
- } = _ref76;
39025
+ const editErrorHandler = ({
39026
+ errorFields,
39027
+ t = s => s
39028
+ }) => {
38969
39029
  if (Array.isArray(errorFields) && errorFields.length) {
38970
39030
  const name = errorFields[0].name.join(".");
38971
- const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
39031
+ const element = document.querySelector(`[data-id="${name}"]`);
38972
39032
  if (element) {
38973
39033
  element.scrollIntoView();
38974
39034
  antd.message.error(t("errors::please-correct-invalid-inputs"));