datastake-daf 0.6.808 → 0.6.810

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.
@@ -4778,7 +4778,7 @@ const config$2 = {
4778
4778
  Down: config$3
4779
4779
  };
4780
4780
 
4781
- const _excluded$H = ["width", "height", "size", "name", "fill"];
4781
+ const _excluded$G = ["width", "height", "size", "name", "fill"];
4782
4782
  const CustomIcon = _ref => {
4783
4783
  let {
4784
4784
  width = 14,
@@ -4787,7 +4787,7 @@ const CustomIcon = _ref => {
4787
4787
  name = "",
4788
4788
  fill = "none"
4789
4789
  } = _ref,
4790
- props = _objectWithoutProperties(_ref, _excluded$H);
4790
+ props = _objectWithoutProperties(_ref, _excluded$G);
4791
4791
  const conf = config$2[name];
4792
4792
  if (conf) {
4793
4793
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5076,7 +5076,7 @@ createCommonjsModule(function (module, exports) {
5076
5076
  !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])+"]"}}}));
5077
5077
  });
5078
5078
 
5079
- const _excluded$G = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5079
+ const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5080
5080
  dayjs__default["default"].extend(customParseFormat);
5081
5081
  dayjs__default["default"].extend(utc);
5082
5082
  dayjs__default["default"].extend(utc);
@@ -5452,7 +5452,7 @@ const filterCreateData = data => {
5452
5452
  createdAt,
5453
5453
  updatedAt
5454
5454
  } = data,
5455
- rest = _objectWithoutProperties(data, _excluded$G);
5455
+ rest = _objectWithoutProperties(data, _excluded$F);
5456
5456
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5457
5457
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5458
5458
  meta: _meta
@@ -5984,7 +5984,7 @@ SelectFilters.propTypes = {
5984
5984
  apiUrl: PropTypes__default["default"].string
5985
5985
  };
5986
5986
 
