@djb25/digit-ui-module-ws 1.0.116 → 1.0.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27832,10 +27832,15 @@ const WSConnectionHolderDetails = _ref => {
27832
27832
  } = reactRouterDom.useLocation();
27833
27833
  const filters = getQueryStringParams(location.search);
27834
27834
  const [connectionHolderDetails, setConnectionHolderDetails] = React.useState(() => {
27835
- if (formData !== null && formData !== void 0 && formData.ConnectionHolderDetails) {
27836
- var _formData$ConnectionH;
27835
+ var _Digit$SessionStorage, _formData$ConnectionH, _sessionDetails$;
27836
+ const sessionDetails = (_Digit$SessionStorage = Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.ConnectionHolderDetails;
27837
+ if (formData !== null && formData !== void 0 && formData.ConnectionHolderDetails && formData.ConnectionHolderDetails.length > 0 && (_formData$ConnectionH = formData.ConnectionHolderDetails[0]) !== null && _formData$ConnectionH !== void 0 && _formData$ConnectionH.name) {
27837
27838
  return [{
27838
- ...(formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH = formData.ConnectionHolderDetails) === null || _formData$ConnectionH === void 0 ? void 0 : _formData$ConnectionH[0])
27839
+ ...formData.ConnectionHolderDetails[0]
27840
+ }];
27841
+ } else if (sessionDetails && sessionDetails.length > 0 && (_sessionDetails$ = sessionDetails[0]) !== null && _sessionDetails$ !== void 0 && _sessionDetails$.name) {
27842
+ return [{
27843
+ ...sessionDetails[0]
27839
27844
  }];
27840
27845
  } else {
27841
27846
  var _Digit$UserService$ge;
@@ -27905,6 +27910,17 @@ const WSConnectionHolderDetails = _ref => {
27905
27910
  }
27906
27911
  }
27907
27912
  }, [connectionHolderDetails, config === null || config === void 0 ? void 0 : config.key]);
27913
+ React.useEffect(() => {
27914
+ if (formData !== null && formData !== void 0 && formData.ConnectionHolderDetails && formData.ConnectionHolderDetails.length > 0) {
27915
+ const incoming = formData.ConnectionHolderDetails[0];
27916
+ const current = connectionHolderDetails === null || connectionHolderDetails === void 0 ? void 0 : connectionHolderDetails[0];
27917
+ if (incoming && (incoming.name || incoming.middleName || incoming.lastName) && !lodash.isEqual(current, incoming)) {
27918
+ setConnectionHolderDetails([{
27919
+ ...incoming
27920
+ }]);
27921
+ }
27922
+ }
27923
+ }, [formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails]);
27908
27924
  function ispagereloadingenabled(eyeclick) {
27909
27925
  var _Object$values, _formData$ConnectionH2;
27910
27926
  if ((window.location.href.includes("edit") || window.location.href.includes("modify")) && formData !== null && formData !== void 0 && formData.ConnectionHolderDetails && ((_Object$values = Object.values(formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH2 = formData.ConnectionHolderDetails) === null || _formData$ConnectionH2 === void 0 ? void 0 : _formData$ConnectionH2[0])) === null || _Object$values === void 0 ? void 0 : _Object$values.length) > 1) {
@@ -28050,6 +28066,23 @@ const ConnectionDetails$1 = _props => {
28050
28066
  watsAppMobileNumber,
28051
28067
  isWatsappSameAsMobile
28052
28068
  }), [name, middleName, lastName, gender, mobileNumber, guardian, relationship, ownerType, sameAsOwnerDetails, address, uuid, emailId, watsAppMobileNumber, isWatsappSameAsMobile]);
28069
+ React.useEffect(() => {
28070
+ if (connectionHolderDetail) {
28071
+ if (connectionHolderDetail.name !== undefined && connectionHolderDetail.name !== name) setName(connectionHolderDetail.name);
28072
+ if (connectionHolderDetail.middleName !== undefined && connectionHolderDetail.middleName !== middleName) setMiddleName(connectionHolderDetail.middleName);
28073
+ if (connectionHolderDetail.lastName !== undefined && connectionHolderDetail.lastName !== lastName) setLastName(connectionHolderDetail.lastName);
28074
+ if (connectionHolderDetail.gender !== undefined && connectionHolderDetail.gender !== gender) setGender(connectionHolderDetail.gender);
28075
+ if (connectionHolderDetail.mobileNumber !== undefined && connectionHolderDetail.mobileNumber !== mobileNumber) setMobileNumber(connectionHolderDetail.mobileNumber);
28076
+ if (connectionHolderDetail.guardian !== undefined && connectionHolderDetail.guardian !== guardian) setGuardian(connectionHolderDetail.guardian);
28077
+ if (connectionHolderDetail.relationship !== undefined && connectionHolderDetail.relationship !== relationship) setRelationship(connectionHolderDetail.relationship);
28078
+ if (connectionHolderDetail.address !== undefined && connectionHolderDetail.address !== address) setAddress(connectionHolderDetail.address);
28079
+ if (connectionHolderDetail.ownerType !== undefined && connectionHolderDetail.ownerType !== ownerType) setOwnerType(connectionHolderDetail.ownerType);
28080
+ if (connectionHolderDetail.sameAsOwnerDetails !== undefined && connectionHolderDetail.sameAsOwnerDetails !== sameAsOwnerDetails) setSameAsOwnerDetails(connectionHolderDetail.sameAsOwnerDetails);
28081
+ if (connectionHolderDetail.emailId !== undefined && connectionHolderDetail.emailId !== emailId) setEmailId(connectionHolderDetail.emailId);
28082
+ if (connectionHolderDetail.watsAppMobileNumber !== undefined && connectionHolderDetail.watsAppMobileNumber !== watsAppMobileNumber) setWatsAppMobileNumber(connectionHolderDetail.watsAppMobileNumber);
28083
+ if (connectionHolderDetail.isWatsappSameAsMobile !== undefined && connectionHolderDetail.isWatsappSameAsMobile !== isWatsappSameAsMobile) setIsWatsappSameAsMobile(connectionHolderDetail.isWatsappSameAsMobile);
28084
+ }
28085
+ }, [connectionHolderDetail]);
28053
28086
  const {
28054
28087
  errors
28055
28088
  } = localFormState;
@@ -28124,7 +28157,7 @@ const ConnectionDetails$1 = _props => {
28124
28157
  const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/;
28125
28158
  const errors = sessionStorage.getItem("FORMSTATE_ERRORS");
28126
28159
  let formStateErros = typeof errors === "string" ? JSON.parse(errors) : {};
28127
- if (emailPattern.test(value)) {
28160
+ if (!value || !value.trim() || emailPattern.test(value)) {
28128
28161
  var _formStateErros$Conne, _formStateErros$Conne2, _formStateErros$Conne3, _formStateErros$Conne4;
28129
28162
  if (clearErrors) clearErrors("emailId");
28130
28163
  if (formStateErros["ConnectionHolderDetails"] && (_formStateErros$Conne = formStateErros["ConnectionHolderDetails"]) !== null && _formStateErros$Conne !== void 0 && _formStateErros$Conne.type && (_formStateErros$Conne2 = formStateErros["ConnectionHolderDetails"]) !== null && _formStateErros$Conne2 !== void 0 && (_formStateErros$Conne3 = _formStateErros$Conne2.type) !== null && _formStateErros$Conne3 !== void 0 && _formStateErros$Conne3.emailId) {
@@ -31466,7 +31499,7 @@ const WSDocumentsEmployee = _ref => {
31466
31499
  } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesNewMasters(tenantId, wsDocsData);
31467
31500
  const hasDjbEmployeeDoc = (documents || []).some(d => {
31468
31501
  var _d$documentType2;
31469
- return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType2 = d.documentType) === null || _d$documentType2 === void 0 ? void 0 : _d$documentType2.includes("DJB_EMPLOYEE_ID"))) && (d === null || d === void 0 ? void 0 : d.fileStoreId);
31502
+ return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType2 = d.documentType) === null || _d$documentType2 === void 0 ? void 0 : _d$documentType2.includes("DJB_EMPLOYEE_ID"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
31470
31503
  });
31471
31504
  const addEmployeeDocError = () => {
31472
31505
  var _formState$errors, _formState$errors$con;
@@ -31500,21 +31533,35 @@ const WSDocumentsEmployee = _ref => {
31500
31533
  addEmployeeDocError();
31501
31534
  } else {
31502
31535
  removeEmployeeDocError();
31536
+ if (formSetValue && formData !== null && formData !== void 0 && formData.djbEmployee) {
31537
+ var _formData$djbEmployee;
31538
+ const djbItem = (documents || []).find(d => {
31539
+ var _d$documentType3;
31540
+ return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("DJB_EMPLOYEE_ID"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
31541
+ });
31542
+ const fsId = (djbItem === null || djbItem === void 0 ? void 0 : djbItem.fileStoreId) || (djbItem === null || djbItem === void 0 ? void 0 : djbItem.file);
31543
+ if (fsId && (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee = formData.djbEmployee) === null || _formData$djbEmployee === void 0 ? void 0 : _formData$djbEmployee.document) !== fsId) {
31544
+ formSetValue("djbEmployee", {
31545
+ ...formData.djbEmployee,
31546
+ document: fsId
31547
+ });
31548
+ }
31549
+ }
31503
31550
  }
31504
31551
  } else {
31505
- var _formData$djbEmployee;
31552
+ var _formData$djbEmployee2;
31506
31553
  removeEmployeeDocError();
31507
31554
  setDocuments(prevDocs => {
31508
31555
  const filtered = (prevDocs || []).filter(d => {
31509
- var _d$documentType3;
31510
- return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType3 = d.documentType) !== null && _d$documentType3 !== void 0 && _d$documentType3.includes("DJB_EMPLOYEE_ID"));
31556
+ var _d$documentType4;
31557
+ return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType4 = d.documentType) !== null && _d$documentType4 !== void 0 && _d$documentType4.includes("DJB_EMPLOYEE_ID"));
31511
31558
  });
31512
31559
  if (filtered.length !== (prevDocs || []).length) {
31513
31560
  return filtered;
31514
31561
  }
31515
31562
  return prevDocs;
31516
31563
  });
31517
- if (formSetValue && formData !== null && formData !== void 0 && (_formData$djbEmployee = formData.djbEmployee) !== null && _formData$djbEmployee !== void 0 && _formData$djbEmployee.document) {
31564
+ if (formSetValue && formData !== null && formData !== void 0 && (_formData$djbEmployee2 = formData.djbEmployee) !== null && _formData$djbEmployee2 !== void 0 && _formData$djbEmployee2.document) {
31518
31565
  formSetValue("djbEmployee", {
31519
31566
  ...formData.djbEmployee,
31520
31567
  document: ""
@@ -31749,7 +31796,7 @@ const WSDocumentsEmployee = _ref => {
31749
31796
  }));
31750
31797
  };
31751
31798
  function EmployeeIdDocumentUpload(_ref2) {
31752
- var _formData$djbEmployee2, _formData$djbEmployee3, _formData$djbEmployee4, _formData$djbEmployee5, _formData$djbEmployee0;
31799
+ var _formData$djbEmployee3, _formData$djbEmployee4, _formData$djbEmployee5, _formData$djbEmployee6, _formData$djbEmployee1;
31753
31800
  let {
31754
31801
  t,
31755
31802
  documents,
@@ -31759,26 +31806,26 @@ function EmployeeIdDocumentUpload(_ref2) {
31759
31806
  tenantId
31760
31807
  } = _ref2;
31761
31808
  const existingEmployeeDoc = documents === null || documents === void 0 ? void 0 : documents.find(d => {
31762
- var _d$documentType4;
31763
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType4 = d.documentType) === null || _d$documentType4 === void 0 ? void 0 : _d$documentType4.includes("DJB_EMPLOYEE_ID"));
31809
+ var _d$documentType5;
31810
+ return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("DJB_EMPLOYEE_ID"));
31764
31811
  });
31765
- const initialFileId = (existingEmployeeDoc === null || existingEmployeeDoc === void 0 ? void 0 : existingEmployeeDoc.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee2 = formData.djbEmployee) === null || _formData$djbEmployee2 === void 0 ? void 0 : (_formData$djbEmployee3 = _formData$djbEmployee2.document) === null || _formData$djbEmployee3 === void 0 ? void 0 : _formData$djbEmployee3.fileStoreId) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee4 = formData.djbEmployee) === null || _formData$djbEmployee4 === void 0 ? void 0 : _formData$djbEmployee4.document) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee5 = formData.djbEmployee) === null || _formData$djbEmployee5 === void 0 ? void 0 : _formData$djbEmployee5.document : null);
31812
+ const initialFileId = (existingEmployeeDoc === null || existingEmployeeDoc === void 0 ? void 0 : existingEmployeeDoc.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee3 = formData.djbEmployee) === null || _formData$djbEmployee3 === void 0 ? void 0 : (_formData$djbEmployee4 = _formData$djbEmployee3.document) === null || _formData$djbEmployee4 === void 0 ? void 0 : _formData$djbEmployee4.fileStoreId) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee5 = formData.djbEmployee) === null || _formData$djbEmployee5 === void 0 ? void 0 : _formData$djbEmployee5.document) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee6 = formData.djbEmployee) === null || _formData$djbEmployee6 === void 0 ? void 0 : _formData$djbEmployee6.document : null);
31766
31813
  const [file, setFile] = React.useState(null);
31767
31814
  const [uploadedFile, setUploadedFile] = React.useState(initialFileId || null);
31768
31815
  const [fileName, setFileName] = React.useState((existingEmployeeDoc === null || existingEmployeeDoc === void 0 ? void 0 : existingEmployeeDoc.fileName) || "");
31769
31816
  const [errorUpload, setErrorUpload] = React.useState(null);
31770
31817
  React.useEffect(() => {
31771
- var _formData$djbEmployee6, _formData$djbEmployee7, _formData$djbEmployee8, _formData$djbEmployee9;
31818
+ var _formData$djbEmployee7, _formData$djbEmployee8, _formData$djbEmployee9, _formData$djbEmployee0;
31772
31819
  const doc = documents === null || documents === void 0 ? void 0 : documents.find(d => {
31773
- var _d$documentType5;
31774
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("DJB_EMPLOYEE_ID"));
31820
+ var _d$documentType6;
31821
+ return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType6 = d.documentType) === null || _d$documentType6 === void 0 ? void 0 : _d$documentType6.includes("DJB_EMPLOYEE_ID"));
31775
31822
  });
31776
- const currentId = (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee6 = formData.djbEmployee) === null || _formData$djbEmployee6 === void 0 ? void 0 : (_formData$djbEmployee7 = _formData$djbEmployee6.document) === null || _formData$djbEmployee7 === void 0 ? void 0 : _formData$djbEmployee7.fileStoreId) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee8 = formData.djbEmployee) === null || _formData$djbEmployee8 === void 0 ? void 0 : _formData$djbEmployee8.document) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee9 = formData.djbEmployee) === null || _formData$djbEmployee9 === void 0 ? void 0 : _formData$djbEmployee9.document : null);
31823
+ const currentId = (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee7 = formData.djbEmployee) === null || _formData$djbEmployee7 === void 0 ? void 0 : (_formData$djbEmployee8 = _formData$djbEmployee7.document) === null || _formData$djbEmployee8 === void 0 ? void 0 : _formData$djbEmployee8.fileStoreId) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee9 = formData.djbEmployee) === null || _formData$djbEmployee9 === void 0 ? void 0 : _formData$djbEmployee9.document) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee0 = formData.djbEmployee) === null || _formData$djbEmployee0 === void 0 ? void 0 : _formData$djbEmployee0.document : null);
31777
31824
  if (currentId !== uploadedFile) {
31778
31825
  setUploadedFile(currentId || null);
31779
31826
  if (doc !== null && doc !== void 0 && doc.fileName) setFileName(doc.fileName);
31780
31827
  }
31781
- }, [documents, formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee0 = formData.djbEmployee) === null || _formData$djbEmployee0 === void 0 ? void 0 : _formData$djbEmployee0.document]);
31828
+ }, [documents, formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee1 = formData.djbEmployee) === null || _formData$djbEmployee1 === void 0 ? void 0 : _formData$djbEmployee1.document]);
31782
31829
  React.useEffect(() => {
31783
31830
  (function () {
31784
31831
  try {
@@ -31802,17 +31849,17 @@ function EmployeeIdDocumentUpload(_ref2) {
31802
31849
  setUploadedFile(fileId);
31803
31850
  setFileName(nameOfFile);
31804
31851
  setDocuments(prevDocs => {
31805
- var _formData$djbEmployee1;
31852
+ var _formData$djbEmployee10;
31806
31853
  const filtered = (prevDocs || []).filter(d => {
31807
- var _d$documentType6;
31808
- return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType6 = d.documentType) !== null && _d$documentType6 !== void 0 && _d$documentType6.includes("DJB_EMPLOYEE_ID"));
31854
+ var _d$documentType7;
31855
+ return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType7 = d.documentType) !== null && _d$documentType7 !== void 0 && _d$documentType7.includes("DJB_EMPLOYEE_ID"));
31809
31856
  });
31810
31857
  return [...filtered, {
31811
31858
  documentType: "OWNER.DJB_EMPLOYEE_ID",
31812
31859
  fileStoreId: fileId,
31813
31860
  fileName: nameOfFile,
31814
31861
  documentName: "WS_UPLOAD_EMPLOYEE_ID_DOC",
31815
- documentUid: (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee1 = formData.djbEmployee) === null || _formData$djbEmployee1 === void 0 ? void 0 : _formData$djbEmployee1.employeeId) || "",
31862
+ documentUid: (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee10 = formData.djbEmployee) === null || _formData$djbEmployee10 === void 0 ? void 0 : _formData$djbEmployee10.employeeId) || "",
31816
31863
  i18nKey: "WS_UPLOAD_EMPLOYEE_ID_DOC",
31817
31864
  status: "ACTIVE"
31818
31865
  }];
@@ -31862,8 +31909,8 @@ function EmployeeIdDocumentUpload(_ref2) {
31862
31909
  const fileInput = document.getElementById("employee-doc-upload");
31863
31910
  if (fileInput) fileInput.value = "";
31864
31911
  setDocuments(prevDocs => (prevDocs || []).filter(d => {
31865
- var _d$documentType7;
31866
- return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType7 = d.documentType) !== null && _d$documentType7 !== void 0 && _d$documentType7.includes("DJB_EMPLOYEE_ID"));
31912
+ var _d$documentType8;
31913
+ return (d === null || d === void 0 ? void 0 : d.documentType) !== "OWNER.DJB_EMPLOYEE_ID" && !(d !== null && d !== void 0 && (_d$documentType8 = d.documentType) !== null && _d$documentType8 !== void 0 && _d$documentType8.includes("DJB_EMPLOYEE_ID"));
31867
31914
  }));
31868
31915
  if (formSetValue && formData !== null && formData !== void 0 && formData.djbEmployee) {
31869
31916
  formSetValue("djbEmployee", {
@@ -38486,6 +38533,7 @@ const WSDeclaration = _ref => {
38486
38533
  const initialFsId = (formData === null || formData === void 0 ? void 0 : (_formData$declaration = formData.declarationData) === null || _formData$declaration === void 0 ? void 0 : _formData$declaration.signatureFileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration2 = formData.declaration) === null || _formData$declaration2 === void 0 ? void 0 : _formData$declaration2.signatureFileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration3 = formData.declarationData) === null || _formData$declaration3 === void 0 ? void 0 : (_formData$declaration4 = _formData$declaration3.signatureFile) === null || _formData$declaration4 === void 0 ? void 0 : _formData$declaration4.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration5 = formData.declaration) === null || _formData$declaration5 === void 0 ? void 0 : (_formData$declaration6 = _formData$declaration5.signatureFile) === null || _formData$declaration6 === void 0 ? void 0 : _formData$declaration6.fileStoreId) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$declaration7 = formData.declarationData) === null || _formData$declaration7 === void 0 ? void 0 : _formData$declaration7.signatureFile) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$declaration8 = formData.declarationData) === null || _formData$declaration8 === void 0 ? void 0 : _formData$declaration8.signatureFile : null) || (typeof (formData === null || formData === void 0 ? void 0 : (_formData$declaration9 = formData.declaration) === null || _formData$declaration9 === void 0 ? void 0 : _formData$declaration9.signatureFile) === "string" ? formData === null || formData === void 0 ? void 0 : (_formData$declaration0 = formData.declaration) === null || _formData$declaration0 === void 0 ? void 0 : _formData$declaration0.signatureFile : null) || (formData === null || formData === void 0 ? void 0 : (_formData$additionalD = formData.additionalDetails) === null || _formData$additionalD === void 0 ? void 0 : _formData$additionalD.signatureFileStoreId) || null;
38487
38534
  const initialFileName = (formData === null || formData === void 0 ? void 0 : (_formData$declaration1 = formData.declarationData) === null || _formData$declaration1 === void 0 ? void 0 : _formData$declaration1.signatureFileName) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration10 = formData.declaration) === null || _formData$declaration10 === void 0 ? void 0 : _formData$declaration10.signatureFileName) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration11 = formData.declarationData) === null || _formData$declaration11 === void 0 ? void 0 : (_formData$declaration12 = _formData$declaration11.signatureFile) === null || _formData$declaration12 === void 0 ? void 0 : _formData$declaration12.fileName) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration13 = formData.declaration) === null || _formData$declaration13 === void 0 ? void 0 : (_formData$declaration14 = _formData$declaration13.signatureFile) === null || _formData$declaration14 === void 0 ? void 0 : _formData$declaration14.fileName) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration15 = formData.declarationData) === null || _formData$declaration15 === void 0 ? void 0 : (_formData$declaration16 = _formData$declaration15.signatureFile) === null || _formData$declaration16 === void 0 ? void 0 : _formData$declaration16.name) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration17 = formData.declaration) === null || _formData$declaration17 === void 0 ? void 0 : (_formData$declaration18 = _formData$declaration17.signatureFile) === null || _formData$declaration18 === void 0 ? void 0 : _formData$declaration18.name) || (formData === null || formData === void 0 ? void 0 : (_formData$additionalD2 = formData.additionalDetails) === null || _formData$additionalD2 === void 0 ? void 0 : _formData$additionalD2.signatureFileName) || (initialFsId ? "signature.png" : "");
38488
38535
  const [signatureFileStoreId, setSignatureFileStoreId] = React.useState(initialFsId);
38536
+ const [localFile, setLocalFile] = React.useState(null);
38489
38537
  const [signatureFile, setSignatureFile] = React.useState((formData === null || formData === void 0 ? void 0 : (_formData$declaration19 = formData.declarationData) === null || _formData$declaration19 === void 0 ? void 0 : _formData$declaration19.signatureFile) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration20 = formData.declaration) === null || _formData$declaration20 === void 0 ? void 0 : _formData$declaration20.signatureFile) || (initialFsId ? {
38490
38538
  fileStoreId: initialFsId,
38491
38539
  fileName: initialFileName
@@ -38560,11 +38608,8 @@ const WSDeclaration = _ref => {
38560
38608
  } : null
38561
38609
  };
38562
38610
  if (!lodash.isEqual(lastSentValue.current, currentValues)) {
38563
- const timer = setTimeout(() => {
38564
- lastSentValue.current = currentValues;
38565
- onSelect(config === null || config === void 0 ? void 0 : config.key, currentValues);
38566
- }, 200);
38567
- return () => clearTimeout(timer);
38611
+ lastSentValue.current = currentValues;
38612
+ onSelect(config === null || config === void 0 ? void 0 : config.key, currentValues);
38568
38613
  }
38569
38614
  }, [formValue, signatureFileStoreId, signatureFile, config === null || config === void 0 ? void 0 : config.key, onSelect]);
38570
38615
  const onUploadSignature = function (e) {
@@ -38575,6 +38620,7 @@ const WSDeclaration = _ref => {
38575
38620
  if (file) {
38576
38621
  const _temp2 = function () {
38577
38622
  if (file.size >= 5242880) {} else {
38623
+ setLocalFile(file);
38578
38624
  const _temp = _catch(function () {
38579
38625
  return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId())).then(function (response) {
38580
38626
  var _response$data, _response$data$files;
@@ -38587,13 +38633,23 @@ const WSDeclaration = _ref => {
38587
38633
  };
38588
38634
  setSignatureFileStoreId(fsId);
38589
38635
  setSignatureFile(sigObj);
38590
- setValue("signatureFileStoreId", fsId);
38591
- setValue("signatureFile", sigObj);
38592
- setValue("signatureFileName", file.name);
38636
+ setValue("signatureFileStoreId", fsId, {
38637
+ shouldDirty: true,
38638
+ shouldValidate: true
38639
+ });
38640
+ setValue("signatureFile", sigObj, {
38641
+ shouldDirty: true,
38642
+ shouldValidate: true
38643
+ });
38644
+ setValue("signatureFileName", file.name, {
38645
+ shouldDirty: true,
38646
+ shouldValidate: true
38647
+ });
38593
38648
  }
38594
38649
  });
38595
38650
  }, function (err) {
38596
38651
  console.error("Signature upload failed", err);
38652
+ setLocalFile(null);
38597
38653
  });
38598
38654
  if (_temp && _temp.then) return _temp.then(function () {});
38599
38655
  }
@@ -38683,12 +38739,23 @@ const WSDeclaration = _ref => {
38683
38739
  })