5987
- const _excluded$F = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
5987
+ const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
5988
5988
  function DAFTable(_ref) {
5989
5989
  let {
5990
5990
  columns = [],
@@ -6015,7 +6015,7 @@ function DAFTable(_ref) {
6015
6015
  app,
6016
6016
  doEmptyRows
6017
6017
  } = _ref,
6018
- rest = _objectWithoutProperties(_ref, _excluded$F);
6018
+ rest = _objectWithoutProperties(_ref, _excluded$E);
6019
6019
  const [source, setSource] = React.useState([]);
6020
6020
  const projectData = (projects || []).find(p => p.id === selectedProject);
6021
6021
  const [filtersInit, setFiltersInit] = React.useState(!loading);
@@ -6833,7 +6833,7 @@ function ComponentWithFocus(_ref) {
6833
6833
  }
6834
6834
 
6835
6835
  var _templateObject$h;
6836
- const _excluded$E = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6836
+ const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6837
6837
  function StickyTable(_ref) {
6838
6838
  let {
6839
6839
  size = "small",
@@ -6844,7 +6844,7 @@ function StickyTable(_ref) {
6844
6844
  pagination = false,
6845
6845
  doEmptyRows = true
6846
6846
  } = _ref,
6847
- props = _objectWithoutProperties(_ref, _excluded$E);
6847
+ props = _objectWithoutProperties(_ref, _excluded$D);
6848
6848
  const data = React__default["default"].useMemo(() => {
6849
6849
  if (!doEmptyRows) {
6850
6850
  return dataSource;
@@ -7372,7 +7372,7 @@ const BTN_SIZE = {
7372
7372
  LG: 'large'
7373
7373
  };
7374
7374
 
7375
- const _excluded$D = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7375
+ const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7376
7376
  function DafButton(_ref) {
7377
7377
  let {
7378
7378
  content = '',
@@ -7386,7 +7386,7 @@ function DafButton(_ref) {
7386
7386
  style = {},
7387
7387
  className = ''
7388
7388
  } = _ref,
7389
- restProps = _objectWithoutProperties(_ref, _excluded$D);
7389
+ restProps = _objectWithoutProperties(_ref, _excluded$C);
7390
7390
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7391
7391
  icon: icon,
7392
7392
  type: type,
@@ -7505,12 +7505,12 @@ const Style$R = styled__default["default"].div`
7505
7505
  }
7506
7506
  `;
7507
7507
 
7508
- const _excluded$C = ["children"];
7508
+ const _excluded$B = ["children"];
7509
7509
  const BorderedButton = _ref => {
7510
7510
  let {
7511
7511
  children
7512
7512
  } = _ref,
7513
- props = _objectWithoutProperties(_ref, _excluded$C);
7513
+ props = _objectWithoutProperties(_ref, _excluded$B);
7514
7514
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7515
7515
  className: "d-btn-cont",
7516
7516
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7650,12 +7650,12 @@ Badge.propTypes = {
7650
7650
  props: PropTypes__default["default"].object
7651
7651
  };
7652
7652
 
7653
- const _excluded$B = ["icon"];
7653
+ const _excluded$A = ["icon"];
7654
7654
  function GetIcon(_ref) {
7655
7655
  let {
7656
7656
  icon
7657
7657
  } = _ref,
7658
- props = _objectWithoutProperties(_ref, _excluded$B);
7658
+ props = _objectWithoutProperties(_ref, _excluded$A);
7659
7659
  let Icon = Icons__namespace.CloseOutlined;
7660
7660
  if (Icons__namespace[icon]) {
7661
7661
  Icon = Icons__namespace[icon];
@@ -7985,7 +7985,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
7985
7985
  }
7986
7986
  `;
7987
7987
 
7988
- const _excluded$A = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
7988
+ const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
7989
7989
  const {
7990
7990
  useToken: useToken$n
7991
7991
  } = antd.theme;
@@ -8078,7 +8078,7 @@ function Multiselect(_ref) {
8078
8078
  isSingle = false,
8079
8079
  selectionType = SELECTION_TYPES.DEFAULT
8080
8080
  } = _ref,
8081
- restProps = _objectWithoutProperties(_ref, _excluded$A);
8081
+ restProps = _objectWithoutProperties(_ref, _excluded$z);
8082
8082
  const {
8083
8083
  token
8084
8084
  } = useToken$n();
@@ -8798,7 +8798,7 @@ DAFHeader.propTypes = {
8798
8798
  filtersConfig: PropTypes__default["default"].any
8799
8799
  };
8800
8800
 
8801
- const _excluded$z = ["tabs", "onChange", "value", "className"];
8801
+ const _excluded$y = ["tabs", "onChange", "value", "className"];
8802
8802
  function TabsHeader(_ref) {
8803
8803
  let {
8804
8804
  tabs = [],
@@ -8806,7 +8806,7 @@ function TabsHeader(_ref) {
8806
8806
  value = '',
8807
8807
  className = 'mt-2'
8808
8808
  } = _ref,
8809
- rest = _objectWithoutProperties(_ref, _excluded$z);
8809
+ rest = _objectWithoutProperties(_ref, _excluded$y);
8810
8810
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8811
8811
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8812
8812
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8903,7 +8903,7 @@ DrawerHeader.propTypes = {
8903
8903
  tabsConfig: PropTypes__default["default"].any
8904
8904
  };
8905
8905
 
8906
- const _excluded$y = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8906
+ const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8907
8907
  const useFooter = _ref => {
8908
8908
  let {
8909
8909
  leftContent,
@@ -8938,7 +8938,7 @@ const useFooter = _ref => {
8938
8938
  style = {},
8939
8939
  className = ""
8940
8940
  } = button,
8941
- restProps = _objectWithoutProperties(button, _excluded$y);
8941
+ restProps = _objectWithoutProperties(button, _excluded$x);
8942
8942
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8943
8943
  content: label,
8944
8944
  type: type,
@@ -11819,7 +11819,7 @@ Widget.propTypes = {
11819
11819
  };
11820
11820
  Widget.displayName = 'Widget';
11821
11821
 
11822
- const _excluded$x = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11822
+ const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11823
11823
  function ImageWidget(_ref) {
11824
11824
  let {
11825
11825
  loading = false,
@@ -11830,7 +11830,7 @@ function ImageWidget(_ref) {
11830
11830
  noDescriptionText,
11831
11831
  isPdf = false
11832
11832
  } = _ref,
11833
- props = _objectWithoutProperties(_ref, _excluded$x);
11833
+ props = _objectWithoutProperties(_ref, _excluded$w);
11834
11834
  const expandable = isPdf ? false : props.expandable;
11835
11835
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11836
11836
  loading: loading,
@@ -11890,7 +11890,7 @@ function ImageWidget(_ref) {
11890
11890
  ImageWidget.displayName = 'ImageWidget';
11891
11891
 
11892
11892
  var _templateObject$e;
11893
- const _excluded$w = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11893
+ const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11894
11894
  function FlowWidget(_ref) {
11895
11895
  let {
11896
11896
  title,
@@ -11902,7 +11902,7 @@ function FlowWidget(_ref) {
11902
11902
  className,
11903
11903
  direction = "horizontal"
11904
11904
  } = _ref,
11905
- rest = _objectWithoutProperties(_ref, _excluded$w);
11905
+ rest = _objectWithoutProperties(_ref, _excluded$v);
11906
11906
  const [activeTab, setActiveTab] = React.useState();
11907
11907
  React.useEffect(() => {
11908
11908
  if (defaultActiveTab) {
@@ -15618,7 +15618,7 @@ Map$3.propTypes = {
15618
15618
  link: PropTypes__default["default"].any
15619
15619
  };
15620
15620
 
15621
- const _excluded$v = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15621
+ const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15622
15622
  function InExpandableWidgetMap(_ref) {
15623
15623
  let {
15624
15624
  isExpanded,
@@ -15632,7 +15632,7 @@ function InExpandableWidgetMap(_ref) {
15632
15632
  height,
15633
15633
  widgetConfig
15634
15634
  } = _ref,
15635
- rest = _objectWithoutProperties(_ref, _excluded$v);
15635
+ rest = _objectWithoutProperties(_ref, _excluded$u);
15636
15636
  const [mapKey, setMapKey] = React.useState(0);
15637
15637
  const [isMapReady, setIsMapReady] = React.useState(false);
15638
15638
  React.useEffect(() => {
@@ -17832,14 +17832,14 @@ const MapConfig = ({
17832
17832
  });
17833
17833
  };
17834
17834
 
17835
- const _excluded$u = ["config", "title", "loading"];
17835
+ const _excluded$t = ["config", "title", "loading"];
17836
17836
  const Details = _ref => {
17837
17837
  let {
17838
17838
  config = [],
17839
17839
  title,
17840
17840
  loading = false
17841
17841
  } = _ref,
17842
- rest = _objectWithoutProperties(_ref, _excluded$u);
17842
+ rest = _objectWithoutProperties(_ref, _excluded$t);
17843
17843
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17844
17844
  className: "with-border-header h-w-btn-header card",
17845
17845
  loading: loading,
@@ -17855,14 +17855,14 @@ const Details = _ref => {
17855
17855
  }));
17856
17856
  };
17857
17857
 
17858
- const _excluded$t = ["config", "title", "loading"];
17858
+ const _excluded$s = ["config", "title", "loading"];
17859
17859
  const KeyIndicatorsDetails = _ref => {
17860
17860
  let {
17861
17861
  config,
17862
17862
  title,
17863
17863
  loading = false
17864
17864
  } = _ref,
17865
- rest = _objectWithoutProperties(_ref, _excluded$t);
17865
+ rest = _objectWithoutProperties(_ref, _excluded$s);
17866
17866
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17867
17867
  className: "with-border-header h-w-btn-header",
17868
17868
  title: title,
@@ -17892,7 +17892,7 @@ const Style$G = styled__default["default"].div`
17892
17892
  }
17893
17893
  `;
17894
17894
 
17895
- const _excluded$s = ["children", "config", "detailsTitle", "firstColumnWidth"];
17895
+ const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
17896
17896
  const DetailsSection = _ref => {
17897
17897
  let {
17898
17898
  children,
@@ -17900,7 +17900,7 @@ const DetailsSection = _ref => {
17900
17900
  detailsTitle,
17901
17901
  firstColumnWidth = "250px"
17902
17902
  } = _ref,
17903
- rest = _objectWithoutProperties(_ref, _excluded$s);
17903
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17904
17904
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17905
17905
  firstColumnWidth: firstColumnWidth,
17906
17906
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18076,14 +18076,14 @@ const getGoalConfig = () => {
18076
18076
  };
18077
18077
 
18078
18078
  var _templateObject$c;
18079
- const _excluded$r = ["title", "activeSdgGoals", "t"];
18079
+ const _excluded$q = ["title", "activeSdgGoals", "t"];
18080
18080
  function SDGWidget(_ref) {
18081
18081
  let {
18082
18082
  title = "Sustainable Development Goals",
18083
18083
  activeSdgGoals = [],
18084
18084
  t = key => key
18085
18085
  } = _ref,
18086
- props = _objectWithoutProperties(_ref, _excluded$r);
18086
+ props = _objectWithoutProperties(_ref, _excluded$q);
18087
18087
  const sdgConfig = getGoalConfig();
18088
18088
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18089
18089
  title: title,
@@ -18381,7 +18381,7 @@ function SdgList({
18381
18381
  });
18382
18382
  }
18383
18383
 
18384
- const _excluded$q = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18384
+ const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18385
18385
  const {
18386
18386
  Meta
18387
18387
  } = antd.Card;
@@ -18401,7 +18401,7 @@ function ProjectWidget(_ref) {
18401
18401
  hideSDGList = false,
18402
18402
  t = x => x
18403
18403
  } = _ref,
18404
- props = _objectWithoutProperties(_ref, _excluded$q);
18404
+ props = _objectWithoutProperties(_ref, _excluded$p);
18405
18405
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18406
18406
  const {
18407
18407
  token
@@ -18673,13 +18673,13 @@ const WidgetCard = _ref => {
18673
18673
  });
18674
18674
  };
18675
18675
 
18676
- const _excluded$p = ["title", "children"];
18676
+ const _excluded$o = ["title", "children"];
18677
18677
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18678
18678
  let {
18679
18679
  title,
18680
18680
  children
18681
18681
  } = _ref,
18682
- rest = _objectWithoutProperties(_ref, _excluded$p);
18682
+ rest = _objectWithoutProperties(_ref, _excluded$o);
18683
18683
  /**
18684
18684
  * Handles carousel slide change events
18685
18685
  * @param {number} currentSlide - The index of the current slide after change
@@ -18843,7 +18843,7 @@ const EmptyStateContainer = styled__default["default"].div`
18843
18843
  }
18844
18844
  `;
18845
18845
 
18846
- const _excluded$o = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18846
+ const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18847
18847
  function ImageCarousel(_ref) {
18848
18848
  let {
18849
18849
  title,
@@ -18858,7 +18858,7 @@ function ImageCarousel(_ref) {
18858
18858
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18859
18859
  emptyText = "No Image"
18860
18860
  } = _ref,
18861
- rest = _objectWithoutProperties(_ref, _excluded$o);
18861
+ rest = _objectWithoutProperties(_ref, _excluded$n);
18862
18862
  const [previewVisible, setPreviewVisible] = React.useState(false);
18863
18863
  const [current, setCurrent] = React.useState(0);
18864
18864
  const carouselRef = React.useRef(null);
@@ -19227,7 +19227,7 @@ const getVegetationConfig = () => {
19227
19227
  };
19228
19228
 
19229
19229
  var _templateObject$a, _templateObject2$3;
19230
- const _excluded$n = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19230
+ const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19231
19231
  function VegetationWidget(_ref) {
19232
19232
  let {
19233
19233
  title = "Vegetation Health",
@@ -19239,7 +19239,7 @@ function VegetationWidget(_ref) {
19239
19239
  growthObservations = [],
19240
19240
  t = key => key
19241
19241
  } = _ref,
19242
- props = _objectWithoutProperties(_ref, _excluded$n);
19242
+ props = _objectWithoutProperties(_ref, _excluded$m);
19243
19243
  let vegetationConfig = getVegetationConfig();
19244
19244
 
19245
19245
  // Get all VEGETATION_KEYS values before filtering (needed for mapping check)
@@ -19362,7 +19362,7 @@ const getFaunaConfig = () => {
19362
19362
  };
19363
19363
 
19364
19364
  var _templateObject$9, _templateObject2$2;
19365
- const _excluded$m = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19365
+ const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19366
19366
  function FaunaWidget(_ref) {
19367
19367
  let {
19368
19368
  title = "Observed Fauna",
@@ -19373,7 +19373,7 @@ function FaunaWidget(_ref) {
19373
19373
  itemHeight = 100,
19374
19374
  t = key => key
19375
19375
  } = _ref,
19376
- props = _objectWithoutProperties(_ref, _excluded$m);
19376
+ props = _objectWithoutProperties(_ref, _excluded$l);
19377
19377
  let faunaConfig = getFaunaConfig();
19378
19378
 
19379
19379
  // Filter to show only specific keys if filterKeys is provided
@@ -19440,7 +19440,7 @@ const getInvasiveSpeciesConfig = () => {
19440
19440
  };
19441
19441
 
19442
19442
  var _templateObject$8, _templateObject2$1;
19443
- const _excluded$l = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19443
+ const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19444
19444
  function InvasiveSpeciesWidget(_ref) {
19445
19445
  let {
19446
19446
  title = "Invasive Species",
@@ -19452,7 +19452,7 @@ function InvasiveSpeciesWidget(_ref) {
19452
19452
  itemHeight = 100,
19453
19453
  t = key => key
19454
19454
  } = _ref,
19455
- props = _objectWithoutProperties(_ref, _excluded$l);
19455
+ props = _objectWithoutProperties(_ref, _excluded$k);
19456
19456
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19457
19457
 
19458
19458
  // Filter to show only specific keys if filterKeys is provided
@@ -24875,8 +24875,8 @@ const RepeatableModals = ({
24875
24875
  }) : null;
24876
24876
  };
24877
24877
 
24878
- const _excluded$k = ["viewGroup"],
24879
- _excluded2$2 = ["label", "icon", "position"];
24878
+ const _excluded$j = ["viewGroup"],
24879
+ _excluded2$1 = ["label", "icon", "position"];
24880
24880
  const Content$1 = _ref => {
24881
24881
  let {
24882
24882
  style = {},
@@ -24947,7 +24947,7 @@ const Content$1 = _ref => {
24947
24947
  if (groups[gKey].viewGroup === key) {
24948
24948
  // eslint-disable-next-line no-unused-vars
24949
24949
  const _groups$gKey = groups[gKey],
24950
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
24950
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
24951
24951
  items[gKey] = gCfg;
24952
24952
  }
24953
24953
  return items;
@@ -25175,7 +25175,7 @@ const Content$1 = _ref => {
25175
25175
  showIcon: true
25176
25176
  });
25177
25177
  }
25178
- let groups = _objectWithoutProperties(f, _excluded2$2);
25178
+ let groups = _objectWithoutProperties(f, _excluded2$1);
25179
25179
  groups = Object.keys(groups).reduce((items, key) => {
25180
25180
  var _groups$key2;
25181
25181
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -25227,7 +25227,7 @@ const Content$1 = _ref => {
25227
25227
  });
25228
25228
  };
25229
25229
 
25230
- const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25230
+ const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25231
25231
  function Modal(_ref) {
25232
25232
  let {
25233
25233
  t = text => text,
@@ -25243,7 +25243,7 @@ function Modal(_ref) {
25243
25243
  disabled = false,
25244
25244
  withModalFormWrapper = true
25245
25245
  } = _ref,
25246
- props = _objectWithoutProperties(_ref, _excluded$j);
25246
+ props = _objectWithoutProperties(_ref, _excluded$i);
25247
25247
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25248
25248
  width: 650,
25249
25249
  footer: null,
@@ -30737,6 +30737,7 @@ function Repeatable({
30737
30737
  });
30738
30738
  }
30739
30739
 
30740
+ /* eslint-disable no-eval */
30740
30741
  const isRiskComment = inputData => {
30741
30742
  if (inputData) {
30742
30743
  if (inputData.name === 'assessment') {
@@ -30749,10 +30750,7 @@ const isRiskComment = inputData => {
30749
30750
  };
30750
30751
 
30751
30752
  // options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
30752
- function renderNestedInputs$1(options, k) {
30753
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
30754
- args[_key - 2] = arguments[_key];
30755
- }
30753
+ function renderNestedInputs$1(options, k, ...args) {
30756
30754
  if (options[k].repeatable) {
30757
30755
  return renderRepeatable$1(options, k, ...args);
30758
30756
  } else {
@@ -30780,11 +30778,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30780
30778
  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, {
30781
30779
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
30782
30780
  name: formId,
30783
- children: (fields, _ref) => {
30784
- let {
30785
- add,
30786
- remove
30787
- } = _ref;
30781
+ children: (fields, {
30782
+ add,
30783
+ remove
30784
+ }) => {
30788
30785
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
30789
30786
  if (fields.length === 0) {
30790
30787
  const formInputs = form.inputs;
@@ -30834,10 +30831,14 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30834
30831
  const _val = {
30835
30832
  [formId]: formData.map((d, j) => i === j ? val : d)
30836
30833
  };
30837
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, values), _val));
30838
- setValues(_objectSpread2(_objectSpread2({}, values), {}, {
30834
+ onValuesChange(_val, {
30835
+ ...values,
30836
+ ..._val
30837
+ });
30838
+ setValues({
30839
+ ...values,
30839
30840
  [formId]: formData.map((d, j) => i === j ? val : d)
30840
- }));
30841
+ });
30841
30842
  };
30842
30843
  return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
30843
30844
  form: form,
@@ -30893,156 +30894,154 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
30893
30894
  highlightMandatory
30894
30895
  });
30895
30896
  };
30896
- const GroupContent = _ref2 => {
30897
- var _form$meta;
30898
- let {
30899
- form,
30900
- values = {},
30901
- i,
30902
- formId,
30903
- excludedKeys,
30904
- getData,
30905
- setValues,
30906
- MainForm,
30907
- options,
30908
- plainForms,
30909
- setAddress,
30910
- onValuesChange,
30911
- allData,
30912
- changeInputMeta,
30913
- highlightMandatory
30914
- } = _ref2;
30897
+ const GroupContent = ({
30898
+ form,
30899
+ values = {},
30900
+ i,
30901
+ formId,
30902
+ excludedKeys,
30903
+ getData,
30904
+ setValues,
30905
+ MainForm,
30906
+ options,
30907
+ plainForms,
30908
+ setAddress,
30909
+ onValuesChange,
30910
+ allData,
30911
+ changeInputMeta,
30912
+ highlightMandatory
30913
+ }) => {
30915
30914
  const {
30916
30915
  user,
30917
30916
  t
30918
30917
  } = useEditContext();
30919
30918
  const label = getInputLabel$1(form, values);
30920
- 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);
30919
+ const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
30921
30920
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
30922
30921
  const formValues = values[form.dataId];
30923
- const renderInputs = () => {
30924
- var _form$meta2;
30925
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30926
- children: [form !== null && form !== void 0 && (_form$meta2 = form.meta) !== null && _form$meta2 !== void 0 && _form$meta2.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30927
- config: form.meta.groupInfo,
30928
- user: user,
30929
- t: t
30930
- }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30931
- var _ref3, _values$meta, _values$meta2, _input$meta, _inputData$rules, _input$meta2;
30932
- const isAjaxSubGroup = (form === null || form === void 0 ? void 0 : form.type) === "ajaxSubGroup";
30933
- const input = form.inputs[inp];
30934
- const inputId = input.dataId || inp;
30935
- const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30936
- const value = inputValues[inputId];
30937
- const commentValue = inputValues["".concat(inputId, "Comment")];
30938
- const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
30939
- const subtitles = form.subtitles || null;
30940
- 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] || {};
30941
- inputData.repeatIndex = undefined;
30942
- inputData.inputName = inputId;
30943
- inputData.repeatValues = inputValues;
30944
- if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
30945
- inputData.groupInputs = inputData.groupInputs.map(gpI => {
30946
- gpI.data.inputName = gpI.data.name;
30947
- gpI.data.repeatIndex = undefined;
30948
- gpI.data.name = formId;
30949
- return gpI;
30922
+ const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30923
+ children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30924
+ config: form.meta.groupInfo,
30925
+ user: user,
30926
+ t: t
30927
+ }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30928
+ const isAjaxSubGroup = form?.type === "ajaxSubGroup";
30929
+ const input = form.inputs[inp];
30930
+ const inputId = input.dataId || inp;
30931
+ const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30932
+ const value = inputValues[inputId];
30933
+ const commentValue = inputValues[`${inputId}Comment`];
30934
+ const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
30935
+ const subtitles = form.subtitles || null;
30936
+ const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
30937
+ inputData.repeatIndex = undefined;
30938
+ inputData.inputName = inputId;
30939
+ inputData.repeatValues = inputValues;
30940
+ if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
30941
+ inputData.groupInputs = inputData.groupInputs.map(gpI => {
30942
+ gpI.data.inputName = gpI.data.name;
30943
+ gpI.data.repeatIndex = undefined;
30944
+ gpI.data.name = formId;
30945
+ return gpI;
30946
+ });
30947
+ }
30948
+ const isRisk = isRiskComment(inputData);
30949
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
30950
+ const btnOnClick = () => {
30951
+ if (typeof inputData.commentValue === 'string') {
30952
+ onValuesChange({}, {
30953
+ ...values,
30954
+ [`${inputData.inputName}`]: null
30950
30955
  });
30951
30956
  }
30952
- const isRisk = isRiskComment(inputData);
30953
- 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);
30954
- const btnOnClick = () => {
30955
- if (typeof inputData.commentValue === 'string') {
30956
- onValuesChange({}, _objectSpread2(_objectSpread2({}, values), {}, {
30957
- ["".concat(inputData.inputName)]: null
30958
- }));
30959
- }
30957
+ const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
30958
+ inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
30959
+ if (Array.isArray(values[formId])) {
30960
+ values[formId] = inputValues;
30961
+ } else {
30962
+ values[formId] = inputValues;
30963
+ }
30964
+ setValues({
30965
+ ...values
30966
+ });
30967
+ };
30968
+ const btnOnClick2 = () => {
30969
+ if (typeof inputData.commentValue !== 'string') {
30960
30970
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
30961
- inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
30971
+ inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
30962
30972
  if (Array.isArray(values[formId])) {
30963
30973
  values[formId] = inputValues;
30964
30974
  } else {
30965
30975
  values[formId] = inputValues;
30966
30976
  }
30967
- setValues(_objectSpread2({}, values));
30968
- };
30969
- const btnOnClick2 = () => {
30970
- if (typeof inputData.commentValue !== 'string') {
30971
- const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
30972
- inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
30973
- if (Array.isArray(values[formId])) {
30974
- values[formId] = inputValues;
30975
- } else {
30976
- values[formId] = inputValues;
30977
- }
30978
- setValues(_objectSpread2({}, values));
30979
- }
30980
- };
30981
- 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 => {
30982
- if (rule.metaIf && typeof rule.metaIf === 'string') {
30983
- var _values$meta3, _values$meta4;
30984
- const [name, cond, value] = rule.metaIf.split(' ');
30985
- 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]];
30986
- if (cond === 'is') {
30987
- return !!(val !== null && val !== void 0 && val[value]);
30988
- }
30989
- }
30990
- return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
30991
- });
30992
- const requiredRule = rules.find(r => r.required);
30993
- if (requiredRule && input.type === 'text') {
30994
- rules.push({
30995
- whitespace: true,
30996
- message: requiredRule.message || ''
30977
+ setValues({
30978
+ ...values
30997
30979
  });
30998
30980
  }
30999
- return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31000
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31001
- style: {
31002
- position: 'relative'
31003
- },
31004
- 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, {
31005
- input: input,
31006
- inputTypeComponent: inputTypeComponent$1,
31007
- inputData: inputData,
31008
- MainForm: MainForm,
31009
- options: options,
31010
- setValues: setValues,
31011
- formId: formId,
31012
- inputId: inputId,
31013
- inputOnBlur: inputOnBlur,
31014
- values: values,
31015
- getInputLabel: getInputLabel$1,
31016
- plainForms: plainForms,
31017
- setAddress: setAddress,
31018
- btnOnClick: btnOnClick,
31019
- btnOnClick2: btnOnClick2,
31020
- locationName: (allData || {}).locationName,
31021
- subGroupTitle: (allData || {}).subGroupTitle
31022
- }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31023
- values,
31024
- formId,
31025
- setValues,
31026
- MainForm,
31027
- options,
31028
- plainForms,
31029
- setAddress,
31030
- inputData,
31031
- inputId,
31032
- input,
31033
- rules,
31034
- inputMeta,
31035
- changeInputMeta,
31036
- notPartOfTheForm,
31037
- isAjaxSubGroup,
31038
- isHighlighted
31039
- })]
31040
- }, ii)
31041
- }, "".concat(i).concat(ii)) : null;
31042
- })]
31043
- });
31044
- };
31045
- const isNa = (formValues === null || formValues === void 0 ? void 0 : formValues.valuation) === 'na';
30981
+ };
30982
+ const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
30983
+ if (rule.metaIf && typeof rule.metaIf === 'string') {
30984
+ const [name, cond, value] = rule.metaIf.split(' ');
30985
+ const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
30986
+ if (cond === 'is') {
30987
+ return !!val?.[value];
30988
+ }
30989
+ }
30990
+ return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
30991
+ });
30992
+ const requiredRule = rules.find(r => r.required);
30993
+ if (requiredRule && input.type === 'text') {
30994
+ rules.push({
30995
+ whitespace: true,
30996
+ message: requiredRule.message || ''
30997
+ });
30998
+ }
30999
+ return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31000
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31001
+ style: {
31002
+ position: 'relative'
31003
+ },
31004
+ 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, {
31005
+ input: input,
31006
+ inputTypeComponent: inputTypeComponent$1,
31007
+ inputData: inputData,
31008
+ MainForm: MainForm,
31009
+ options: options,
31010
+ setValues: setValues,
31011
+ formId: formId,
31012
+ inputId: inputId,
31013
+ inputOnBlur: inputOnBlur,
31014
+ values: values,
31015
+ getInputLabel: getInputLabel$1,
31016
+ plainForms: plainForms,
31017
+ setAddress: setAddress,
31018
+ btnOnClick: btnOnClick,
31019
+ btnOnClick2: btnOnClick2,
31020
+ locationName: (allData || {}).locationName,
31021
+ subGroupTitle: (allData || {}).subGroupTitle
31022
+ }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31023
+ values,
31024
+ formId,
31025
+ setValues,
31026
+ MainForm,
31027
+ options,
31028
+ plainForms,
31029
+ setAddress,
31030
+ inputData,
31031
+ inputId,
31032
+ input,
31033
+ rules,
31034
+ inputMeta,
31035
+ changeInputMeta,
31036
+ notPartOfTheForm,
31037
+ isAjaxSubGroup,
31038
+ isHighlighted
31039
+ })]
31040
+ }, ii)
31041
+ }, `${i}${ii}`) : null;
31042
+ })]
31043
+ });
31044
+ const isNa = formValues?.valuation === 'na';
31046
31045
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31047
31046
  children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
31048
31047
  className: "risk-header",
@@ -31050,46 +31049,44 @@ const GroupContent = _ref2 => {
31050
31049
  children: label
31051
31050
  })
31052
31051
  }) : /*#__PURE__*/jsxRuntime.jsx("h3", {
31053
- className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
31052
+ className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
31054
31053
  children: label
31055
31054
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
31056
- className: "repeatable ".concat(hasLabel ? "mb-4" : ""),
31055
+ className: `repeatable ${hasLabel ? "mb-4" : ""}`,
31057
31056
  children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
31058
31057
  children: getInputProp(form.titleLabel, values)
31059
- }) : null, formValues !== null && formValues !== void 0 && formValues.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31058
+ }) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31060
31059
  t: t,
31061
31060
  isNa: isNa,
31062
31061
  isSuccess: !isNa
31063
31062
  // TODO: translate
31064
31063
  ,
31065
31064
  config: {
31066
- title: t("No ".concat((formValues === null || formValues === void 0 ? void 0 : formValues.stage) || 'planning', " required"))
31065
+ title: t(`No ${formValues?.stage || 'planning'} required`)
31067
31066
  },
31068
31067
  children: renderInputs()
31069
31068
  }) : renderInputs()]
31070
31069
  })]
31071
31070
  });
31072
31071
  };
31073
- const GroupContentFormItem = _ref4 => {
31074
- 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;
31075
- let {
31076
- values,
31077
- formId,
31078
- setValues,
31079
- MainForm,
31080
- options,
31081
- plainForms,
31082
- setAddress,
31083
- inputData,
31084
- inputId,
31085
- input,
31086
- rules,
31087
- inputMeta,
31088
- changeInputMeta,
31089
- notPartOfTheForm = true,
31090
- isAjaxSubGroup,
31091
- isHighlighted
31092
- } = _ref4;
31072
+ const GroupContentFormItem = ({
31073
+ values,
31074
+ formId,
31075
+ setValues,
31076
+ MainForm,
31077
+ options,
31078
+ plainForms,
31079
+ setAddress,
31080
+ inputData,
31081
+ inputId,
31082
+ input,
31083
+ rules,
31084
+ inputMeta,
31085
+ changeInputMeta,
31086
+ notPartOfTheForm = true,
31087
+ isAjaxSubGroup,
31088
+ isHighlighted
31089
+ }) => {
31093
31090
  const {
31094
31091
  t,
31095
31092
  user,
@@ -31103,10 +31100,10 @@ const GroupContentFormItem = _ref4 => {
31103
31100
  staticWidth,
31104
31101
  fullWidth
31105
31102
  } = useEditContext();
31106
- const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
31107
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
31103
+ const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
31104
+ let maxRule = rules.find(rule => rule.max)?.max;
31108
31105
  const requiredRule = rules.find(r => r.required);
31109
- 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];
31106
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
31110
31107
  if (!maxRule && input.type === 'textarea') {
31111
31108
  maxRule = MAX_TEXT_AREA_LENGTH;
31112
31109
  }
@@ -31125,35 +31122,38 @@ const GroupContentFormItem = _ref4 => {
31125
31122
  }
31126
31123
  setIsShown(true);
31127
31124
  if (notPartOfTheForm || isAjaxSubGroup) {
31128
- var _values$meta5;
31129
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
31125
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31130
31126
  const _defaultData = MainForm.getFieldValue(formId);
31131
31127
  if (isAjaxSubGroup) {
31132
- var _defaultData$meta, _defaultData$meta2;
31133
31128
  changeInputMeta({
31134
31129
  key: formId,
31135
31130
  type: input.type,
31136
31131
  otherValues: {
31137
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31132
+ [formId]: {
31133
+ ..._defaultData,
31138
31134
  meta: {
31139
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta = _defaultData.meta) === null || _defaultData$meta === void 0 ? void 0 : _defaultData$meta.inputs) || {}), {}, {
31140
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta2 = _defaultData.meta) === null || _defaultData$meta2 === void 0 ? void 0 : _defaultData$meta2.inputs) || {})[inputId] || {}), {}, {
31135
+ inputs: {
31136
+ ...(_defaultData?.meta?.inputs || {}),
31137
+ [inputId]: {
31138
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31141
31139
  comment: ''
31142
- })
31143
- })
31140
+ }
31141
+ }
31144
31142
  }
31145
- })
31143
+ }
31146
31144
  }
31147
31145
  });
31148
31146
  } else {
31149
31147
  changeInputMeta({
31150
31148
  key: formId,
31151
31149
  type: input.type,
31152
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31153
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31150
+ value: {
31151
+ ..._defaultMeta,
31152
+ [inputId]: {
31153
+ ...(_defaultMeta[inputId] || {}),
31154
31154
  comment: ''
31155
- })
31156
- })
31155
+ }
31156
+ }
31157
31157
  });
31158
31158
  }
31159
31159
  } else {
@@ -31170,58 +31170,62 @@ const GroupContentFormItem = _ref4 => {
31170
31170
  if (!isReview) {
31171
31171
  return;
31172
31172
  }
31173
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
31173
+ const reviewSuccess = lastReview?.reviewSuccess;
31174
31174
  if (notPartOfTheForm || isAjaxSubGroup) {
31175
- var _values$meta6;
31176
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
31175
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31177
31176
  const _defaultData = MainForm.getFieldValue(formId);
31178
31177
  if (isAjaxSubGroup) {
31179
- var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
31180
31178
  changeInputMeta({
31181
31179
  key: formId,
31182
31180
  type: input.type,
31183
31181
  otherValues: {
31184
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31182
+ [formId]: {
31183
+ ..._defaultData,
31185
31184
  meta: {
31186
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta3 = _defaultData.meta) === null || _defaultData$meta3 === void 0 ? void 0 : _defaultData$meta3.inputs) || {}), {}, {
31187
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta4 = _defaultData.meta) === null || _defaultData$meta4 === void 0 ? void 0 : _defaultData$meta4.inputs) || {})[inputId] || {}), {}, {
31188
- 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 || []), {
31185
+ inputs: {
31186
+ ...(_defaultData?.meta?.inputs || {}),
31187
+ [inputId]: {
31188
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31189
+ reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31189
31190
  reviewer: user,
31190
31191
  createdAt: new Date().toISOString(),
31191
31192
  reviewSuccess: true
31192
31193
  }]
31193
- })
31194
- })
31194
+ }
31195
+ }
31195
31196
  }
31196
- })
31197
+ }
31197
31198
  }
31198
31199
  });
31199
31200
  } else {
31200
31201
  changeInputMeta({
31201
31202
  key: formId,
31202
31203
  type: input.type,
31203
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31204
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31204
+ value: {
31205
+ ..._defaultMeta,
31206
+ [inputId]: {
31207
+ ...(_defaultMeta[inputId] || {}),
31205
31208
  reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31206
31209
  reviewer: user,
31207
31210
  createdAt: new Date().toISOString(),
31208
31211
  reviewSuccess: true
31209
31212
  }]
31210
- })
31211
- })
31213
+ }
31214
+ }
31212
31215
  });
31213
31216
  }
31214
31217
  } else {
31215
31218
  changeInputMeta({
31216
31219
  key: inputId,
31217
31220
  type: input.type,
31218
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31221
+ value: {
31222
+ ...inputMeta,
31219
31223
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31220
31224
  reviewer: user,
31221
31225
  createdAt: new Date().toISOString(),
31222
31226
  reviewSuccess: true
31223
31227
  }]
31224
- })
31228
+ }
31225
31229
  });
31226
31230
  }
31227
31231
  };
@@ -31229,111 +31233,118 @@ const GroupContentFormItem = _ref4 => {
31229
31233
  if (!isReview) {
31230
31234
  return;
31231
31235
  }
31232
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
31236
+ const reviewError = lastReview?.reviewError;
31233
31237
  if (notPartOfTheForm || isAjaxSubGroup) {
31234
- var _values$meta7;
31235
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
31238
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31236
31239
  const _defaultData = MainForm.getFieldValue(formId);
31237
31240
  if (isAjaxSubGroup) {
31238
- var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
31239
31241
  changeInputMeta({
31240
31242
  key: formId,
31241
31243
  type: input.type,
31242
31244
  otherValues: {
31243
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31245
+ [formId]: {
31246
+ ..._defaultData,
31244
31247
  meta: {
31245
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta7 = _defaultData.meta) === null || _defaultData$meta7 === void 0 ? void 0 : _defaultData$meta7.inputs) || {}), {}, {
31246
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta8 = _defaultData.meta) === null || _defaultData$meta8 === void 0 ? void 0 : _defaultData$meta8.inputs) || {})[inputId] || {}), {}, {
31247
- 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 || []), {
31248
+ inputs: {
31249
+ ...(_defaultData?.meta?.inputs || {}),
31250
+ [inputId]: {
31251
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31252
+ reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31248
31253
  reviewer: user,
31249
31254
  createdAt: new Date().toISOString(),
31250
31255
  reviewError: true,
31251
31256
  comment: ''
31252
31257
  }]
31253
- })
31254
- })
31258
+ }
31259
+ }
31255
31260
  }
31256
- })
31261
+ }
31257
31262
  }
31258
31263
  });
31259
31264
  } else {
31260
31265
  changeInputMeta({
31261
31266
  key: formId,
31262
31267
  type: input.type,
31263
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31264
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31268
+ value: {
31269
+ ..._defaultMeta,
31270
+ [inputId]: {
31271
+ ...(_defaultMeta[inputId] || {}),
31265
31272
  reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31266
31273
  reviewer: user,
31267
31274
  createdAt: new Date().toISOString(),
31268
31275
  reviewError: true,
31269
31276
  comment: ''
31270
31277
  }]
31271
- })
31272
- })
31278
+ }
31279
+ }
31273
31280
  });
31274
31281
  }
31275
31282
  } else {
31276
31283
  changeInputMeta({
31277
31284
  key: inputId,
31278
31285
  type: input.type,
31279
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31286
+ value: {
31287
+ ...inputMeta,
31280
31288
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31281
31289
  reviewer: user,
31282
31290
  createdAt: new Date().toISOString(),
31283
31291
  reviewError: true,
31284
31292
  comment: ''
31285
31293
  }]
31286
- })
31294
+ }
31287
31295
  });
31288
31296
  }
31289
31297
  };
31290
- 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';
31298
+ const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
31291
31299
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31292
31300
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
31293
31301
  className: "flex input-cont",
31294
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
31295
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
31296
- }, ['total100', 'group'].includes(input.type) ? {} : {
31297
- name: notPartOfTheForm ? [formId, inputId] : inputId,
31298
- fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31299
- initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31300
- }), ['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31301
- valuePropName: "fileList",
31302
- getValueFromEvent: e => {
31303
- if (Array.isArray(e)) {
31304
- return e;
31305
- }
31306
- return e && e.fileList && e.fileList.map(f => {
31307
- if (f.response) {
31308
- return f.response;
31302
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31303
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
31304
+ ...(['total100', 'group'].includes(input.type) ? {} : {
31305
+ name: notPartOfTheForm ? [formId, inputId] : inputId,
31306
+ fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31307
+ initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31308
+ }),
31309
+ ...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31310
+ valuePropName: "fileList",
31311
+ getValueFromEvent: e => {
31312
+ if (Array.isArray(e)) {
31313
+ return e;
31309
31314
  }
31310
- return f;
31311
- });
31312
- }
31313
- } : {}), inputOnBlur.includes(input.type) ? {
31314
- trigger: "onBlur"
31315
- } : {}), {}, {
31315
+ return e && e.fileList && e.fileList.map(f => {
31316
+ if (f.response) {
31317
+ return f.response;
31318
+ }
31319
+ return f;
31320
+ });
31321
+ }
31322
+ } : {}),
31323
+ ...(inputOnBlur.includes(input.type) ? {
31324
+ trigger: "onBlur"
31325
+ } : {}),
31316
31326
  style: input.showOnView === false ? {
31317
31327
  display: 'none'
31318
- } : {}
31319
- }, ['switch'].includes(input.type) ? {
31320
- labelCol: {
31321
- span: 20
31322
- },
31323
- style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
31324
- display: 'none'
31325
- } : {}), {}, {
31326
- flexDirection: 'row',
31327
- justifyContent: 'space-between'
31328
- })
31329
- } : {}), {}, {
31328
+ } : {},
31329
+ ...(['switch'].includes(input.type) ? {
31330
+ labelCol: {
31331
+ span: 20
31332
+ },
31333
+ style: {
31334
+ ...(input.showOnView === false ? {
31335
+ display: 'none'
31336
+ } : {}),
31337
+ flexDirection: 'row',
31338
+ justifyContent: 'space-between'
31339
+ }
31340
+ } : {}),
31330
31341
  label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
31331
- className: (input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.code) && "mr-10",
31342
+ className: input?.meta?.code && "mr-10",
31332
31343
  children: getInputLabel$1(input, values)
31333
31344
  }) : null,
31334
31345
  rules: rules,
31335
- 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']),
31336
- "data-id": "".concat(formId, ".").concat(inputId),
31346
+ className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
31347
+ "data-id": `${formId}.${inputId}`,
31337
31348
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
31338
31349
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31339
31350
  className: formatClassname(["ml-4 input-actions"]),
@@ -31343,7 +31354,7 @@ const GroupContentFormItem = _ref4 => {
31343
31354
  title: t('Add review note'),
31344
31355
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31345
31356
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31346
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && 'primary']),
31357
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
31347
31358
  type: "link",
31348
31359
  onClick: onClickReviewError,
31349
31360
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -31359,7 +31370,7 @@ const GroupContentFormItem = _ref4 => {
31359
31370
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31360
31371
  type: "link",
31361
31372
  onClick: onClickReviewSuccess,
31362
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && 'primary']),
31373
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
31363
31374
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31364
31375
  name: "CheckSquare",
31365
31376
  width: 16,
@@ -31376,59 +31387,65 @@ const GroupContentFormItem = _ref4 => {
31376
31387
  className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
31377
31388
  type: "link",
31378
31389
  onClick: () => {
31379
- var _input$meta5, _input$meta6;
31380
31390
  const value = getDefaultInputValue(input);
31381
- const commentMeta = input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.requiredCommentOnNotApplicable ? {
31391
+ const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
31382
31392
  comment: ''
31383
31393
  } : {};
31384
- if (input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.requiredCommentOnNotApplicable) {
31394
+ if (input?.meta?.requiredCommentOnNotApplicable) {
31385
31395
  setIsShown(true);
31386
31396
  }
31387
31397
  if (notPartOfTheForm || isAjaxSubGroup) {
31388
- var _values$meta8;
31389
31398
  const _defaultData = MainForm.getFieldValue(formId);
31390
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta8 = values.meta) === null || _values$meta8 === void 0 ? void 0 : _values$meta8.inputs) || {})[formId] || {};
31399
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31391
31400
  if (isAjaxSubGroup) {
31392
- var _defaultData$meta11;
31393
31401
  changeInputMeta({
31394
31402
  key: formId,
31395
31403
  type: input.type,
31396
31404
  otherValues: {
31397
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31405
+ [formId]: {
31406
+ ..._defaultData,
31398
31407
  [inputId]: value,
31399
31408
  meta: {
31400
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta11 = _defaultData.meta) === null || _defaultData$meta11 === void 0 ? void 0 : _defaultData$meta11.inputs) || {}), {}, {
31401
- [inputId]: inputMeta.notApplicable ? _objectSpread2({
31409
+ inputs: {
31410
+ ...(_defaultData?.meta?.inputs || {}),
31411
+ [inputId]: inputMeta.notApplicable ? {
31402
31412
  notApplicable: false,
31403
- notAvailable: false
31404
- }, commentMeta) : _objectSpread2({
31413
+ notAvailable: false,
31414
+ ...commentMeta
31415
+ } : {
31405
31416
  notApplicable: true,
31406
- notAvailable: false
31407
- }, commentMeta)
31408
- })
31417
+ notAvailable: false,
31418
+ ...commentMeta
31419
+ }
31420
+ }
31409
31421
  }
31410
- })
31422
+ }
31411
31423
  }
31412
31424
  });
31413
31425
  } else {
31414
31426
  changeInputMeta({
31415
31427
  key: formId,
31416
31428
  type: input.type,
31417
- value: inputMeta.notApplicable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31418
- [inputId]: _objectSpread2({
31429
+ value: inputMeta.notApplicable ? {
31430
+ ..._defaultMeta,
31431
+ [inputId]: {
31419
31432
  notApplicable: false,
31420
- notAvailable: false
31421
- }, commentMeta)
31422
- }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31423
- [inputId]: _objectSpread2({
31433
+ notAvailable: false,
31434
+ ...commentMeta
31435
+ }
31436
+ } : {
31437
+ ..._defaultMeta,
31438
+ [inputId]: {
31424
31439
  notApplicable: true,
31425
- notAvailable: false
31426
- }, commentMeta)
31427
- }),
31440
+ notAvailable: false,
31441
+ ...commentMeta
31442
+ }
31443
+ },
31428
31444
  otherValues: {
31429
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31445
+ [formId]: {
31446
+ ..._defaultData,
31430
31447
  [inputId]: value
31431
- })
31448
+ }
31432
31449
  }
31433
31450
  });
31434
31451
  }
@@ -31449,7 +31466,7 @@ const GroupContentFormItem = _ref4 => {
31449
31466
  });
31450
31467
  }
31451
31468
  },
31452
- disabled: !((_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.notApplicable),
31469
+ disabled: !input.meta?.notApplicable,
31453
31470
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31454
31471
  name: "NotApplicable",
31455
31472
  width: 16,
@@ -31463,24 +31480,24 @@ const GroupContentFormItem = _ref4 => {
31463
31480
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31464
31481
  className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
31465
31482
  type: "link",
31466
- disabled: !((_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.notAvailable),
31483
+ disabled: !input.meta?.notAvailable,
31467
31484
  onClick: () => {
31468
31485
  const value = getDefaultInputValue(input);
31469
31486
  if (notPartOfTheForm || isAjaxSubGroup) {
31470
- var _values$meta9;
31471
31487
  const _defaultData = MainForm.getFieldValue(formId);
31472
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta9 = values.meta) === null || _values$meta9 === void 0 ? void 0 : _values$meta9.inputs) || {})[formId] || {};
31488
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31473
31489
  if (isAjaxSubGroup) {
31474
31490
  if (isAjaxSubGroup) {
31475
- var _defaultData$meta12;
31476
31491
  changeInputMeta({
31477
31492
  key: formId,
31478
31493
  type: input.type,
31479
31494
  otherValues: {
31480
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31495
+ [formId]: {
31496
+ ..._defaultData,
31481
31497
  [inputId]: value,
31482
31498
  meta: {
31483
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta12 = _defaultData.meta) === null || _defaultData$meta12 === void 0 ? void 0 : _defaultData$meta12.inputs) || {}), {}, {
31499
+ inputs: {
31500
+ ...(_defaultData?.meta?.inputs || {}),
31484
31501
  [inputId]: inputMeta.notAvailable ? {
31485
31502
  notApplicable: false,
31486
31503
  notAvailable: false
@@ -31488,9 +31505,9 @@ const GroupContentFormItem = _ref4 => {
31488
31505
  notApplicable: false,
31489
31506
  notAvailable: true
31490
31507
  }
31491
- })
31508
+ }
31492
31509
  }
31493
- })
31510
+ }
31494
31511
  }
31495
31512
  });
31496
31513
  }
@@ -31498,21 +31515,24 @@ const GroupContentFormItem = _ref4 => {
31498
31515
  changeInputMeta({
31499
31516
  key: formId,
31500
31517
  type: input.type,
31501
- value: inputMeta.notAvailable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31518
+ value: inputMeta.notAvailable ? {
31519
+ ..._defaultMeta,
31502
31520
  [inputId]: {
31503
31521
  notApplicable: false,
31504
31522
  notAvailable: false
31505
31523
  }
31506
- }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31524
+ } : {
31525
+ ..._defaultMeta,
31507
31526
  [inputId]: {
31508
31527
  notApplicable: false,
31509
31528
  notAvailable: true
31510
31529
  }
31511
- }),
31530
+ },
31512
31531
  otherValues: {
31513
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31532
+ [formId]: {
31533
+ ..._defaultData,
31514
31534
  [inputId]: value
31515
- })
31535
+ }
31516
31536
  }
31517
31537
  });
31518
31538
  }
@@ -31543,33 +31563,38 @@ const GroupContentFormItem = _ref4 => {
31543
31563
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
31544
31564
  title: t('Add comment'),
31545
31565
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31546
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
31566
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31547
31567
  type: "link",
31548
- disabled: !((_input$meta9 = input.meta) !== null && _input$meta9 !== void 0 && _input$meta9.comment)
31549
- }, !isShown ? {
31550
- className: 'default p-0'
31551
- } : {
31552
- className: 'p-0 primary'
31553
- }), {}, {
31568
+ disabled: !input.meta?.comment,
31569
+ ...(!isShown ? {
31570
+ className: 'default p-0'
31571
+ } : {
31572
+ className: 'p-0 primary'
31573
+ }),
31554
31574
  onClick: onClickComment,
31555
31575
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31556
31576
  name: "AddComment",
31557
31577
  width: 16,
31558
31578
  height: 16
31559
31579
  })
31560
- }))
31580
+ })
31561
31581
  })
31562
31582
  })]
31563
31583
  }) : null]
31564
31584
  }) : null
31565
31585
  }),
31566
31586
  children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
31567
- data: _objectSpread2(_objectSpread2({}, values[formId] || {}), {}, {
31568
- meta: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 ? void 0 : values.meta) || {}), {}, {
31569
- 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] || {})
31570
- })
31571
- }),
31572
- 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),
31587
+ data: {
31588
+ ...(values[formId] || {}),
31589
+ meta: {
31590
+ ...(values?.meta || {}),
31591
+ inputs: {
31592
+ ...(values?.meta?.inputs || {}),
31593
+ ...((values?.meta?.inputs || {})[formId] || {})
31594
+ }
31595
+ }
31596
+ },
31597
+ linkingData: values?.linking || values?.parent?.linking,
31573
31598
  name: input.dataId,
31574
31599
  config: input,
31575
31600
  t: t,
@@ -31581,12 +31606,13 @@ const GroupContentFormItem = _ref4 => {
31581
31606
  getToken: getToken,
31582
31607
  app: app,
31583
31608
  valueOnlyString: true
31584
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31609
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
31610
+ ...inputData,
31585
31611
  name: inputId,
31586
31612
  maxWidth,
31587
31613
  staticWidth,
31588
31614
  fullWidth
31589
- }), {
31615
+ }, {
31590
31616
  form: MainForm,
31591
31617
  forms: options,
31592
31618
  allForms: plainForms,
@@ -31604,10 +31630,10 @@ const GroupContentFormItem = _ref4 => {
31604
31630
  staticWidth,
31605
31631
  fullWidth
31606
31632
  }) : console.log(input)
31607
- })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31633
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31608
31634
  className: "code",
31609
31635
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31610
- children: (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.code
31636
+ children: input.meta?.code
31611
31637
  })
31612
31638
  }) : null]
31613
31639
  }), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31627,16 +31653,16 @@ const GroupContentFormItem = _ref4 => {
31627
31653
  className: "max-char-span",
31628
31654
  children: t('max-char', {
31629
31655
  chars: maxRule,
31630
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
31656
+ filled: inputData?.value?.length || 0
31631
31657
  })
31632
31658
  })
31633
- }) : null, (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31659
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31634
31660
  className: "input-content",
31635
31661
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31636
31662
  className: "comment-textarea",
31637
- initialValue: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31663
+ initialValue: inputMeta?.comment || '',
31638
31664
  hidden: !isShown,
31639
- name: "".concat(formId, "-").concat(inputId, "-comment"),
31665
+ name: `${formId}-${inputId}-comment`,
31640
31666
  required: requiredComment,
31641
31667
  rules: requiredComment ? [{
31642
31668
  required: true,
@@ -31653,35 +31679,38 @@ const GroupContentFormItem = _ref4 => {
31653
31679
  onConfirm: () => {
31654
31680
  setIsShown(false);
31655
31681
  if (notPartOfTheForm) {
31656
- var _values$meta12;
31657
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
31682
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31658
31683
  const _defaultData = MainForm.getFieldValue(formId);
31659
31684
  if (isAjaxSubGroup) {
31660
- var _defaultData$meta13, _defaultData$meta14;
31661
31685
  changeInputMeta({
31662
31686
  key: formId,
31663
31687
  type: input.type,
31664
31688
  otherValues: {
31665
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31689
+ [formId]: {
31690
+ ..._defaultData,
31666
31691
  meta: {
31667
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta13 = _defaultData.meta) === null || _defaultData$meta13 === void 0 ? void 0 : _defaultData$meta13.inputs) || {}), {}, {
31668
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta14 = _defaultData.meta) === null || _defaultData$meta14 === void 0 ? void 0 : _defaultData$meta14.inputs) || {})[inputId] || {}), {}, {
31692
+ inputs: {
31693
+ ...(_defaultData?.meta?.inputs || {}),
31694
+ [inputId]: {
31695
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31669
31696
  comment: null
31670
- })
31671
- })
31697
+ }
31698
+ }
31672
31699
  }
31673
- })
31700
+ }
31674
31701
  }
31675
31702
  });
31676
31703
  } else {
31677
31704
  changeInputMeta({
31678
31705
  key: formId,
31679
31706
  type: input.type,
31680
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31681
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31707
+ value: {
31708
+ ..._defaultMeta,
31709
+ [inputId]: {
31710
+ ...(_defaultMeta[inputId] || {}),
31682
31711
  comment: null
31683
- })
31684
- })
31712
+ }
31713
+ }
31685
31714
  });
31686
31715
  }
31687
31716
  } else {
@@ -31696,7 +31725,7 @@ const GroupContentFormItem = _ref4 => {
31696
31725
  },
31697
31726
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31698
31727
  type: "link",
31699
- disabled: !((_input$meta13 = input.meta) !== null && _input$meta13 !== void 0 && _input$meta13.comment),
31728
+ disabled: !input.meta?.comment,
31700
31729
  className: "p-0",
31701
31730
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
31702
31731
  width: 16,
@@ -31708,41 +31737,44 @@ const GroupContentFormItem = _ref4 => {
31708
31737
  children: inputTypeComponent$1.comment(inputData, {
31709
31738
  form: MainForm,
31710
31739
  forms: options,
31711
- value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31740
+ value: inputMeta?.comment || '',
31712
31741
  maxWidth,
31713
31742
  staticWidth,
31714
31743
  fullWidth,
31715
31744
  onChange: val => {
31716
31745
  if (notPartOfTheForm) {
31717
- var _values$meta13;
31718
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
31746
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31719
31747
  const _defaultData = MainForm.getFieldValue(formId);
31720
31748
  if (isAjaxSubGroup) {
31721
- var _defaultData$meta15, _defaultData$meta16;
31722
31749
  changeInputMeta({
31723
31750
  key: formId,
31724
31751
  type: input.type,
31725
31752
  otherValues: {
31726
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31753
+ [formId]: {
31754
+ ..._defaultData,
31727
31755
  meta: {
31728
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta15 = _defaultData.meta) === null || _defaultData$meta15 === void 0 ? void 0 : _defaultData$meta15.inputs) || {}), {}, {
31729
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta16 = _defaultData.meta) === null || _defaultData$meta16 === void 0 ? void 0 : _defaultData$meta16.inputs) || {})[inputId] || {}), {}, {
31756
+ inputs: {
31757
+ ...(_defaultData?.meta?.inputs || {}),
31758
+ [inputId]: {
31759
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31730
31760
  comment: val
31731
- })
31732
- })
31761
+ }
31762
+ }
31733
31763
  }
31734
- })
31764
+ }
31735
31765
  }
31736
31766
  });
31737
31767
  } else {
31738
31768
  changeInputMeta({
31739
31769
  key: formId,
31740
31770
  type: input.type,
31741
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31742
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31771
+ value: {
31772
+ ..._defaultMeta,
31773
+ [inputId]: {
31774
+ ...(_defaultMeta[inputId] || {}),
31743
31775
  comment: val
31744
- })
31745
- })
31776
+ }
31777
+ }
31746
31778
  });
31747
31779
  }
31748
31780
  } else {
@@ -31763,16 +31795,16 @@ const GroupContentFormItem = _ref4 => {
31763
31795
  className: "max-char-span",
31764
31796
  children: t('max-char', {
31765
31797
  chars: MAX_COMMENTS_LENGTH,
31766
- filled: (inputMeta === null || inputMeta === void 0 || (_inputMeta$comment = inputMeta.comment) === null || _inputMeta$comment === void 0 ? void 0 : _inputMeta$comment.length) || 0
31798
+ filled: inputMeta?.comment?.length || 0
31767
31799
  })
31768
31800
  })]
31769
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31801
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31770
31802
  className: "input-content",
31771
31803
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31772
31804
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31773
31805
  className: "comment-textarea",
31774
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31775
- name: "".concat(formId, "-").concat(inputId, "-reviewErrorComment"),
31806
+ initialValue: lastReview?.comment || '',
31807
+ name: `${formId}-${inputId}-reviewErrorComment`,
31776
31808
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
31777
31809
  className: "flex w-100",
31778
31810
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31783,71 +31815,78 @@ const GroupContentFormItem = _ref4 => {
31783
31815
  children: inputTypeComponent$1.comment(inputData, {
31784
31816
  form: MainForm,
31785
31817
  forms: options,
31786
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31818
+ value: lastReview?.comment || '',
31787
31819
  maxWidth,
31788
31820
  staticWidth,
31789
31821
  fullWidth,
31790
31822
  onChange: val => {
31791
31823
  if (notPartOfTheForm) {
31792
- var _values$meta14;
31793
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
31824
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31794
31825
  const _defaultData = MainForm.getFieldValue(formId);
31795
31826
  if (isAjaxSubGroup) {
31796
- var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
31797
31827
  changeInputMeta({
31798
31828
  key: formId,
31799
31829
  type: input.type,
31800
31830
  otherValues: {
31801
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31831
+ [formId]: {
31832
+ ..._defaultData,
31802
31833
  meta: {
31803
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta17 = _defaultData.meta) === null || _defaultData$meta17 === void 0 ? void 0 : _defaultData$meta17.inputs) || {}), {}, {
31804
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta18 = _defaultData.meta) === null || _defaultData$meta18 === void 0 ? void 0 : _defaultData$meta18.inputs) || {})[inputId] || {}), {}, {
31805
- reviews: ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta19 = _defaultData.meta) === null || _defaultData$meta19 === void 0 ? void 0 : _defaultData$meta19.inputs) || {})[inputId] || {}).reviews || []).map(v => {
31834
+ inputs: {
31835
+ ...(_defaultData?.meta?.inputs || {}),
31836
+ [inputId]: {
31837
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31838
+ reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
31806
31839
  if (v.createdAt === lastReview.createdAt) {
31807
- return _objectSpread2(_objectSpread2({}, v), {}, {
31840
+ return {
31841
+ ...v,
31808
31842
  comment: val
31809
- });
31843
+ };
31810
31844
  }
31811
31845
  return v;
31812
31846
  })
31813
- })
31814
- })
31847
+ }
31848
+ }
31815
31849
  }
31816
- })
31850
+ }
31817
31851
  }
31818
31852
  });
31819
31853
  } else {
31820
31854
  changeInputMeta({
31821
31855
  key: formId,
31822
31856
  type: input.type,
31823
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31824
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31857
+ value: {
31858
+ ..._defaultMeta,
31859
+ [inputId]: {
31860
+ ...(_defaultMeta[inputId] || {}),
31825
31861
  reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
31826
31862
  if (v.createdAt === lastReview.createdAt) {
31827
- return _objectSpread2(_objectSpread2({}, v), {}, {
31863
+ return {
31864
+ ...v,
31828
31865
  comment: val
31829
- });
31866
+ };
31830
31867
  }
31831
31868
  return v;
31832
31869
  })
31833
- })
31834
- })
31870
+ }
31871
+ }
31835
31872
  });
31836
31873
  }
31837
31874
  } else {
31838
31875
  changeInputMeta({
31839
31876
  key: inputId,
31840
31877
  type: input.type,
31841
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31842
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
31878
+ value: {
31879
+ ...inputMeta,
31880
+ reviews: (inputMeta?.reviews || []).map(v => {
31843
31881
  if (v.createdAt === lastReview.createdAt) {
31844
- return _objectSpread2(_objectSpread2({}, v), {}, {
31882
+ return {
31883
+ ...v,
31845
31884
  comment: val
31846
- });
31885
+ };
31847
31886
  }
31848
31887
  return v;
31849
31888
  })
31850
- })
31889
+ }
31851
31890
  });
31852
31891
  }
31853
31892
  },
@@ -31859,7 +31898,7 @@ const GroupContentFormItem = _ref4 => {
31859
31898
  className: "max-char-span",
31860
31899
  children: t('max-char', {
31861
31900
  chars: MAX_COMMENTS_LENGTH,
31862
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
31901
+ filled: lastReview.comment?.length || 0
31863
31902
  })
31864
31903
  })]
31865
31904
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -31880,7 +31919,7 @@ const GroupContentFormItem = _ref4 => {
31880
31919
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
31881
31920
  className: "flex flex-column justify-center mr-1",
31882
31921
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31883
- 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')
31922
+ children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31884
31923
  })
31885
31924
  })]
31886
31925
  })]
@@ -35853,13 +35892,11 @@ const beforeUpload = allowedExtensions => file => {
35853
35892
  };
35854
35893
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35855
35894
 
35856
- const _excluded$i = ["placeholder"],
35857
- _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35895
+ /* eslint-disable no-case-declarations */
35858
35896
  dayjs__default["default"].extend(utc);
35859
35897
  dayjs__default["default"].extend(timezone);
35860
35898
  dayjs__default["default"].tz.setDefault("UTC");
35861
- const getDefaultInputValue = function () {
35862
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35899
+ const getDefaultInputValue = (input = {}) => {
35863
35900
  let value = undefined;
35864
35901
  if (input.type === "multiselect") {
35865
35902
  value = [];
@@ -35877,30 +35914,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35877
35914
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35878
35915
  return isShown;
35879
35916
  };
35880
- const renderDataLinkGroup = _ref2 => {
35881
- var _input$meta, _formsValue$meta, _input$meta2;
35882
- let {
35883
- input,
35884
- groupFormId,
35885
- name,
35886
- formsValue,
35887
- form,
35888
- onValuesChange,
35889
- setValues,
35890
- changeLinking,
35891
- isHighlighted
35892
- } = _ref2;
35893
- const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35894
- var _input$inputs$k;
35895
- 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";
35896
- });
35897
- const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35898
- const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35899
- all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35917
+ const renderDataLinkGroup = ({
35918
+ input,
35919
+ groupFormId,
35920
+ name,
35921
+ formsValue,
35922
+ form,
35923
+ onValuesChange,
35924
+ setValues,
35925
+ changeLinking,
35926
+ isHighlighted
35927
+ }) => {
35928
+ const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35929
+ const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35930
+ const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35931
+ all[key] = input?.inputs[key];
35900
35932
  return all;
35901
35933
  }, {});
35902
- const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
35903
- 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));
35934
+ const isSingle = input?.meta?.maxRepeat === 1;
35935
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35936
+ ...(formsValue[groupFormId] || {})[name]
35937
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35938
+ ...v
35939
+ })) : isSingle ? formsValue[name] ? [{
35940
+ ...formsValue[name]
35941
+ }] : [] : getArray(formsValue[name] || []).map(v => ({
35942
+ ...v
35943
+ }));
35904
35944
  const onUpdate = (val, i) => {
35905
35945
  const _val = isSingle ? {
35906
35946
  [name]: val
@@ -35908,20 +35948,31 @@ const renderDataLinkGroup = _ref2 => {
35908
35948
  [name]: formData.map((d, j) => i === j ? val : d)
35909
35949
  };
35910
35950
  if (groupFormId) {
35911
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35912
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35913
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35951
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
35952
+ const _newData = {
35953
+ ..._defaultData,
35954
+ ..._val
35955
+ };
35956
+ onValuesChange(_newData, {
35957
+ ...formsValue,
35914
35958
  [groupFormId]: _newData
35915
- }));
35916
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35917
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35959
+ });
35960
+ form?.setFieldValue(groupFormId, _newData);
35961
+ setValues({
35962
+ ...formsValue,
35918
35963
  [groupFormId]: _newData
35919
- }));
35964
+ });
35920
35965
  return;
35921
35966
  }
35922
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35923
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35924
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
35967
+ onValuesChange(_val, {
35968
+ ...formsValue,
35969
+ ..._val
35970
+ });
35971
+ form?.setFieldValue(name, _val[name]);
35972
+ setValues({
35973
+ ...formsValue,
35974
+ ..._val
35975
+ });
35925
35976
  };
35926
35977
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
35927
35978
  form: input,
@@ -35932,79 +35983,102 @@ const renderDataLinkGroup = _ref2 => {
35932
35983
  isHighlighted: isHighlighted,
35933
35984
  dataLinkInput: dataLinkInput,
35934
35985
  formsValue: formsValue,
35935
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
35986
+ values: groupFormId ? {
35987
+ ...(formsValue[groupFormId] || {}),
35936
35988
  meta: {
35937
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
35989
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
35938
35990
  }
35939
- }) : formsValue,
35991
+ } : formsValue,
35940
35992
  name: name,
35941
35993
  groupFormId: groupFormId,
35942
- maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
35943
- remove: _ref3 => {
35944
- let {
35945
- key
35946
- } = _ref3;
35994
+ maxRepeat: input?.meta?.maxRepeat,
35995
+ remove: ({
35996
+ key
35997
+ }) => {
35947
35998
  const _val = isSingle ? {
35948
35999
  [name]: null
35949
36000
  } : {
35950
36001
  [name]: formData.filter((v, j) => j !== key)
35951
36002
  };
35952
36003
  if (groupFormId) {
35953
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35954
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35955
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36004
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36005
+ const _newData = {
36006
+ ..._defaultData,
36007
+ ..._val
36008
+ };
36009
+ onValuesChange(_newData, {
36010
+ ...formsValue,
35956
36011
  [groupFormId]: _newData
35957
- }));
35958
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35959
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36012
+ });
36013
+ form?.setFieldValue(groupFormId, _newData);
36014
+ setValues({
36015
+ ...formsValue,
35960
36016
  [groupFormId]: _newData
35961
- }));
36017
+ });
35962
36018
  return;
35963
36019
  }
35964
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35965
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35966
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36020
+ onValuesChange(_val, {
36021
+ ...formsValue,
36022
+ ..._val
36023
+ });
36024
+ form?.setFieldValue(name, _val[name]);
36025
+ setValues({
36026
+ ...formsValue,
36027
+ ..._val
36028
+ });
35967
36029
  },
35968
36030
  add: val => {
35969
36031
  const _val = isSingle ? {
35970
36032
  [name]: val
35971
36033
  } : {
35972
- [name]: [...formData, _objectSpread2({}, val)]
36034
+ [name]: [...formData, {
36035
+ ...val
36036
+ }]
35973
36037
  };
35974
36038
  if (groupFormId) {
35975
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35976
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35977
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35978
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36039
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36040
+ const _newData = {
36041
+ ..._defaultData,
36042
+ ..._val
36043
+ };
36044
+ form?.setFieldValue(groupFormId, _newData);
36045
+ onValuesChange(_newData, {
36046
+ ...formsValue,
35979
36047
  [groupFormId]: _newData
35980
- }));
35981
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36048
+ });
36049
+ setValues({
36050
+ ...formsValue,
35982
36051
  [groupFormId]: _newData
35983
- }));
36052
+ });
35984
36053
  return;
35985
36054
  }
35986
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35987
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35988
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36055
+ form?.setFieldValue(name, _val[name]);
36056
+ onValuesChange(_val, {
36057
+ ...formsValue,
36058
+ ..._val
36059
+ });
36060
+ setValues({
36061
+ ...formsValue,
36062
+ ..._val
36063
+ });
35989
36064
  },
35990
36065
  k: name,
35991
36066
  formData: formData
35992
36067
  });
35993
36068
  };
35994
36069
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
35995
- var _input$meta3, _data$meta;
35996
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
36070
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
35997
36071
  return false;
35998
36072
  }
35999
- if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
36000
- var _input$meta4;
36001
- return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
36073
+ if (typeof input?.meta?.excludeFromEdit === "boolean") {
36074
+ return !input?.meta?.excludeFromEdit;
36002
36075
  }
36003
- const formsValue = _objectSpread2({}, data);
36004
- Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
36005
- var _data$meta2;
36006
- const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
36007
- if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
36076
+ const formsValue = {
36077
+ ...data
36078
+ };
36079
+ Object.keys(data?.meta?.inputs || {}).forEach(key => {
36080
+ const input = data?.meta?.inputs[key];
36081
+ if (input?.notApplicable || input?.notAvailable) {
36008
36082
  formsValue[key] = undefined;
36009
36083
  delete formsValue[key];
36010
36084
  }
@@ -36063,35 +36137,35 @@ function getInputHeadLines$1(type, i, input, values) {
36063
36137
  switch (type) {
36064
36138
  case "h2":
36065
36139
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36066
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36140
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36067
36141
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36068
36142
  children: getInputLabel$1(input, values)
36069
36143
  })
36070
36144
  });
36071
36145
  case "h3":
36072
36146
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36073
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36147
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36074
36148
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36075
36149
  children: getInputLabel$1(input, values)
36076
36150
  })
36077
36151
  });
36078
36152
  case "h4":
36079
36153
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36080
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36154
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36081
36155
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36082
36156
  children: getInputLabel$1(input, values)
36083
36157
  })
36084
36158
  });
36085
36159
  case "h5":
36086
36160
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36087
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36161
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36088
36162
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36089
36163
  children: getInputLabel$1(input, values)
36090
36164
  })
36091
36165
  });
36092
36166
  case "h6":
36093
36167
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36094
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36168
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36095
36169
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36096
36170
  children: getInputLabel$1(input, values)
36097
36171
  })
@@ -36100,16 +36174,15 @@ function getInputHeadLines$1(type, i, input, values) {
36100
36174
  return null;
36101
36175
  }
36102
36176
  }
36103
- function getInputProp(prop) {
36104
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36105
- let scope = arguments.length > 2 ? arguments[2] : undefined;
36177
+ function getInputProp(prop, formsValue = {}, scope) {
36106
36178
  if (prop && typeof prop === "object") {
36107
36179
  const validations = Object.keys(prop);
36108
36180
  const key = validations.find(v => {
36109
36181
  let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
36110
- const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36182
+ const value = dot__default["default"].pick(path, {
36183
+ ...formsValue,
36111
36184
  scope
36112
- }));
36185
+ });
36113
36186
  return _checkValue(wantedValue, match, value);
36114
36187
  });
36115
36188
  const label = key ? prop[key] : prop[validations[0]];
@@ -36118,33 +36191,29 @@ function getInputProp(prop) {
36118
36191
  return prop;
36119
36192
  }
36120
36193
  }
36121
- function getInputLabel$1(input) {
36122
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36123
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
36194
+ function getInputLabel$1(input, formsValue = {}, asText = false) {
36124
36195
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
36125
36196
  input: input,
36126
36197
  formsValue: formsValue,
36127
36198
  asText: asText
36128
36199
  });
36129
36200
  }
36130
- const InputLabel = _ref4 => {
36131
- var _input$meta5, _input$meta6, _input$meta7;
36132
- let {
36133
- input,
36134
- formsValue,
36135
- asText
36136
- } = _ref4;
36201
+ const InputLabel = ({
36202
+ input,
36203
+ formsValue,
36204
+ asText
36205
+ }) => {
36137
36206
  const {
36138
36207
  t,
36139
36208
  evaluationConfig,
36140
36209
  scope
36141
36210
  } = useEditContext();
36142
36211
  const label = getInputProp(input.label, formsValue, scope);
36143
- 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, {
36212
+ return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36144
36213
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
36145
36214
  className: "flex",
36146
36215
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
36147
- content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36216
+ content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36148
36217
  t: t,
36149
36218
  evaluationConfig: evaluationConfig
36150
36219
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36152,7 +36221,7 @@ const InputLabel = _ref4 => {
36152
36221
  children: ReactHtmlParser__default["default"](input.description)
36153
36222
  }),
36154
36223
  placement: "top",
36155
- 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", {
36224
+ children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36156
36225
  className: "flex flex-column justify-content-center ml-1",
36157
36226
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
36158
36227
  fontSize: 13
@@ -36174,9 +36243,7 @@ function getSectionLabel$1(labels, values) {
36174
36243
  }
36175
36244
  return labels;
36176
36245
  }
36177
- function getSubtitles$1(subtitles, position) {
36178
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36179
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36246
+ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
36180
36247
  let subtitle = subtitles && subtitles[position];
36181
36248
  if (subtitle && typeof subtitle === "object") {
36182
36249
  let newSubtitle = subtitle.default || "";
@@ -36220,12 +36287,14 @@ function getSubtitles$1(subtitles, position) {
36220
36287
  function getFormTitles$1(titles, key, position) {
36221
36288
  let tilte = titles && titles[key];
36222
36289
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
36223
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36290
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
36224
36291
  children: tilte
36225
36292
  }) : null;
36226
36293
  }
36227
36294
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
36228
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36295
+ formsValue = Object.assign(formsValue, {
36296
+ ...mainForm.getFieldsValue(true)
36297
+ });
36229
36298
  if (typeof repeatIndex === "number" && repeatValues) {
36230
36299
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
36231
36300
  repeatValues[inputName] = value;
@@ -36260,16 +36329,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
36260
36329
  };
36261
36330
  const inputOnBlur = [];
36262
36331
  const inputTypeComponent$1 = {
36263
- text: (_ref5, _ref6) => {
36264
- let {
36265
- props,
36266
- rules
36267
- } = _ref5;
36268
- let {
36269
- inputMeta = {},
36270
- t,
36271
- isHighlighted
36272
- } = _ref6;
36332
+ text: ({
36333
+ props,
36334
+ rules
36335
+ }, {
36336
+ inputMeta = {},
36337
+ t,
36338
+ isHighlighted
36339
+ }) => {
36273
36340
  const maxRule = rules.find(r => r.max);
36274
36341
  const maxProps = {
36275
36342
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36277,28 +36344,26 @@ const inputTypeComponent$1 = {
36277
36344
  if (maxRule) {
36278
36345
  maxProps.maxLength = maxRule.max;
36279
36346
  }
36280
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36281
- size: "large"
36282
- }, maxProps), {}, {
36347
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36348
+ size: "large",
36349
+ ...maxProps,
36283
36350
  allowClear: true,
36284
36351
  autoComplete: "new-password",
36285
- type: "text"
36286
- }, props), {}, {
36352
+ type: "text",
36353
+ ...props,
36287
36354
  className: formatClassname([isHighlighted && "highlighted-input"]),
36288
36355
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36289
36356
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36290
- }));
36357
+ });
36291
36358
  },
36292
- link: (_ref7, _ref8) => {
36293
- let {
36294
- props,
36295
- rules
36296
- } = _ref7;
36297
- let {
36298
- inputMeta = {},
36299
- t,
36300
- isHighlighted
36301
- } = _ref8;
36359
+ link: ({
36360
+ props,
36361
+ rules
36362
+ }, {
36363
+ inputMeta = {},
36364
+ t,
36365
+ isHighlighted
36366
+ }) => {
36302
36367
  const maxRule = rules.find(r => r.max);
36303
36368
  const maxProps = {
36304
36369
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36306,32 +36371,29 @@ const inputTypeComponent$1 = {
36306
36371
  if (maxRule) {
36307
36372
  maxProps.maxLength = maxRule.max;
36308
36373
  }
36309
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36310
- size: "large"
36311
- }, maxProps), {}, {
36374
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36375
+ size: "large",
36376
+ ...maxProps,
36312
36377
  allowClear: true,
36313
36378
  autoComplete: "new-password",
36314
- type: "text"
36315
- }, props), {}, {
36379
+ type: "text",
36380
+ ...props,
36316
36381
  className: formatClassname([isHighlighted && "highlighted-input"]),
36317
36382
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36318
36383
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36319
- }));
36384
+ });
36320
36385
  },
36321
- number: (_ref9, _ref10) => {
36322
- var _input$meta8;
36323
- let {
36324
- props,
36325
- rules,
36326
- input
36327
- } = _ref9;
36328
- let {
36329
- inputMeta = {},
36330
- t,
36331
- isHighlighted
36332
- } = _ref10;
36386
+ number: ({
36387
+ props,
36388
+ rules,
36389
+ input
36390
+ }, {
36391
+ inputMeta = {},
36392
+ t,
36393
+ isHighlighted
36394
+ }) => {
36333
36395
  const maxRule = rules.find(r => r.max);
36334
- const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36396
+ const integerRule = !input?.meta?.isDecimal;
36335
36397
  const parser = value => {
36336
36398
  if (!value) {
36337
36399
  return "";
@@ -36342,63 +36404,60 @@ const inputTypeComponent$1 = {
36342
36404
  return value.replace(/\$\s?|(,*)/g, "");
36343
36405
  };
36344
36406
  if (maxRule) {
36345
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36407
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36346
36408
  size: "large",
36347
36409
  allowClear: true,
36348
- autoComplete: "new-password"
36349
- }, props), {}, {
36410
+ autoComplete: "new-password",
36411
+ ...props,
36350
36412
  type: "number",
36351
36413
  parser: parser,
36352
36414
  min: 0,
36353
36415
  max: maxRule.max,
36354
36416
  className: formatClassname([isHighlighted && "highlighted-input"])
36355
- }));
36417
+ });
36356
36418
  }
36357
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36419
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36358
36420
  size: "large",
36359
36421
  allowClear: true,
36360
36422
  className: formatClassname([isHighlighted && "highlighted-input"]),
36361
- autoComplete: "new-password"
36362
- }, props), {}, {
36423
+ autoComplete: "new-password",
36424
+ ...props,
36363
36425
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36364
36426
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36365
36427
  min: 0,
36366
36428
  formatter: value => numberWithCommas$1(value),
36367
36429
  parser: parser
36368
- }));
36430
+ });
36369
36431
  },
36370
36432
  // eslint-disable-next-line no-unused-vars
36371
- select: (_ref11, _ref12) => {
36372
- var _input$meta9, _input$meta10;
36373
- let {
36374
- value,
36375
- options,
36376
- optionGroup,
36377
- props,
36378
- formsValue,
36379
- optionsFilter,
36380
- filterCond,
36381
- repeatValues,
36382
- repeatIndex,
36383
- name,
36384
- inputName,
36385
- address,
36386
- addressData,
36387
- input,
36388
- scope
36389
- } = _ref11;
36390
- let {
36391
- forms,
36392
- form,
36393
- setAddress,
36394
- inputMeta = {},
36395
- t,
36396
- isHighlighted,
36397
- changeInputMeta,
36398
- groupFormId
36399
- } = _ref12;
36433
+ select: ({
36434
+ value,
36435
+ options,
36436
+ optionGroup,
36437
+ props,
36438
+ formsValue,
36439
+ optionsFilter,
36440
+ filterCond,
36441
+ repeatValues,
36442
+ repeatIndex,
36443
+ name,
36444
+ inputName,
36445
+ address,
36446
+ addressData,
36447
+ input,
36448
+ scope
36449
+ }, {
36450
+ forms,
36451
+ form,
36452
+ setAddress,
36453
+ inputMeta = {},
36454
+ t,
36455
+ isHighlighted,
36456
+ changeInputMeta,
36457
+ groupFormId
36458
+ }) => {
36400
36459
  let opts;
36401
- const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36460
+ const isEvaluation = input?.meta?.isEvaluation;
36402
36461
  let defaultValue = value;
36403
36462
  if (typeof options === "string") {
36404
36463
  const [formName, key] = options.split(".");
@@ -36423,7 +36482,7 @@ const inputTypeComponent$1 = {
36423
36482
  opts = [];
36424
36483
  }
36425
36484
  } else {
36426
- opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36485
+ opts = options?.filter(o => !o.onlyView);
36427
36486
  }
36428
36487
  opts = JSON.parse(JSON.stringify(opts || []));
36429
36488
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36433,7 +36492,7 @@ const inputTypeComponent$1 = {
36433
36492
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36434
36493
 
36435
36494
  // Handle default value logic
36436
- 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)) {
36495
+ if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36437
36496
  // If no current value but there's a default value, use the default
36438
36497
  value = input.meta.defaultValue;
36439
36498
  defaultValue = value;
@@ -36466,7 +36525,7 @@ const inputTypeComponent$1 = {
36466
36525
  }
36467
36526
  opts = groupOptions;
36468
36527
  }
36469
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36528
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36470
36529
  size: "large",
36471
36530
  autoComplete: "new-password",
36472
36531
  allowClear: true,
@@ -36475,32 +36534,35 @@ const inputTypeComponent$1 = {
36475
36534
  value: value // Use value instead of defaultValue for controlled behavior
36476
36535
  ,
36477
36536
  filterOption: filterSelectOptions,
36478
- optionFilterProp: "children"
36479
- }, props), {}, {
36537
+ optionFilterProp: "children",
36538
+ ...props,
36480
36539
  className: formatClassname([isHighlighted && "highlighted-select"]),
36481
36540
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36482
36541
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36483
36542
  onChange: (val, selectedValue) => {
36484
36543
  // ONLY FOR SBG EVALUATON !!
36485
36544
  if (isEvaluation && val === "na" && groupFormId) {
36486
- var _formsValue$meta2;
36487
36545
  changeInputMeta({
36488
36546
  key: groupFormId,
36489
- 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]) || {}), {}, {
36547
+ value: {
36548
+ ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36490
36549
  documentation: {
36491
36550
  notApplicable: true
36492
36551
  }
36493
- }),
36552
+ },
36494
36553
  otherValues: {
36495
- [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36554
+ [groupFormId]: {
36555
+ ...(formsValue?.[groupFormId] || {}),
36496
36556
  [name]: val
36497
- })
36557
+ }
36498
36558
  }
36499
36559
  });
36500
36560
  }
36501
36561
  if (address && selectedValue) {
36502
36562
  dot__default["default"].str(address, selectedValue.children, addressData);
36503
- setAddress(_objectSpread2({}, addressData));
36563
+ setAddress({
36564
+ ...addressData
36565
+ });
36504
36566
  }
36505
36567
  if (props.onChange) {
36506
36568
  props.onChange(val);
@@ -36531,15 +36593,15 @@ const inputTypeComponent$1 = {
36531
36593
  if (og.disabled !== undefined) {
36532
36594
  groupOtherProps.disabled = og.disabled;
36533
36595
  }
36534
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36535
- value: og.value
36536
- }, groupOtherProps), {}, {
36596
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36597
+ value: og.value,
36598
+ ...groupOtherProps,
36537
36599
  children: og.label
36538
- }), "".concat(i).concat(j));
36600
+ }, `${i}${j}`);
36539
36601
  })
36540
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36541
- value: option.value
36542
- }, otherProps), {}, {
36602
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36603
+ value: option.value,
36604
+ ...otherProps,
36543
36605
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36544
36606
  className: "flex",
36545
36607
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36547,35 +36609,33 @@ const inputTypeComponent$1 = {
36547
36609
  children: sgbEvaluationIcons[option.value]
36548
36610
  }), option.label]
36549
36611
  }) : option.label
36550
- }), option.value);
36612
+ }, option.value);
36551
36613
  })
36552
- }));
36614
+ });
36553
36615
  },
36554
- multiselect: (_ref13, _ref14) => {
36555
- let {
36556
- value,
36557
- options,
36558
- optionGroup,
36559
- optionsFilter,
36560
- filterCond,
36561
- props,
36562
- formsValue,
36563
- repeatValues,
36564
- repeatIndex,
36565
- inputName,
36566
- name,
36567
- tags,
36568
- maxWidth,
36569
- staticWidth,
36570
- fullWidth
36571
- } = _ref13;
36572
- let {
36573
- forms,
36574
- form,
36575
- inputMeta = {},
36576
- t,
36577
- isHighlighted
36578
- } = _ref14;
36616
+ multiselect: ({
36617
+ value,
36618
+ options,
36619
+ optionGroup,
36620
+ optionsFilter,
36621
+ filterCond,
36622
+ props,
36623
+ formsValue,
36624
+ repeatValues,
36625
+ repeatIndex,
36626
+ inputName,
36627
+ name,
36628
+ tags,
36629
+ maxWidth,
36630
+ staticWidth,
36631
+ fullWidth
36632
+ }, {
36633
+ forms,
36634
+ form,
36635
+ inputMeta = {},
36636
+ t,
36637
+ isHighlighted
36638
+ }) => {
36579
36639
  let opts;
36580
36640
  if (typeof options === "string") {
36581
36641
  const [formName, key] = options.split(".");
@@ -36637,17 +36697,17 @@ const inputTypeComponent$1 = {
36637
36697
  staticWidth,
36638
36698
  fullWidth
36639
36699
  });
36640
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36700
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36641
36701
  size: "medium",
36642
36702
  allowClear: true,
36643
36703
  autoComplete: "new-password",
36644
36704
  mode: tags ? "tags" : "multiple",
36645
- optionFilterProp: "children"
36646
- }, tags ? {
36647
- tokenSeparators: [","]
36648
- } : {}), {}, {
36649
- filterOption: filterSelectOptions
36650
- }, props), {}, {
36705
+ optionFilterProp: "children",
36706
+ ...(tags ? {
36707
+ tokenSeparators: [","]
36708
+ } : {}),
36709
+ filterOption: filterSelectOptions,
36710
+ ...props,
36651
36711
  className: formatClassname([isHighlighted && "highlighted-select"]),
36652
36712
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36653
36713
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
@@ -36686,52 +36746,51 @@ const inputTypeComponent$1 = {
36686
36746
  if (og.disabled !== undefined) {
36687
36747
  groupOtherProps.disabled = og.disabled;
36688
36748
  }
36689
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36690
- value: og.value
36691
- }, groupOtherProps), {}, {
36749
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36750
+ value: og.value,
36751
+ ...groupOtherProps,
36692
36752
  children: og.label
36693
- }), "".concat(i).concat(j));
36753
+ }, `${i}${j}`);
36694
36754
  })
36695
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36696
- value: option.value
36697
- }, otherProps), {}, {
36755
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36756
+ value: option.value,
36757
+ ...otherProps,
36698
36758
  children: option.label
36699
- }), i);
36759
+ }, i);
36700
36760
  })
36701
- }));
36761
+ });
36702
36762
  },
36703
- date: (_ref15, _ref16) => {
36704
- var _formsValue$groupForm, _value2;
36705
- let {
36706
- props,
36707
- rules,
36708
- repeatValues,
36709
- formsValue,
36710
- name
36711
- } = _ref15;
36712
- let {
36713
- setFormValues,
36714
- inputMeta,
36715
- form,
36716
- t,
36717
- isHighlighted,
36718
- groupFormId
36719
- } = _ref16;
36763
+ date: ({
36764
+ props,
36765
+ rules,
36766
+ repeatValues,
36767
+ formsValue,
36768
+ name
36769
+ }, {
36770
+ setFormValues,
36771
+ inputMeta,
36772
+ form,
36773
+ t,
36774
+ isHighlighted,
36775
+ groupFormId
36776
+ }) => {
36720
36777
  const lng = localStorage.getItem("datastakeLng") || "en";
36721
36778
  const maxRule = rules.find(r => r.max);
36722
- let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36779
+ let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36723
36780
  const handleDateChange = date => {
36724
36781
  if (date) {
36725
36782
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36726
36783
  const localDate = dayjs__default["default"].utc(date);
36727
36784
  if (groupFormId) {
36728
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36785
+ const _new = {
36786
+ ...(formsValue[groupFormId] || {}),
36729
36787
  [name]: localDate
36730
- });
36788
+ };
36731
36789
  form.setFieldValue(groupFormId, _new);
36732
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36790
+ setFormValues({
36791
+ ...formsValue,
36733
36792
  [groupFormId]: _new
36734
- }));
36793
+ });
36735
36794
  } else {
36736
36795
  form.setFieldValue(name, localDate);
36737
36796
  }
@@ -36740,13 +36799,15 @@ const inputTypeComponent$1 = {
36740
36799
  if (groupFormId) {
36741
36800
  if (typeof value === "string" || typeof value === "undefined") {
36742
36801
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36743
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36802
+ const _new = {
36803
+ ...(formsValue[groupFormId] || {}),
36744
36804
  [name]: value
36745
- });
36805
+ };
36746
36806
  form.setFieldValue(groupFormId, _new);
36747
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36807
+ setFormValues({
36808
+ ...formsValue,
36748
36809
  [groupFormId]: _new
36749
- }));
36810
+ });
36750
36811
  }
36751
36812
  } else {
36752
36813
  if (typeof value === "string") {
@@ -36762,13 +36823,12 @@ const inputTypeComponent$1 = {
36762
36823
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36763
36824
  }
36764
36825
  if (checkForMax) {
36765
- var _value;
36766
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36826
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36767
36827
  size: "large",
36768
36828
  allowClear: true,
36769
- autoComplete: "new-password"
36770
- }, props), {}, {
36771
- value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36829
+ autoComplete: "new-password",
36830
+ ...props,
36831
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36772
36832
  onChange: handleDateChange,
36773
36833
  className: formatClassname([isHighlighted && "highlighted-input"]),
36774
36834
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36778,54 +36838,49 @@ const inputTypeComponent$1 = {
36778
36838
  disabledDate: current => {
36779
36839
  return current && current >= dayjs__default["default"]().endOf("day");
36780
36840
  }
36781
- }));
36841
+ });
36782
36842
  }
36783
36843
  }
36784
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36844
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36785
36845
  size: "large",
36786
36846
  allowClear: true,
36787
- autoComplete: "new-password"
36788
- }, props), {}, {
36789
- value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36847
+ autoComplete: "new-password",
36848
+ ...props,
36849
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36790
36850
  onChange: handleDateChange,
36791
36851
  className: formatClassname([isHighlighted && "highlighted-input"]),
36792
36852
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36793
36853
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36794
36854
  format: DATE_FORMATS,
36795
36855
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36796
- }));
36856
+ });
36797
36857
  },
36798
- groupExpandable: (_ref17, _ref18) => {
36799
- var _formsValue$groupForm2;
36800
- let {
36801
- formsValue,
36802
- name,
36803
- input
36804
- } = _ref17;
36805
- let {
36806
- groupFormId
36807
- } = _ref18;
36808
- 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];
36858
+ groupExpandable: ({
36859
+ formsValue,
36860
+ name,
36861
+ input
36862
+ }, {
36863
+ groupFormId
36864
+ }) => {
36865
+ const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36809
36866
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36810
36867
  input: input,
36811
36868
  formsValue: formsValue,
36812
36869
  data: data
36813
36870
  });
36814
36871
  },
36815
- comment: (_ref19, _ref20) => {
36816
- let {
36817
- props: {
36818
- placeholder
36819
- },
36820
- commentHint
36821
- } = _ref19,
36822
- props = _objectWithoutProperties(_ref19.props, _excluded$i);
36823
- let {
36824
- onChange,
36825
- value,
36826
- isHighlighted
36827
- } = _ref20;
36828
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36872
+ comment: ({
36873
+ props: {
36874
+ placeholder,
36875
+ ...props
36876
+ },
36877
+ commentHint
36878
+ }, {
36879
+ onChange,
36880
+ value,
36881
+ isHighlighted
36882
+ }) => {
36883
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36829
36884
  allowClear: true,
36830
36885
  value: value,
36831
36886
  onChange: e => onChange(e.target.value),
@@ -36836,27 +36891,26 @@ const inputTypeComponent$1 = {
36836
36891
  autoSize: {
36837
36892
  minRows: 5,
36838
36893
  maxRows: 5
36839
- }
36840
- }, props), {}, {
36894
+ },
36895
+ ...props,
36841
36896
  disabled: false
36842
- }));
36897
+ });
36843
36898
  },
36844
- tableComment: (_ref21, _ref22) => {
36845
- var _formsValue$meta3;
36846
- let {
36847
- setValues,
36848
- name,
36849
- onValuesChange,
36850
- formsValue
36851
- } = _ref21;
36852
- let {
36853
- form,
36854
- groupFormId,
36855
- isHighlighted
36856
- } = _ref22;
36857
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36899
+ tableComment: ({
36900
+ setValues,
36901
+ name,
36902
+ onValuesChange,
36903
+ formsValue
36904
+ }, {
36905
+ form,
36906
+ groupFormId,
36907
+ isHighlighted
36908
+ }) => {
36909
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36910
+ ...v,
36858
36911
  key: i
36859
- })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36912
+ })) : (formsValue[name] || []).map((v, i) => ({
36913
+ ...v,
36860
36914
  key: i
36861
36915
  }));
36862
36916
  const onUpdate = (val, i) => {
@@ -36864,89 +36918,121 @@ const inputTypeComponent$1 = {
36864
36918
  [name]: formData.map((d, j) => i === j ? val : d)
36865
36919
  };
36866
36920
  if (groupFormId) {
36867
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36868
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36869
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36921
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36922
+ const _newData = {
36923
+ ..._defaultData,
36924
+ ..._val
36925
+ };
36926
+ onValuesChange(_newData, {
36927
+ ...formsValue,
36870
36928
  [groupFormId]: _newData
36871
- }));
36872
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36873
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36929
+ });
36930
+ form?.setFieldValue(groupFormId, _newData);
36931
+ setValues({
36932
+ ...formsValue,
36874
36933
  [groupFormId]: _newData
36875
- }));
36934
+ });
36876
36935
  return;
36877
36936
  }
36878
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36879
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36880
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36937
+ onValuesChange(_val, {
36938
+ ...formsValue,
36939
+ ..._val
36940
+ });
36941
+ form?.setFieldValue(name, _val[name]);
36942
+ setValues({
36943
+ ...formsValue,
36944
+ ..._val
36945
+ });
36881
36946
  };
36882
36947
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36883
36948
  onUpdate: onUpdate,
36884
36949
  isHighlighted: isHighlighted,
36885
36950
  form: form,
36886
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36951
+ values: groupFormId ? {
36952
+ ...(formsValue[groupFormId] || {}),
36887
36953
  meta: {
36888
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
36954
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36889
36955
  }
36890
- }) : formsValue,
36956
+ } : formsValue,
36891
36957
  name: name,
36892
- remove: _ref23 => {
36893
- let {
36894
- key
36895
- } = _ref23;
36958
+ remove: ({
36959
+ key
36960
+ }) => {
36896
36961
  const _val = {
36897
36962
  [name]: formData.filter(v => v.key !== key)
36898
36963
  };
36899
36964
  if (groupFormId) {
36900
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36901
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36902
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36965
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36966
+ const _newData = {
36967
+ ..._defaultData,
36968
+ ..._val
36969
+ };
36970
+ onValuesChange(_newData, {
36971
+ ...formsValue,
36903
36972
  [groupFormId]: _newData
36904
- }));
36905
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36906
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36973
+ });
36974
+ form?.setFieldValue(groupFormId, _newData);
36975
+ setValues({
36976
+ ...formsValue,
36907
36977
  [groupFormId]: _newData
36908
- }));
36978
+ });
36909
36979
  return;
36910
36980
  }
36911
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36912
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36913
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36981
+ onValuesChange(_val, {
36982
+ ...formsValue,
36983
+ ..._val
36984
+ });
36985
+ form?.setFieldValue(name, _val[name]);
36986
+ setValues({
36987
+ ...formsValue,
36988
+ ..._val
36989
+ });
36914
36990
  },
36915
36991
  add: val => {
36916
36992
  const _val = {
36917
- [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
36993
+ [name]: [...formData, {
36994
+ ...val,
36918
36995
  key: formData.length
36919
- })]
36996
+ }]
36920
36997
  };
36921
36998
  if (groupFormId) {
36922
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36923
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36924
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36925
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36999
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37000
+ const _newData = {
37001
+ ..._defaultData,
37002
+ ..._val
37003
+ };
37004
+ form?.setFieldValue(groupFormId, _newData);
37005
+ onValuesChange(_newData, {
37006
+ ...formsValue,
36926
37007
  [groupFormId]: _newData
36927
- }));
36928
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37008
+ });
37009
+ setValues({
37010
+ ...formsValue,
36929
37011
  [groupFormId]: _newData
36930
- }));
37012
+ });
36931
37013
  return;
36932
37014
  }
36933
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36934
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36935
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37015
+ form?.setFieldValue(name, _val[name]);
37016
+ onValuesChange(_val, {
37017
+ ...formsValue,
37018
+ ..._val
37019
+ });
37020
+ setValues({
37021
+ ...formsValue,
37022
+ ..._val
37023
+ });
36936
37024
  },
36937
37025
  k: name
36938
37026
  });
36939
37027
  },
36940
- textarea: (_ref24, _ref25) => {
36941
- let {
36942
- props,
36943
- rules
36944
- } = _ref24;
36945
- let {
36946
- inputMeta,
36947
- t,
36948
- isHighlighted
36949
- } = _ref25;
37028
+ textarea: ({
37029
+ props,
37030
+ rules
37031
+ }, {
37032
+ inputMeta,
37033
+ t,
37034
+ isHighlighted
37035
+ }) => {
36950
37036
  const maxRule = rules.find(r => r.max);
36951
37037
  let maxLength = MAX_TEXT_AREA_LENGTH;
36952
37038
  let rows = 5;
@@ -36973,7 +37059,7 @@ const inputTypeComponent$1 = {
36973
37059
  // rows = 14;
36974
37060
  // }
36975
37061
  }
36976
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
37062
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36977
37063
  allowClear: true,
36978
37064
  autoComplete: "new-password",
36979
37065
  maxLength: maxLength,
@@ -36981,37 +37067,35 @@ const inputTypeComponent$1 = {
36981
37067
  autoSize: {
36982
37068
  minRows: rows,
36983
37069
  maxRows: rows
36984
- }
36985
- }, props), {}, {
37070
+ },
37071
+ ...props,
36986
37072
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36987
37073
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36988
- }));
37074
+ });
36989
37075
  },
36990
- phoneNumber: (_ref26, _ref27) => {
36991
- let {
36992
- name,
36993
- inputName,
36994
- props,
36995
- value,
36996
- repeatIndex,
36997
- repeatValues,
36998
- formsValue
36999
- } = _ref26;
37000
- let {
37001
- setFormValues,
37002
- inputMeta,
37003
- t,
37004
- isHighlighted
37005
- } = _ref27;
37006
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
37076
+ phoneNumber: ({
37077
+ name,
37078
+ inputName,
37079
+ props,
37080
+ value,
37081
+ repeatIndex,
37082
+ repeatValues,
37083
+ formsValue
37084
+ }, {
37085
+ setFormValues,
37086
+ inputMeta,
37087
+ t,
37088
+ isHighlighted
37089
+ }) => {
37090
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
37007
37091
  customSelectWidthPercentage: "20%",
37008
37092
  t: t,
37009
37093
  size: "large",
37010
37094
  allowClear: true,
37011
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
37095
+ country: formsValue?.country,
37012
37096
  initialValue: value,
37013
- name: name
37014
- }, props), {}, {
37097
+ name: name,
37098
+ ...props,
37015
37099
  className: formatClassname([isHighlighted && "highlighted-input"]),
37016
37100
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37017
37101
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -37032,27 +37116,26 @@ const inputTypeComponent$1 = {
37032
37116
  }
37033
37117
  return val;
37034
37118
  }
37035
- }));
37119
+ });
37036
37120
  },
37037
- switch: (_ref28, _ref29) => {
37038
- let {
37039
- props,
37040
- value,
37041
- restricted,
37042
- autocomplete,
37043
- formsValue,
37044
- repeatValues,
37045
- repeatIndex,
37046
- name,
37047
- inputName,
37048
- replace: replaceInput,
37049
- unique
37050
- } = _ref28;
37051
- let {
37052
- form,
37053
- isHighlighted
37054
- } = _ref29;
37055
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
37121
+ switch: ({
37122
+ props,
37123
+ value,
37124
+ restricted,
37125
+ autocomplete,
37126
+ formsValue,
37127
+ repeatValues,
37128
+ repeatIndex,
37129
+ name,
37130
+ inputName,
37131
+ replace: replaceInput,
37132
+ unique
37133
+ }, {
37134
+ form,
37135
+ isHighlighted
37136
+ }) => {
37137
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
37138
+ ...props,
37056
37139
  size: "default",
37057
37140
  defaultChecked: value || false,
37058
37141
  checked: value || false,
@@ -37080,7 +37163,9 @@ const inputTypeComponent$1 = {
37080
37163
  const [formName, replaceInputName] = replaceTo.split(".");
37081
37164
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
37082
37165
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
37083
- formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
37166
+ formsValue = Object.assign(formsValue, {
37167
+ ...form.getFieldsValue(true)
37168
+ });
37084
37169
  if (oldId) {
37085
37170
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
37086
37171
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -37121,22 +37206,20 @@ const inputTypeComponent$1 = {
37121
37206
  }
37122
37207
  }
37123
37208
  }
37124
- }));
37209
+ });
37125
37210
  },
37126
- radioGroup: (_ref30, _ref31) => {
37127
- let {
37128
- props,
37129
- value,
37130
- options,
37131
- isRisk
37132
- } = _ref30;
37133
- let {
37134
- isHighlighted
37135
- } = _ref31;
37211
+ radioGroup: ({
37212
+ props,
37213
+ value,
37214
+ options,
37215
+ isRisk
37216
+ }, {
37217
+ isHighlighted
37218
+ }) => {
37136
37219
  if (isRisk) {
37137
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37138
- value: value
37139
- }, props), {}, {
37220
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37221
+ value: value,
37222
+ ...props,
37140
37223
  className: "is-risk-radio",
37141
37224
  children: (options || []).map(o => {
37142
37225
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37150,11 +37233,11 @@ const inputTypeComponent$1 = {
37150
37233
  }) : null]
37151
37234
  }, o.value);
37152
37235
  })
37153
- }));
37236
+ });
37154
37237
  }
37155
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37156
- value: value
37157
- }, props), {}, {
37238
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37239
+ value: value,
37240
+ ...props,
37158
37241
  className: formatClassname([isHighlighted && "highlighted-input"]),
37159
37242
  children: (options || []).map(o => {
37160
37243
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37168,20 +37251,18 @@ const inputTypeComponent$1 = {
37168
37251
  }) : null]
37169
37252
  }, o.value);
37170
37253
  })
37171
- }));
37254
+ });
37172
37255
  },
37173
- checkboxGroup: (_ref32, _ref33) => {
37174
- let {
37175
- props,
37176
- value,
37177
- options
37178
- } = _ref32;
37179
- let {
37180
- isHighlighted
37181
- } = _ref33;
37182
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
37183
- value: value
37184
- }, props), {}, {
37256
+ checkboxGroup: ({
37257
+ props,
37258
+ value,
37259
+ options
37260
+ }, {
37261
+ isHighlighted
37262
+ }) => {
37263
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37264
+ value: value,
37265
+ ...props,
37185
37266
  className: formatClassname([isHighlighted && "highlighted-input"]),
37186
37267
  style: {
37187
37268
  display: "grid",
@@ -37205,18 +37286,16 @@ const inputTypeComponent$1 = {
37205
37286
  }) : null]
37206
37287
  }, o.value);
37207
37288
  })
37208
- }));
37289
+ });
37209
37290
  },
37210
- total100: (_ref34, _ref35) => {
37211
- let {
37212
- props,
37213
- name,
37214
- options,
37215
- value
37216
- } = _ref34;
37217
- let {
37218
- isHighlighted
37219
- } = _ref35;
37291
+ total100: ({
37292
+ props,
37293
+ name,
37294
+ options,
37295
+ value
37296
+ }, {
37297
+ isHighlighted
37298
+ }) => {
37220
37299
  value = value ? Array.isArray(value) ? value : [value] : [];
37221
37300
  function totalValue() {
37222
37301
  let total = 0;
@@ -37240,11 +37319,10 @@ const inputTypeComponent$1 = {
37240
37319
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
37241
37320
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
37242
37321
  name: name,
37243
- children: (fields, _ref36) => {
37244
- let {
37245
- add,
37246
- remove
37247
- } = _ref36;
37322
+ children: (fields, {
37323
+ add,
37324
+ remove
37325
+ }) => {
37248
37326
  if (fields.length === 0) {
37249
37327
  const formData = value || [];
37250
37328
  if (formData.length) {
@@ -37263,27 +37341,27 @@ const inputTypeComponent$1 = {
37263
37341
  const v = value[field.name] || {};
37264
37342
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
37265
37343
  className: "total",
37266
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37267
- noStyle: true
37268
- }, field), {}, {
37344
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37345
+ noStyle: true,
37346
+ ...field,
37269
37347
  name: [field.name, "type"],
37270
37348
  fieldKey: [field.fieldKey, "type"],
37271
37349
  initialValue: v.type || null,
37272
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37350
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
37273
37351
  size: "large",
37274
37352
  allowClear: true,
37275
37353
  showSearch: true,
37276
37354
  filterOption: filterSelectOptions,
37277
- optionFilterProp: "children"
37278
- }, props), {}, {
37355
+ optionFilterProp: "children",
37356
+ ...props,
37279
37357
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
37280
37358
  value: option.value,
37281
37359
  children: option.label
37282
37360
  }, i))
37283
- }))
37284
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37285
- noStyle: true
37286
- }, field), {}, {
37361
+ })
37362
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37363
+ noStyle: true,
37364
+ ...field,
37287
37365
  name: [field.name, "value"],
37288
37366
  fieldKey: [field.fieldKey, "value"],
37289
37367
  initialValue: v.value,
@@ -37292,14 +37370,14 @@ const inputTypeComponent$1 = {
37292
37370
  allowClear: true,
37293
37371
  name: "value",
37294
37372
  formatter: value => {
37295
- return value ? "".concat(value, "%") : "";
37373
+ return value ? `${value}%` : "";
37296
37374
  },
37297
37375
  disabled: !v.type || null,
37298
37376
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
37299
37377
  min: 1,
37300
37378
  max: 100 - siblingTotal(v.type || 0)
37301
37379
  })
37302
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37380
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37303
37381
  disabled: !v.value || !v.type || totalValue() >= 100,
37304
37382
  type: "primary",
37305
37383
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -37331,22 +37409,19 @@ const inputTypeComponent$1 = {
37331
37409
  }) : null]
37332
37410
  });
37333
37411
  },
37334
- percentage: (_ref37, _ref38) => {
37335
- var _input$meta11;
37336
- let {
37337
- name,
37338
- inputName,
37339
- totalMax,
37340
- repeatIndex,
37341
- props,
37342
- formsValue,
37343
- input
37344
- } = _ref37;
37345
- let {
37346
- inputMeta,
37347
- t,
37348
- isHighlighted
37349
- } = _ref38;
37412
+ percentage: ({
37413
+ name,
37414
+ inputName,
37415
+ totalMax,
37416
+ repeatIndex,
37417
+ props,
37418
+ formsValue,
37419
+ input
37420
+ }, {
37421
+ inputMeta,
37422
+ t,
37423
+ isHighlighted
37424
+ }) => {
37350
37425
  const isRepeatable = Array.isArray(formsValue[name]);
37351
37426
  let totalSiblings = 0;
37352
37427
  if (isRepeatable && totalMax) {
@@ -37354,47 +37429,45 @@ const inputTypeComponent$1 = {
37354
37429
  totl = totl + (grp[inputName] || 0);
37355
37430
  return totl;
37356
37431
  }, 0);
37357
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37432
+ } else if (Array.isArray(input?.meta?.siblings)) {
37358
37433
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
37359
37434
  totl = totl + (formsValue[key] || 0);
37360
37435
  return totl;
37361
37436
  }, 0);
37362
37437
  }
37363
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37438
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37364
37439
  size: "large",
37365
- allowClear: true
37366
- }, props), {}, {
37440
+ allowClear: true,
37441
+ ...props,
37367
37442
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37368
37443
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37369
37444
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37370
37445
  min: 0,
37371
37446
  max: 100 - totalSiblings,
37372
37447
  formatter: value => {
37373
- return value ? "".concat(value) : "";
37448
+ return value ? `${value}` : "";
37374
37449
  },
37375
37450
  parser: value => value.replace("%", ""),
37376
37451
  addonAfter: "%"
37377
- }));
37452
+ });
37378
37453
  },
37379
- drawTerritory: (_ref39, _ref40) => {
37380
- let {
37381
- formsValue,
37382
- name,
37383
- addressData
37384
- } = _ref39;
37385
- let {
37386
- setFormValues
37387
- } = _ref40;
37454
+ drawTerritory: ({
37455
+ formsValue,
37456
+ name,
37457
+ addressData
37458
+ }, {
37459
+ setFormValues
37460
+ }) => {
37388
37461
  let search = formsValue.country;
37389
37462
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37390
37463
  if (addressData.address.country) {
37391
37464
  search = addressData.address.country;
37392
37465
  }
37393
37466
  if (addressData.address.level1) {
37394
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37467
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
37395
37468
  }
37396
37469
  if (addressData.address.level2) {
37397
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37470
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37398
37471
  }
37399
37472
  } else {
37400
37473
  const country = countriesList.countries[formsValue.country] || {};
@@ -37402,10 +37475,10 @@ const inputTypeComponent$1 = {
37402
37475
  search = country.name;
37403
37476
  }
37404
37477
  if (formsValue.administrativeLevel1Name) {
37405
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37478
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37406
37479
  }
37407
37480
  if (formsValue.administrativeLevel2Name) {
37408
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37481
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37409
37482
  }
37410
37483
  }
37411
37484
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37417,36 +37490,32 @@ const inputTypeComponent$1 = {
37417
37490
  searchValue: search
37418
37491
  });
37419
37492
  },
37420
- year: (_ref41, _ref42) => {
37421
- let {
37422
- props
37423
- } = _ref41;
37424
- let {
37425
- isHighlighted
37426
- } = _ref42;
37493
+ year: ({
37494
+ props
37495
+ }, {
37496
+ isHighlighted
37497
+ }) => {
37427
37498
  const lng = localStorage.getItem("datastakeLng") || "en";
37428
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37499
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37429
37500
  size: "large",
37430
37501
  allowClear: true,
37431
37502
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37432
- picker: "year"
37433
- }, props), {}, {
37503
+ picker: "year",
37504
+ ...props,
37434
37505
  className: formatClassname([isHighlighted && "highlighted-input"]),
37435
37506
  format: "YYYY"
37436
- }));
37507
+ });
37437
37508
  },
37438
- upload: (_ref43, _ref44) => {
37439
- let {
37440
- rules,
37441
- value
37442
- } = _ref43;
37443
- let {
37444
- setLoading = () => {},
37445
- getApiBaseUrl,
37446
- getAppHeader,
37447
- t,
37448
- isHighlighted
37449
- } = _ref44;
37509
+ upload: ({
37510
+ rules,
37511
+ value
37512
+ }, {
37513
+ setLoading = () => {},
37514
+ getApiBaseUrl,
37515
+ getAppHeader,
37516
+ t,
37517
+ isHighlighted
37518
+ }) => {
37450
37519
  const apiURL = getApiBaseUrl();
37451
37520
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37452
37521
  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) : []) || [];
@@ -37459,12 +37528,13 @@ const inputTypeComponent$1 = {
37459
37528
  maxProps.multiple = true;
37460
37529
  }
37461
37530
  }
37462
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37531
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37532
+ ...maxProps,
37463
37533
  accept: accept,
37464
- action: "".concat(apiURL, "/upload"),
37534
+ action: `${apiURL}/upload`,
37465
37535
  beforeUpload: beforeUpload(allowedExtensions),
37466
37536
  onChange: val => {
37467
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37537
+ if (val?.file && typeof setLoading === "function") {
37468
37538
  if (val.file.percent !== 100) {
37469
37539
  setLoading(true);
37470
37540
  } else {
@@ -37472,9 +37542,10 @@ const inputTypeComponent$1 = {
37472
37542
  }
37473
37543
  }
37474
37544
  },
37475
- headers: _objectSpread2({
37476
- Authorization: "Bearer ".concat(getToken())
37477
- }, getAppHeader()),
37545
+ headers: {
37546
+ Authorization: `Bearer ${getToken()}`,
37547
+ ...getAppHeader()
37548
+ },
37478
37549
  defaultFileList: values,
37479
37550
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37480
37551
  style: {
@@ -37485,20 +37556,18 @@ const inputTypeComponent$1 = {
37485
37556
  children: t("Upload")
37486
37557
  })]
37487
37558
  })
37488
- }));
37559
+ });
37489
37560
  },
37490
- imageUpload: (_ref45, _ref46) => {
37491
- let {
37492
- rules,
37493
- value
37494
- } = _ref45;
37495
- let {
37496
- setLoading = () => {},
37497
- getApiBaseUrl,
37498
- getAppHeader,
37499
- t,
37500
- isHighlighted
37501
- } = _ref46;
37561
+ imageUpload: ({
37562
+ rules,
37563
+ value
37564
+ }, {
37565
+ setLoading = () => {},
37566
+ getApiBaseUrl,
37567
+ getAppHeader,
37568
+ t,
37569
+ isHighlighted
37570
+ }) => {
37502
37571
  const apiURL = getApiBaseUrl();
37503
37572
  const values = getImageUploadEditValue(value);
37504
37573
  const maxRule = rules.find(r => r.max);
@@ -37509,18 +37578,17 @@ const inputTypeComponent$1 = {
37509
37578
  maxProps.multiple = true;
37510
37579
  }
37511
37580
  }
37512
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37513
- beforeUpload: beforeUpload(allowedImageExtensions)
37514
- }, maxProps), {}, {
37581
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37582
+ beforeUpload: beforeUpload(allowedImageExtensions),
37583
+ ...maxProps,
37515
37584
  accept: "image/*",
37516
37585
  classList: !values || !values.length ? "empty" : "",
37517
37586
  listType: "picture",
37518
- action: "".concat(apiURL, "/upload"),
37587
+ action: `${apiURL}/upload`,
37519
37588
  onChange: val => {
37520
37589
  if (typeof setLoading === "function") {
37521
- if (val !== null && val !== void 0 && val.file) {
37522
- var _val$file;
37523
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37590
+ if (val?.file) {
37591
+ if (val?.file?.status === "removed") {
37524
37592
  setLoading(false);
37525
37593
  return;
37526
37594
  }
@@ -37532,9 +37600,10 @@ const inputTypeComponent$1 = {
37532
37600
  setLoading(false);
37533
37601
  }
37534
37602
  },
37535
- headers: _objectSpread2({
37536
- Authorization: "Bearer ".concat(getToken())
37537
- }, getAppHeader()),
37603
+ headers: {
37604
+ Authorization: `Bearer ${getToken()}`,
37605
+ ...getAppHeader()
37606
+ },
37538
37607
  defaultFileList: values,
37539
37608
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37540
37609
  style: {
@@ -37545,20 +37614,18 @@ const inputTypeComponent$1 = {
37545
37614
  children: t("Upload")
37546
37615
  })]
37547
37616
  })
37548
- }));
37617
+ });
37549
37618
  },
37550
- videoUpload: (_ref47, _ref48) => {
37551
- let {
37552
- rules,
37553
- value
37554
- } = _ref47;
37555
- let {
37556
- setLoading = () => {},
37557
- getApiBaseUrl,
37558
- getAppHeader,
37559
- t,
37560
- isHighlighted
37561
- } = _ref48;
37619
+ videoUpload: ({
37620
+ rules,
37621
+ value
37622
+ }, {
37623
+ setLoading = () => {},
37624
+ getApiBaseUrl,
37625
+ getAppHeader,
37626
+ t,
37627
+ isHighlighted
37628
+ }) => {
37562
37629
  const apiURL = getApiBaseUrl();
37563
37630
  const values = getImageUploadEditValue(value);
37564
37631
  const maxRule = rules.find(r => r.max);
@@ -37569,25 +37636,21 @@ const inputTypeComponent$1 = {
37569
37636
  maxProps.multiple = true;
37570
37637
  }
37571
37638
  }
37572
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37573
- itemRender: (item, fileList) => {
37574
- var _fileList$response;
37575
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37576
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37577
- 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)
37578
- }), item]
37579
- });
37580
- }
37581
- }, maxProps), {}, {
37639
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37640
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37641
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37642
+ url: fileList?.response?.url || fileList?.url
37643
+ }), item]
37644
+ }),
37645
+ ...maxProps,
37582
37646
  accept: "video/*",
37583
37647
  classList: !values || !values.length ? "empty" : "",
37584
37648
  listType: "picture",
37585
- action: "".concat(apiURL, "/upload"),
37649
+ action: `${apiURL}/upload`,
37586
37650
  onChange: val => {
37587
37651
  if (typeof setLoading === "function") {
37588
- if (val !== null && val !== void 0 && val.file) {
37589
- var _val$file2;
37590
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37652
+ if (val?.file) {
37653
+ if (val?.file?.status === "removed") {
37591
37654
  setLoading(false);
37592
37655
  return;
37593
37656
  }
@@ -37599,9 +37662,10 @@ const inputTypeComponent$1 = {
37599
37662
  setLoading(false);
37600
37663
  }
37601
37664
  },
37602
- headers: _objectSpread2({
37603
- Authorization: "Bearer ".concat(getToken())
37604
- }, getAppHeader()),
37665
+ headers: {
37666
+ Authorization: `Bearer ${getToken()}`,
37667
+ ...getAppHeader()
37668
+ },
37605
37669
  fileList: values,
37606
37670
  defaultFileList: values,
37607
37671
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37613,30 +37677,28 @@ const inputTypeComponent$1 = {
37613
37677
  children: t("Upload")
37614
37678
  })]
37615
37679
  })
37616
- }));
37680
+ });
37617
37681
  },
37618
- geolocation: (_ref49, _ref50) => {
37619
- let {
37620
- value,
37621
- name,
37622
- props,
37623
- formsValue,
37624
- addressData
37625
- } = _ref49;
37626
- let {
37627
- inputMeta,
37628
- isHighlighted
37629
- } = _ref50;
37682
+ geolocation: ({
37683
+ value,
37684
+ name,
37685
+ props,
37686
+ formsValue,
37687
+ addressData
37688
+ }, {
37689
+ inputMeta,
37690
+ isHighlighted
37691
+ }) => {
37630
37692
  let search = formsValue.country;
37631
37693
  if (addressData && Object.keys(addressData).length > 0) {
37632
37694
  if (addressData.country) {
37633
37695
  search = addressData.country;
37634
37696
  }
37635
37697
  if (addressData.level1) {
37636
- search = "".concat(addressData.level1, ", ").concat(addressData.country);
37698
+ search = `${addressData.level1}, ${addressData.country}`;
37637
37699
  }
37638
37700
  if (addressData.level2) {
37639
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37701
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37640
37702
  }
37641
37703
  } else {
37642
37704
  const country = countriesList.countries[formsValue.country] || {};
@@ -37644,10 +37706,10 @@ const inputTypeComponent$1 = {
37644
37706
  search = country.name;
37645
37707
  }
37646
37708
  if (formsValue.administrativeLevel1Name) {
37647
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37709
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37648
37710
  }
37649
37711
  if (formsValue.administrativeLevel2Name) {
37650
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37712
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37651
37713
  }
37652
37714
  }
37653
37715
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37661,36 +37723,34 @@ const inputTypeComponent$1 = {
37661
37723
  searchValue: search
37662
37724
  });
37663
37725
  },
37664
- ajaxSelect: (_ref51, _ref52) => {
37665
- let {
37666
- call,
37667
- automaticallyLink,
37668
- name,
37669
- inputName,
37670
- props,
37671
- formsValue,
37672
- onNewSetValue,
37673
- multiple,
37674
- updateOptions,
37675
- repeatValues,
37676
- repeatIndex,
37677
- value,
37678
- unique,
37679
- address,
37680
- addressData = {},
37681
- getFromLinking,
37682
- input
37683
- } = _ref51;
37684
- let {
37685
- form,
37686
- forms,
37687
- setAddress,
37688
- changeInputMeta,
37689
- inputMeta,
37690
- meta,
37691
- isHighlighted,
37692
- groupFormId
37693
- } = _ref52;
37726
+ ajaxSelect: ({
37727
+ call,
37728
+ automaticallyLink,
37729
+ name,
37730
+ inputName,
37731
+ props,
37732
+ formsValue,
37733
+ onNewSetValue,
37734
+ multiple,
37735
+ updateOptions,
37736
+ repeatValues,
37737
+ repeatIndex,
37738
+ value,
37739
+ unique,
37740
+ address,
37741
+ addressData = {},
37742
+ getFromLinking,
37743
+ input
37744
+ }, {
37745
+ form,
37746
+ forms,
37747
+ setAddress,
37748
+ changeInputMeta,
37749
+ inputMeta,
37750
+ meta,
37751
+ isHighlighted,
37752
+ groupFormId
37753
+ }) => {
37694
37754
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37695
37755
  size: "medium",
37696
37756
  input: input,
@@ -37727,7 +37787,9 @@ const inputTypeComponent$1 = {
37727
37787
  const selectedValue = data.find(v => v.value === ev);
37728
37788
  if (address && selectedValue) {
37729
37789
  dot__default["default"].str(address, selectedValue.label, addressData);
37730
- setAddress(_objectSpread2({}, addressData));
37790
+ setAddress({
37791
+ ...addressData
37792
+ });
37731
37793
  }
37732
37794
  }
37733
37795
  },
@@ -37736,11 +37798,10 @@ const inputTypeComponent$1 = {
37736
37798
  address: true
37737
37799
  });
37738
37800
  },
37739
- tag: _ref53 => {
37740
- let {
37741
- value,
37742
- repeatLabel
37743
- } = _ref53;
37801
+ tag: ({
37802
+ value,
37803
+ repeatLabel
37804
+ }) => {
37744
37805
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37745
37806
  size: "large",
37746
37807
  allowClear: true,
@@ -37748,28 +37809,26 @@ const inputTypeComponent$1 = {
37748
37809
  newPlaceholder: repeatLabel
37749
37810
  });
37750
37811
  },
37751
- modal: (_ref54, _ref55) => {
37752
- let {
37753
- call,
37754
- automaticallyLink,
37755
- name,
37756
- inputName,
37757
- props,
37758
- formsValue,
37759
- allFormsValue,
37760
- onNewSetValue,
37761
- repeatValues,
37762
- repeatIndex,
37763
- value,
37764
- modalTitle,
37765
- totalInputs,
37766
- shownInputs,
37767
- allowDupplicates
37768
- } = _ref54;
37769
- let {
37770
- form,
37771
- add
37772
- } = _ref55;
37812
+ modal: ({
37813
+ call,
37814
+ automaticallyLink,
37815
+ name,
37816
+ inputName,
37817
+ props,
37818
+ formsValue,
37819
+ allFormsValue,
37820
+ onNewSetValue,
37821
+ repeatValues,
37822
+ repeatIndex,
37823
+ value,
37824
+ modalTitle,
37825
+ totalInputs,
37826
+ shownInputs,
37827
+ allowDupplicates
37828
+ }, {
37829
+ form,
37830
+ add
37831
+ }) => {
37773
37832
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37774
37833
  allowClear: true,
37775
37834
  call: call,
@@ -37792,44 +37851,40 @@ const inputTypeComponent$1 = {
37792
37851
  allowDupplicates: allowDupplicates
37793
37852
  });
37794
37853
  },
37795
- dataLink: (_ref56, _ref57) => {
37796
- var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37797
- let {
37798
- setValues,
37799
- name,
37800
- onValuesChange,
37801
- changeLinking,
37802
- formsValue,
37803
- input,
37804
- call,
37805
- automaticallyLink,
37806
- inputName,
37807
- props,
37808
- onNewSetValue,
37809
- multiple,
37810
- updateOptions,
37811
- repeatValues,
37812
- repeatIndex,
37813
- value,
37814
- unique,
37815
- address,
37816
- addressData = {},
37817
- getFromLinking
37818
- } = _ref56;
37819
- let {
37820
- form,
37821
- forms,
37822
- setAddress,
37823
- changeInputMeta,
37824
- inputMeta,
37825
- meta,
37826
- isHighlighted,
37827
- groupFormId
37828
- } = _ref57;
37829
- 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") {
37830
- var _formsValue$groupForm3, _input$meta13, _input$meta14;
37831
- const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37832
- (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()::::";
37854
+ dataLink: ({
37855
+ setValues,
37856
+ name,
37857
+ onValuesChange,
37858
+ changeLinking,
37859
+ formsValue,
37860
+ input,
37861
+ call,
37862
+ automaticallyLink,
37863
+ inputName,
37864
+ props,
37865
+ onNewSetValue,
37866
+ multiple,
37867
+ updateOptions,
37868
+ repeatValues,
37869
+ repeatIndex,
37870
+ value,
37871
+ unique,
37872
+ address,
37873
+ addressData = {},
37874
+ getFromLinking
37875
+ }, {
37876
+ form,
37877
+ forms,
37878
+ setAddress,
37879
+ changeInputMeta,
37880
+ inputMeta,
37881
+ meta,
37882
+ isHighlighted,
37883
+ groupFormId
37884
+ }) => {
37885
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37886
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37887
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37833
37888
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37834
37889
  size: "medium",
37835
37890
  input: input,
@@ -37866,7 +37921,9 @@ const inputTypeComponent$1 = {
37866
37921
  const selectedValue = data.find(v => v.value === ev);
37867
37922
  if (address && selectedValue) {
37868
37923
  dot__default["default"].str(address, selectedValue.label, addressData);
37869
- setAddress(_objectSpread2({}, addressData));
37924
+ setAddress({
37925
+ ...addressData
37926
+ });
37870
37927
  }
37871
37928
  }
37872
37929
  },
@@ -37876,93 +37933,138 @@ const inputTypeComponent$1 = {
37876
37933
  isDataLink: true
37877
37934
  });
37878
37935
  }
37879
- const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37880
- 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));
37936
+ const isSingle = input?.meta?.maxRepeat === 1;
37937
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37938
+ ...(formsValue[groupFormId] || {})[name]
37939
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
37940
+ ...v
37941
+ })) : isSingle ? formsValue[name] ? [{
37942
+ ...formsValue[name]
37943
+ }] : [] : (formsValue[name] || []).map(v => ({
37944
+ ...v
37945
+ }));
37881
37946
  const onUpdate = (editData, i) => {
37882
- const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
37947
+ const val = {
37948
+ ...formData[i],
37949
+ ...editData
37950
+ };
37883
37951
  const _val = isSingle ? {
37884
37952
  [name]: val
37885
37953
  } : {
37886
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
37954
+ [name]: formData?.map((d, j) => i === j ? val : d)
37887
37955
  };
37888
37956
  if (groupFormId) {
37889
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37890
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37891
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37957
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37958
+ const _newData = {
37959
+ ..._defaultData,
37960
+ ..._val
37961
+ };
37962
+ onValuesChange(_newData, {
37963
+ ...formsValue,
37892
37964
  [groupFormId]: _newData
37893
- }));
37894
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37895
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37965
+ });
37966
+ form?.setFieldValue(groupFormId, _newData);
37967
+ setValues({
37968
+ ...formsValue,
37896
37969
  [groupFormId]: _newData
37897
- }));
37970
+ });
37898
37971
  return;
37899
37972
  }
37900
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37901
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37902
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37973
+ onValuesChange(_val, {
37974
+ ...formsValue,
37975
+ ..._val
37976
+ });
37977
+ form?.setFieldValue(name, _val[name]);
37978
+ setValues({
37979
+ ...formsValue,
37980
+ ..._val
37981
+ });
37903
37982
  };
37904
- if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
37905
- var _formsValue$meta4, _input$meta17;
37983
+ if (input?.meta?.flat) {
37906
37984
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
37907
37985
  form: input,
37908
37986
  changeLinking: changeLinking,
37909
37987
  onUpdate: onUpdate,
37910
37988
  isHighlighted: isHighlighted,
37911
37989
  formsValue: formsValue,
37912
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
37990
+ values: groupFormId ? {
37991
+ ...(formsValue[groupFormId] || {}),
37913
37992
  meta: {
37914
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
37993
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
37915
37994
  }
37916
- }) : formsValue,
37995
+ } : formsValue,
37917
37996
  name: name,
37918
37997
  groupFormId: groupFormId,
37919
- maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
37920
- remove: _ref58 => {
37921
- let {
37922
- key
37923
- } = _ref58;
37998
+ maxRepeat: input?.meta?.maxRepeat,
37999
+ remove: ({
38000
+ key
38001
+ }) => {
37924
38002
  const _val = isSingle ? {
37925
38003
  [name]: null
37926
38004
  } : {
37927
38005
  [name]: formData.filter((v, i) => i !== key)
37928
38006
  };
37929
38007
  if (groupFormId) {
37930
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37931
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37932
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38008
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38009
+ const _newData = {
38010
+ ..._defaultData,
38011
+ ..._val
38012
+ };
38013
+ onValuesChange(_newData, {
38014
+ ...formsValue,
37933
38015
  [groupFormId]: _newData
37934
- }));
37935
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37936
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38016
+ });
38017
+ form?.setFieldValue(groupFormId, _newData);
38018
+ setValues({
38019
+ ...formsValue,
37937
38020
  [groupFormId]: _newData
37938
- }));
38021
+ });
37939
38022
  return;
37940
38023
  }
37941
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37942
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37943
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38024
+ onValuesChange(_val, {
38025
+ ...formsValue,
38026
+ ..._val
38027
+ });
38028
+ form?.setFieldValue(name, _val[name]);
38029
+ setValues({
38030
+ ...formsValue,
38031
+ ..._val
38032
+ });
37944
38033
  },
37945
38034
  add: val => {
37946
38035
  const _val = isSingle ? {
37947
38036
  [name]: val
37948
38037
  } : {
37949
- [name]: [...formData, _objectSpread2({}, val)]
38038
+ [name]: [...formData, {
38039
+ ...val
38040
+ }]
37950
38041
  };
37951
38042
  if (groupFormId) {
37952
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37953
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37954
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37955
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38043
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38044
+ const _newData = {
38045
+ ..._defaultData,
38046
+ ..._val
38047
+ };
38048
+ form?.setFieldValue(groupFormId, _newData);
38049
+ onValuesChange(_newData, {
38050
+ ...formsValue,
37956
38051
  [groupFormId]: _newData
37957
- }));
37958
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38052
+ });
38053
+ setValues({
38054
+ ...formsValue,
37959
38055
  [groupFormId]: _newData
37960
- }));
38056
+ });
37961
38057
  return;
37962
38058
  }
37963
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37964
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37965
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38059
+ form?.setFieldValue(name, _val[name]);
38060
+ onValuesChange(_val, {
38061
+ ...formsValue,
38062
+ ..._val
38063
+ });
38064
+ setValues({
38065
+ ...formsValue,
38066
+ ..._val
38067
+ });
37966
38068
  },
37967
38069
  k: name,
37968
38070
  formData: formData
@@ -37974,79 +38076,101 @@ const inputTypeComponent$1 = {
37974
38076
  onUpdate: onUpdate,
37975
38077
  isHighlighted: isHighlighted,
37976
38078
  formsValue: formsValue,
37977
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38079
+ values: groupFormId ? {
38080
+ ...(formsValue[groupFormId] || {}),
37978
38081
  meta: {
37979
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
38082
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
37980
38083
  }
37981
- }) : formsValue,
38084
+ } : formsValue,
37982
38085
  name: name,
37983
38086
  groupFormId: groupFormId,
37984
- maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
37985
- remove: _ref59 => {
37986
- let {
37987
- key
37988
- } = _ref59;
38087
+ maxRepeat: input?.meta?.maxRepeat,
38088
+ remove: ({
38089
+ key
38090
+ }) => {
37989
38091
  const _val = isSingle ? {
37990
38092
  [name]: null
37991
38093
  } : {
37992
38094
  [name]: formData.filter((v, i) => i !== key)
37993
38095
  };
37994
38096
  if (groupFormId) {
37995
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37996
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37997
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38097
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38098
+ const _newData = {
38099
+ ..._defaultData,
38100
+ ..._val
38101
+ };
38102
+ onValuesChange(_newData, {
38103
+ ...formsValue,
37998
38104
  [groupFormId]: _newData
37999
- }));
38000
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38001
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38105
+ });
38106
+ form?.setFieldValue(groupFormId, _newData);
38107
+ setValues({
38108
+ ...formsValue,
38002
38109
  [groupFormId]: _newData
38003
- }));
38110
+ });
38004
38111
  return;
38005
38112
  }
38006
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38007
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38008
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38113
+ onValuesChange(_val, {
38114
+ ...formsValue,
38115
+ ..._val
38116
+ });
38117
+ form?.setFieldValue(name, _val[name]);
38118
+ setValues({
38119
+ ...formsValue,
38120
+ ..._val
38121
+ });
38009
38122
  },
38010
38123
  add: val => {
38011
38124
  const _val = isSingle ? {
38012
38125
  [name]: val
38013
38126
  } : {
38014
- [name]: [...formData, _objectSpread2({}, val)]
38127
+ [name]: [...formData, {
38128
+ ...val
38129
+ }]
38015
38130
  };
38016
38131
  if (groupFormId) {
38017
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38018
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38019
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38020
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38132
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38133
+ const _newData = {
38134
+ ..._defaultData,
38135
+ ..._val
38136
+ };
38137
+ form?.setFieldValue(groupFormId, _newData);
38138
+ onValuesChange(_newData, {
38139
+ ...formsValue,
38021
38140
  [groupFormId]: _newData
38022
- }));
38023
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38141
+ });
38142
+ setValues({
38143
+ ...formsValue,
38024
38144
  [groupFormId]: _newData
38025
- }));
38145
+ });
38026
38146
  return;
38027
38147
  }
38028
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38029
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38030
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38148
+ form?.setFieldValue(name, _val[name]);
38149
+ onValuesChange(_val, {
38150
+ ...formsValue,
38151
+ ..._val
38152
+ });
38153
+ setValues({
38154
+ ...formsValue,
38155
+ ..._val
38156
+ });
38031
38157
  },
38032
38158
  k: name,
38033
38159
  formData: formData
38034
38160
  });
38035
38161
  },
38036
- dataLinkGroup: (_ref60, _ref61) => {
38037
- let {
38038
- setValues,
38039
- name,
38040
- onValuesChange,
38041
- changeLinking,
38042
- formsValue,
38043
- input
38044
- } = _ref60;
38045
- let {
38046
- form,
38047
- groupFormId,
38048
- isHighlighted
38049
- } = _ref61;
38162
+ dataLinkGroup: ({
38163
+ setValues,
38164
+ name,
38165
+ onValuesChange,
38166
+ changeLinking,
38167
+ formsValue,
38168
+ input
38169
+ }, {
38170
+ form,
38171
+ groupFormId,
38172
+ isHighlighted
38173
+ }) => {
38050
38174
  return renderDataLinkGroup({
38051
38175
  input,
38052
38176
  name,
@@ -38059,41 +38183,51 @@ const inputTypeComponent$1 = {
38059
38183
  isHighlighted
38060
38184
  });
38061
38185
  },
38062
- groupCheckbox: (_ref62, _ref63) => {
38063
- let {
38064
- setValues,
38065
- name,
38066
- onValuesChange,
38067
- formsValue,
38068
- input
38069
- } = _ref62;
38070
- let {
38071
- form,
38072
- groupFormId,
38073
- isHighlighted
38074
- } = _ref63;
38186
+ groupCheckbox: ({
38187
+ setValues,
38188
+ name,
38189
+ onValuesChange,
38190
+ formsValue,
38191
+ input
38192
+ }, {
38193
+ form,
38194
+ groupFormId,
38195
+ isHighlighted
38196
+ }) => {
38075
38197
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
38076
38198
  const onUpdate = (val, key) => {
38077
38199
  const _val = {
38078
- [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
38200
+ [name]: {
38201
+ ...formData,
38079
38202
  [key]: val
38080
- })
38203
+ }
38081
38204
  };
38082
38205
  if (groupFormId) {
38083
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38084
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38085
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38206
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38207
+ const _newData = {
38208
+ ..._defaultData,
38209
+ ..._val
38210
+ };
38211
+ onValuesChange(_newData, {
38212
+ ...formsValue,
38086
38213
  [groupFormId]: _newData
38087
- }));
38088
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38089
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38214
+ });
38215
+ form?.setFieldValue(groupFormId, _newData);
38216
+ setValues({
38217
+ ...formsValue,
38090
38218
  [groupFormId]: _newData
38091
- }));
38219
+ });
38092
38220
  return;
38093
38221
  }
38094
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38095
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38096
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38222
+ onValuesChange(_val, {
38223
+ ...formsValue,
38224
+ ..._val
38225
+ });
38226
+ form?.setFieldValue(name, _val[name]);
38227
+ setValues({
38228
+ ...formsValue,
38229
+ ..._val
38230
+ });
38097
38231
  };
38098
38232
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
38099
38233
  form: input,
@@ -38102,91 +38236,96 @@ const inputTypeComponent$1 = {
38102
38236
  isHighlighted: isHighlighted
38103
38237
  });
38104
38238
  },
38105
- website: (_ref64, _ref65) => {
38106
- let {
38107
- name,
38108
- inputName,
38109
- props,
38110
- value,
38111
- repeatIndex,
38112
- repeatValues,
38113
- formsValue
38114
- } = _ref64;
38115
- let {
38116
- form,
38117
- isHighlighted,
38118
- inputMeta = {},
38119
- t
38120
- } = _ref65;
38121
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38239
+ website: ({
38240
+ name,
38241
+ inputName,
38242
+ props,
38243
+ value,
38244
+ repeatIndex,
38245
+ repeatValues,
38246
+ formsValue
38247
+ }, {
38248
+ form,
38249
+ isHighlighted,
38250
+ inputMeta = {},
38251
+ t
38252
+ }) => {
38253
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
38122
38254
  size: "large",
38123
38255
  allowClear: true,
38124
- initialValue: value
38125
- }, props), {}, {
38256
+ initialValue: value,
38257
+ ...props,
38126
38258
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
38127
38259
  className: formatClassname([isHighlighted && "highlighted-cont"]),
38128
38260
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
38129
38261
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
38130
- }));
38262
+ });
38131
38263
  },
38132
- group: (_ref66, _ref67) => {
38133
- let {
38134
- props,
38135
- groupInputs,
38136
- formsValue
38137
- } = _ref66;
38138
- let {
38139
- inputMeta,
38140
- isHighlighted
38141
- } = _ref67;
38142
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38264
+ group: ({
38265
+ props,
38266
+ groupInputs,
38267
+ formsValue
38268
+ }, {
38269
+ inputMeta,
38270
+ isHighlighted
38271
+ }) => {
38272
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38143
38273
  formsValue: formsValue,
38144
38274
  isHighlighted: isHighlighted,
38145
38275
  groupInputs: groupInputs,
38146
- inputMeta: inputMeta
38147
- }, props));
38276
+ inputMeta: inputMeta,
38277
+ ...props
38278
+ });
38148
38279
  },
38149
- groupInputs: (_ref68, _ref69) => {
38150
- let {
38151
- props,
38152
- groupInputs,
38153
- formsValue
38154
- } = _ref68;
38155
- let {
38156
- inputMeta,
38157
- isHighlighted
38158
- } = _ref69;
38159
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38280
+ groupInputs: ({
38281
+ props,
38282
+ groupInputs,
38283
+ formsValue
38284
+ }, {
38285
+ inputMeta,
38286
+ isHighlighted
38287
+ }) => {
38288
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38160
38289
  formsValue: formsValue,
38161
38290
  isHighlighted: isHighlighted,
38162
38291
  groupInputs: groupInputs,
38163
- inputMeta: inputMeta
38164
- }, props));
38292
+ inputMeta: inputMeta,
38293
+ ...props
38294
+ });
38165
38295
  },
38166
- smartHelp: (_ref70, _ref71) => {
38296
+ smartHelp: ({
38297
+ name,
38298
+ inputName,
38299
+ props,
38300
+ value,
38301
+ repeatIndex,
38302
+ repeatValues,
38303
+ formsValue
38304
+ }, {
38305
+ form,
38306
+ isHighlighted,
38307
+ inputMeta = {},
38308
+ t
38309
+ }) => {
38167
38310
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
38168
38311
  }
38169
38312
  };
38170
38313
  const filterForm = (f, d) => {
38171
38314
  return f && (f.showFormIf ? showHideForm(f, d) : true);
38172
38315
  };
38173
- const checkFormHasSubsections = function () {
38174
- let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38175
- return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38176
- };
38316
+ const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38177
38317
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
38178
- const _ref72 = f[key] || {},
38179
- {
38180
- label,
38181
- description = "",
38182
- excludeFromEdit,
38183
- showFormIf,
38184
- icon = "",
38185
- position = 0,
38186
- template,
38187
- formClass
38188
- } = _ref72,
38189
- fc = _objectWithoutProperties(_ref72, _excluded2$1);
38318
+ const {
38319
+ label,
38320
+ description = "",
38321
+ excludeFromEdit,
38322
+ showFormIf,
38323
+ icon = "",
38324
+ position = 0,
38325
+ template,
38326
+ formClass,
38327
+ ...fc
38328
+ } = f[key] || {};
38190
38329
  const fConf = {
38191
38330
  id: key,
38192
38331
  label,
@@ -38245,14 +38384,11 @@ const groupSubForms = (fConf, d) => {
38245
38384
  return f;
38246
38385
  }, {});
38247
38386
  };
38248
- const inputIsEmpty = function () {
38249
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38250
- let values = arguments.length > 1 ? arguments[1] : undefined;
38251
- let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
38252
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38387
+ const inputIsEmpty = (input = {}, values, inputMeta) => {
38388
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
38253
38389
  return false;
38254
38390
  }
38255
- if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38391
+ if (input?.type === "groupInputs") {
38256
38392
  return true;
38257
38393
  }
38258
38394
  const value = values[input.dataId];
@@ -38264,28 +38400,26 @@ const inputIsEmpty = function () {
38264
38400
  }
38265
38401
  return !value;
38266
38402
  };
38267
- const GetFormItem$1 = _ref73 => {
38268
- var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
38269
- let {
38270
- highlightMandatory,
38271
- inputData,
38272
- inputId,
38273
- input,
38274
- values,
38275
- MainForm,
38276
- options,
38277
- plainForms,
38278
- setValues,
38279
- setAddress,
38280
- i,
38281
- inputKey,
38282
- onValuesChange = () => {},
38283
- setLoading = () => {},
38284
- inputMeta = {},
38285
- changeInputMeta = () => {},
38286
- changeLinking = () => {},
38287
- namespace
38288
- } = _ref73;
38403
+ const GetFormItem$1 = ({
38404
+ highlightMandatory,
38405
+ inputData,
38406
+ inputId,
38407
+ input,
38408
+ values,
38409
+ MainForm,
38410
+ options,
38411
+ plainForms,
38412
+ setValues,
38413
+ setAddress,
38414
+ i,
38415
+ inputKey,
38416
+ onValuesChange = () => {},
38417
+ setLoading = () => {},
38418
+ inputMeta = {},
38419
+ changeInputMeta = () => {},
38420
+ changeLinking = () => {},
38421
+ namespace
38422
+ }) => {
38289
38423
  const {
38290
38424
  t,
38291
38425
  user,
@@ -38300,42 +38434,44 @@ const GetFormItem$1 = _ref73 => {
38300
38434
  staticWidth,
38301
38435
  fullWidth
38302
38436
  } = useEditContext();
38303
- 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];
38437
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
38304
38438
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
38305
38439
  const inputLabel = getInputLabel$1(input, values);
38306
38440
  const onClickReviewSuccess = () => {
38307
38441
  if (!isReview) {
38308
38442
  return;
38309
38443
  }
38310
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38444
+ const reviewSuccess = lastReview?.reviewSuccess;
38311
38445
  changeInputMeta({
38312
38446
  key: inputId,
38313
38447
  type: input.type,
38314
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38448
+ value: {
38449
+ ...inputMeta,
38315
38450
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38316
38451
  reviewer: user,
38317
38452
  createdAt: new Date().toISOString(),
38318
38453
  reviewSuccess: true
38319
38454
  }]
38320
- })
38455
+ }
38321
38456
  });
38322
38457
  };
38323
38458
  const onClickReviewError = () => {
38324
38459
  if (!isReview) {
38325
38460
  return;
38326
38461
  }
38327
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38462
+ const reviewError = lastReview?.reviewError;
38328
38463
  changeInputMeta({
38329
38464
  key: inputId,
38330
38465
  type: input.type,
38331
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38466
+ value: {
38467
+ ...inputMeta,
38332
38468
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38333
38469
  reviewer: user,
38334
38470
  createdAt: new Date().toISOString(),
38335
38471
  reviewError: true,
38336
38472
  comment: ""
38337
38473
  }]
38338
- })
38474
+ }
38339
38475
  });
38340
38476
  };
38341
38477
  switch (input.type) {
@@ -38349,12 +38485,12 @@ const GetFormItem$1 = _ref73 => {
38349
38485
  case "header":
38350
38486
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
38351
38487
  className: "daf-title with-subtitle",
38352
- style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38488
+ style: input?.meta?.style,
38353
38489
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38354
38490
  className: "flex",
38355
38491
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
38356
38492
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
38357
- }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38493
+ }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38358
38494
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
38359
38495
  className: "tooltip-popover-cont",
38360
38496
  children: ReactHtmlParser__default["default"](input.description)
@@ -38381,7 +38517,7 @@ const GetFormItem$1 = _ref73 => {
38381
38517
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38382
38518
 
38383
38519
  // eslint-disable-next-line no-case-declarations
38384
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38520
+ let maxRule = rules.find(rule => rule.max)?.max;
38385
38521
  if (!maxRule && input.type === "textarea") {
38386
38522
  maxRule = MAX_TEXT_AREA_LENGTH;
38387
38523
  }
@@ -38394,30 +38530,27 @@ const GetFormItem$1 = _ref73 => {
38394
38530
  message: requiredRule.message || ""
38395
38531
  });
38396
38532
  }
38397
- 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);
38533
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38398
38534
  if (requiredRule || specialCharsRule) {
38399
38535
  if (input.type === "groupInputs") {
38400
38536
  rules = rules.map(r => {
38401
38537
  if (r.required) {
38402
- return _ref74 => {
38403
- let {
38404
- getFieldValue
38405
- } = _ref74;
38406
- return {
38407
- validator() {
38408
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38409
- return Promise.resolve();
38410
- }
38411
- const keys = Object.keys(input.inputs);
38412
- for (let i = 0; i < keys.length; i++) {
38413
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38414
- return Promise.reject(r.message);
38415
- }
38416
- }
38538
+ return ({
38539
+ getFieldValue
38540
+ }) => ({
38541
+ validator() {
38542
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38417
38543
  return Promise.resolve();
38418
38544
  }
38419
- };
38420
- };
38545
+ const keys = Object.keys(input.inputs);
38546
+ for (let i = 0; i < keys.length; i++) {
38547
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38548
+ return Promise.reject(r.message);
38549
+ }
38550
+ }
38551
+ return Promise.resolve();
38552
+ }
38553
+ });
38421
38554
  }
38422
38555
  return r;
38423
38556
  });
@@ -38455,13 +38588,12 @@ const GetFormItem$1 = _ref73 => {
38455
38588
  }
38456
38589
  }
38457
38590
  if (input && typeof input === "object") {
38458
- 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;
38459
38591
  // check if input is valid
38460
38592
  const hideComment = namespace === "project-readiness";
38461
38593
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38462
38594
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38463
38595
  className: "flex-row input-cont",
38464
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38596
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38465
38597
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38466
38598
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38467
38599
  className: formatClassname(["ml-4 input-actions"]),
@@ -38471,7 +38603,7 @@ const GetFormItem$1 = _ref73 => {
38471
38603
  title: t("Add review note"),
38472
38604
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38473
38605
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38474
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38606
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38475
38607
  type: "link",
38476
38608
  onClick: onClickReviewError,
38477
38609
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38487,7 +38619,7 @@ const GetFormItem$1 = _ref73 => {
38487
38619
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38488
38620
  type: "link",
38489
38621
  onClick: onClickReviewSuccess,
38490
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38622
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38491
38623
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38492
38624
  name: "CheckSquare",
38493
38625
  width: 16,
@@ -38524,7 +38656,7 @@ const GetFormItem$1 = _ref73 => {
38524
38656
  }
38525
38657
  });
38526
38658
  },
38527
- disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38659
+ disabled: !input.meta?.notApplicable,
38528
38660
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38529
38661
  name: "NotApplicable",
38530
38662
  width: 16,
@@ -38538,7 +38670,7 @@ const GetFormItem$1 = _ref73 => {
38538
38670
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38539
38671
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38540
38672
  type: "link",
38541
- disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38673
+ disabled: !input.meta?.notAvailable,
38542
38674
  onClick: () => {
38543
38675
  const value = getDefaultInputValue(input);
38544
38676
  MainForm.setFields([{
@@ -38570,14 +38702,14 @@ const GetFormItem$1 = _ref73 => {
38570
38702
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38571
38703
  title: t("Add comment"),
38572
38704
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38573
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38705
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38574
38706
  type: "link",
38575
- disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38576
- }, !isShown ? {
38577
- className: "default p-0"
38578
- } : {
38579
- className: "p-0 primary"
38580
- }), {}, {
38707
+ disabled: !input.meta?.comment,
38708
+ ...(!isShown ? {
38709
+ className: "default p-0"
38710
+ } : {
38711
+ className: "p-0 primary"
38712
+ }),
38581
38713
  onClick: () => {
38582
38714
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38583
38715
  return;
@@ -38596,7 +38728,7 @@ const GetFormItem$1 = _ref73 => {
38596
38728
  width: 16,
38597
38729
  height: 16
38598
38730
  })
38599
- }))
38731
+ })
38600
38732
  })
38601
38733
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38602
38734
  title: t("Project Readiness"),
@@ -38615,34 +38747,36 @@ const GetFormItem$1 = _ref73 => {
38615
38747
  }) : null]
38616
38748
  }) : null
38617
38749
  }),
38618
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38619
- }, inputOnBlur.includes(input.type) ? {
38620
- trigger: "onBlur"
38621
- } : {}), ["total100", "group"].includes(input.type) ? {} : {
38622
- name: inputId,
38623
- fieldKey: inputId,
38624
- initialValue: inputData.value
38625
- }), ["upload"].includes(input.type) ? {
38626
- valuePropName: "fileList",
38627
- getValueFromEvent: e => {
38628
- if (Array.isArray(e)) {
38629
- return e;
38630
- }
38631
- return e && e.fileList && e.fileList.map(f => {
38632
- if (f.response) {
38633
- return f.response;
38750
+ initialValue: inputMeta?.defaultValue,
38751
+ ...(inputOnBlur.includes(input.type) ? {
38752
+ trigger: "onBlur"
38753
+ } : {}),
38754
+ ...(["total100", "group"].includes(input.type) ? {} : {
38755
+ name: inputId,
38756
+ fieldKey: inputId,
38757
+ initialValue: inputData.value
38758
+ }),
38759
+ ...(["upload"].includes(input.type) ? {
38760
+ valuePropName: "fileList",
38761
+ getValueFromEvent: e => {
38762
+ if (Array.isArray(e)) {
38763
+ return e;
38634
38764
  }
38635
- return f;
38636
- });
38637
- }
38638
- } : {}), {}, {
38639
- className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38765
+ return e && e.fileList && e.fileList.map(f => {
38766
+ if (f.response) {
38767
+ return f.response;
38768
+ }
38769
+ return f;
38770
+ });
38771
+ }
38772
+ } : {}),
38773
+ className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38640
38774
  "data-id": inputData.name,
38641
38775
  rules: rules,
38642
38776
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38643
38777
  labelCol: 12,
38644
38778
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38645
- className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38779
+ className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38646
38780
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38647
38781
  className: "mr-1",
38648
38782
  children: getInputLabel$1(input, values)
@@ -38655,7 +38789,7 @@ const GetFormItem$1 = _ref73 => {
38655
38789
  config: input,
38656
38790
  t: t,
38657
38791
  ajaxForms: ajaxForms,
38658
- 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),
38792
+ linkingData: values?.linking || values?.parent?.linking,
38659
38793
  changeAjaxForms: changeAjaxForms,
38660
38794
  getApiBaseUrl: getApiBaseUrl,
38661
38795
  getAppHeader: getAppHeader,
@@ -38663,11 +38797,12 @@ const GetFormItem$1 = _ref73 => {
38663
38797
  getToken: getToken,
38664
38798
  app: app,
38665
38799
  valueOnlyString: true
38666
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
38800
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38801
+ ...inputData,
38667
38802
  maxWidth,
38668
38803
  staticWidth,
38669
38804
  fullWidth
38670
- }), {
38805
+ }, {
38671
38806
  form: MainForm,
38672
38807
  forms: options,
38673
38808
  allForms: plainForms,
@@ -38688,10 +38823,10 @@ const GetFormItem$1 = _ref73 => {
38688
38823
  staticWidth,
38689
38824
  fullWidth
38690
38825
  }) : console.log(input)
38691
- })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38826
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38692
38827
  className: "code",
38693
38828
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38694
- children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38829
+ children: input.meta?.code
38695
38830
  })
38696
38831
  }) : null]
38697
38832
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38711,10 +38846,10 @@ const GetFormItem$1 = _ref73 => {
38711
38846
  className: "max-char-span",
38712
38847
  children: t("max-char", {
38713
38848
  chars: maxRule,
38714
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38849
+ filled: inputData?.value?.length || 0
38715
38850
  })
38716
38851
  })
38717
- }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38852
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38718
38853
  className: "input-content",
38719
38854
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38720
38855
  className: "comment-textarea",
@@ -38740,7 +38875,7 @@ const GetFormItem$1 = _ref73 => {
38740
38875
  },
38741
38876
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38742
38877
  type: "link",
38743
- disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38878
+ disabled: !input.meta?.comment,
38744
38879
  className: "p-0",
38745
38880
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38746
38881
  width: 16,
@@ -38749,11 +38884,12 @@ const GetFormItem$1 = _ref73 => {
38749
38884
  })
38750
38885
  })]
38751
38886
  }),
38752
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38887
+ children: inputTypeComponent$1.comment({
38888
+ ...inputData,
38753
38889
  maxWidth,
38754
38890
  staticWidth,
38755
38891
  fullWidth
38756
- }), {
38892
+ }, {
38757
38893
  form: MainForm,
38758
38894
  forms: options,
38759
38895
  setFormValues: setValues,
@@ -38778,16 +38914,16 @@ const GetFormItem$1 = _ref73 => {
38778
38914
  className: "max-char-span",
38779
38915
  children: t("max-char", {
38780
38916
  chars: MAX_COMMENTS_LENGTH,
38781
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38917
+ filled: inputData?.commentValue?.length || 0
38782
38918
  })
38783
38919
  })]
38784
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38920
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38785
38921
  className: "input-content",
38786
38922
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38787
38923
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38788
38924
  className: "comment-textarea",
38789
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38790
- name: "".concat(inputId, "-reviewErrorComment"),
38925
+ initialValue: lastReview?.comment || "",
38926
+ name: `${inputId}-reviewErrorComment`,
38791
38927
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38792
38928
  className: "flex w-100",
38793
38929
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38795,28 +38931,31 @@ const GetFormItem$1 = _ref73 => {
38795
38931
  children: t("Review note")
38796
38932
  })
38797
38933
  }),
38798
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38934
+ children: inputTypeComponent$1.comment({
38935
+ ...inputData,
38799
38936
  maxWidth,
38800
38937
  staticWidth,
38801
38938
  fullWidth
38802
- }), {
38939
+ }, {
38803
38940
  form: MainForm,
38804
38941
  forms: options,
38805
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38942
+ value: lastReview?.comment || "",
38806
38943
  onChange: val => {
38807
38944
  changeInputMeta({
38808
38945
  key: inputId,
38809
38946
  type: input.type,
38810
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38811
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
38947
+ value: {
38948
+ ...inputMeta,
38949
+ reviews: (inputMeta?.reviews || []).map(v => {
38812
38950
  if (v.createdAt === lastReview.createdAt) {
38813
- return _objectSpread2(_objectSpread2({}, v), {}, {
38951
+ return {
38952
+ ...v,
38814
38953
  comment: val
38815
- });
38954
+ };
38816
38955
  }
38817
38956
  return v;
38818
38957
  })
38819
- })
38958
+ }
38820
38959
  });
38821
38960
  },
38822
38961
  t,
@@ -38830,7 +38969,7 @@ const GetFormItem$1 = _ref73 => {
38830
38969
  className: "max-char-span",
38831
38970
  children: t("max-char", {
38832
38971
  chars: MAX_COMMENTS_LENGTH,
38833
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
38972
+ filled: lastReview.comment?.length || 0
38834
38973
  })
38835
38974
  })]
38836
38975
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -38851,7 +38990,7 @@ const GetFormItem$1 = _ref73 => {
38851
38990
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38852
38991
  className: "flex flex-column justify-center mr-1",
38853
38992
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38854
- 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")
38993
+ children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38855
38994
  })
38856
38995
  })]
38857
38996
  })]
@@ -38862,14 +39001,13 @@ const GetFormItem$1 = _ref73 => {
38862
39001
  return null;
38863
39002
  }
38864
39003
  };
38865
- const editErrorHandler = _ref76 => {
38866
- let {
38867
- errorFields,
38868
- t = s => s
38869
- } = _ref76;
39004
+ const editErrorHandler = ({
39005
+ errorFields,
39006
+ t = s => s
39007
+ }) => {
38870
39008
  if (Array.isArray(errorFields) && errorFields.length) {
38871
39009
  const name = errorFields[0].name.join(".");
38872
- const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
39010
+ const element = document.querySelector(`[data-id="${name}"]`);
38873
39011
  if (element) {
38874
39012
  element.scrollIntoView();
38875
39013
  antd.message.error(t("errors::please-correct-invalid-inputs"));