38684
38740
  })), /*#__PURE__*/React__default.createElement("div", {
38685
38741
  className: "formcomposer-section-grid"
38686
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_UPLOAD_SIGNATURE_FILE")), /*#__PURE__*/React__default.createElement("div", {
38742
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_UPLOAD_SIGNATURE_FILE"), " ", /*#__PURE__*/React__default.createElement("span", {
38743
+ style: {
38744
+ color: "red"
38745
+ }
38746
+ }, "*")), /*#__PURE__*/React__default.createElement("div", {
38687
38747
  className: "field",
38748
+ style: {
38749
+ display: "flex",
38750
+ flexDirection: "column",
38751
+ gap: "6px"
38752
+ }
38753
+ }, /*#__PURE__*/React__default.createElement("div", {
38688
38754
  style: {
38689
38755
  display: "flex",
38690
38756
  gap: "10px",
38691
- alignItems: "center"
38757
+ alignItems: "center",
38758
+ width: "100%"
38692
38759
  }
38693
38760
  }, /*#__PURE__*/React__default.createElement("div", {
38694
38761
  style: {
@@ -38697,10 +38764,21 @@ const WSDeclaration = _ref => {
38697
38764
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.UploadFile, {
38698
38765
  onUpload: onUploadSignature,
38699
38766
  onDelete: () => {
38767
+ setLocalFile(null);
38700
38768
  setSignatureFile(null);
38701
38769
  setSignatureFileStoreId(null);
38702
- setValue("signatureFile", null);
38703
- setValue("signatureFileStoreId", null);
38770
+ setValue("signatureFile", null, {
38771
+ shouldDirty: true,
38772
+ shouldValidate: true
38773
+ });
38774
+ setValue("signatureFileStoreId", null, {
38775
+ shouldDirty: true,
38776
+ shouldValidate: true
38777
+ });
38778
+ setValue("signatureFileName", "", {
38779
+ shouldDirty: true,
38780
+ shouldValidate: true
38781
+ });
38704
38782
  },
38705
38783
  id: "ws-declaration-signature",
38706
38784
  message: signatureFileStoreId ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
@@ -38709,22 +38787,38 @@ const WSDeclaration = _ref => {
38709
38787
  },
38710
38788
  buttonType: "button",
38711
38789
  accept: "image/*, .pdf, .png, .jpeg, .jpg",
38712
- uploadedFiles: signatureFileStoreId ? [[(formValue === null || formValue === void 0 ? void 0 : formValue.signatureFileName) || "Signature", {
38790
+ uploadedFiles: signatureFileStoreId && !localFile ? [[(formValue === null || formValue === void 0 ? void 0 : formValue.signatureFileName) || (signatureFile === null || signatureFile === void 0 ? void 0 : signatureFile.fileName) || (signatureFile === null || signatureFile === void 0 ? void 0 : signatureFile.name) || "signature.png", {
38713
38791
  fileStoreId: signatureFileStoreId
38714
38792
  }]] : undefined,
38715
38793
  removeTargetedFile: () => {
38794
+ setLocalFile(null);
38716
38795
  setSignatureFile(null);
38717
38796
  setSignatureFileStoreId(null);
38718
- setValue("signatureFile", null);
38719
- setValue("signatureFileStoreId", null);
38720
- setValue("signatureFileName", "");
38797
+ setValue("signatureFile", null, {
38798
+ shouldDirty: true,
38799
+ shouldValidate: true
38800
+ });
38801
+ setValue("signatureFileStoreId", null, {
38802
+ shouldDirty: true,
38803
+ shouldValidate: true
38804
+ });
38805
+ setValue("signatureFileName", "", {
38806
+ shouldDirty: true,
38807
+ shouldValidate: true
38808
+ });
38721
38809
  }
38722
38810
  })), signatureFileStoreId && /*#__PURE__*/React__default.createElement("div", {
38723
38811
  onClick: viewDocument,
38724
38812
  style: {
38725
38813
  cursor: "pointer"
38726
38814
  }
38727
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ViewsIcon, null))))))), showDocModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
38815
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ViewsIcon, null))), !signatureFileStoreId && (formValue === null || formValue === void 0 ? void 0 : formValue.agree) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
38816
+ style: {
38817
+ color: "red",
38818
+ fontSize: "12px",
38819
+ marginTop: "4px"
38820
+ }
38821
+ }, t("WS_SIGNATURE_MANDATORY_ERROR") || "Signature is mandatory to submit application")))))), showDocModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
38728
38822
  open: showDocModal,
38729
38823
  headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
38730
38824
  headerBarEnd: /*#__PURE__*/React__default.createElement("div", {
@@ -38782,7 +38876,7 @@ const WSDeclaration = _ref => {
38782
38876
  };
38783
38877
 
38784
38878
  const WSDjbEmployee = _ref => {
38785
- var _formData$additionalD, _localFormState$touch, _formValue$employeeId, _formValue$employeeId2, _localFormState$touch2, _formValue$designatio, _formValue$designatio2, _formData$dueVerifica;
38879
+ var _formData$additionalD, _formData$djbEmployee3, _localFormState$touch, _formValue$employeeId, _formValue$employeeId2, _localFormState$touch2, _formValue$designatio, _formValue$designatio2, _formData$dueVerifica;
38786
38880
  let {
38787
38881
  config,
38788
38882
  onSelect,
@@ -38880,20 +38974,27 @@ const WSDjbEmployee = _ref => {
38880
38974
  React.useEffect(() => {
38881
38975
  const isEmployeeMode = userType === "employee" || window.location.href.includes("edit-application") || window.location.href.includes("modify-connection") || window.location.href.includes("old-application");
38882
38976
  if (isEmployeeMode) {
38883
- const isDifferent = !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData.djbEmployee, formValue);
38977
+ var _formData$djbEmployee;
38978
+ const currentDoc = (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee = formData.djbEmployee) === null || _formData$djbEmployee === void 0 ? void 0 : _formData$djbEmployee.document) || (formValue === null || formValue === void 0 ? void 0 : formValue.document) || "";
38979
+ const formValueComparable = {
38980
+ ...formValue,
38981
+ document: currentDoc
38982
+ };
38983
+ const isDifferent = !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData.djbEmployee, formValueComparable);
38884
38984
  if (isDifferent) {
38885
- var _formData$djbEmployee;
38886
- const isImmediate = (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee = formData.djbEmployee) === null || _formData$djbEmployee === void 0 ? void 0 : _formData$djbEmployee.isDjbEmployee) !== (formValue === null || formValue === void 0 ? void 0 : formValue.isDjbEmployee);
38985
+ var _formData$djbEmployee2;
38986
+ const isImmediate = (formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee2 = formData.djbEmployee) === null || _formData$djbEmployee2 === void 0 ? void 0 : _formData$djbEmployee2.isDjbEmployee) !== (formValue === null || formValue === void 0 ? void 0 : formValue.isDjbEmployee);
38887
38987
  const delay = isImmediate ? 0 : 100;
38888
38988
  const timer = setTimeout(() => {
38889
38989
  onSelect((config === null || config === void 0 ? void 0 : config.key) || "djbEmployee", {
38890
- ...formValue
38990
+ ...formValue,
38991
+ document: currentDoc
38891
38992
  });
38892
38993
  }, delay);
38893
38994
  return () => clearTimeout(timer);
38894
38995
  }
38895
38996
  }
38896
- }, [formValue, userType]);
38997
+ }, [formValue, userType, formData === null || formData === void 0 ? void 0 : (_formData$djbEmployee3 = formData.djbEmployee) === null || _formData$djbEmployee3 === void 0 ? void 0 : _formData$djbEmployee3.document]);
38897
38998
  React.useEffect(() => {
38898
38999
  const configKey = (config === null || config === void 0 ? void 0 : config.key) || "djbEmployee";
38899
39000
  if (hasDjbErrors) {
@@ -51623,7 +51724,7 @@ const ReSubmitDisconnectionApplication = () => {
51623
51724
  };
51624
51725
 
51625
51726
  const CheckPage = _ref => {
51626
- var _value$ConnectionDeta, _value$waterConnectio, _cpt$details12, _cpt$details13, _reversedOwners$, _cpt$details14, _cpt$details15, _cpt$details16, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$ad, _connectionDetails$ad2, _connectionDetails$ad3, _data, _data$additionalDetai, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _ConnectionHolderDeta, _ConnectionHolderDeta2, _ConnectionHolderDeta3, _ConnectionHolderDeta4, _ConnectionHolderDeta5, _ConnectionHolderDeta6, _ConnectionHolderDeta7, _ConnectionHolderDeta8, _ConnectionHolderDeta9, _ConnectionHolderDeta0, _propertyAddress$zro, _propertyAddress$addi, _propertyAddress$addr, _propertyAddress$addr2, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _propertyAddress$zone, _propertyAddress$zone2, _propertyAddress$zone3, _propertyAddress$zone4, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$numberOfF, _useDetails$numberOfF2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _property, _property$additionalD, _property2, _property2$additional, _property3, _property4, _property5, _property6, _property6$additional, _property7, _property7$additional, _property8, _property9, _property0, _property0$additional, _property1, _property1$additional, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _useDetails$propertyC3, _useDetails$propertyC4, _cpt$additionalDetail, _cpt$additionalDetail2, _cpt$additionalDetail3, _cpt$propertyType, _cpt$additionalDetail4, _cpt$additionalDetail5;
51727
+ var _value$ConnectionDeta, _value$waterConnectio, _cpt$details12, _cpt$details13, _reversedOwners$, _cpt$details14, _cpt$details15, _cpt$details16, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$ad, _connectionDetails$ad2, _connectionDetails$ad3, _data, _data$additionalDetai, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _ConnectionHolderDeta, _ConnectionHolderDeta2, _ConnectionHolderDeta3, _ConnectionHolderDeta4, _ConnectionHolderDeta5, _ConnectionHolderDeta6, _ConnectionHolderDeta7, _ConnectionHolderDeta8, _ConnectionHolderDeta9, _ConnectionHolderDeta0, _propertyAddress$zro, _propertyAddress$addi, _propertyAddress$addr, _propertyAddress$addr2, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _cpt$details17, _cpt$details17$addres, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _cpt$details18, _cpt$details18$addres, _cpt$details19, _cpt$details19$addres, _propertyAddress$zone, _propertyAddress$zone2, _cpt$details20, _cpt$details20$addres, _cpt$details21, _cpt$details21$addres, _cpt$details22, _cpt$details22$addres, _cpt$details23, _cpt$details23$addres, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$numberOfF, _useDetails$numberOfF2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _property, _property$additionalD, _property2, _property2$additional, _property3, _property4, _property5, _property6, _property6$additional, _property7, _property7$additional, _property8, _property9, _property0, _property0$additional, _property1, _property1$additional, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _useDetails$propertyC3, _useDetails$propertyC4, _cpt$additionalDetail, _cpt$additionalDetail2, _cpt$additionalDetail3, _cpt$propertyType, _cpt$additionalDetail4, _cpt$additionalDetail5;
51627
51728
  let {
51628
51729
  onSubmit,
51629
51730
  value
@@ -51883,22 +51984,22 @@ const CheckPage = _ref => {
51883
51984
  text: `${t(checkForNA(propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.longitude))}`
51884
51985
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51885
51986
  label: t("COMMON_ASSEMBLY"),
51886
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$asse = propertyAddress.assembly) === null || _propertyAddress$asse === void 0 ? void 0 : _propertyAddress$asse.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$asse2 = propertyAddress.assembly) === null || _propertyAddress$asse2 === void 0 ? void 0 : _propertyAddress$asse2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.assembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.assembly)))}`
51987
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$asse = propertyAddress.assembly) === null || _propertyAddress$asse === void 0 ? void 0 : _propertyAddress$asse.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$asse2 = propertyAddress.assembly) === null || _propertyAddress$asse2 === void 0 ? void 0 : _propertyAddress$asse2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.assembly) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details17 = cpt.details) === null || _cpt$details17 === void 0 ? void 0 : (_cpt$details17$addres = _cpt$details17.address) === null || _cpt$details17$addres === void 0 ? void 0 : _cpt$details17$addres.assembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.assembly)))}`
51887
51988
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51888
51989
  label: t("COMMON_WARD"),
51889
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$bloc = propertyAddress.block) === null || _propertyAddress$bloc === void 0 ? void 0 : _propertyAddress$bloc.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$bloc2 = propertyAddress.block) === null || _propertyAddress$bloc2 === void 0 ? void 0 : _propertyAddress$bloc2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.block) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$ward = propertyAddress.ward) === null || _propertyAddress$ward === void 0 ? void 0 : _propertyAddress$ward.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$ward2 = propertyAddress.ward) === null || _propertyAddress$ward2 === void 0 ? void 0 : _propertyAddress$ward2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.ward) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.ward)))}`
51990
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$bloc = propertyAddress.block) === null || _propertyAddress$bloc === void 0 ? void 0 : _propertyAddress$bloc.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$bloc2 = propertyAddress.block) === null || _propertyAddress$bloc2 === void 0 ? void 0 : _propertyAddress$bloc2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.block) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$ward = propertyAddress.ward) === null || _propertyAddress$ward === void 0 ? void 0 : _propertyAddress$ward.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$ward2 = propertyAddress.ward) === null || _propertyAddress$ward2 === void 0 ? void 0 : _propertyAddress$ward2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.ward) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details18 = cpt.details) === null || _cpt$details18 === void 0 ? void 0 : (_cpt$details18$addres = _cpt$details18.address) === null || _cpt$details18$addres === void 0 ? void 0 : _cpt$details18$addres.ward) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details19 = cpt.details) === null || _cpt$details19 === void 0 ? void 0 : (_cpt$details19$addres = _cpt$details19.address) === null || _cpt$details19$addres === void 0 ? void 0 : _cpt$details19$addres.block) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.ward)))}`
51890
51991
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51891
51992
  label: t("COMMON_ZONE"),
51892
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone = propertyAddress.zone) === null || _propertyAddress$zone === void 0 ? void 0 : _propertyAddress$zone.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone2 = propertyAddress.zone) === null || _propertyAddress$zone2 === void 0 ? void 0 : _propertyAddress$zone2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.zone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.zone)))}`
51993
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone = propertyAddress.zone) === null || _propertyAddress$zone === void 0 ? void 0 : _propertyAddress$zone.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone2 = propertyAddress.zone) === null || _propertyAddress$zone2 === void 0 ? void 0 : _propertyAddress$zone2.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.zone) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details20 = cpt.details) === null || _cpt$details20 === void 0 ? void 0 : (_cpt$details20$addres = _cpt$details20.address) === null || _cpt$details20$addres === void 0 ? void 0 : _cpt$details20$addres.zone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.zone)))}`
51893
51994
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51894
- label: t("COMMON_CURRENT_ASSEMBLY"),
51895
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualAssembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualAssembly)))}`
51995
+ label: t("COMMON_CURRENT_ASSEMBLY") && t("COMMON_CURRENT_ASSEMBLY") !== "Assembly" && t("COMMON_CURRENT_ASSEMBLY") !== "COMMON_CURRENT_ASSEMBLY" ? t("COMMON_CURRENT_ASSEMBLY") : "Actual Assembly",
51996
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualAssembly) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details21 = cpt.details) === null || _cpt$details21 === void 0 ? void 0 : (_cpt$details21$addres = _cpt$details21.address) === null || _cpt$details21$addres === void 0 ? void 0 : _cpt$details21$addres.actualAssembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualAssembly)))}`
51896
51997
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51897
- label: t("COMMON_CURRENT_WARD"),
51898
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualWard) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualWard)))}`
51998
+ label: t("COMMON_CURRENT_WARD") && t("COMMON_CURRENT_WARD") !== "Ward" && t("COMMON_CURRENT_WARD") !== "COMMON_CURRENT_WARD" ? t("COMMON_CURRENT_WARD") : "Actual Ward",
51999
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualWard) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details22 = cpt.details) === null || _cpt$details22 === void 0 ? void 0 : (_cpt$details22$addres = _cpt$details22.address) === null || _cpt$details22$addres === void 0 ? void 0 : _cpt$details22$addres.actualWard) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualWard)))}`
51899
52000
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51900
- label: t("COMMON_CURRENT_ZONE"),
51901
- text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone3 = propertyAddress.zone) === null || _propertyAddress$zone3 === void 0 ? void 0 : _propertyAddress$zone3.name) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$zone4 = propertyAddress.zone) === null || _propertyAddress$zone4 === void 0 ? void 0 : _propertyAddress$zone4.code) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.zone) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualZone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualZone)))}`
52001
+ label: t("COMMON_CURRENT_ZONE") && t("COMMON_CURRENT_ZONE") !== "Zone" && t("COMMON_CURRENT_ZONE") !== "COMMON_CURRENT_ZONE" ? t("COMMON_CURRENT_ZONE") : "Actual Zone",
52002
+ text: `${t(checkForNA((propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.actualZone) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$details23 = cpt.details) === null || _cpt$details23 === void 0 ? void 0 : (_cpt$details23$addres = _cpt$details23.address) === null || _cpt$details23$addres === void 0 ? void 0 : _cpt$details23$addres.actualZone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualZone)))}`
51902
52003
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
51903
52004
  label: t("LANDMARK"),
51904
52005
  text: `${t(checkForNA(propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.landmark))}`
@@ -66574,7 +66675,7 @@ const openFilePDF = fileId => {
66574
66675
  }).catch(error => console.error("Error fetching file:", error));
66575
66676
  };
66576
66677
  const CheckPage$4 = _ref2 => {
66577
- var _Digit$UserService$ge, _data$cpt, _propertyAddress, _propertyAddress2, _cpt$additionalDetail, _cpt$additionalDetail2, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ad, _data$cpt3, _data$cpt3$details, _data$cpt3$details$ad, _data$cpt4, _data$cpt4$details, _propertyAddress3, _propertyAddress4, _cpt$additionalDetail3, _cpt$additionalDetail4, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ad, _data$cpt6, _data$cpt6$details, _data$cpt6$details$ad, _data$ConnectionDetai, _data$connectionDetai, _data$ConnectionHolde, _data$connectionHolde, _data$useDetails, _data$DocumentsRequir, _data$documents, _data$djbEmployee, _data$disability, _data$rainWaterHarves, _connectionDetails, _connectionDetails$se, _connectionDetails2, _connectionDetails2$s, _connectionDetails3, _connectionDetails4, _connectionDetails4$a, _connectionDetails5, _connectionDetails5$a, _connectionDetails6, _connectionDetails1, _connectionDetails1$a, _connectionDetails10, _connectionDetails10$, _connectionDetails11, _connectionDetails11$, _connectionDetails12, _data$additionalDetai4, _holderDetails, _holderDetails2, _holderDetails3, _holderDetails4, _holderDetails4$gende, _holderDetails5, _holderDetails5$gende, _holderDetails6, _holderDetails7, _holderDetails8, _holderDetails9, _propertyAddress5, _propertyAddress5$zro, _propertyAddress6, _propertyAddress7, _propertyAddress8, _propertyAddress8$add, _propertyAddress9, _propertyAddress9$add, _propertyAddress0, _propertyAddress0$add, _propertyAddress1, _propertyAddress10, _propertyAddress10$ci, _propertyAddress11, _propertyAddress11$ci, _propertyAddress12, _propertyAddress13, _propertyAddress14, _propertyAddress15, _propertyAddress15$lo, _propertyAddress16, _propertyAddress16$lo, _propertyAddress17, _propertyAddress18, _propertyAddress18$su, _propertyAddress19, _propertyAddress19$su, _propertyAddress20, _propertyAddress21, _propertyAddress22, _propertyAddress23, _propertyAddress24, _propertyAddress25, _propertyAddress26, _propertyAddress27, _propertyAddress28, _propertyAddress29, _propertyAddress30, _propertyAddress31, _propertyAddress31$as, _propertyAddress32, _propertyAddress32$as, _propertyAddress33, _propertyAddress34, _propertyAddress34$bl, _propertyAddress35, _propertyAddress35$bl, _propertyAddress36, _propertyAddress37, _propertyAddress37$wa, _propertyAddress38, _propertyAddress38$wa, _propertyAddress39, _propertyAddress40, _propertyAddress40$zo, _propertyAddress41, _propertyAddress41$zo, _propertyAddress42, _propertyAddress43, _propertyAddress44, _propertyAddress45, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _useDetails$propertyC3, _useDetails$propertyC4, _cpt$additionalDetail5, _cpt$additionalDetail6, _cpt$additionalDetail7, _cpt$propertyType, _cpt$additionalDetail8, _cpt$additionalDetail9;
66678
+ var _Digit$UserService$ge, _data$cpt, _propertyAddress, _propertyAddress2, _cpt$additionalDetail, _cpt$additionalDetail2, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ad, _data$cpt3, _data$cpt3$details, _data$cpt3$details$ad, _data$cpt4, _data$cpt4$details, _propertyAddress3, _propertyAddress4, _cpt$additionalDetail3, _cpt$additionalDetail4, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ad, _data$cpt6, _data$cpt6$details, _data$cpt6$details$ad, _data$ConnectionDetai, _data$connectionDetai, _data$ConnectionHolde, _data$connectionHolde, _data$useDetails, _data$DocumentsRequir, _data$documents, _data$djbEmployee, _data$disability, _data$rainWaterHarves, _connectionDetails, _connectionDetails$se, _connectionDetails2, _connectionDetails2$s, _connectionDetails3, _connectionDetails4, _connectionDetails4$a, _connectionDetails5, _connectionDetails5$a, _connectionDetails6, _connectionDetails1, _connectionDetails1$a, _connectionDetails10, _connectionDetails10$, _connectionDetails11, _connectionDetails11$, _connectionDetails12, _data$additionalDetai4, _holderDetails, _holderDetails2, _holderDetails3, _holderDetails4, _holderDetails4$gende, _holderDetails5, _holderDetails5$gende, _holderDetails6, _holderDetails7, _holderDetails8, _holderDetails9, _propertyAddress5, _propertyAddress5$zro, _propertyAddress6, _propertyAddress7, _propertyAddress8, _propertyAddress8$add, _propertyAddress9, _propertyAddress9$add, _propertyAddress0, _propertyAddress0$add, _propertyAddress1, _propertyAddress10, _propertyAddress10$ci, _propertyAddress11, _propertyAddress11$ci, _propertyAddress12, _propertyAddress13, _propertyAddress14, _propertyAddress15, _propertyAddress15$lo, _propertyAddress16, _propertyAddress16$lo, _propertyAddress17, _propertyAddress18, _propertyAddress18$su, _propertyAddress19, _propertyAddress19$su, _propertyAddress20, _propertyAddress21, _propertyAddress22, _propertyAddress23, _propertyAddress24, _propertyAddress25, _propertyAddress26, _propertyAddress27, _propertyAddress28, _propertyAddress29, _propertyAddress30, _propertyAddress31, _propertyAddress31$as, _propertyAddress32, _propertyAddress32$as, _propertyAddress33, _cpt$address, _propertyAddress34, _propertyAddress34$bl, _propertyAddress35, _propertyAddress35$bl, _propertyAddress36, _propertyAddress37, _propertyAddress37$wa, _propertyAddress38, _propertyAddress38$wa, _propertyAddress39, _cpt$address2, _cpt$address3, _propertyAddress40, _propertyAddress40$zo, _propertyAddress41, _propertyAddress41$zo, _propertyAddress42, _cpt$address4, _propertyAddress43, _cpt$address5, _cpt$additionalDetail5, _propertyAddress44, _cpt$address6, _cpt$additionalDetail6, _propertyAddress45, _cpt$address7, _cpt$additionalDetail7, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _useDetails$propertyC3, _useDetails$propertyC4, _cpt$additionalDetail8, _cpt$additionalDetail9, _cpt$additionalDetail0, _cpt$propertyType, _cpt$additionalDetail1, _cpt$additionalDetail10;
66578
66679
  let {
66579
66680
  data,
66580
66681
  onSubmit,
@@ -66767,22 +66868,22 @@ const CheckPage$4 = _ref2 => {
66767
66868
  text: `${t(checkForNA$1((_propertyAddress30 = propertyAddress) === null || _propertyAddress30 === void 0 ? void 0 : _propertyAddress30.longitude))}`
66768
66869
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66769
66870
  label: t("COMMON_ASSEMBLY"),
66770
- text: `${t(checkForNA$1(((_propertyAddress31 = propertyAddress) === null || _propertyAddress31 === void 0 ? void 0 : (_propertyAddress31$as = _propertyAddress31.assembly) === null || _propertyAddress31$as === void 0 ? void 0 : _propertyAddress31$as.name) || ((_propertyAddress32 = propertyAddress) === null || _propertyAddress32 === void 0 ? void 0 : (_propertyAddress32$as = _propertyAddress32.assembly) === null || _propertyAddress32$as === void 0 ? void 0 : _propertyAddress32$as.code) || ((_propertyAddress33 = propertyAddress) === null || _propertyAddress33 === void 0 ? void 0 : _propertyAddress33.assembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.assembly)))}`
66871
+ text: `${t(checkForNA$1(((_propertyAddress31 = propertyAddress) === null || _propertyAddress31 === void 0 ? void 0 : (_propertyAddress31$as = _propertyAddress31.assembly) === null || _propertyAddress31$as === void 0 ? void 0 : _propertyAddress31$as.name) || ((_propertyAddress32 = propertyAddress) === null || _propertyAddress32 === void 0 ? void 0 : (_propertyAddress32$as = _propertyAddress32.assembly) === null || _propertyAddress32$as === void 0 ? void 0 : _propertyAddress32$as.code) || ((_propertyAddress33 = propertyAddress) === null || _propertyAddress33 === void 0 ? void 0 : _propertyAddress33.assembly) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address = cpt.address) === null || _cpt$address === void 0 ? void 0 : _cpt$address.assembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.assembly)))}`
66771
66872
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66772
66873
  label: t("COMMON_WARD"),
66773
- text: `${t(checkForNA$1(((_propertyAddress34 = propertyAddress) === null || _propertyAddress34 === void 0 ? void 0 : (_propertyAddress34$bl = _propertyAddress34.block) === null || _propertyAddress34$bl === void 0 ? void 0 : _propertyAddress34$bl.name) || ((_propertyAddress35 = propertyAddress) === null || _propertyAddress35 === void 0 ? void 0 : (_propertyAddress35$bl = _propertyAddress35.block) === null || _propertyAddress35$bl === void 0 ? void 0 : _propertyAddress35$bl.code) || ((_propertyAddress36 = propertyAddress) === null || _propertyAddress36 === void 0 ? void 0 : _propertyAddress36.block) || ((_propertyAddress37 = propertyAddress) === null || _propertyAddress37 === void 0 ? void 0 : (_propertyAddress37$wa = _propertyAddress37.ward) === null || _propertyAddress37$wa === void 0 ? void 0 : _propertyAddress37$wa.name) || ((_propertyAddress38 = propertyAddress) === null || _propertyAddress38 === void 0 ? void 0 : (_propertyAddress38$wa = _propertyAddress38.ward) === null || _propertyAddress38$wa === void 0 ? void 0 : _propertyAddress38$wa.code) || ((_propertyAddress39 = propertyAddress) === null || _propertyAddress39 === void 0 ? void 0 : _propertyAddress39.ward) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.ward)))}`
66874
+ text: `${t(checkForNA$1(((_propertyAddress34 = propertyAddress) === null || _propertyAddress34 === void 0 ? void 0 : (_propertyAddress34$bl = _propertyAddress34.block) === null || _propertyAddress34$bl === void 0 ? void 0 : _propertyAddress34$bl.name) || ((_propertyAddress35 = propertyAddress) === null || _propertyAddress35 === void 0 ? void 0 : (_propertyAddress35$bl = _propertyAddress35.block) === null || _propertyAddress35$bl === void 0 ? void 0 : _propertyAddress35$bl.code) || ((_propertyAddress36 = propertyAddress) === null || _propertyAddress36 === void 0 ? void 0 : _propertyAddress36.block) || ((_propertyAddress37 = propertyAddress) === null || _propertyAddress37 === void 0 ? void 0 : (_propertyAddress37$wa = _propertyAddress37.ward) === null || _propertyAddress37$wa === void 0 ? void 0 : _propertyAddress37$wa.name) || ((_propertyAddress38 = propertyAddress) === null || _propertyAddress38 === void 0 ? void 0 : (_propertyAddress38$wa = _propertyAddress38.ward) === null || _propertyAddress38$wa === void 0 ? void 0 : _propertyAddress38$wa.code) || ((_propertyAddress39 = propertyAddress) === null || _propertyAddress39 === void 0 ? void 0 : _propertyAddress39.ward) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address2 = cpt.address) === null || _cpt$address2 === void 0 ? void 0 : _cpt$address2.ward) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address3 = cpt.address) === null || _cpt$address3 === void 0 ? void 0 : _cpt$address3.block) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.ward)))}`
66774
66875
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66775
66876
  label: t("COMMON_ZONE"),
66776
- text: `${t(checkForNA$1(((_propertyAddress40 = propertyAddress) === null || _propertyAddress40 === void 0 ? void 0 : (_propertyAddress40$zo = _propertyAddress40.zone) === null || _propertyAddress40$zo === void 0 ? void 0 : _propertyAddress40$zo.name) || ((_propertyAddress41 = propertyAddress) === null || _propertyAddress41 === void 0 ? void 0 : (_propertyAddress41$zo = _propertyAddress41.zone) === null || _propertyAddress41$zo === void 0 ? void 0 : _propertyAddress41$zo.code) || ((_propertyAddress42 = propertyAddress) === null || _propertyAddress42 === void 0 ? void 0 : _propertyAddress42.zone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.zone)))}`
66877
+ text: `${t(checkForNA$1(((_propertyAddress40 = propertyAddress) === null || _propertyAddress40 === void 0 ? void 0 : (_propertyAddress40$zo = _propertyAddress40.zone) === null || _propertyAddress40$zo === void 0 ? void 0 : _propertyAddress40$zo.name) || ((_propertyAddress41 = propertyAddress) === null || _propertyAddress41 === void 0 ? void 0 : (_propertyAddress41$zo = _propertyAddress41.zone) === null || _propertyAddress41$zo === void 0 ? void 0 : _propertyAddress41$zo.code) || ((_propertyAddress42 = propertyAddress) === null || _propertyAddress42 === void 0 ? void 0 : _propertyAddress42.zone) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address4 = cpt.address) === null || _cpt$address4 === void 0 ? void 0 : _cpt$address4.zone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.zone)))}`
66777
66878
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66778
- label: t("COMMON_CURRENT_ASSEMBLY"),
66779
- text: `${t(checkForNA$1(((_propertyAddress43 = propertyAddress) === null || _propertyAddress43 === void 0 ? void 0 : _propertyAddress43.actualAssembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualAssembly)))}`
66879
+ label: t("COMMON_CURRENT_ASSEMBLY") && t("COMMON_CURRENT_ASSEMBLY") !== "Assembly" && t("COMMON_CURRENT_ASSEMBLY") !== "COMMON_CURRENT_ASSEMBLY" ? t("COMMON_CURRENT_ASSEMBLY") : "Actual Assembly",
66880
+ text: `${t(checkForNA$1(((_propertyAddress43 = propertyAddress) === null || _propertyAddress43 === void 0 ? void 0 : _propertyAddress43.actualAssembly) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address5 = cpt.address) === null || _cpt$address5 === void 0 ? void 0 : _cpt$address5.actualAssembly) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualAssembly) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail5 = cpt.additionalDetails) === null || _cpt$additionalDetail5 === void 0 ? void 0 : _cpt$additionalDetail5.actualAssembly)))}`
66780
66881
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66781
- label: t("COMMON_CURRENT_WARD"),
66782
- text: `${t(checkForNA$1(((_propertyAddress44 = propertyAddress) === null || _propertyAddress44 === void 0 ? void 0 : _propertyAddress44.actualWard) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualWard)))}`
66882
+ label: t("COMMON_CURRENT_WARD") && t("COMMON_CURRENT_WARD") !== "Ward" && t("COMMON_CURRENT_WARD") !== "COMMON_CURRENT_WARD" ? t("COMMON_CURRENT_WARD") : "Actual Ward",
66883
+ text: `${t(checkForNA$1(((_propertyAddress44 = propertyAddress) === null || _propertyAddress44 === void 0 ? void 0 : _propertyAddress44.actualWard) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address6 = cpt.address) === null || _cpt$address6 === void 0 ? void 0 : _cpt$address6.actualWard) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualWard) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail6 = cpt.additionalDetails) === null || _cpt$additionalDetail6 === void 0 ? void 0 : _cpt$additionalDetail6.actualWard)))}`
66783
66884
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66784
- label: t("COMMON_CURRENT_ZONE"),
66785
- text: `${t(checkForNA$1(((_propertyAddress45 = propertyAddress) === null || _propertyAddress45 === void 0 ? void 0 : _propertyAddress45.actualZone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualZone)))}`
66885
+ label: t("COMMON_CURRENT_ZONE") && t("COMMON_CURRENT_ZONE") !== "Zone" && t("COMMON_CURRENT_ZONE") !== "COMMON_CURRENT_ZONE" ? t("COMMON_CURRENT_ZONE") : "Actual Zone",
66886
+ text: `${t(checkForNA$1(((_propertyAddress45 = propertyAddress) === null || _propertyAddress45 === void 0 ? void 0 : _propertyAddress45.actualZone) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$address7 = cpt.address) === null || _cpt$address7 === void 0 ? void 0 : _cpt$address7.actualZone) || (additionalDetails === null || additionalDetails === void 0 ? void 0 : additionalDetails.actualZone) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail7 = cpt.additionalDetails) === null || _cpt$additionalDetail7 === void 0 ? void 0 : _cpt$additionalDetail7.actualZone)))}`
66786
66887
  })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, null, t("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, {
66787
66888
  style: {
66788
66889
  marginTop: "10px",
@@ -66815,10 +66916,10 @@ const CheckPage$4 = _ref2 => {
66815
66916
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66816
66917
  label: t("WS_SELECT_YEAR_OF_CONSTRUCTION"),
66817
66918
  text: `${t(checkForNA$1((useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$SelectYea = useDetails.SelectYearofConstruction) === null || _useDetails$SelectYea === void 0 ? void 0 : _useDetails$SelectYea.i18nKey) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$SelectYea2 = useDetails.SelectYearofConstruction) === null || _useDetails$SelectYea2 === void 0 ? void 0 : _useDetails$SelectYea2.value) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$SelectYea3 = useDetails.SelectYearofConstruction) === null || _useDetails$SelectYea3 === void 0 ? void 0 : _useDetails$SelectYea3.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.SelectYearofConstruction) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$construct = useDetails.constructionYear) === null || _useDetails$construct === void 0 ? void 0 : _useDetails$construct.i18nKey) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$construct2 = useDetails.constructionYear) === null || _useDetails$construct2 === void 0 ? void 0 : _useDetails$construct2.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.constructionYear)))}`
66818
- }), String((useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC3 = useDetails.propertyCategory) === null || _useDetails$propertyC3 === void 0 ? void 0 : _useDetails$propertyC3.code) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC4 = useDetails.propertyCategory) === null || _useDetails$propertyC4 === void 0 ? void 0 : _useDetails$propertyC4.name) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail5 = cpt.additionalDetails) === null || _cpt$additionalDetail5 === void 0 ? void 0 : (_cpt$additionalDetail6 = _cpt$additionalDetail5.propertyCategory) === null || _cpt$additionalDetail6 === void 0 ? void 0 : _cpt$additionalDetail6.code) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail7 = cpt.additionalDetails) === null || _cpt$additionalDetail7 === void 0 ? void 0 : _cpt$additionalDetail7.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$propertyType = cpt.propertyType) === null || _cpt$propertyType === void 0 ? void 0 : _cpt$propertyType.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : cpt.usageCategory) || "").toUpperCase().includes("RESIDENTIAL") ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66919
+ }), String((useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC3 = useDetails.propertyCategory) === null || _useDetails$propertyC3 === void 0 ? void 0 : _useDetails$propertyC3.code) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC4 = useDetails.propertyCategory) === null || _useDetails$propertyC4 === void 0 ? void 0 : _useDetails$propertyC4.name) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail8 = cpt.additionalDetails) === null || _cpt$additionalDetail8 === void 0 ? void 0 : (_cpt$additionalDetail9 = _cpt$additionalDetail8.propertyCategory) === null || _cpt$additionalDetail9 === void 0 ? void 0 : _cpt$additionalDetail9.code) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail0 = cpt.additionalDetails) === null || _cpt$additionalDetail0 === void 0 ? void 0 : _cpt$additionalDetail0.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$propertyType = cpt.propertyType) === null || _cpt$propertyType === void 0 ? void 0 : _cpt$propertyType.propertyCategory) || (cpt === null || cpt === void 0 ? void 0 : cpt.usageCategory) || "").toUpperCase().includes("RESIDENTIAL") ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
66819
66920
  label: t("WS_NUMBER_OF_DWELLING_UNITS"),
66820
66921
  text: `${t(checkForNA$1((useDetails === null || useDetails === void 0 ? void 0 : useDetails.NumberofDwellingUnits) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.noOfDwellingUnits)))}`
66821
- }) : null, (Array.isArray((useDetails === null || useDetails === void 0 ? void 0 : useDetails.questions) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail8 = cpt.additionalDetails) === null || _cpt$additionalDetail8 === void 0 ? void 0 : _cpt$additionalDetail8.questions)) ? (useDetails === null || useDetails === void 0 ? void 0 : useDetails.questions) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail9 = cpt.additionalDetails) === null || _cpt$additionalDetail9 === void 0 ? void 0 : _cpt$additionalDetail9.questions) : []).map((q, idx) => {
66922
+ }) : null, (Array.isArray((useDetails === null || useDetails === void 0 ? void 0 : useDetails.questions) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail1 = cpt.additionalDetails) === null || _cpt$additionalDetail1 === void 0 ? void 0 : _cpt$additionalDetail1.questions)) ? (useDetails === null || useDetails === void 0 ? void 0 : useDetails.questions) || (cpt === null || cpt === void 0 ? void 0 : (_cpt$additionalDetail10 = cpt.additionalDetails) === null || _cpt$additionalDetail10 === void 0 ? void 0 : _cpt$additionalDetail10.questions) : []).map((q, idx) => {
66822
66923
  var _q$answer, _q$answer2, _q$answer3;
66823
66924
  const qText = typeof q === "object" ? (q === null || q === void 0 ? void 0 : q.question) || (q === null || q === void 0 ? void 0 : q.questionText) || (q === null || q === void 0 ? void 0 : q.title) || `Question ${idx + 1}` : `Question ${idx + 1}`;
66824
66925
  const aText = typeof q === "object" ? typeof (q === null || q === void 0 ? void 0 : q.answer) === "object" ? (q === null || q === void 0 ? void 0 : (_q$answer = q.answer) === null || _q$answer === void 0 ? void 0 : _q$answer.name) || (q === null || q === void 0 ? void 0 : (_q$answer2 = q.answer) === null || _q$answer2 === void 0 ? void 0 : _q$answer2.value) || (q === null || q === void 0 ? void 0 : (_q$answer3 = q.answer) === null || _q$answer3 === void 0 ? void 0 : _q$answer3.code) : q === null || q === void 0 ? void 0 : q.answer : q;
@@ -66910,17 +67011,24 @@ const CheckPage$4 = _ref2 => {
66910
67011
  declarationData: declarationData
66911
67012
  },
66912
67013
  userType: "employee"
66913
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
66914
- label: t("CS_COMMON_SUBMIT"),
66915
- onSubmit: () => onSubmit({
66916
- ...data,
66917
- declarationData
66918
- }),
66919
- style: {
66920
- width: "150px"
66921
- },
66922
- disabled: !(declarationData !== null && declarationData !== void 0 && declarationData.agree)
66923
- }), " ")), showDocModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
67014
+ })), ((_declarationData$sign, _data$declarationData, _data$declaration, _data$additionalDetai7) => {
67015
+ const hasSignature = Boolean((declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFileStoreId) || (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signature) || (declarationData === null || declarationData === void 0 ? void 0 : (_declarationData$sign = declarationData.signatureFile) === null || _declarationData$sign === void 0 ? void 0 : _declarationData$sign.fileStoreId) || typeof (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFile) === "string" && (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFile.trim()) || (data === null || data === void 0 ? void 0 : (_data$declarationData = data.declarationData) === null || _data$declarationData === void 0 ? void 0 : _data$declarationData.signatureFileStoreId) || (data === null || data === void 0 ? void 0 : (_data$declaration = data.declaration) === null || _data$declaration === void 0 ? void 0 : _data$declaration.signatureFileStoreId) || (data === null || data === void 0 ? void 0 : (_data$additionalDetai7 = data.additionalDetails) === null || _data$additionalDetai7 === void 0 ? void 0 : _data$additionalDetai7.signatureFileStoreId));
67016
+ const isSubmitDisabled = !(declarationData !== null && declarationData !== void 0 && declarationData.agree) || !hasSignature;
67017
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
67018
+ label: t("CS_COMMON_SUBMIT"),
67019
+ onSubmit: () => {
67020
+ if (isSubmitDisabled) return;
67021
+ onSubmit({
67022
+ ...data,
67023
+ declarationData
67024
+ });
67025
+ },
67026
+ style: {
67027
+ width: "150px"
67028
+ },
67029
+ disabled: isSubmitDisabled
67030
+ }));
67031
+ })()), showDocModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
66924
67032
  open: showDocModal,
66925
67033
  headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
66926
67034
  headerBarEnd: /*#__PURE__*/React__default.createElement("div", {
@@ -67040,8 +67148,12 @@ const OLDApplication = () => {
67040
67148
  const formDataRef = React.useRef(sessionFormData || {});
67041
67149
  const sessionSaveTimeoutRef = React.useRef(null);
67042
67150
  const defaultValues = React.useMemo(() => {
67043
- return sessionFormData && Object.keys(sessionFormData).length > 0 ? sessionFormData : Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM") || {};
67044
- }, []);
67151
+ const fromStorage = Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM");
67152
+ if (fromStorage && Object.keys(fromStorage).length > 0) return fromStorage;
67153
+ if (sessionFormData && Object.keys(sessionFormData).length > 0) return sessionFormData;
67154
+ if (formDataRef.current && Object.keys(formDataRef.current).length > 0) return formDataRef.current;
67155
+ return {};
67156
+ }, [sessionFormData, showCheckPage]);
67045
67157
  const {
67046
67158
  data: propertyDetails
67047
67159
  } = Digit.Hooks.pt.usePropertySearch({
@@ -67179,6 +67291,41 @@ const OLDApplication = () => {
67179
67291
  setPropertyId(cptId);
67180
67292
  }
67181
67293
  }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt, propertyId]);
67294
+ React.useEffect(() => {
67295
+ var _formDataRef$current, _formDataRef$current$, _formDataRef$current$2, _propertyDetails$Prop, _propertyDetails$Prop2;
67296
+ const hasProp = ((_formDataRef$current = formDataRef.current) === null || _formDataRef$current === void 0 ? void 0 : (_formDataRef$current$ = _formDataRef$current.cpt) === null || _formDataRef$current$ === void 0 ? void 0 : (_formDataRef$current$2 = _formDataRef$current$.details) === null || _formDataRef$current$2 === void 0 ? void 0 : _formDataRef$current$2.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.propertyId);
67297
+ if (hasProp && !canSubmit) {
67298
+ var _formDataRef$current2, _formDataRef$current3, _formDataRef$current4, _formDataRef$current5, _formDataRef$current6, _formDataRef$current7, _formDataRef$current8, _djbData$document, _formDataRef$current9, _formDataRef$current0;
67299
+ const djbData = ((_formDataRef$current2 = formDataRef.current) === null || _formDataRef$current2 === void 0 ? void 0 : _formDataRef$current2.djbEmployee) || ((_formDataRef$current3 = formDataRef.current) === null || _formDataRef$current3 === void 0 ? void 0 : _formDataRef$current3.additionalDetails);
67300
+ const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
67301
+ const docs = ((_formDataRef$current4 = formDataRef.current) === null || _formDataRef$current4 === void 0 ? void 0 : (_formDataRef$current5 = _formDataRef$current4.DocumentsRequired) === null || _formDataRef$current5 === void 0 ? void 0 : _formDataRef$current5.documents) || ((_formDataRef$current6 = formDataRef.current) === null || _formDataRef$current6 === void 0 ? void 0 : (_formDataRef$current7 = _formDataRef$current6.documents) === null || _formDataRef$current7 === void 0 ? void 0 : _formDataRef$current7.documents) || ((_formDataRef$current8 = formDataRef.current) === null || _formDataRef$current8 === void 0 ? void 0 : _formDataRef$current8.documents) || [];
67302
+ const foundDjb = Array.isArray(docs) && docs.find(d => {
67303
+ var _d$documentType;
67304
+ return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes("DJB_EMPLOYEE_ID"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file) || (d === null || d === void 0 ? void 0 : d.filestoreId));
67305
+ });
67306
+ const djbDoc = (djbData === null || djbData === void 0 ? void 0 : (_djbData$document = djbData.document) === null || _djbData$document === void 0 ? void 0 : _djbData$document.fileStoreId) || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && (djbData === null || djbData === void 0 ? void 0 : djbData.document.trim()) || (djbData === null || djbData === void 0 ? void 0 : djbData.document) || (foundDjb ? foundDjb.fileStoreId || foundDjb.file || foundDjb.filestoreId : null);
67307
+ const isDjbEmpInv = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !djbDoc);
67308
+ const rwhData = ((_formDataRef$current9 = formDataRef.current) === null || _formDataRef$current9 === void 0 ? void 0 : _formDataRef$current9.rainWaterHarvesting) || ((_formDataRef$current0 = formDataRef.current) === null || _formDataRef$current0 === void 0 ? void 0 : _formDataRef$current0.additionalDetails);
67309
+ const isRwhReq = (rwhData === null || rwhData === void 0 ? void 0 : rwhData.hasCertificate) === true || String(rwhData === null || rwhData === void 0 ? void 0 : rwhData.hasCertificate) === "true" || (rwhData === null || rwhData === void 0 ? void 0 : rwhData.isRainwaterHarvesting) === true || String(rwhData === null || rwhData === void 0 ? void 0 : rwhData.isRainwaterHarvesting) === "true";
67310
+ const isRwhUploaded = Array.isArray(docs) && docs.some(d => isRwhDoc(d) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file)));
67311
+ const isRwhInv = isRwhReq && !isRwhUploaded;
67312
+ const storedErrors = sessionStorage.getItem("FORMSTATE_ERRORS");
67313
+ let parsedErrors = {};
67314
+ try {
67315
+ parsedErrors = storedErrors ? JSON.parse(storedErrors) : {};
67316
+ } catch (e) {}
67317
+ const hasStoredErrors = Object.keys(parsedErrors).some(k => {
67318
+ const err = parsedErrors[k];
67319
+ if (!err) return false;
67320
+ if (Array.isArray(err === null || err === void 0 ? void 0 : err.type) && err.type.length === 0) return false;
67321
+ if (typeof err === "object" && Object.keys(err).length === 0) return false;
67322
+ return true;
67323
+ });
67324
+ if (!hasStoredErrors && !isDjbEmpInv && !isRwhInv) {
67325
+ setSubmitValve(true);
67326
+ }
67327
+ }
67328
+ }, [propertyId, propertyDetails]);
67182
67329
  const {
67183
67330
  isLoading: creatingWaterApplicationLoading,
67184
67331
  mutate: waterMutation
@@ -67196,7 +67343,7 @@ const OLDApplication = () => {
67196
67343
  mutate: sewerageUpdateMutation
67197
67344
  } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
67198
67345
  const onFormValueChange = (setValue, formData, formState) => {
67199
- var _formData$cpt, _formData$cpt$details, _formDataRef$current, _formDataRef$current2, _djbData$document, _formDataRef$current3, _formDataRef$current4, _formDataRef$current5, _formDataRef$current6, _formData$DocumentsRe, _formData$DocumentsRe2, _formData$DocumentsRe3, _formDataRef$current7, _formDataRef$current8, _formDataRef$current9, _formDataRef$current0, _formData$documents, _formData$documents$d, _formData$documents$d2, _djbData$document2, _formDataRef$current1, _formDataRef$current10, _formDataRef$current11, _propertyDetails$Prop, _propertyDetails$Prop2;
67346
+ var _formData$cpt, _formData$cpt$details, _formDataRef$current1, _formDataRef$current10, _djbData$document2, _formDataRef$current11, _formDataRef$current12, _formData$DocumentsRe, _formDataRef$current13, _formDataRef$current14, _formData$documents, _formDataRef$current15, _formDataRef$current16, _formDataRef$current17, _formDataRef$current18, _formDataRef$current19, _formData$DocumentsRe2, _formDataRef$current20, _formDataRef$current21, _formData$documents2, _formDataRef$current22, _formDataRef$current23, _formDataRef$current24, _formDataRef$current25, _propertyDetails$Prop3, _propertyDetails$Prop4;
67200
67347
  formDataRef.current = {
67201
67348
  ...formDataRef.current,
67202
67349
  ...formData
@@ -67206,42 +67353,57 @@ const OLDApplication = () => {
67206
67353
  }
67207
67354
  sessionSaveTimeoutRef.current = setTimeout(() => {
67208
67355
  Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", formDataRef.current);
67356
+ setSessionFormData(formDataRef.current);
67209
67357
  }, 300);
67210
67358
  sessionStorage.setItem("FORMSTATE_ERRORS", JSON.stringify((formState === null || formState === void 0 ? void 0 : formState.errors) || {}));
67211
67359
  const cptPropId = formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : (_formData$cpt$details = _formData$cpt.details) === null || _formData$cpt$details === void 0 ? void 0 : _formData$cpt$details.propertyId;
67212
67360
  if (!propertyId && cptPropId) {
67213
67361
  setPropertyId(cptPropId);
67214
67362
  }
67215
- const djbData = ((_formDataRef$current = formDataRef.current) === null || _formDataRef$current === void 0 ? void 0 : _formDataRef$current.djbEmployee) || ((_formDataRef$current2 = formDataRef.current) === null || _formDataRef$current2 === void 0 ? void 0 : _formDataRef$current2.additionalDetails);
67363
+ const findDjbDoc = docs => {
67364
+ if (!Array.isArray(docs)) return null;
67365
+ const found = docs.find(d => {
67366
+ var _d$documentType2;
67367
+ return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType2 = d.documentType) === null || _d$documentType2 === void 0 ? void 0 : _d$documentType2.includes("DJB_EMPLOYEE_ID"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file) || (d === null || d === void 0 ? void 0 : d.filestoreId));
67368
+ });
67369
+ return found ? found.fileStoreId || found.file || found.filestoreId : null;
67370
+ };
67371
+ const djbData = ((_formDataRef$current1 = formDataRef.current) === null || _formDataRef$current1 === void 0 ? void 0 : _formDataRef$current1.djbEmployee) || ((_formDataRef$current10 = formDataRef.current) === null || _formDataRef$current10 === void 0 ? void 0 : _formDataRef$current10.additionalDetails);
67216
67372
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
67217
- const djbDoc = (djbData === null || djbData === void 0 ? void 0 : (_djbData$document = djbData.document) === null || _djbData$document === void 0 ? void 0 : _djbData$document.fileStoreId) || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && (djbData === null || djbData === void 0 ? void 0 : djbData.document.trim()) || (djbData === null || djbData === void 0 ? void 0 : djbData.document) || ((_formDataRef$current3 = formDataRef.current) === null || _formDataRef$current3 === void 0 ? void 0 : (_formDataRef$current4 = _formDataRef$current3.DocumentsRequired) === null || _formDataRef$current4 === void 0 ? void 0 : (_formDataRef$current5 = _formDataRef$current4.documents) === null || _formDataRef$current5 === void 0 ? void 0 : (_formDataRef$current6 = _formDataRef$current5.find(d => {
67218
- var _d$documentType;
67219
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes("DJB_EMPLOYEE_ID"));
67220
- })) === null || _formDataRef$current6 === void 0 ? void 0 : _formDataRef$current6.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe = formData.DocumentsRequired) === null || _formData$DocumentsRe === void 0 ? void 0 : (_formData$DocumentsRe2 = _formData$DocumentsRe.documents) === null || _formData$DocumentsRe2 === void 0 ? void 0 : (_formData$DocumentsRe3 = _formData$DocumentsRe2.find(d => {
67221
- var _d$documentType2;
67222
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType2 = d.documentType) === null || _d$documentType2 === void 0 ? void 0 : _d$documentType2.includes("DJB_EMPLOYEE_ID"));
67223
- })) === null || _formData$DocumentsRe3 === void 0 ? void 0 : _formData$DocumentsRe3.fileStoreId) || ((_formDataRef$current7 = formDataRef.current) === null || _formDataRef$current7 === void 0 ? void 0 : (_formDataRef$current8 = _formDataRef$current7.documents) === null || _formDataRef$current8 === void 0 ? void 0 : (_formDataRef$current9 = _formDataRef$current8.documents) === null || _formDataRef$current9 === void 0 ? void 0 : (_formDataRef$current0 = _formDataRef$current9.find(d => {
67224
- var _d$documentType3;
67225
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("DJB_EMPLOYEE_ID"));
67226
- })) === null || _formDataRef$current0 === void 0 ? void 0 : _formDataRef$current0.fileStoreId) || (formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : (_formData$documents$d = _formData$documents.documents) === null || _formData$documents$d === void 0 ? void 0 : (_formData$documents$d2 = _formData$documents$d.find(d => {
67227
- var _d$documentType4;
67228
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType4 = d.documentType) === null || _d$documentType4 === void 0 ? void 0 : _d$documentType4.includes("DJB_EMPLOYEE_ID"));
67229
- })) === null || _formData$documents$d2 === void 0 ? void 0 : _formData$documents$d2.fileStoreId);
67230
- const isDjbEmpInvalid = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !(djbData !== null && djbData !== void 0 && (_djbData$document2 = djbData.document) !== null && _djbData$document2 !== void 0 && _djbData$document2.fileStoreId || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && djbData !== null && djbData !== void 0 && djbData.document.trim() || djbData !== null && djbData !== void 0 && djbData.document));
67231
- const hasErrors = Object.keys((formState === null || formState === void 0 ? void 0 : formState.errors) || {}).length > 0 || isDjbEmpInvalid;
67232
- const hasProperty = ((_formDataRef$current1 = formDataRef.current) === null || _formDataRef$current1 === void 0 ? void 0 : (_formDataRef$current10 = _formDataRef$current1.cpt) === null || _formDataRef$current10 === void 0 ? void 0 : (_formDataRef$current11 = _formDataRef$current10.details) === null || _formDataRef$current11 === void 0 ? void 0 : _formDataRef$current11.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.propertyId);
67373
+ const djbDoc = (djbData === null || djbData === void 0 ? void 0 : (_djbData$document2 = djbData.document) === null || _djbData$document2 === void 0 ? void 0 : _djbData$document2.fileStoreId) || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && (djbData === null || djbData === void 0 ? void 0 : djbData.document.trim()) || (djbData === null || djbData === void 0 ? void 0 : djbData.document) || findDjbDoc((_formDataRef$current11 = formDataRef.current) === null || _formDataRef$current11 === void 0 ? void 0 : (_formDataRef$current12 = _formDataRef$current11.DocumentsRequired) === null || _formDataRef$current12 === void 0 ? void 0 : _formDataRef$current12.documents) || findDjbDoc(formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe = formData.DocumentsRequired) === null || _formData$DocumentsRe === void 0 ? void 0 : _formData$DocumentsRe.documents) || findDjbDoc((_formDataRef$current13 = formDataRef.current) === null || _formDataRef$current13 === void 0 ? void 0 : (_formDataRef$current14 = _formDataRef$current13.documents) === null || _formDataRef$current14 === void 0 ? void 0 : _formDataRef$current14.documents) || findDjbDoc(formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : _formData$documents.documents) || findDjbDoc((_formDataRef$current15 = formDataRef.current) === null || _formDataRef$current15 === void 0 ? void 0 : _formDataRef$current15.documents) || findDjbDoc(formData === null || formData === void 0 ? void 0 : formData.documents);
67374
+ if (djbDoc) {
67375
+ if (!formDataRef.current.djbEmployee) formDataRef.current.djbEmployee = {};
67376
+ formDataRef.current.djbEmployee.document = djbDoc;
67377
+ }
67378
+ const isDjbEmpInvalid = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !djbDoc);
67379
+ const rwhData = ((_formDataRef$current16 = formDataRef.current) === null || _formDataRef$current16 === void 0 ? void 0 : _formDataRef$current16.rainWaterHarvesting) || ((_formDataRef$current17 = formDataRef.current) === null || _formDataRef$current17 === void 0 ? void 0 : _formDataRef$current17.additionalDetails);
67380
+ const isRwhRequired = (rwhData === null || rwhData === void 0 ? void 0 : rwhData.hasCertificate) === true || String(rwhData === null || rwhData === void 0 ? void 0 : rwhData.hasCertificate) === "true" || (rwhData === null || rwhData === void 0 ? void 0 : rwhData.isRainwaterHarvesting) === true || String(rwhData === null || rwhData === void 0 ? void 0 : rwhData.isRainwaterHarvesting) === "true";
67381
+ const allCurrentDocs = ((_formDataRef$current18 = formDataRef.current) === null || _formDataRef$current18 === void 0 ? void 0 : (_formDataRef$current19 = _formDataRef$current18.DocumentsRequired) === null || _formDataRef$current19 === void 0 ? void 0 : _formDataRef$current19.documents) || (formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe2 = formData.DocumentsRequired) === null || _formData$DocumentsRe2 === void 0 ? void 0 : _formData$DocumentsRe2.documents) || ((_formDataRef$current20 = formDataRef.current) === null || _formDataRef$current20 === void 0 ? void 0 : (_formDataRef$current21 = _formDataRef$current20.documents) === null || _formDataRef$current21 === void 0 ? void 0 : _formDataRef$current21.documents) || (formData === null || formData === void 0 ? void 0 : (_formData$documents2 = formData.documents) === null || _formData$documents2 === void 0 ? void 0 : _formData$documents2.documents) || ((_formDataRef$current22 = formDataRef.current) === null || _formDataRef$current22 === void 0 ? void 0 : _formDataRef$current22.documents) || (formData === null || formData === void 0 ? void 0 : formData.documents) || [];
67382
+ const isRwhDocUploaded = Array.isArray(allCurrentDocs) && allCurrentDocs.some(d => isRwhDoc(d) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file)));
67383
+ const isRwhInvalid = isRwhRequired && !isRwhDocUploaded;
67384
+ const actualFormErrors = Object.keys((formState === null || formState === void 0 ? void 0 : formState.errors) || {}).filter(key => {
67385
+ var _formState$errors;
67386
+ const err = formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : _formState$errors[key];
67387
+ if (!err) return false;
67388
+ if (Array.isArray(err === null || err === void 0 ? void 0 : err.type) && err.type.length === 0) return false;
67389
+ if (typeof err === "object" && Object.keys(err).length === 0) return false;
67390
+ return true;
67391
+ });
67392
+ const hasErrors = actualFormErrors.length > 0 || isDjbEmpInvalid || isRwhInvalid;
67393
+ const hasProperty = ((_formDataRef$current23 = formDataRef.current) === null || _formDataRef$current23 === void 0 ? void 0 : (_formDataRef$current24 = _formDataRef$current23.cpt) === null || _formDataRef$current24 === void 0 ? void 0 : (_formDataRef$current25 = _formDataRef$current24.details) === null || _formDataRef$current25 === void 0 ? void 0 : _formDataRef$current25.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.propertyId);
67233
67394
  const canSubmitNow = !hasErrors && !!hasProperty;
67234
67395
  setSubmitValve(prev => prev !== canSubmitNow ? canSubmitNow : prev);
67235
67396
  };
67236
67397
  const onFormSubmit = data => {
67237
- var _combinedData$cpt, _combinedData$cpt$det, _propertyDetails$Prop3, _propertyDetails$Prop4, _combinedData$cpt2, _propertyDetails$Prop5, _djbData$document3, _combinedData$Documen, _combinedData$Documen2, _combinedData$Documen3, _combinedData$documen, _combinedData$documen2, _combinedData$documen3, _combinedData$Documen4, _combinedData$documen4, _formDataRef$current12, _formDataRef$current13, _formDataRef$current14, _formDataRef$current15, _formDataRef$current16;
67398
+ var _combinedData$cpt, _combinedData$cpt$det, _propertyDetails$Prop5, _propertyDetails$Prop6, _combinedData$cpt2, _propertyDetails$Prop7, _djbData$document3, _combinedData$Documen, _combinedData$documen, _formDataRef$current26, _formDataRef$current27, _formDataRef$current28, _formDataRef$current29, _formDataRef$current30, _combinedData$Documen2, _combinedData$documen2, _formDataRef$current31, _formDataRef$current32, _formDataRef$current33, _formDataRef$current34, _formDataRef$current35;
67238
67399
  const combinedData = {
67239
67400
  ...formDataRef.current,
67240
67401
  ...data
67241
67402
  };
67242
67403
  formDataRef.current = combinedData;
67243
67404
  Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", combinedData);
67244
- const hasProperty = (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$cpt = combinedData.cpt) === null || _combinedData$cpt === void 0 ? void 0 : (_combinedData$cpt$det = _combinedData$cpt.details) === null || _combinedData$cpt$det === void 0 ? void 0 : _combinedData$cpt$det.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.propertyId);
67405
+ setSessionFormData(combinedData);
67406
+ const hasProperty = (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$cpt = combinedData.cpt) === null || _combinedData$cpt === void 0 ? void 0 : (_combinedData$cpt$det = _combinedData$cpt.details) === null || _combinedData$cpt$det === void 0 ? void 0 : _combinedData$cpt$det.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop5 = propertyDetails.Properties) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5[0]) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6.propertyId);
67245
67407
  if (!hasProperty) {
67246
67408
  console.warn("[WS] onSubmit EXIT: invalid property", {
67247
67409
  cpt: combinedData === null || combinedData === void 0 ? void 0 : combinedData.cpt,
@@ -67253,7 +67415,7 @@ const OLDApplication = () => {
67253
67415
  });
67254
67416
  return;
67255
67417
  }
67256
- if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt2 = combinedData.cpt) !== null && _combinedData$cpt2 !== void 0 && _combinedData$cpt2.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop5 = propertyDetails.Properties) !== null && _propertyDetails$Prop5 !== void 0 && _propertyDetails$Prop5[0])) {
67418
+ if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt2 = combinedData.cpt) !== null && _combinedData$cpt2 !== void 0 && _combinedData$cpt2.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop7 = propertyDetails.Properties) !== null && _propertyDetails$Prop7 !== void 0 && _propertyDetails$Prop7[0])) {
67257
67419
  var _combinedData$cpt3;
67258
67420
  if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt3 = combinedData.cpt) !== null && _combinedData$cpt3 !== void 0 && _combinedData$cpt3.details) || !propertyDetails) {
67259
67421
  console.warn("[WS] onSubmit EXIT: invalid property", {
@@ -67269,13 +67431,15 @@ const OLDApplication = () => {
67269
67431
  }
67270
67432
  const djbData = (combinedData === null || combinedData === void 0 ? void 0 : combinedData.djbEmployee) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.additionalDetails);
67271
67433
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
67272
- const djbDoc = (djbData === null || djbData === void 0 ? void 0 : (_djbData$document3 = djbData.document) === null || _djbData$document3 === void 0 ? void 0 : _djbData$document3.fileStoreId) || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && (djbData === null || djbData === void 0 ? void 0 : djbData.document.trim()) || (djbData === null || djbData === void 0 ? void 0 : djbData.document) || (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$Documen = combinedData.DocumentsRequired) === null || _combinedData$Documen === void 0 ? void 0 : (_combinedData$Documen2 = _combinedData$Documen.documents) === null || _combinedData$Documen2 === void 0 ? void 0 : (_combinedData$Documen3 = _combinedData$Documen2.find(d => {
67273
- var _d$documentType5;
67274
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("DJB_EMPLOYEE_ID"));
67275
- })) === null || _combinedData$Documen3 === void 0 ? void 0 : _combinedData$Documen3.fileStoreId) || (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$documen = combinedData.documents) === null || _combinedData$documen === void 0 ? void 0 : (_combinedData$documen2 = _combinedData$documen.documents) === null || _combinedData$documen2 === void 0 ? void 0 : (_combinedData$documen3 = _combinedData$documen2.find(d => {
67276
- var _d$documentType6;
67277
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType6 = d.documentType) === null || _d$documentType6 === void 0 ? void 0 : _d$documentType6.includes("DJB_EMPLOYEE_ID"));
67278
- })) === null || _combinedData$documen3 === void 0 ? void 0 : _combinedData$documen3.fileStoreId);
67434
+ const findDjbDocInSubmit = docs => {
67435
+ if (!Array.isArray(docs)) return null;
67436
+ const found = docs.find(d => {
67437
+ var _d$documentType3;
67438
+ return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("DJB_EMPLOYEE_ID"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file) || (d === null || d === void 0 ? void 0 : d.filestoreId));
67439
+ });
67440
+ return found ? found.fileStoreId || found.file || found.filestoreId : null;
67441
+ };
67442
+ const djbDoc = (djbData === null || djbData === void 0 ? void 0 : (_djbData$document3 = djbData.document) === null || _djbData$document3 === void 0 ? void 0 : _djbData$document3.fileStoreId) || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && (djbData === null || djbData === void 0 ? void 0 : djbData.document.trim()) || (djbData === null || djbData === void 0 ? void 0 : djbData.document) || findDjbDocInSubmit(combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$Documen = combinedData.DocumentsRequired) === null || _combinedData$Documen === void 0 ? void 0 : _combinedData$Documen.documents) || findDjbDocInSubmit(combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$documen = combinedData.documents) === null || _combinedData$documen === void 0 ? void 0 : _combinedData$documen.documents) || findDjbDocInSubmit(combinedData === null || combinedData === void 0 ? void 0 : combinedData.documents) || findDjbDocInSubmit((_formDataRef$current26 = formDataRef.current) === null || _formDataRef$current26 === void 0 ? void 0 : (_formDataRef$current27 = _formDataRef$current26.DocumentsRequired) === null || _formDataRef$current27 === void 0 ? void 0 : _formDataRef$current27.documents) || findDjbDocInSubmit((_formDataRef$current28 = formDataRef.current) === null || _formDataRef$current28 === void 0 ? void 0 : (_formDataRef$current29 = _formDataRef$current28.documents) === null || _formDataRef$current29 === void 0 ? void 0 : _formDataRef$current29.documents) || findDjbDocInSubmit((_formDataRef$current30 = formDataRef.current) === null || _formDataRef$current30 === void 0 ? void 0 : _formDataRef$current30.documents);
67279
67443
  const isDjbEmpInvalid = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !djbDoc);
67280
67444
  if (isDjbEmpInvalid) {
67281
67445
  setShowToast({
@@ -67286,7 +67450,7 @@ const OLDApplication = () => {
67286
67450
  }
67287
67451
  const rwhSubmitData = (combinedData === null || combinedData === void 0 ? void 0 : combinedData.rainWaterHarvesting) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.additionalDetails);
67288
67452
  const isRwhSubmitRequired = (rwhSubmitData === null || rwhSubmitData === void 0 ? void 0 : rwhSubmitData.hasCertificate) === true || String(rwhSubmitData === null || rwhSubmitData === void 0 ? void 0 : rwhSubmitData.hasCertificate) === "true" || (rwhSubmitData === null || rwhSubmitData === void 0 ? void 0 : rwhSubmitData.isRainwaterHarvesting) === true || String(rwhSubmitData === null || rwhSubmitData === void 0 ? void 0 : rwhSubmitData.isRainwaterHarvesting) === "true";
67289
- const allSubmitDocs = (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$Documen4 = combinedData.DocumentsRequired) === null || _combinedData$Documen4 === void 0 ? void 0 : _combinedData$Documen4.documents) || (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$documen4 = combinedData.documents) === null || _combinedData$documen4 === void 0 ? void 0 : _combinedData$documen4.documents) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.documents) || ((_formDataRef$current12 = formDataRef.current) === null || _formDataRef$current12 === void 0 ? void 0 : (_formDataRef$current13 = _formDataRef$current12.DocumentsRequired) === null || _formDataRef$current13 === void 0 ? void 0 : _formDataRef$current13.documents) || ((_formDataRef$current14 = formDataRef.current) === null || _formDataRef$current14 === void 0 ? void 0 : (_formDataRef$current15 = _formDataRef$current14.documents) === null || _formDataRef$current15 === void 0 ? void 0 : _formDataRef$current15.documents) || ((_formDataRef$current16 = formDataRef.current) === null || _formDataRef$current16 === void 0 ? void 0 : _formDataRef$current16.documents) || [];
67453
+ const allSubmitDocs = (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$Documen2 = combinedData.DocumentsRequired) === null || _combinedData$Documen2 === void 0 ? void 0 : _combinedData$Documen2.documents) || (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$documen2 = combinedData.documents) === null || _combinedData$documen2 === void 0 ? void 0 : _combinedData$documen2.documents) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.documents) || ((_formDataRef$current31 = formDataRef.current) === null || _formDataRef$current31 === void 0 ? void 0 : (_formDataRef$current32 = _formDataRef$current31.DocumentsRequired) === null || _formDataRef$current32 === void 0 ? void 0 : _formDataRef$current32.documents) || ((_formDataRef$current33 = formDataRef.current) === null || _formDataRef$current33 === void 0 ? void 0 : (_formDataRef$current34 = _formDataRef$current33.documents) === null || _formDataRef$current34 === void 0 ? void 0 : _formDataRef$current34.documents) || ((_formDataRef$current35 = formDataRef.current) === null || _formDataRef$current35 === void 0 ? void 0 : _formDataRef$current35.documents) || [];
67290
67454
  const isRwhSubmitDocUploaded = Array.isArray(allSubmitDocs) && allSubmitDocs.some(d => isRwhDoc(d) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file)));
67291
67455
  if (isRwhSubmitRequired && !isRwhSubmitDocUploaded) {
67292
67456
  setShowToast({
@@ -67305,7 +67469,7 @@ const OLDApplication = () => {
67305
67469
  };
67306
67470
  const processSubmission = function (data) {
67307
67471
  try {
67308
- var _data$useDetails, _data$ConnectionDetai, _data$ConnectionDetai2, _data$DocumentsRequir, _data$djbEmployee, _data$djbEmployee$doc, _data$djbEmployee2, _data$djbEmployee3, _data$djbEmployee4, _data$DocumentsRequir2, _data$DocumentsRequir3, _data$DocumentsRequir4, _data$documents, _data$documents$docum, _data$documents$docum2, _data$cpt, _Digit$UserService$ge2, _data$ConnectionHolde, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _propertyDetails$Prop7, _propertyDetails$Prop8, _propertyDetails$Prop9, _propertyDetails$Prop0, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2;
67472
+ var _data$useDetails, _data$ConnectionDetai, _data$ConnectionDetai2, _data$DocumentsRequir, _data$djbEmployee, _data$djbEmployee$doc, _data$djbEmployee2, _data$djbEmployee3, _data$djbEmployee4, _data$DocumentsRequir2, _data$DocumentsRequir3, _data$DocumentsRequir4, _data$documents, _data$documents$docum, _data$documents$docum2, _data$cpt, _Digit$UserService$ge2, _data$ConnectionHolde, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _propertyDetails$Prop9, _propertyDetails$Prop0, _propertyDetails$Prop1, _propertyDetails$Prop10, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2;
67309
67473
  const basePath = window.location.href.includes("/employee") ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
67310
67474
  if (data !== null && data !== void 0 && (_data$useDetails = data.useDetails) !== null && _data$useDetails !== void 0 && _data$useDetails.useDetails) {
67311
67475
  data.useDetails = {
@@ -67348,16 +67512,16 @@ const OLDApplication = () => {
67348
67512
  if (data !== null && data !== void 0 && (_data$DocumentsRequir = data.DocumentsRequired) !== null && _data$DocumentsRequir !== void 0 && _data$DocumentsRequir.documents) {
67349
67513
  const docs = data.DocumentsRequired.documents;
67350
67514
  const identityDoc = docs.find(d => {
67351
- var _d$documentType7;
67352
- return d === null || d === void 0 ? void 0 : (_d$documentType7 = d.documentType) === null || _d$documentType7 === void 0 ? void 0 : _d$documentType7.includes("IDENTITYPROOF");
67515
+ var _d$documentType4;
67516
+ return d === null || d === void 0 ? void 0 : (_d$documentType4 = d.documentType) === null || _d$documentType4 === void 0 ? void 0 : _d$documentType4.includes("IDENTITYPROOF");
67353
67517
  });
67354
67518
  const ownershipDoc = docs.find(d => {
67355
- var _d$documentType8, _d$documentType9;
67356
- return (d === null || d === void 0 ? void 0 : (_d$documentType8 = d.documentType) === null || _d$documentType8 === void 0 ? void 0 : _d$documentType8.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType9 = d.documentType) === null || _d$documentType9 === void 0 ? void 0 : _d$documentType9.includes("OWNERSHIPPROOF"));
67519
+ var _d$documentType5, _d$documentType6;
67520
+ return (d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType6 = d.documentType) === null || _d$documentType6 === void 0 ? void 0 : _d$documentType6.includes("OWNERSHIPPROOF"));
67357
67521
  });
67358
67522
  const otherDoc = docs.find(d => {
67359
- var _d$documentType0;
67360
- return d === null || d === void 0 ? void 0 : (_d$documentType0 = d.documentType) === null || _d$documentType0 === void 0 ? void 0 : _d$documentType0.includes("OTHERDOCUMENTS");
67523
+ var _d$documentType7;
67524
+ return d === null || d === void 0 ? void 0 : (_d$documentType7 = d.documentType) === null || _d$documentType7 === void 0 ? void 0 : _d$documentType7.includes("OTHERDOCUMENTS");
67361
67525
  });
67362
67526
  data.documents = {
67363
67527
  documents: docs,
@@ -67367,11 +67531,11 @@ const OLDApplication = () => {
67367
67531
  };
67368
67532
  }
67369
67533
  const djbDoc = (data === null || data === void 0 ? void 0 : (_data$djbEmployee = data.djbEmployee) === null || _data$djbEmployee === void 0 ? void 0 : (_data$djbEmployee$doc = _data$djbEmployee.document) === null || _data$djbEmployee$doc === void 0 ? void 0 : _data$djbEmployee$doc.fileStoreId) || typeof (data === null || data === void 0 ? void 0 : (_data$djbEmployee2 = data.djbEmployee) === null || _data$djbEmployee2 === void 0 ? void 0 : _data$djbEmployee2.document) === "string" && (data === null || data === void 0 ? void 0 : (_data$djbEmployee3 = data.djbEmployee) === null || _data$djbEmployee3 === void 0 ? void 0 : _data$djbEmployee3.document.trim()) || (data === null || data === void 0 ? void 0 : (_data$djbEmployee4 = data.djbEmployee) === null || _data$djbEmployee4 === void 0 ? void 0 : _data$djbEmployee4.document) || (data === null || data === void 0 ? void 0 : (_data$DocumentsRequir2 = data.DocumentsRequired) === null || _data$DocumentsRequir2 === void 0 ? void 0 : (_data$DocumentsRequir3 = _data$DocumentsRequir2.documents) === null || _data$DocumentsRequir3 === void 0 ? void 0 : (_data$DocumentsRequir4 = _data$DocumentsRequir3.find(d => {
67370
- var _d$documentType1;
67371
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType1 = d.documentType) === null || _d$documentType1 === void 0 ? void 0 : _d$documentType1.includes("DJB_EMPLOYEE_ID"));
67534
+ var _d$documentType8;
67535
+ return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType8 = d.documentType) === null || _d$documentType8 === void 0 ? void 0 : _d$documentType8.includes("DJB_EMPLOYEE_ID"));
67372
67536
  })) === null || _data$DocumentsRequir4 === void 0 ? void 0 : _data$DocumentsRequir4.fileStoreId) || (data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : (_data$documents$docum = _data$documents.documents) === null || _data$documents$docum === void 0 ? void 0 : (_data$documents$docum2 = _data$documents$docum.find(d => {
67373
- var _d$documentType10;
67374
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType10 = d.documentType) === null || _d$documentType10 === void 0 ? void 0 : _d$documentType10.includes("DJB_EMPLOYEE_ID"));
67537
+ var _d$documentType9;
67538
+ return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType9 = d.documentType) === null || _d$documentType9 === void 0 ? void 0 : _d$documentType9.includes("DJB_EMPLOYEE_ID"));
67375
67539
  })) === null || _data$documents$docum2 === void 0 ? void 0 : _data$documents$docum2.fileStoreId);
67376
67540
  if (djbDoc) {
67377
67541
  if (!data.djbEmployee) data.djbEmployee = {};
@@ -67404,6 +67568,13 @@ const OLDApplication = () => {
67404
67568
  var _data$declarationData, _data$declarationData2, _data$declarationData3, _data$declarationData4, _data$declarationData5, _data$declarationData6, _data$declarationData7, _data$declarationData8, _data$declarationData9, _data$declarationData0, _data$declarationData1, _data$declarationData10, _data$declarationData11, _data$declarationData12, _data$declarationData13, _data$declarationData14, _data$declarationData15;
67405
67569
  const declarations = (_data$declarationData = data.declarationData) !== null && _data$declarationData !== void 0 && _data$declarationData.agree ? true : false;
67406
67570
  const sigFsId = ((_data$declarationData2 = data.declarationData) === null || _data$declarationData2 === void 0 ? void 0 : _data$declarationData2.signatureFileStoreId) || ((_data$declarationData3 = data.declarationData) === null || _data$declarationData3 === void 0 ? void 0 : (_data$declarationData4 = _data$declarationData3.signatureFile) === null || _data$declarationData4 === void 0 ? void 0 : _data$declarationData4.fileStoreId) || (typeof ((_data$declarationData5 = data.declarationData) === null || _data$declarationData5 === void 0 ? void 0 : _data$declarationData5.signatureFile) === "string" ? (_data$declarationData6 = data.declarationData) === null || _data$declarationData6 === void 0 ? void 0 : _data$declarationData6.signatureFile : null) || ((_data$declarationData7 = data.declarationData) === null || _data$declarationData7 === void 0 ? void 0 : _data$declarationData7.signature) || null;
67571
+ if (!sigFsId) {
67572
+ setShowToast({
67573
+ key: "error",
67574
+ message: t("ERR_SIGNATURE_MANDATORY") || "Signature is mandatory to submit application"
67575
+ });
67576
+ return Promise.resolve();
67577
+ }
67407
67578
  const sigFileName = ((_data$declarationData8 = data.declarationData) === null || _data$declarationData8 === void 0 ? void 0 : _data$declarationData8.signatureFileName) || ((_data$declarationData9 = data.declarationData) === null || _data$declarationData9 === void 0 ? void 0 : (_data$declarationData0 = _data$declarationData9.signatureFile) === null || _data$declarationData0 === void 0 ? void 0 : _data$declarationData0.name) || ((_data$declarationData1 = data.declarationData) === null || _data$declarationData1 === void 0 ? void 0 : (_data$declarationData10 = _data$declarationData1.signatureFile) === null || _data$declarationData10 === void 0 ? void 0 : _data$declarationData10.fileName) || "signature.png";
67408
67579
  data.declaration = {
67409
67580
  ...data.declarationData,
@@ -67441,9 +67612,9 @@ const OLDApplication = () => {
67441
67612
  };
67442
67613
  }
67443
67614
  if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.details)) {
67444
- var _propertyDetails$Prop6;
67615
+ var _propertyDetails$Prop8;
67445
67616
  data.cpt = {
67446
- details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop6 = propertyDetails.Properties) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6[0]
67617
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8[0]
67447
67618
  };
67448
67619
  }
67449
67620
  data.channel = ((_Digit$UserService$ge2 = Digit.UserService.getType()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.toUpperCase()) === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER";
@@ -67459,7 +67630,7 @@ const OLDApplication = () => {
67459
67630
  code: "NONPTPRESSURE"
67460
67631
  },
67461
67632
  categoryType: (connDetail === null || connDetail === void 0 ? void 0 : connDetail.categoryType) || {
67462
- code: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde = data.ConnectionHolderDetails) === null || _data$ConnectionHolde === void 0 ? void 0 : (_data$ConnectionHolde2 = _data$ConnectionHolde[0]) === null || _data$ConnectionHolde2 === void 0 ? void 0 : (_data$ConnectionHolde3 = _data$ConnectionHolde2.ownerType) === null || _data$ConnectionHolde3 === void 0 ? void 0 : _data$ConnectionHolde3.code) || (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde4 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde4 === void 0 ? void 0 : (_data$ConnectionHolde5 = _data$ConnectionHolde4[0]) === null || _data$ConnectionHolde5 === void 0 ? void 0 : _data$ConnectionHolde5.ownerType) || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties) === null || _propertyDetails$Prop7 === void 0 ? void 0 : (_propertyDetails$Prop8 = _propertyDetails$Prop7[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : (_propertyDetails$Prop9 = _propertyDetails$Prop8.owners) === null || _propertyDetails$Prop9 === void 0 ? void 0 : (_propertyDetails$Prop0 = _propertyDetails$Prop9[0]) === null || _propertyDetails$Prop0 === void 0 ? void 0 : _propertyDetails$Prop0.ownerType) || "NONE"
67633
+ code: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde = data.ConnectionHolderDetails) === null || _data$ConnectionHolde === void 0 ? void 0 : (_data$ConnectionHolde2 = _data$ConnectionHolde[0]) === null || _data$ConnectionHolde2 === void 0 ? void 0 : (_data$ConnectionHolde3 = _data$ConnectionHolde2.ownerType) === null || _data$ConnectionHolde3 === void 0 ? void 0 : _data$ConnectionHolde3.code) || (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde4 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde4 === void 0 ? void 0 : (_data$ConnectionHolde5 = _data$ConnectionHolde4[0]) === null || _data$ConnectionHolde5 === void 0 ? void 0 : _data$ConnectionHolde5.ownerType) || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop9 = propertyDetails.Properties) === null || _propertyDetails$Prop9 === void 0 ? void 0 : (_propertyDetails$Prop0 = _propertyDetails$Prop9[0]) === null || _propertyDetails$Prop0 === void 0 ? void 0 : (_propertyDetails$Prop1 = _propertyDetails$Prop0.owners) === null || _propertyDetails$Prop1 === void 0 ? void 0 : (_propertyDetails$Prop10 = _propertyDetails$Prop1[0]) === null || _propertyDetails$Prop10 === void 0 ? void 0 : _propertyDetails$Prop10.ownerType) || "NONE"
67463
67634
  },
67464
67635
  domesticType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.domesticType,
67465
67636
  departmentType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.departmentType,
@@ -67616,6 +67787,13 @@ const OLDApplication = () => {
67616
67787
  if (isEnableLoader || isLoading) {
67617
67788
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
67618
67789
  }
67790
+ const handleEdit = () => {
67791
+ setShowCheckPage(false);
67792
+ window.scrollTo({
67793
+ top: 0,
67794
+ behavior: "smooth"
67795
+ });
67796
+ };
67619
67797
  if (showCheckPage) {
67620
67798
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
67621
67799
  className: "employee-form-section-wrapper"
@@ -67626,7 +67804,7 @@ const OLDApplication = () => {
67626
67804
  }), /*#__PURE__*/React__default.createElement(CheckPage$4, {
67627
67805
  data: formDataRef.current || sessionFormData,
67628
67806
  onSubmit: finalData => processSubmission(finalData || formDataRef.current || sessionFormData),
67629
- onEdit: () => setShowCheckPage(false)
67807
+ onEdit: handleEdit
67630
67808
  })));
67631
67809
  }
67632
67810
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {