@djb25/digit-ui-module-ws 1.0.82 → 1.0.84

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.
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useMemo, useEffect, useRef, Fragment as Fragment$2, useReducer, useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Link, useHistory, useLocation, Switch, Route, useRouteMatch, Redirect, useParams } from 'react-router-dom';
4
- import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, VerticalTimeline, CollapsibleCardPage, LabelFieldPair, CardLabel, CardLabelError, CheckBox, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, DatePicker, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, WrapUnMaskComponent, MobileNumber, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, Header, FilterFormField, RemoveableTag as RemoveableTag$1, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, PDFSvg, GenericFileIcon, EditIcon, Label, CardSectionSubText, DownloadIcon, CardLabelDesc, FormComposer, MultiUploadWrapper, Close as Close$f, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector as ButtonSelector$1, CitizenHomeCard } from '@djb25/digit-ui-react-components';
4
+ import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, VerticalTimeline, CollapsibleCardPage, LabelFieldPair, CardLabel, CardLabelError, CheckBox, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, DatePicker, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, WrapUnMaskComponent, MobileNumber, RemoveIcon, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, Header, FilterFormField, RemoveableTag as RemoveableTag$1, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, PDFSvg, GenericFileIcon, EditIcon, Label, CardSectionSubText, DownloadIcon, CardLabelDesc, FormComposer, MultiUploadWrapper, Close as Close$f, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector as ButtonSelector$1, CitizenHomeCard } from '@djb25/digit-ui-react-components';
5
5
  import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
6
6
  import { read, utils as utils$1 } from 'xlsx';
7
7
  import { useQueryClient, useQuery } from 'react-query';
@@ -531,7 +531,7 @@ const getFiles = function (filesArray, tenant) {
531
531
  };
532
532
  const createPayloadOfWS = function (data) {
533
533
  try {
534
- var _Digit$UserService$ge, _userInfo$roles, _data$cpt, _data$cpt$details, _data$cpt$details$own, _data$applicationSele, _data$ConnectionDetai, _data$ConnectionDetai2, _ref, _data$ConnectionHolde, _data$documents, _data$djbEmployee, _data$governmentEmplo, _connectionHolder$gen, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2, _connectionHolder$own, _connectionHolder$rel, _data$propertyAddress, _data$applicant, _data$useDetails, _data$useDetails$gend, _data$contact, _data$applicant2, _data$applicant3, _data$applicant4, _data$contact2, _data$contact3, _data$applicationSele2, _data$applicationSele3, _data$contact4, _data$cpt3, _data$cpt4, _data$cpt4$details, _data$propertyAddress2, _data$propertyAddress3, _data$propertyAddress4, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ad, _data$propertyAddress5, _data$cpt6, _data$cpt6$details, _data$cpt6$details$ad, _data$propertyAddress6, _data$cpt7, _data$cpt7$details, _data$cpt7$details$ad, _data$propertyAddress7, _data$cpt8, _data$cpt8$details, _data$cpt8$details$ad, _data$propertyAddress8, _data$cpt9, _data$cpt9$details, _data$cpt9$details$ad, _data$propertyAddress9, _data$cpt0, _data$cpt0$details, _data$cpt0$details$ad, _data$propertyAddress0, _data$cpt1, _data$cpt1$details, _data$cpt1$details$ad, _data$propertyAddress1, _data$cpt10, _data$cpt10$details, _data$cpt10$details$a, _data$propertyAddress10, _data$cpt11, _data$cpt11$details, _data$cpt11$details$a, _data$cpt12, _data$cpt12$details, _data$cpt12$details$a, _data$propertyAddress11, _data$cpt13, _data$cpt13$details, _data$cpt13$details$a, _data$cpt13$details$a2, _data$propertyAddress12, _data$cpt14, _data$cpt14$details, _data$cpt14$details$a, _data$cpt14$details$a2, _data$propertyAddress13, _data$cpt15, _data$cpt15$details, _data$cpt15$details$a, _data$cpt15$details$a2, _data$cpt16, _data$cpt16$details, _data$roadCuttingDeta, _data$plumberDetails, _data$djbEmployee4, _data$djbEmployee4$do, _data$djbEmployee5, _data$zro, _data$propertyAddress14, _data$propertyAddress15, _data$cpt17, _data$cpt17$details, _data$cpt17$details$a, _data$cpt17$details$a2, _data$plumberDetails2, _data$plumberDetails3, _data$plumberDetails4, _data$plumberDetails5, _data$plumberDetails6, _data$applicationSele4, _data$applicationSele5, _data$applicationSele6, _data$applicationSele7, _connectionDetailsObj, _useDetailsObject$cat, _data$applicationSele8, _data$applicationSele9, _connectionHolder$own2, _useDetailsObject$noO, _data$applicationSele0, _data$applicationSele1, _data$applicationSele10, _data$applicationSele11, _data$applicationSele12, _data$applicationSele13, _data$applicationSele14, _data$applicationSele15, _data$applicationSele16, _data$applicationSele17, _data$applicationSele18, _data$applicationSele19, _data$applicationSele20, _data$applicationSele21, _data$applicationSele22, _data$applicationSele23, _data$applicationSele24, _data$contact5, _data$documents2, _data$documents3, _data$documents4, _data$cpt18, _Digit, _Digit$Customizations, _Digit$Customizations2, _Digit2, _Digit2$Customization, _Digit2$Customization2;
534
+ var _Digit$UserService$ge, _userInfo$roles, _data$cpt, _data$cpt$details, _data$cpt$details$own, _data$applicationSele, _data$ConnectionDetai, _data$ConnectionDetai2, _ref, _data$ConnectionHolde, _data$documents, _data$djbEmployee, _data$governmentEmplo, _connectionHolder$gen, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2, _connectionHolder$own, _connectionHolder$rel, _data$propertyAddress, _data$applicant, _data$useDetails, _data$useDetails$gend, _data$contact, _data$applicant2, _data$applicant3, _data$applicant4, _data$contact2, _data$contact3, _data$applicationSele2, _data$applicationSele3, _data$contact4, _data$cpt3, _data$cpt4, _data$cpt4$details, _data$propertyAddress2, _data$propertyAddress3, _data$propertyAddress4, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ad, _data$propertyAddress5, _data$cpt6, _data$cpt6$details, _data$cpt6$details$ad, _data$propertyAddress6, _data$cpt7, _data$cpt7$details, _data$cpt7$details$ad, _data$propertyAddress7, _data$cpt8, _data$cpt8$details, _data$cpt8$details$ad, _data$propertyAddress8, _data$cpt9, _data$cpt9$details, _data$cpt9$details$ad, _data$propertyAddress9, _data$cpt0, _data$cpt0$details, _data$cpt0$details$ad, _data$propertyAddress0, _data$cpt1, _data$cpt1$details, _data$cpt1$details$ad, _data$propertyAddress1, _data$cpt10, _data$cpt10$details, _data$cpt10$details$a, _data$propertyAddress10, _data$cpt11, _data$cpt11$details, _data$cpt11$details$a, _data$cpt12, _data$cpt12$details, _data$cpt12$details$a, _data$propertyAddress11, _data$cpt13, _data$cpt13$details, _data$cpt13$details$a, _data$cpt13$details$a2, _data$propertyAddress12, _data$cpt14, _data$cpt14$details, _data$cpt14$details$a, _data$cpt14$details$a2, _data$propertyAddress13, _data$cpt15, _data$cpt15$details, _data$cpt15$details$a, _data$cpt15$details$a2, _data$cpt16, _data$cpt16$details, _data$roadCuttingDeta, _data$plumberDetails, _data$disability, _data$djbEmployee4, _data$djbEmployee4$do, _data$djbEmployee5, _data$zro, _data$propertyAddress14, _data$propertyAddress15, _data$cpt17, _data$cpt17$details, _data$cpt17$details$a, _data$cpt17$details$a2, _data$plumberDetails2, _data$plumberDetails3, _data$plumberDetails4, _data$plumberDetails5, _data$plumberDetails6, _data$applicationSele4, _data$applicationSele5, _data$applicationSele6, _data$applicationSele7, _connectionDetailsObj, _useDetailsObject$cat, _data$applicationSele8, _data$applicationSele9, _connectionHolder$own2, _useDetailsObject$noO, _data$applicationSele0, _data$applicationSele1, _data$applicationSele10, _data$applicationSele11, _data$applicationSele12, _data$applicationSele13, _data$applicationSele14, _data$applicationSele15, _data$applicationSele16, _data$applicationSele17, _data$applicationSele18, _data$applicationSele19, _data$applicationSele20, _data$applicationSele21, _data$applicationSele22, _data$applicationSele23, _data$applicationSele24, _data$contact5, _data$documents2, _data$documents3, _data$documents4, _data$cpt18, _Digit, _Digit$Customizations, _Digit$Customizations2, _Digit2, _Digit2$Customization, _Digit2$Customization2;
535
535
  const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
536
536
  const isCitizen = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.type) === "CITIZEN" || (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$roles = userInfo.roles) === null || _userInfo$roles === void 0 ? void 0 : _userInfo$roles.some(role => role.code === "CITIZEN"));
537
537
  data === null || data === void 0 ? void 0 : (_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : (_data$cpt$details$own = _data$cpt$details.owners) === null || _data$cpt$details$own === void 0 ? void 0 : _data$cpt$details$own.forEach(owner => {
@@ -642,7 +642,8 @@ const createPayloadOfWS = function (data) {
642
642
  name: details === null || details === void 0 ? void 0 : details.plumberName,
643
643
  mobileNumber: details === null || details === void 0 ? void 0 : details.plumberMobileNo
644
644
  })),
645
- additionalDetails: _extends({}, useDetailsObject, data === null || data === void 0 ? void 0 : data.djbEmployee, {
645
+ additionalDetails: _extends({}, useDetailsObject, data === null || data === void 0 ? void 0 : data.djbEmployee, data === null || data === void 0 ? void 0 : data.disability, {
646
+ isDivyangjan: !!(data !== null && data !== void 0 && (_data$disability = data.disability) !== null && _data$disability !== void 0 && _data$disability.isDivyangjan),
646
647
  document: (data === null || data === void 0 ? void 0 : (_data$djbEmployee4 = data.djbEmployee) === null || _data$djbEmployee4 === void 0 ? void 0 : (_data$djbEmployee4$do = _data$djbEmployee4.document) === null || _data$djbEmployee4$do === void 0 ? void 0 : _data$djbEmployee4$do.fileStoreId) || (data === null || data === void 0 ? void 0 : (_data$djbEmployee5 = data.djbEmployee) === null || _data$djbEmployee5 === void 0 ? void 0 : _data$djbEmployee5.document) || undefined
647
648
  }, data === null || data === void 0 ? void 0 : data.bankDetails, data === null || data === void 0 ? void 0 : data.declarationData, data === null || data === void 0 ? void 0 : data.declaration, {
648
649
  zro: (data === null || data === void 0 ? void 0 : (_data$zro = data.zro) === null || _data$zro === void 0 ? void 0 : _data$zro.code) || (data === null || data === void 0 ? void 0 : data.zro),
@@ -18047,6 +18048,14 @@ const UploadFileDigiLocker = props => {
18047
18048
  };
18048
18049
 
18049
18050
  const DIGILOCKER_SUPPORTED_CODES = ["AADHAAR", "AADHAR", "DRIVING", "DRVLC", "PAN"];
18051
+ const ENVIRONMENT_FILE_STORE_IDS = {
18052
+ uat: "261542df-8dae-41e7-aa17-00cd288faf3b",
18053
+ dev: "0d394691-45ed-4036-97e8-8de8b0f166b1"
18054
+ };
18055
+ const getEnvironmentFileStoreId = () => {
18056
+ const hostname = window.location.hostname.toLowerCase();
18057
+ return hostname.includes("uat") ? ENVIRONMENT_FILE_STORE_IDS.uat : ENVIRONMENT_FILE_STORE_IDS.dev;
18058
+ };
18050
18059
  const isDigiLockerEligible = function (code) {
18051
18060
  if (code === void 0) {
18052
18061
  code = "";
@@ -18054,8 +18063,26 @@ const isDigiLockerEligible = function (code) {
18054
18063
  const upper = code.toUpperCase();
18055
18064
  return DIGILOCKER_SUPPORTED_CODES.some(keyword => upper.includes(keyword));
18056
18065
  };
18066
+ const isOtherDocument = function (code) {
18067
+ if (code === void 0) {
18068
+ code = "";
18069
+ }
18070
+ return code.toUpperCase().includes("OTHER");
18071
+ };
18072
+ const removeDuplicateOtherDocuments = function (documentList) {
18073
+ if (documentList === void 0) {
18074
+ documentList = [];
18075
+ }
18076
+ const documentTypes = new Set();
18077
+ return documentList.filter(document => {
18078
+ if (!isOtherDocument(document === null || document === void 0 ? void 0 : document.documentType)) return true;
18079
+ if (documentTypes.has(document.documentType)) return false;
18080
+ documentTypes.add(document.documentType);
18081
+ return true;
18082
+ });
18083
+ };
18057
18084
  const WSDocumentsEmployee = _ref => {
18058
- var _formData$documents, _formData$DocumentsRe, _applicationDetailsDa, _applicationDetailsDa2, _wsDocs$wsDocsData3;
18085
+ var _applicationDetailsDa, _applicationDetailsDa2, _wsDocs$wsDocsData3;
18059
18086
  let t = _ref.t,
18060
18087
  config = _ref.config,
18061
18088
  onSelect = _ref.onSelect,
@@ -18065,7 +18092,10 @@ const WSDocumentsEmployee = _ref => {
18065
18092
  clearFormErrors = _ref.clearErrors,
18066
18093
  formState = _ref.formState;
18067
18094
  const tenantId = Digit.ULBService.getCurrentTenantId();
18068
- const _useState = useState(userType === "citizen" ? (formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : _formData$documents.documents) || (formData === null || formData === void 0 ? void 0 : formData.documents) || [] : (formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe = formData.DocumentsRequired) === null || _formData$DocumentsRe === void 0 ? void 0 : _formData$DocumentsRe.documents) || []),
18095
+ const _useState = useState(() => {
18096
+ var _formData$documents, _formData$DocumentsRe;
18097
+ return removeDuplicateOtherDocuments(userType === "citizen" ? (formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : _formData$documents.documents) || (formData === null || formData === void 0 ? void 0 : formData.documents) || [] : (formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe = formData.DocumentsRequired) === null || _formData$DocumentsRe === void 0 ? void 0 : _formData$DocumentsRe.documents) || []);
18098
+ }),
18069
18099
  documents = _useState[0],
18070
18100
  setDocuments = _useState[1];
18071
18101
  const _useState2 = useState(true),
@@ -18092,10 +18122,21 @@ const WSDocumentsEmployee = _ref => {
18092
18122
  onSelect(config.key, documentStep);
18093
18123
  } else {
18094
18124
  onSelect(config.key, {
18095
- documents
18125
+ documents: removeDuplicateOtherDocuments(documents)
18096
18126
  });
18097
18127
  }
18098
18128
  };
18129
+ const downloadDocument = function () {
18130
+ try {
18131
+ return Promise.resolve(Digit.UploadServices.DownloadFile(getEnvironmentFileStoreId(), "dl", "NOC for New Delhi Jal Board Connection.pdf")).then(function (downloaded) {
18132
+ if (!downloaded) {
18133
+ setError(t("CS_FILE_DOWNLOAD_ERROR") || "PDF download failed");
18134
+ }
18135
+ });
18136
+ } catch (e) {
18137
+ return Promise.reject(e);
18138
+ }
18139
+ };
18099
18140
  useEffect(() => {
18100
18141
  var _wsDocs$wsDocsData;
18101
18142
  let count = 0;
@@ -18152,7 +18193,8 @@ const WSDocumentsEmployee = _ref => {
18152
18193
  setFormError: setFormError,
18153
18194
  clearFormErrors: clearFormErrors,
18154
18195
  config: config,
18155
- formState: formState
18196
+ formState: formState,
18197
+ isOtherDocument: isOtherDocument(document === null || document === void 0 ? void 0 : document.code)
18156
18198
  });
18157
18199
  }));
18158
18200
  if (userType === "citizen") {
@@ -18173,14 +18215,32 @@ const WSDocumentsEmployee = _ref => {
18173
18215
  return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18174
18216
  title: t("WS_DOCUMENTS"),
18175
18217
  defaultOpen: true
18176
- }, innerContent, error && /*#__PURE__*/React.createElement(Toast, {
18218
+ }, /*#__PURE__*/React.createElement("button", {
18219
+ type: "button",
18220
+ onClick: event => {
18221
+ event.stopPropagation();
18222
+ downloadDocument();
18223
+ },
18224
+ style: {
18225
+ cursor: "pointer",
18226
+ color: "#fff",
18227
+ fontWeight: "bold",
18228
+ padding: "6px 14px",
18229
+ border: "1px solid #00497e",
18230
+ borderRadius: "4px",
18231
+ backgroundColor: "#00497e",
18232
+ marginLeft: "auto",
18233
+ marginRight: "32px",
18234
+ whiteSpace: "nowrap"
18235
+ }
18236
+ }, t("WS_DOWNLOAD_DOCUMENT")), innerContent, error && /*#__PURE__*/React.createElement(Toast, {
18177
18237
  label: error,
18178
18238
  onClose: () => setError(null),
18179
18239
  error: true
18180
18240
  }));
18181
18241
  };
18182
18242
  function SelectDocument(_ref2) {
18183
- var _formData$ConnectionD, _doc$i18nKey, _selectedDocument$cod2, _selectedDocument$cod3, _selectedDocument$cod4, _selectedDocument$cod5, _selectedDocument$cod6, _selectedDocument$cod7, _selectedDocument$cod8, _selectedDocument$cod9, _selectedDocument$cod0, _selectedDocument$cod1, _selectedDocument$cod10, _selectedDocument$cod11, _selectedDocument$cod12, _selectedDocument$cod13, _selectedDocument$cod14, _selectedDocument$cod15, _doc$i18nKey2, _doc$i18nKey3;
18243
+ var _formData$ConnectionD, _doc$i18nKey, _selectedDocument$cod2, _selectedDocument$cod3, _selectedDocument$cod4, _selectedDocument$cod5, _selectedDocument$cod6, _selectedDocument$cod7, _selectedDocument$cod8, _selectedDocument$cod9, _selectedDocument$cod0, _selectedDocument$cod1, _selectedDocument$cod10, _selectedDocument$cod11, _selectedDocument$cod12, _selectedDocument$cod13, _selectedDocument$cod14, _selectedDocument$cod15, _doc$i18nKey2;
18184
18244
  let t = _ref2.t,
18185
18245
  doc = _ref2.document,
18186
18246
  setDocuments = _ref2.setDocuments,
@@ -18191,11 +18251,17 @@ function SelectDocument(_ref2) {
18191
18251
  clearFormErrors = _ref2.clearFormErrors,
18192
18252
  config = _ref2.config,
18193
18253
  formState = _ref2.formState,
18194
- id = _ref2.id;
18254
+ id = _ref2.id,
18255
+ _ref2$isOtherDocument = _ref2.isOtherDocument,
18256
+ isOther = _ref2$isOtherDocument === void 0 ? false : _ref2$isOtherDocument;
18195
18257
  const fileRef = useRef();
18196
- const filteredDocument = documents === null || documents === void 0 ? void 0 : documents.filter(item => {
18258
+ const otherUploadedDocuments = isOther ? (documents === null || documents === void 0 ? void 0 : documents.filter(item => {
18197
18259
  var _item$documentType;
18198
18260
  return item === null || item === void 0 ? void 0 : (_item$documentType = item.documentType) === null || _item$documentType === void 0 ? void 0 : _item$documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code);
18261
+ })) || [] : [];
18262
+ const filteredDocument = isOther ? null : documents === null || documents === void 0 ? void 0 : documents.filter(item => {
18263
+ var _item$documentType2;
18264
+ return item === null || item === void 0 ? void 0 : (_item$documentType2 = item.documentType) === null || _item$documentType2 === void 0 ? void 0 : _item$documentType2.includes(doc === null || doc === void 0 ? void 0 : doc.code);
18199
18265
  })[0];
18200
18266
  const _useState4 = useState(() => {
18201
18267
  var _filteredDocument$doc, _doc$dropdownData2;
@@ -18214,10 +18280,10 @@ function SelectDocument(_ref2) {
18214
18280
  const _useState5 = useState(null),
18215
18281
  file = _useState5[0],
18216
18282
  setFile = _useState5[1];
18217
- const _useState6 = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null),
18283
+ const _useState6 = useState(() => isOther ? null : (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null),
18218
18284
  uploadedFile = _useState6[0],
18219
18285
  setUploadedFile = _useState6[1];
18220
- const _useState7 = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentUid) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentNumber) || ""),
18286
+ const _useState7 = useState(() => isOther ? "" : (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentUid) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentNumber) || ""),
18221
18287
  documentUid = _useState7[0],
18222
18288
  setDocumentUid = _useState7[1];
18223
18289
  const _useState8 = useState(false),
@@ -18276,12 +18342,23 @@ function SelectDocument(_ref2) {
18276
18342
  setShowCamera(false);
18277
18343
  };
18278
18344
  const handleSelectDocument = value => setSelectedDocument(value);
18279
- const viewDocument = function () {
18345
+ const removeUploadedDocument = fileStoreId => {
18346
+ setDocuments(previousDocuments => previousDocuments.filter(item => (item === null || item === void 0 ? void 0 : item.fileStoreId) !== fileStoreId));
18347
+ if (fileStoreId === uploadedFile) {
18348
+ setUploadedFile(null);
18349
+ setFile(null);
18350
+ setDocumentUid("");
18351
+ }
18352
+ };
18353
+ const viewDocument = function (fileStoreId) {
18354
+ if (fileStoreId === void 0) {
18355
+ fileStoreId = uploadedFile;
18356
+ }
18280
18357
  try {
18281
18358
  const _temp2 = function () {
18282
- if (uploadedFile) {
18359
+ if (fileStoreId) {
18283
18360
  const _temp = _catch(function () {
18284
- return Promise.resolve(Digit.UploadServices.FileFetchbyid(uploadedFile, Digit.ULBService.getStateId())).then(function (res) {
18361
+ return Promise.resolve(Digit.UploadServices.FileFetchbyid(fileStoreId, Digit.ULBService.getStateId())).then(function (res) {
18285
18362
  if (res !== null && res !== void 0 && res.data) {
18286
18363
  var _res$headers, _res$headers2;
18287
18364
  const contentType = ((_res$headers = res.headers) === null || _res$headers === void 0 ? void 0 : _res$headers["content-type"]) || ((_res$headers2 = res.headers) === null || _res$headers2 === void 0 ? void 0 : _res$headers2["Content-Type"]) || "";
@@ -18362,7 +18439,7 @@ function SelectDocument(_ref2) {
18362
18439
  useEffect(() => {
18363
18440
  if (selectedDocument !== null && selectedDocument !== void 0 && selectedDocument.code) {
18364
18441
  setDocuments(prev => {
18365
- const filteredDocumentsByDocumentType = prev === null || prev === void 0 ? void 0 : prev.filter(item => (item === null || item === void 0 ? void 0 : item.documentType) !== (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code));
18442
+ const filteredDocumentsByDocumentType = isOther ? prev === null || prev === void 0 ? void 0 : prev.filter(item => (item === null || item === void 0 ? void 0 : item.fileStoreId) !== (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId)) : prev === null || prev === void 0 ? void 0 : prev.filter(item => (item === null || item === void 0 ? void 0 : item.documentType) !== (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code));
18366
18443
  if ((uploadedFile === null || uploadedFile === void 0 ? void 0 : uploadedFile.length) === 0 || uploadedFile === null) {
18367
18444
  return filteredDocumentsByDocumentType;
18368
18445
  }
@@ -18371,6 +18448,7 @@ function SelectDocument(_ref2) {
18371
18448
  documentType: selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code,
18372
18449
  fileStoreId: uploadedFile,
18373
18450
  fileName: (file === null || file === void 0 ? void 0 : file.name) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileName) || "",
18451
+ documentName: (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.i18nKey) || (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code) || "",
18374
18452
  documentUid: documentUid,
18375
18453
  documentNumber: documentUid,
18376
18454
  i18nKey: selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code,
@@ -18400,48 +18478,60 @@ function SelectDocument(_ref2) {
18400
18478
  (function () {
18401
18479
  try {
18402
18480
  setError(null);
18403
- const _temp6 = function () {
18481
+ const _temp7 = function () {
18404
18482
  if (file) {
18405
- const _temp5 = function () {
18406
- if (file.size >= 5242880) {
18407
- setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
18483
+ const isDuplicateDocument = isOther && documents.some(item => (item === null || item === void 0 ? void 0 : item.documentType) === (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code));
18484
+ const _temp6 = function () {
18485
+ if (isDuplicateDocument) {
18486
+ const documentNameKey = (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.i18nKey) || (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code) || "This";
18487
+ const translatedDocumentName = t(documentNameKey);
18488
+ const documentName = translatedDocumentName === documentNameKey ? documentNameKey.replaceAll("_", " ") : translatedDocumentName;
18489
+ setError("Document \"" + documentName + "\" has already been uploaded.");
18490
+ setFile(null);
18408
18491
  } else {
18409
- const _temp4 = function () {
18410
- if ((doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" && !file.type.match(/image\/(jpeg|png)/i) && !file.name.match(/\.(jpg|jpeg|png)$/i)) {
18411
- setError(t("WS_ONLY_JPG_PNG_ALLOWED") || "Only JPG and PNG files are allowed for Applicant Photo");
18412
- setFile(null);
18492
+ const _temp5 = function () {
18493
+ if (file.size >= 5242880) {
18494
+ setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
18413
18495
  } else {
18414
- const _temp3 = _finallyRethrows(function () {
18415
- return _catch(function () {
18416
- setUploadedFile(null);
18417
- setIsUploading(true);
18418
- return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId())).then(function (response) {
18419
- var _response$data, _response$data$files;
18420
- if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
18421
- var _response$data2, _response$data2$files;
18422
- setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
18423
- } else {
18496
+ const _temp4 = function () {
18497
+ if ((doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" && !file.type.match(/image\/(jpeg|png)/i) && !file.name.match(/\.(jpg|jpeg|png)$/i)) {
18498
+ setError(t("WS_ONLY_JPG_PNG_ALLOWED") || "Only JPG and PNG files are allowed for Applicant Photo");
18499
+ setFile(null);
18500
+ } else {
18501
+ const _temp3 = _finallyRethrows(function () {
18502
+ return _catch(function () {
18503
+ setUploadedFile(null);
18504
+ setIsUploading(true);
18505
+ return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId())).then(function (response) {
18506
+ var _response$data, _response$data$files;
18507
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
18508
+ var _response$data2, _response$data2$files;
18509
+ setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
18510
+ } else {
18511
+ setError(t("CS_FILE_UPLOAD_ERROR"));
18512
+ }
18513
+ });
18514
+ }, function () {
18424
18515
  setError(t("CS_FILE_UPLOAD_ERROR"));
18425
- }
18516
+ });
18517
+ }, function (_wasThrown, _result) {
18518
+ setIsUploading(false);
18519
+ if (_wasThrown) throw _result;
18520
+ return _result;
18426
18521
  });
18427
- }, function () {
18428
- setError(t("CS_FILE_UPLOAD_ERROR"));
18429
- });
18430
- }, function (_wasThrown, _result) {
18431
- setIsUploading(false);
18432
- if (_wasThrown) throw _result;
18433
- return _result;
18434
- });
18435
- if (_temp3 && _temp3.then) return _temp3.then(function () {});
18522
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
18523
+ }
18524
+ }();
18525
+ if (_temp4 && _temp4.then) return _temp4.then(function () {});
18436
18526
  }
18437
18527
  }();
18438
- if (_temp4 && _temp4.then) return _temp4.then(function () {});
18528
+ if (_temp5 && _temp5.then) return _temp5.then(function () {});
18439
18529
  }
18440
18530
  }();
18441
- if (_temp5 && _temp5.then) return _temp5.then(function () {});
18531
+ if (_temp6 && _temp6.then) return _temp6.then(function () {});
18442
18532
  }
18443
18533
  }();
18444
- return _temp6 && _temp6.then ? _temp6.then(function () {}) : void 0;
18534
+ return _temp7 && _temp7.then ? _temp7.then(function () {}) : void 0;
18445
18535
  } catch (e) {
18446
18536
  Promise.reject(e);
18447
18537
  }
@@ -18567,11 +18657,35 @@ function SelectDocument(_ref2) {
18567
18657
  gap: "8px",
18568
18658
  gridColumn: "span 1"
18569
18659
  }
18660
+ }, /*#__PURE__*/React.createElement("div", {
18661
+ style: {
18662
+ display: "flex",
18663
+ alignItems: "center",
18664
+ justifyContent: "space-between"
18665
+ }
18570
18666
  }, /*#__PURE__*/React.createElement(CardLabel, {
18571
18667
  style: {
18572
18668
  margin: 0
18573
18669
  }
18574
- }, doc !== null && doc !== void 0 && doc.required ? t((doc === null || doc === void 0 ? void 0 : (_doc$i18nKey2 = doc.i18nKey) === null || _doc$i18nKey2 === void 0 ? void 0 : _doc$i18nKey2.replaceAll(".", "_")) + "_UPLOAD_DOCUMENT") + "*" : "" + t((doc === null || doc === void 0 ? void 0 : (_doc$i18nKey3 = doc.i18nKey) === null || _doc$i18nKey3 === void 0 ? void 0 : _doc$i18nKey3.replaceAll(".", "_")) + "_UPLOAD_DOCUMENT")), /*#__PURE__*/React.createElement("div", {
18670
+ }, t((doc === null || doc === void 0 ? void 0 : (_doc$i18nKey2 = doc.i18nKey) === null || _doc$i18nKey2 === void 0 ? void 0 : _doc$i18nKey2.replaceAll(".", "_")) + "_UPLOAD_DOCUMENT"), doc !== null && doc !== void 0 && doc.required ? "*" : ""), isOther && /*#__PURE__*/React.createElement("button", {
18671
+ type: "button",
18672
+ onClick: () => {
18673
+ setUploadedFile(null);
18674
+ setFile(null);
18675
+ setSelectedDocument(doc !== null && doc !== void 0 && doc.hasDropdown ? {} : doc);
18676
+ setDocumentUid("");
18677
+ setDocNumberError(null);
18678
+ },
18679
+ style: {
18680
+ border: "1px solid #00497e",
18681
+ background: "#fff",
18682
+ color: "#00497e",
18683
+ borderRadius: "4px",
18684
+ padding: "4px 10px",
18685
+ cursor: "pointer",
18686
+ fontWeight: "bold"
18687
+ }
18688
+ }, "+ Add")), /*#__PURE__*/React.createElement("div", {
18575
18689
  className: "field",
18576
18690
  style: {
18577
18691
  display: "flex",
@@ -18642,7 +18756,47 @@ function SelectDocument(_ref2) {
18642
18756
  setIsDocumentUidLocked(false);
18643
18757
  setDocumentUid("");
18644
18758
  }
18645
- })))), /*#__PURE__*/React.createElement("div", {
18759
+ }))), (isOther ? otherUploadedDocuments : uploadedFile ? [{
18760
+ fileStoreId: uploadedFile,
18761
+ fileName: (file === null || file === void 0 ? void 0 : file.name) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileName),
18762
+ documentNumber: documentUid
18763
+ }] : []).map((uploadedDocument, index) => /*#__PURE__*/React.createElement("div", {
18764
+ key: uploadedDocument.fileStoreId || index,
18765
+ style: {
18766
+ display: "flex",
18767
+ alignItems: "center",
18768
+ gap: "12px",
18769
+ marginTop: "4px",
18770
+ color: "#00497e"
18771
+ }
18772
+ }, /*#__PURE__*/React.createElement("span", {
18773
+ style: {
18774
+ fontWeight: "bold"
18775
+ }
18776
+ }, uploadedDocument.documentName || uploadedDocument.i18nKey || uploadedDocument.documentType ? t(uploadedDocument.documentName || uploadedDocument.i18nKey || uploadedDocument.documentType) : t("CS_COMMON_DOCUMENT"), " - ", uploadedDocument.fileName || t("CS_COMMON_DOCUMENT")), uploadedDocument.documentNumber && /*#__PURE__*/React.createElement("span", null, uploadedDocument.documentNumber), /*#__PURE__*/React.createElement("button", {
18777
+ type: "button",
18778
+ onClick: () => viewDocument(uploadedDocument.fileStoreId),
18779
+ title: t("WS_VIEW_DOCUMENT") || "View Document",
18780
+ style: {
18781
+ border: "none",
18782
+ background: "transparent",
18783
+ color: "#00497e",
18784
+ cursor: "pointer",
18785
+ padding: 0
18786
+ }
18787
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)), /*#__PURE__*/React.createElement("button", {
18788
+ type: "button",
18789
+ onClick: () => removeUploadedDocument(uploadedDocument.fileStoreId),
18790
+ title: "Remove Document",
18791
+ style: {
18792
+ border: "none",
18793
+ background: "transparent",
18794
+ color: "#d32f2f",
18795
+ cursor: "pointer",
18796
+ padding: 0,
18797
+ fontSize: "18px"
18798
+ }
18799
+ }, /*#__PURE__*/React.createElement(RemoveIcon, null))))), /*#__PURE__*/React.createElement("div", {
18646
18800
  style: {
18647
18801
  display: "flex",
18648
18802
  flexDirection: "column",
@@ -18695,21 +18849,7 @@ function SelectDocument(_ref2) {
18695
18849
  fontWeight: "bold",
18696
18850
  fontSize: "14px"
18697
18851
  }
18698
- }, "\u2714 Uploaded")), uploadedFile && /*#__PURE__*/React.createElement("div", {
18699
- onClick: viewDocument,
18700
- style: {
18701
- display: "flex",
18702
- alignItems: "center",
18703
- gap: "8px",
18704
- cursor: "pointer",
18705
- color: "#00497e",
18706
- fontWeight: "bold",
18707
- padding: "8px 16px",
18708
- border: "1px solid #00497e",
18709
- borderRadius: "4px",
18710
- backgroundColor: "#fff"
18711
- }
18712
- }, /*#__PURE__*/React.createElement(ViewsIcon, null), /*#__PURE__*/React.createElement("span", null, t("WS_VIEW_DOCUMENT") || "View Document")))), showCamera && /*#__PURE__*/React.createElement(CameraCaptureModal, {
18852
+ }, "\u2714 Uploaded")))), showCamera && /*#__PURE__*/React.createElement(CameraCaptureModal, {
18713
18853
  onCapture: handleCapture,
18714
18854
  onClose: () => setShowCamera(false),
18715
18855
  t: t
@@ -18785,7 +18925,7 @@ const CameraCaptureModal = _ref4 => {
18785
18925
  useEffect(() => {
18786
18926
  const startCamera = function () {
18787
18927
  try {
18788
- const _temp7 = _catch(function () {
18928
+ const _temp8 = _catch(function () {
18789
18929
  return Promise.resolve(navigator.mediaDevices.getUserMedia({
18790
18930
  video: true
18791
18931
  })).then(function (mediaStream) {
@@ -18798,7 +18938,7 @@ const CameraCaptureModal = _ref4 => {
18798
18938
  setError(t("WS_CAMERA_ACCESS_ERROR") || "Camera Access Error");
18799
18939
  console.error("Error accessing camera: ", err);
18800
18940
  });
18801
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
18941
+ return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
18802
18942
  } catch (e) {
18803
18943
  return Promise.reject(e);
18804
18944
  }
@@ -23546,6 +23686,57 @@ const WSDjbEmployee = _ref => {
23546
23686
  return /*#__PURE__*/React.createElement(React.Fragment, null, FormContent);
23547
23687
  };
23548
23688
 
23689
+ const WSDivyangjan = _ref => {
23690
+ var _formData$disability, _formData$additionalD;
23691
+ let config = _ref.config,
23692
+ onSelect = _ref.onSelect,
23693
+ userType = _ref.userType,
23694
+ formData = _ref.formData;
23695
+ const _useTranslation = useTranslation(),
23696
+ t = _useTranslation.t;
23697
+ const _useForm = useForm({
23698
+ defaultValues: {
23699
+ isDivyangjan: !!(formData !== null && formData !== void 0 && (_formData$disability = formData.disability) !== null && _formData$disability !== void 0 && _formData$disability.isDivyangjan || formData !== null && formData !== void 0 && (_formData$additionalD = formData.additionalDetails) !== null && _formData$additionalD !== void 0 && _formData$additionalD.isDivyangjan)
23700
+ }
23701
+ }),
23702
+ control = _useForm.control,
23703
+ watch = _useForm.watch;
23704
+ const formValue = watch();
23705
+ const goNext = () => onSelect(config.key, {
23706
+ isDivyangjan: !!formValue.isDivyangjan
23707
+ });
23708
+ const onSkip = () => onSelect();
23709
+ useEffect(() => {
23710
+ if (userType === "employee") {
23711
+ onSelect(config.key, {
23712
+ isDivyangjan: !!formValue.isDivyangjan
23713
+ });
23714
+ }
23715
+ }, [config.key, formValue.isDivyangjan, onSelect, userType]);
23716
+ const content = /*#__PURE__*/React.createElement(CollapsibleCardPage, {
23717
+ title: "Divyangjan/Person with Disability?",
23718
+ defaultOpen: true
23719
+ }, /*#__PURE__*/React.createElement("div", {
23720
+ style: {
23721
+ width: "max-content"
23722
+ }
23723
+ }, /*#__PURE__*/React.createElement(Controller, {
23724
+ control: control,
23725
+ name: "isDivyangjan",
23726
+ render: props => /*#__PURE__*/React.createElement(CheckBox, {
23727
+ label: "Divyangjan/Person with Disability?",
23728
+ checked: !!props.value,
23729
+ onChange: event => props.onChange(event.target.checked)
23730
+ })
23731
+ })));
23732
+ return userType === "citizen" ? /*#__PURE__*/React.createElement(FormStep, {
23733
+ t: t,
23734
+ config: config,
23735
+ onSelect: goNext,
23736
+ onSkip: onSkip
23737
+ }, content) : content;
23738
+ };
23739
+
23549
23740
  const _excluded$1 = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
23550
23741
  const NUMBER_PATTERN$1 = /^\d+$/;
23551
23742
  const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
@@ -27621,12 +27812,25 @@ const newConfig = [{
27621
27812
  cardText: "",
27622
27813
  submitBarLabel: "CS_COMMON_NEXT"
27623
27814
  }
27815
+ }, {
27816
+ route: "disability-details",
27817
+ component: "WSDivyangjan",
27818
+ key: "disability",
27819
+ nextStep: "document-details",
27820
+ WATER: "document-details",
27821
+ hideInEmployee: true,
27822
+ texts: {
27823
+ headerCaption: "WS_COMMON_CONNECTION_DETAIL",
27824
+ header: "Divyangjan/Person with Disability?",
27825
+ cardText: "",
27826
+ submitBarLabel: "CS_COMMON_NEXT"
27827
+ }
27624
27828
  }, {
27625
27829
  route: "djb-employee-details",
27626
27830
  component: "WSDjbEmployee",
27627
27831
  key: "djbEmployee",
27628
- nextStep: "document-details",
27629
- WATER: "document-details",
27832
+ nextStep: "disability-details",
27833
+ WATER: "disability-details",
27630
27834
  hideInEmployee: true,
27631
27835
  texts: {
27632
27836
  headerCaption: "WS_COMMON_CONNECTION_DETAIL",
@@ -33632,7 +33836,7 @@ const getConnectionDetailsPDF = function (application, property, tenantInfo, t)
33632
33836
  };
33633
33837
 
33634
33838
  const ConnectionDetails$5 = () => {
33635
- var _Digit$SessionStorage, _user$info, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection, _data$WaterConnection2, _Object$keys, _connectionData$Water, _connectionData$Sewer, _data$WaterConnection3, _data$WaterConnection4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$WaterConnection8, _data$WaterConnection9, _data$WaterConnection0, _data$SewerageConnect3, _data$SewerageConnect4, _data$SewerageConnect5, _data$SewerageConnect6, _state, _state$applicationNo, _state2, _state3, _state4, _state4$applicationTy, _state5, _state6, _state7, _state8, _state8$applicationTy, _state9, _state0, _state1, _state10, _state10$applicationT, _state11, _state12, _state13, _state14, _state15, _state15$applicationT, _state16, _state16$waterSource, _state16$waterSource$, _state17, _state18, _state18$waterSource, _state18$waterSource$, _state19, _state20, _state21, _state22, _state22$additionalDe, _state23, _state23$applicationT, _state24, _state24$additionalDe, _state24$additionalDe2, _state25, _state25$additionalDe, _state25$additionalDe2, _state26, _state26$additionalDe, _state27, _state27$additionalDe, _state28, _state28$additionalDe, _state28$additionalDe2, _state29, _state29$additionalDe, _state30, _state31, _state32, _state33, _state33$property, _state33$property$own, _PTData$Properties2, _PTData$Properties2$, _PTData$Properties3, _PTData$Properties3$, _PTData$Properties3$$, _PTData$Properties3$$2, _PTData$Properties4, _PTData$Properties4$, _user$info2, _user$info2$userName, _user$info3, _user$info4, _state34, _state34$additionalDe, _state34$additionalDe2, _state35, _state35$additionalDe, _state35$additionalDe2, _state36, _state36$additionalDe, _state37, _state37$additionalDe, _state38, _state38$additionalDe, _state39, _state39$additionalDe, _state40, _state40$additionalDe, _state41, _state42, _state43, _state44, _state44$connectionHo, _state44$connectionHo2, _data$WaterConnection16, _data$WaterConnection17, _data$WaterConnection18, _data$WaterConnection19, _data$SewerageConnect0, _data$SewerageConnect1, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection20, _data$WaterConnection21, _data$WaterConnection22, _data$WaterConnection23, _data$SewerageConnect12, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$WaterConnection24, _data$WaterConnection25, _data$WaterConnection26, _data$WaterConnection27, _data$SewerageConnect16, _data$SewerageConnect17, _data$SewerageConnect18, _data$SewerageConnect19, _data$WaterConnection28, _data$WaterConnection29, _data$WaterConnection30, _data$WaterConnection31, _data$SewerageConnect20, _data$SewerageConnect21, _data$SewerageConnect22, _data$SewerageConnect23, _data$WaterConnection32, _data$WaterConnection33, _data$WaterConnection34, _data$WaterConnection35, _data$SewerageConnect24, _data$SewerageConnect25, _data$SewerageConnect26, _data$SewerageConnect27, _data$WaterConnection36, _data$WaterConnection37, _data$WaterConnection38, _data$WaterConnection39, _data$SewerageConnect28, _data$SewerageConnect29, _data$SewerageConnect30, _data$SewerageConnect31, _data$WaterConnection40, _data$WaterConnection41, _data$WaterConnection42, _data$WaterConnection43, _data$SewerageConnect32, _data$SewerageConnect33, _data$SewerageConnect34, _data$SewerageConnect35, _data$WaterConnection44, _data$WaterConnection45, _data$WaterConnection46, _data$WaterConnection47, _data$SewerageConnect36, _data$SewerageConnect37, _data$SewerageConnect38, _data$SewerageConnect39, _data$WaterConnection48, _data$WaterConnection49, _data$WaterConnection50, _data$WaterConnection51, _data$SewerageConnect40, _data$SewerageConnect41, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection52, _data$WaterConnection53, _data$WaterConnection54, _data$WaterConnection55, _data$SewerageConnect44, _data$SewerageConnect45, _data$SewerageConnect46, _data$SewerageConnect47, _state45, _state45$additionalDe, _state46, _state46$additionalDe, _state47, _state47$additionalDe, _state48, _state48$additionalDe, _state49, _state49$additionalDe, _state50, _state51, _state54, _state55, _state56, _state57, _state58, _state59, _paymentDetails$data17, _paymentDetails$data18;
33839
+ var _Digit$SessionStorage, _user$info, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection, _data$WaterConnection2, _Object$keys, _connectionData$Water, _connectionData$Water2, _connectionData$Sewer, _connectionData$Sewer2, _data$WaterConnection3, _data$WaterConnection4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$WaterConnection8, _data$WaterConnection9, _data$WaterConnection0, _data$SewerageConnect3, _data$SewerageConnect4, _data$SewerageConnect5, _data$SewerageConnect6, _state, _state$applicationNo, _state2, _state3, _state4, _state4$applicationTy, _state5, _state6, _state7, _state8, _state8$applicationTy, _state9, _state0, _state1, _state10, _state10$applicationT, _state11, _state12, _state13, _state14, _state15, _state15$applicationT, _state16, _state16$waterSource, _state16$waterSource$, _state17, _state18, _state18$waterSource, _state18$waterSource$, _state19, _state20, _state21, _state22, _state22$additionalDe, _state23, _state23$applicationT, _state24, _state24$additionalDe, _state24$additionalDe2, _state25, _state25$additionalDe, _state25$additionalDe2, _state26, _state26$additionalDe, _state27, _state27$additionalDe, _state28, _state28$additionalDe, _state28$additionalDe2, _state29, _state29$additionalDe, _state30, _state31, _state32, _state33, _state33$property, _state33$property$own, _PTData$Properties2, _PTData$Properties2$, _PTData$Properties3, _PTData$Properties3$, _PTData$Properties3$$, _PTData$Properties3$$2, _PTData$Properties4, _PTData$Properties4$, _user$info2, _user$info2$userName, _user$info3, _user$info4, _state34, _state34$additionalDe, _state34$additionalDe2, _state35, _state35$additionalDe, _state35$additionalDe2, _state36, _state36$additionalDe, _state37, _state37$additionalDe, _state38, _state38$additionalDe, _state39, _state39$additionalDe, _state40, _state40$additionalDe, _state41, _state42, _state43, _state44, _state44$connectionHo, _state44$connectionHo2, _data$WaterConnection16, _data$WaterConnection17, _data$WaterConnection18, _data$WaterConnection19, _data$SewerageConnect0, _data$SewerageConnect1, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection20, _data$WaterConnection21, _data$WaterConnection22, _data$WaterConnection23, _data$SewerageConnect12, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$WaterConnection24, _data$WaterConnection25, _data$WaterConnection26, _data$WaterConnection27, _data$SewerageConnect16, _data$SewerageConnect17, _data$SewerageConnect18, _data$SewerageConnect19, _data$WaterConnection28, _data$WaterConnection29, _data$WaterConnection30, _data$WaterConnection31, _data$SewerageConnect20, _data$SewerageConnect21, _data$SewerageConnect22, _data$SewerageConnect23, _data$WaterConnection32, _data$WaterConnection33, _data$WaterConnection34, _data$WaterConnection35, _data$SewerageConnect24, _data$SewerageConnect25, _data$SewerageConnect26, _data$SewerageConnect27, _data$WaterConnection36, _data$WaterConnection37, _data$WaterConnection38, _data$WaterConnection39, _data$SewerageConnect28, _data$SewerageConnect29, _data$SewerageConnect30, _data$SewerageConnect31, _data$WaterConnection40, _data$WaterConnection41, _data$WaterConnection42, _data$WaterConnection43, _data$SewerageConnect32, _data$SewerageConnect33, _data$SewerageConnect34, _data$SewerageConnect35, _data$WaterConnection44, _data$WaterConnection45, _data$WaterConnection46, _data$WaterConnection47, _data$SewerageConnect36, _data$SewerageConnect37, _data$SewerageConnect38, _data$SewerageConnect39, _data$WaterConnection48, _data$WaterConnection49, _data$WaterConnection50, _data$WaterConnection51, _data$SewerageConnect40, _data$SewerageConnect41, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection52, _data$WaterConnection53, _data$WaterConnection54, _data$WaterConnection55, _data$SewerageConnect44, _data$SewerageConnect45, _data$SewerageConnect46, _data$SewerageConnect47, _state45, _state45$additionalDe, _state46, _state46$additionalDe, _state47, _state47$additionalDe, _state48, _state48$additionalDe, _state49, _state49$additionalDe, _state50, _state51, _state54, _state55, _state56, _state57, _state58, _state59, _paymentDetails$data17, _paymentDetails$data18;
33636
33840
  const _useTranslation = useTranslation(),
33637
33841
  t = _useTranslation.t;
33638
33842
  const menuRef = useRef();
@@ -33683,7 +33887,7 @@ const ConnectionDetails$5 = () => {
33683
33887
  enabled: filter2 !== null && filter2 !== void 0 && filter2.connectionNumber ? true : false
33684
33888
  }, true),
33685
33889
  connectionData = _Digit$Hooks$ws$useMy2.data;
33686
- state = ((_Object$keys = Object.keys(state)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? state : applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS") ? connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water = connectionData.WaterConnection) === null || _connectionData$Water === void 0 ? void 0 : _connectionData$Water[0] : connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer = connectionData.SewerageConnections) === null || _connectionData$Sewer === void 0 ? void 0 : _connectionData$Sewer[0];
33890
+ state = ((_Object$keys = Object.keys(state)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? state : applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS") ? (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water = connectionData.WaterConnection) === null || _connectionData$Water === void 0 ? void 0 : _connectionData$Water.find(c => c.applicationStatus === "CONNECTION_ACTIVATED")) || (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water2 = connectionData.WaterConnection) === null || _connectionData$Water2 === void 0 ? void 0 : _connectionData$Water2[0]) : (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer = connectionData.SewerageConnections) === null || _connectionData$Sewer === void 0 ? void 0 : _connectionData$Sewer.find(c => c.applicationStatus === "CONNECTION_ACTIVATED")) || (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer2 = connectionData.SewerageConnections) === null || _connectionData$Sewer2 === void 0 ? void 0 : _connectionData$Sewer2[0]);
33687
33891
  const closeModal = () => {
33688
33892
  setShowOptions(false);
33689
33893
  };
@@ -35143,6 +35347,7 @@ const CheckPage = _ref => {
35143
35347
  const propertyAddress = (value === null || value === void 0 ? void 0 : value.propertyLocationDetails) || {};
35144
35348
  const useDetails = (value === null || value === void 0 ? void 0 : (_value$waterConnectio = value.waterConnection) === null || _value$waterConnectio === void 0 ? void 0 : _value$waterConnectio.useDetails) || {};
35145
35349
  const djbEmployee = (value === null || value === void 0 ? void 0 : value.djbEmployee) || {};
35350
+ const disability = (value === null || value === void 0 ? void 0 : value.disability) || (value === null || value === void 0 ? void 0 : value.additionalDetails) || {};
35146
35351
  const bankDetails = (value === null || value === void 0 ? void 0 : value.bankDetails) || {};
35147
35352
  const additionalDetails = {};
35148
35353
  const checkForNA = val => val ? val : "CS_NA";
@@ -35450,7 +35655,15 @@ const CheckPage = _ref => {
35450
35655
  },
35451
35656
  onClick: () => openFilePDF(djbEmployee === null || djbEmployee === void 0 ? void 0 : djbEmployee.document)
35452
35657
  }, /*#__PURE__*/React.createElement(GenericFileIcon, null), " ", t("CS_COMMON_VIEW"))
35453
- }))), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WS_BANK_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
35658
+ }))), /*#__PURE__*/React.createElement(CardSubHeader, null, "Divyangjan/Person with Disability?"), /*#__PURE__*/React.createElement(StatusTable, {
35659
+ style: {
35660
+ marginTop: "10px",
35661
+ marginBottom: "30px"
35662
+ }
35663
+ }, /*#__PURE__*/React.createElement(Row, {
35664
+ label: "Divyangjan/Person with Disability?",
35665
+ text: "" + (disability !== null && disability !== void 0 && disability.isDivyangjan ? t("CORE_COMMON_YES") : t("CORE_COMMON_NO"))
35666
+ })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WS_BANK_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
35454
35667
  style: {
35455
35668
  marginTop: "10px",
35456
35669
  marginBottom: "30px"
@@ -36904,20 +37117,22 @@ const getAddress$1 = (address, t) => {
36904
37117
  return (address !== null && address !== void 0 && address.doorNo ? (address === null || address === void 0 ? void 0 : address.doorNo) + ", " : "") + " " + (address !== null && address !== void 0 && address.street ? (address === null || address === void 0 ? void 0 : address.street) + ", " : "") + (address !== null && address !== void 0 && address.landmark ? (address === null || address === void 0 ? void 0 : address.landmark) + ", " : "") + t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId)) + ", " + t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId)) + (address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? ", " + address.pincode : " ");
36905
37118
  };
36906
37119
  const WSInfoPage = () => {
36907
- var _Digit$UserService$ge, _Digit$UserService$ge2, _propertyDetails$Prop;
37120
+ var _user$info, _user$info$userName, _user$info2, _propertyDetails$Prop;
36908
37121
  const _useTranslation = useTranslation(),
36909
37122
  t = _useTranslation.t;
36910
37123
  const history = useHistory();
36911
37124
  const location = useLocation();
36912
37125
  const match = useRouteMatch();
36913
37126
  const isEmployee = window.location.href.includes("/employee");
37127
+ const user = Digit.UserService.getUser();
37128
+ const userMobileNumber = user !== null && user !== void 0 && (_user$info = user.info) !== null && _user$info !== void 0 && (_user$info$userName = _user$info.userName) !== null && _user$info$userName !== void 0 && _user$info$userName.match(/^[0-9]{10}$/) ? user.info.userName : user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.mobileNumber;
36914
37129
  const _useState = useState(null),
36915
37130
  hasProperty = _useState[0],
36916
37131
  setHasProperty = _useState[1];
36917
37132
  const _useState2 = useState(null),
36918
37133
  selectedProperty = _useState2[0],
36919
37134
  setSelectedProperty = _useState2[1];
36920
- const _useState3 = useState(""),
37135
+ const _useState3 = useState(isEmployee ? "" : userMobileNumber || ""),
36921
37136
  searchMobileNumber = _useState3[0],
36922
37137
  setSearchMobileNumber = _useState3[1];
36923
37138
  const _useState4 = useState(false),
@@ -36935,9 +37150,11 @@ const WSInfoPage = () => {
36935
37150
  const _useState8 = useState(null),
36936
37151
  showToast = _useState8[0],
36937
37152
  setShowToast = _useState8[1];
37153
+ useEffect(() => {
37154
+ sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
37155
+ }, []);
36938
37156
  const tenantId = Digit.ULBService.getCurrentTenantId();
36939
- const userMobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
36940
- const mobileNumberToSearch = isEmployee ? searchMobileNumber : userMobileNumber;
37157
+ const mobileNumberToSearch = searchMobileNumber;
36941
37158
  const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
36942
37159
  filters: {
36943
37160
  mobileNumber: mobileNumberToSearch
@@ -36963,6 +37180,7 @@ const WSInfoPage = () => {
36963
37180
  const isEmployee = window.location.href.includes("/employee");
36964
37181
  const baseUrl = isEmployee ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
36965
37182
  if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
37183
+ sessionStorage.setItem("WS_OTP_VERIFIED_PROPERTY_ID", selectedProperty.propertyId);
36966
37184
  history.push(baseUrl + "/old-application?propertyId=" + selectedProperty.propertyId);
36967
37185
  } else {
36968
37186
  history.push(baseUrl + "/old-application");
@@ -36981,7 +37199,7 @@ const WSInfoPage = () => {
36981
37199
  mobileNumber: mobileNumberToSearch,
36982
37200
  tenantId: "dl",
36983
37201
  type: "register",
36984
- userType: isEmployee ? "EMPLOYEE" : "CITIZEN"
37202
+ userType: "EMPLOYEE"
36985
37203
  }
36986
37204
  };
36987
37205
  return Promise.resolve(Digit.UserService.sendOtp(payload, "dl")).then(function (response) {
@@ -37115,11 +37333,7 @@ const WSInfoPage = () => {
37115
37333
  if (e.stopPropagation) e.stopPropagation();
37116
37334
  }
37117
37335
  if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
37118
- if (!isEmployee) {
37119
- proceedToNext();
37120
- } else {
37121
- handleSendOtp(e);
37122
- }
37336
+ handleSendOtp(e);
37123
37337
  } else if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty) {
37124
37338
  return;
37125
37339
  } else {
@@ -37228,7 +37442,26 @@ const WSInfoPage = () => {
37228
37442
  style: {
37229
37443
  marginBottom: "24px"
37230
37444
  }
37231
- }, isEmployee && /*#__PURE__*/React.createElement("div", {
37445
+ }, !isEmployee && /*#__PURE__*/React.createElement("div", {
37446
+ style: {
37447
+ marginBottom: "16px"
37448
+ }
37449
+ }, /*#__PURE__*/React.createElement(Label, null, t("CORE_COMMON_MOBILE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
37450
+ t: t,
37451
+ type: "number",
37452
+ isMandatory: false,
37453
+ name: "mobileNumber",
37454
+ value: searchMobileNumber,
37455
+ onChange: e => {
37456
+ const val = e.target.value.replace(/\D/g, "").slice(0, 10);
37457
+ setSearchMobileNumber(val);
37458
+ setSelectedProperty(null);
37459
+ setShowOtpVerification(false);
37460
+ setOtp("");
37461
+ },
37462
+ placeholder: t("Enter mobile number"),
37463
+ maxLength: 10
37464
+ })), isEmployee && /*#__PURE__*/React.createElement("div", {
37232
37465
  style: {
37233
37466
  display: "flex",
37234
37467
  flexDirection: "column",
@@ -38639,6 +38872,7 @@ const DEFAULT_SECTION_STATE = {
38639
38872
  applicant: true,
38640
38873
  contact: true,
38641
38874
  djbEmployee: true,
38875
+ disability: true,
38642
38876
  governmentEmployee: true,
38643
38877
  address: true,
38644
38878
  usage: true,
@@ -38691,6 +38925,9 @@ const DEFAULT_FORM_VALUES = {
38691
38925
  retirementDate: "",
38692
38926
  officeNameAndAddress: ""
38693
38927
  },
38928
+ disability: {
38929
+ isDivyangjan: false
38930
+ },
38694
38931
  governmentEmployee: {
38695
38932
  isGovernmentEmployee: false,
38696
38933
  organizationName: "",
@@ -38844,6 +39081,7 @@ const buildDefaultValues = () => ({
38844
39081
  applicant: _extends({}, DEFAULT_FORM_VALUES.applicant),
38845
39082
  contact: _extends({}, DEFAULT_FORM_VALUES.contact),
38846
39083
  djbEmployee: _extends({}, DEFAULT_FORM_VALUES.djbEmployee),
39084
+ disability: _extends({}, DEFAULT_FORM_VALUES.disability),
38847
39085
  propertyAddress: _extends({}, DEFAULT_FORM_VALUES.propertyAddress),
38848
39086
  useDetails: _extends({}, DEFAULT_FORM_VALUES.useDetails),
38849
39087
  bankDetails: _extends({}, DEFAULT_FORM_VALUES.bankDetails),
@@ -39109,7 +39347,7 @@ const FileUploadField = _ref6 => {
39109
39347
  })))));
39110
39348
  };
39111
39349
  const NewApplication = () => {
39112
- var _Digit$SessionStorage, _getFieldError, _getFieldError2, _getFieldError3, _getFieldError4, _getFieldError5, _getFieldError6, _getFieldError7, _getFieldError8, _getFieldError9, _getFieldError0, _getFieldError1, _getFieldError10, _getFieldError11, _watch, _watch3, _watch5, _watch7, _watch9, _formValues$applicati, _formValues$applicati2, _formValues$applicati3, _formValues$applicati4, _formValues$applicati5, _formValues$applicati6, _formValues$applicati7, _formValues$applicati8, _formValues$applicati9, _formValues$applicati0, _formValues$applicati1, _formValues$applicati10, _formValues$applicati11, _formValues$applicati12, _formValues$applicati13, _formValues$applicati14, _formValues$applicati15, _formValues$applicati16, _formValues$applicati17, _formValues$applicati18, _formValues$applicati19, _formValues$applicati20, _formValues$applicati21, _formValues$applicati22, _formValues$applicati23, _formValues$applicant, _formValues$applicant2, _formValues$applicant3, _formValues$applicant4, _formValues$applicant5, _formValues$applicant6, _formValues$applicant7, _formValues$useDetail, _formValues$applicant8, _formValues$contact, _formValues$contact2, _formValues$contact3, _formValues$documents, _formValues$djbEmploy, _formValues$djbEmploy2, _formValues$djbEmploy3, _formValues$djbEmploy4, _formValues$djbEmploy5, _formValues$governmen, _formValues$governmen2, _formValues$governmen3, _formValues$governmen4, _formValues$propertyA, _formValues$propertyA2, _formValues$propertyA3, _formValues$propertyA4, _formValues$propertyA5, _formValues$propertyA6, _formValues$propertyA7, _formValues$propertyA8, _formValues$propertyA9, _formValues$propertyA0, _formValues$propertyA1, _formValues$useDetail2, _formValues$useDetail3, _formValues$useDetail4, _formValues$useDetail5, _formValues$useDetail6, _formValues$useDetail7, _formValues$useDetail8, _formValues$useDetail9, _formValues$useDetail0, _formValues$useDetail1, _formValues$useDetail10, _formValues$useDetail11, _formValues$bankDetai, _formValues$bankDetai2, _formValues$bankDetai3, _formValues$bankDetai4, _formValues$documents2, _formValues$documents3, _formValues$documents4, _formValues$documents5, _formValues$documents6, _formValues$documents7, _formValues$documents8, _formValues$documents9, _formValues$documents0, _formValues$documents1, _formValues$declarati, _formValues$declarati2, _formValues$declarati3, _formValues$declarati4, _formValues$declarati5;
39350
+ var _Digit$SessionStorage, _getFieldError, _getFieldError2, _getFieldError3, _getFieldError4, _getFieldError5, _getFieldError6, _getFieldError7, _getFieldError8, _getFieldError9, _getFieldError0, _getFieldError1, _getFieldError10, _getFieldError11, _watch, _watch3, _watch5, _watch7, _watch9, _formValues$applicati, _formValues$applicati2, _formValues$applicati3, _formValues$applicati4, _formValues$applicati5, _formValues$applicati6, _formValues$applicati7, _formValues$applicati8, _formValues$applicati9, _formValues$applicati0, _formValues$applicati1, _formValues$applicati10, _formValues$applicati11, _formValues$applicati12, _formValues$applicati13, _formValues$applicati14, _formValues$applicati15, _formValues$applicati16, _formValues$applicati17, _formValues$applicati18, _formValues$applicati19, _formValues$applicati20, _formValues$applicati21, _formValues$applicati22, _formValues$applicati23, _formValues$applicant, _formValues$applicant2, _formValues$applicant3, _formValues$applicant4, _formValues$applicant5, _formValues$applicant6, _formValues$applicant7, _formValues$useDetail, _formValues$applicant8, _formValues$contact, _formValues$contact2, _formValues$contact3, _formValues$documents, _formValues$djbEmploy, _formValues$djbEmploy2, _formValues$djbEmploy3, _formValues$djbEmploy4, _formValues$djbEmploy5, _formValues$disabilit, _formValues$governmen, _formValues$governmen2, _formValues$governmen3, _formValues$governmen4, _formValues$propertyA, _formValues$propertyA2, _formValues$propertyA3, _formValues$propertyA4, _formValues$propertyA5, _formValues$propertyA6, _formValues$propertyA7, _formValues$propertyA8, _formValues$propertyA9, _formValues$propertyA0, _formValues$propertyA1, _formValues$useDetail2, _formValues$useDetail3, _formValues$useDetail4, _formValues$useDetail5, _formValues$useDetail6, _formValues$useDetail7, _formValues$useDetail8, _formValues$useDetail9, _formValues$useDetail0, _formValues$useDetail1, _formValues$useDetail10, _formValues$useDetail11, _formValues$bankDetai, _formValues$bankDetai2, _formValues$bankDetai3, _formValues$bankDetai4, _formValues$documents2, _formValues$documents3, _formValues$documents4, _formValues$documents5, _formValues$documents6, _formValues$documents7, _formValues$documents8, _formValues$documents9, _formValues$documents0, _formValues$documents1, _formValues$declarati, _formValues$declarati2, _formValues$declarati3, _formValues$declarati4, _formValues$declarati5;
39113
39351
  const _useTranslation2 = useTranslation(),
39114
39352
  t = _useTranslation2.t;
39115
39353
  const history = useHistory();
@@ -39151,6 +39389,7 @@ const NewApplication = () => {
39151
39389
  setWaterAndSewerageBoth = _useState12[1];
39152
39390
  const _useState13 = useState(new URLSearchParams(location.search).get("propertyId")),
39153
39391
  propertyId = _useState13[0];
39392
+ const initialPropertyQuery = useRef(location.search);
39154
39393
  const initialFormValues = buildDefaultValues();
39155
39394
  const _useState14 = useState(""),
39156
39395
  city = _useState14[0],
@@ -39243,6 +39482,7 @@ const NewApplication = () => {
39243
39482
  applicant: React.useRef(null),
39244
39483
  contact: React.useRef(null),
39245
39484
  djbEmployee: React.useRef(null),
39485
+ disability: React.useRef(null),
39246
39486
  governmentEmployee: React.useRef(null),
39247
39487
  propertyAddress: React.useRef(null),
39248
39488
  useDetails: React.useRef(null),
@@ -39318,7 +39558,11 @@ const NewApplication = () => {
39318
39558
  sectionId: "djbEmployee",
39319
39559
  route: "djb-employee",
39320
39560
  actions: "For DJB Employee"
39321
- }] : []), ...(isGovernmentEmployee ? [{
39561
+ }] : []), {
39562
+ sectionId: "disability",
39563
+ route: "disability",
39564
+ actions: "Divyangjan/Person with Disability"
39565
+ }, ...(isGovernmentEmployee ? [{
39322
39566
  sectionId: "governmentEmployee",
39323
39567
  route: "government-employee",
39324
39568
  actions: "For Government Employee"
@@ -39399,6 +39643,12 @@ const NewApplication = () => {
39399
39643
  sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
39400
39644
  const _Digit$Hooks$ws$useWS4 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),
39401
39645
  sewerageUpdateMutation = _Digit$Hooks$ws$useWS4.mutate;
39646
+ useEffect(() => {
39647
+ if (location.search !== initialPropertyQuery.current) {
39648
+ window.sessionStorage.removeItem(FORM_STORAGE_KEY);
39649
+ history.replace("/digit-ui/employee/ws/info");
39650
+ }
39651
+ }, [history, location.search]);
39402
39652
  useEffect(() => {
39403
39653
  if (!isGovernmentOrganization) {
39404
39654
  setValue("applicant.governmentOrganizationName", "");
@@ -40471,6 +40721,23 @@ const NewApplication = () => {
40471
40721
  minHeight: "96px"
40472
40722
  }
40473
40723
  })))), /*#__PURE__*/React.createElement(SectionCard, {
40724
+ description: "Please indicate whether the applicant is a Divyangjan/Person with Disability.",
40725
+ isOpen: collapsedSections.disability,
40726
+ onToggle: toggleSection,
40727
+ sectionKey: "disability",
40728
+ title: "Divyangjan/Person with Disability?",
40729
+ sectionRef: sectionRefs.disability
40730
+ }, /*#__PURE__*/React.createElement(FieldBlock, {
40731
+ label: "Divyangjan/Person with Disability?"
40732
+ }, /*#__PURE__*/React.createElement(Controller, {
40733
+ control: control,
40734
+ name: "disability.isDivyangjan",
40735
+ render: props => /*#__PURE__*/React.createElement(CheckBox, {
40736
+ checked: !!props.value,
40737
+ label: "Divyangjan/Person with Disability?",
40738
+ onChange: event => props.onChange(event.target.checked)
40739
+ })
40740
+ }))), /*#__PURE__*/React.createElement(SectionCard, {
40474
40741
  description: t("WS_PROPERTY_ADDRESS_DESC"),
40475
40742
  isOpen: collapsedSections.address,
40476
40743
  onToggle: toggleSection,
@@ -41292,7 +41559,17 @@ const NewApplication = () => {
41292
41559
  isFullWidth: true,
41293
41560
  label: "Office Name & Address",
41294
41561
  value: formValues === null || formValues === void 0 ? void 0 : (_formValues$djbEmploy5 = formValues.djbEmployee) === null || _formValues$djbEmploy5 === void 0 ? void 0 : _formValues$djbEmploy5.officeNameAndAddress
41295
- })) : null), (formValues === null || formValues === void 0 ? void 0 : (_formValues$governmen = formValues.governmentEmployee) === null || _formValues$governmen === void 0 ? void 0 : _formValues$governmen.isGovernmentEmployee) && /*#__PURE__*/React.createElement(SectionCard, {
41562
+ })) : null), /*#__PURE__*/React.createElement(SectionCard, {
41563
+ description: "Divyangjan/Person with Disability declaration.",
41564
+ isOpen: collapsedSections.disability,
41565
+ onToggle: toggleSection,
41566
+ sectionKey: "disability",
41567
+ title: "Divyangjan/Person with Disability?",
41568
+ onEditClick: () => handleSectionEdit("disability")
41569
+ }, /*#__PURE__*/React.createElement(PreviewItem, {
41570
+ label: "Divyangjan/Person with Disability?",
41571
+ value: formValues === null || formValues === void 0 ? void 0 : (_formValues$disabilit = formValues.disability) === null || _formValues$disabilit === void 0 ? void 0 : _formValues$disabilit.isDivyangjan
41572
+ })), (formValues === null || formValues === void 0 ? void 0 : (_formValues$governmen = formValues.governmentEmployee) === null || _formValues$governmen === void 0 ? void 0 : _formValues$governmen.isGovernmentEmployee) && /*#__PURE__*/React.createElement(SectionCard, {
41296
41573
  description: "Government employee organization details.",
41297
41574
  isOpen: collapsedSections.governmentEmployee,
41298
41575
  onToggle: toggleSection,
@@ -51354,7 +51631,8 @@ const EditModifyApplication = () => {
51354
51631
  };
51355
51632
 
51356
51633
  const Step1_SearchConnection = _ref => {
51357
- let defaultKNumber = _ref.defaultKNumber,
51634
+ let t = _ref.t,
51635
+ defaultKNumber = _ref.defaultKNumber,
51358
51636
  onNext = _ref.onNext,
51359
51637
  isEditFlow = _ref.isEditFlow;
51360
51638
  const _useState = useState(defaultKNumber || ""),
@@ -51363,9 +51641,55 @@ const Step1_SearchConnection = _ref => {
51363
51641
  const _useState2 = useState(false),
51364
51642
  isLoading = _useState2[0],
51365
51643
  setIsLoading = _useState2[1];
51366
- const _useState3 = useState(null),
51367
- showToast = _useState3[0],
51368
- setShowToast = _useState3[1];
51644
+ const _useState3 = useState(false),
51645
+ isConsenting = _useState3[0],
51646
+ setIsConsenting = _useState3[1];
51647
+ const _useState4 = useState(null),
51648
+ showToast = _useState4[0],
51649
+ setShowToast = _useState4[1];
51650
+ const handleDigiLockerConsent = function (e) {
51651
+ try {
51652
+ if (e !== null && e !== void 0 && e.preventDefault) e.preventDefault();
51653
+ if (e !== null && e !== void 0 && e.stopPropagation) e.stopPropagation();
51654
+ setIsConsenting(true);
51655
+ const _temp = _finallyRethrows(function () {
51656
+ return _catch(function () {
51657
+ const tenantId = Digit.ULBService.getCurrentTenantId() || "dl";
51658
+ return Promise.resolve(Digit.DigiLockerService.authorization({
51659
+ module: "WS",
51660
+ tenantId
51661
+ })).then(function (data) {
51662
+ const redirectUrl = (data === null || data === void 0 ? void 0 : data.redirectURL) || (data === null || data === void 0 ? void 0 : data.redirectUrl);
51663
+ const verifier = (data === null || data === void 0 ? void 0 : data.dlReqRef) || (data === null || data === void 0 ? void 0 : data.codeverifier) || (data === null || data === void 0 ? void 0 : data.codeVerifier) || (data === null || data === void 0 ? void 0 : data.code_verifier);
51664
+ if (verifier) {
51665
+ sessionStorage.setItem("code_verfier_register", verifier);
51666
+ }
51667
+ if (redirectUrl) {
51668
+ window.location.href = redirectUrl;
51669
+ } else {
51670
+ setShowToast({
51671
+ key: "error",
51672
+ message: "No redirect URL returned from DigiLocker API"
51673
+ });
51674
+ }
51675
+ });
51676
+ }, function (err) {
51677
+ var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
51678
+ setShowToast({
51679
+ key: "error",
51680
+ message: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || (err === null || err === void 0 ? void 0 : err.message) || "Error fetching DigiLocker authorization URL"
51681
+ });
51682
+ });
51683
+ }, function (_wasThrown, _result) {
51684
+ setIsConsenting(false);
51685
+ if (_wasThrown) throw _result;
51686
+ return _result;
51687
+ });
51688
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
51689
+ } catch (e) {
51690
+ return Promise.reject(e);
51691
+ }
51692
+ };
51369
51693
  const handleSendOtp = function () {
51370
51694
  try {
51371
51695
  if (!kNumber) {
@@ -51389,7 +51713,7 @@ const Step1_SearchConnection = _ref => {
51389
51713
  businessService: "WS"
51390
51714
  }).catch(() => null)).then(function (wsResponse) {
51391
51715
  var _wsResponse$WaterConn;
51392
- function _temp2() {
51716
+ function _temp3() {
51393
51717
  var _connection, _connection$connectio, _connection$connectio2, _connection2;
51394
51718
  if (!connection) {
51395
51719
  setIsLoading(false);
@@ -51408,6 +51732,16 @@ const Step1_SearchConnection = _ref => {
51408
51732
  });
51409
51733
  return;
51410
51734
  }
51735
+ if (isEditFlow) {
51736
+ setIsLoading(false);
51737
+ onNext({
51738
+ kNumber,
51739
+ mobileNumber: fetchedMobileNumber,
51740
+ serviceType: detectedServiceType,
51741
+ activeConnection: connection
51742
+ });
51743
+ return;
51744
+ }
51411
51745
  const userType = Digit.UserService.getType().toUpperCase();
51412
51746
  const payload = {
51413
51747
  otp: {
@@ -51428,7 +51762,7 @@ const Step1_SearchConnection = _ref => {
51428
51762
  });
51429
51763
  }
51430
51764
  let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
51431
- const _temp = function () {
51765
+ const _temp2 = function () {
51432
51766
  if (!connection) {
51433
51767
  return Promise.resolve(Digit.WSService.search({
51434
51768
  tenantId,
@@ -51441,14 +51775,14 @@ const Step1_SearchConnection = _ref => {
51441
51775
  });
51442
51776
  }
51443
51777
  }();
51444
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
51778
+ return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
51445
51779
  });
51446
51780
  }, function (err) {
51447
- var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
51781
+ var _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2;
51448
51782
  setIsLoading(false);
51449
51783
  setShowToast({
51450
51784
  key: "error",
51451
- message: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || "Failed to send OTP"
51785
+ message: (err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : (_err$response2$data$E = _err$response2$data.Errors) === null || _err$response2$data$E === void 0 ? void 0 : (_err$response2$data$E2 = _err$response2$data$E[0]) === null || _err$response2$data$E2 === void 0 ? void 0 : _err$response2$data$E2.message) || "Failed to send OTP"
51452
51786
  });
51453
51787
  }));
51454
51788
  } catch (e) {
@@ -51483,7 +51817,7 @@ const Step1_SearchConnection = _ref => {
51483
51817
  style: {
51484
51818
  fontSize: isMobileView ? "13px" : undefined
51485
51819
  }
51486
- }, "Please enter your K Number to proceed with the mutation application. An OTP will be sent to the registered mobile number."), /*#__PURE__*/React.createElement("div", {
51820
+ }, isEditFlow ? "Please verify the K Number to proceed with the mutation edit." : "Please enter your K Number to proceed with the mutation application. An OTP will be sent to the registered mobile number."), /*#__PURE__*/React.createElement("div", {
51487
51821
  style: {
51488
51822
  marginBottom: "24px",
51489
51823
  marginTop: "16px",
@@ -51510,6 +51844,11 @@ const Step1_SearchConnection = _ref => {
51510
51844
  width: "100%"
51511
51845
  },
51512
51846
  disabled: isEditFlow
51847
+ })), !isEditFlow && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SubmitBar, {
51848
+ label: t("WS_LOGIN_WITH_DIGILOCKER") || "Login with DigiLocker",
51849
+ onSubmit: handleDigiLockerConsent,
51850
+ disabled: isConsenting,
51851
+ submit: true
51513
51852
  })), /*#__PURE__*/React.createElement("div", {
51514
51853
  style: {
51515
51854
  display: "flex",
@@ -51531,7 +51870,7 @@ const Step1_SearchConnection = _ref => {
51531
51870
  maxWidth: isMobileView ? "100%" : "200px",
51532
51871
  fontSize: isMobileView ? "14px" : undefined
51533
51872
  }
51534
- }, isLoading ? "Sending OTP..." : "Send OTP →"))), showToast && /*#__PURE__*/React.createElement(Toast, {
51873
+ }, isLoading ? isEditFlow ? "Proceeding..." : "Sending OTP..." : isEditFlow ? "Proceed →" : "Send OTP →"))), showToast && /*#__PURE__*/React.createElement(Toast, {
51535
51874
  error: showToast.key === "error",
51536
51875
  warning: showToast.key === "warning",
51537
51876
  label: showToast.message,
@@ -53469,7 +53808,7 @@ const Step5_Submission = _ref => {
53469
53808
  };
53470
53809
 
53471
53810
  const MutationApplication = () => {
53472
- var _Digit$SessionStorage, _user$info, _state, _user$info2, _user$info2$userName, _user$info3, _user$info4, _details$applicationD, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a4, _applicationDetails$a8, _applicationDetails$a9;
53811
+ var _state, _state2, _state3, _Digit$SessionStorage, _user$info, _state4, _user$info2, _user$info2$userName, _user$info3, _user$info4, _details$applicationD, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a4, _applicationDetails$a8, _applicationDetails$a9;
53473
53812
  const _useTranslation = useTranslation(),
53474
53813
  t = _useTranslation.t;
53475
53814
  const _useRouteMatch = useRouteMatch(),
@@ -53520,14 +53859,45 @@ const MutationApplication = () => {
53520
53859
  authActiveConnection = _Digit$Hooks$useSessi6[0],
53521
53860
  setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
53522
53861
  clearAuthActiveConnection = _Digit$Hooks$useSessi6[2];
53862
+ const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("MUTATION_EDIT_PARAMS", {}),
53863
+ persistedEditParams = _Digit$Hooks$useSessi7[0],
53864
+ setPersistedEditParams = _Digit$Hooks$useSessi7[1];
53523
53865
  const user = Digit.UserService.getUser();
53524
- let tenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code) || (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.permanentCity) || Digit.ULBService.getCurrentTenantId();
53525
- const applicationNumber = filters === null || filters === void 0 ? void 0 : filters.applicationNumber;
53526
- const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
53527
- const details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
53866
+ const urlParams = new URLSearchParams(location.search);
53867
+ const urlAppNo = (filters === null || filters === void 0 ? void 0 : filters.applicationNumber) || urlParams.get("applicationNumber") || ((_state = state) === null || _state === void 0 ? void 0 : _state.id);
53868
+ const urlTenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || urlParams.get("tenantId") || ((_state2 = state) === null || _state2 === void 0 ? void 0 : _state2.tenantId);
53869
+ const urlService = (filters === null || filters === void 0 ? void 0 : filters.service) || urlParams.get("service") || ((_state3 = state) === null || _state3 === void 0 ? void 0 : _state3.service);
53870
+ useEffect(() => {
53871
+ if (location.pathname.endsWith("/search-connection") && !urlAppNo) {
53872
+ setPersistedEditParams({});
53873
+ } else if (urlAppNo || urlTenantId || urlService) {
53874
+ setPersistedEditParams({
53875
+ applicationNumber: urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber),
53876
+ tenantId: urlTenantId || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.tenantId),
53877
+ service: urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service)
53878
+ });
53879
+ }
53880
+ }, [urlAppNo, urlTenantId, urlService, location.pathname]);
53881
+ const applicationNumber = urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber);
53882
+ const serviceType = urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service);
53883
+ let tenantId = urlTenantId || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.tenantId) || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code) || (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.permanentCity) || Digit.ULBService.getCurrentTenantId();
53884
+ const details = cloneDeep_1((_state4 = state) === null || _state4 === void 0 ? void 0 : _state4.data);
53528
53885
  const mobileNumber = user !== null && user !== void 0 && (_user$info2 = user.info) !== null && _user$info2 !== void 0 && (_user$info2$userName = _user$info2.userName) !== null && _user$info2$userName !== void 0 && _user$info2$userName.match(/^[0-9]{10}$/) ? user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.userName : user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.mobileNumber;
53529
53886
  const hasStateData = !!(details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id);
53887
+ useEffect(() => {
53888
+ if (location.pathname === path) {
53889
+ if (typeof clearFormData === "function") clearFormData();
53890
+ if (typeof clearSessionFormData === "function") clearSessionFormData();
53891
+ if (typeof clearCompletedSteps === "function") clearCompletedSteps();
53892
+ if (typeof clearAuthKNumber === "function") clearAuthKNumber();
53893
+ if (typeof clearAuthMobileNumber === "function") clearAuthMobileNumber();
53894
+ if (typeof clearAuthServiceType === "function") clearAuthServiceType();
53895
+ if (typeof clearAuthActiveConnection === "function") clearAuthActiveConnection();
53896
+ if (typeof setPersistedEditParams === "function") setPersistedEditParams({});
53897
+ }
53898
+ }, [location.pathname, path]);
53530
53899
  const editApplicationNumber = (details === null || details === void 0 ? void 0 : details.applicationNo) || applicationNumber;
53900
+ console.log(editApplicationNumber, "editApplicationNumber");
53531
53901
  const _useQuery = useQuery(["WORKFLOW_SEARCH", editApplicationNumber, tenantId], function () {
53532
53902
  try {
53533
53903
  return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, editApplicationNumber)).then(function (res) {
@@ -53542,8 +53912,9 @@ const MutationApplication = () => {
53542
53912
  }),
53543
53913
  isWorkflowLoading = _useQuery.isLoading,
53544
53914
  workflowData = _useQuery.data;
53915
+ console.log(workflowData, "workflowData");
53545
53916
  const isEmployee = window.location.href.includes("/employee/");
53546
- const isEditFlow = !!editApplicationNumber && (isEmployee || (workflowData === null || workflowData === void 0 ? void 0 : workflowData.action) === "SEND_BACK_TO_CITIZEN");
53917
+ const isEditFlow = !!editApplicationNumber && (!!urlAppNo || (workflowData === null || workflowData === void 0 ? void 0 : workflowData.businessService) === "mutationWSConnection" || (workflowData === null || workflowData === void 0 ? void 0 : workflowData.action) === "SEND_BACK_TO_CITIZEN");
53547
53918
  const querySearchParam = isEditFlow ? editApplicationNumber : authKNumber;
53548
53919
  const fallbackServiceType = serviceType || authServiceType;
53549
53920
  const businessService = (fallbackServiceType === null || fallbackServiceType === void 0 ? void 0 : fallbackServiceType.toUpperCase()) === "SEWERAGE" ? "SW" : "WS";
@@ -53572,8 +53943,8 @@ const MutationApplication = () => {
53572
53943
  }
53573
53944
  return wsData ? {
53574
53945
  applicationData: wsData,
53575
- WaterConnection: rawData === null || rawData === void 0 ? void 0 : rawData.WaterConnection,
53576
- SewerageConnections: rawData === null || rawData === void 0 ? void 0 : rawData.SewerageConnections,
53946
+ WaterConnection: [wsData],
53947
+ SewerageConnections: [wsData],
53577
53948
  propertyDetails: null,
53578
53949
  processInstancesDetails: []
53579
53950
  } : null;
@@ -53604,10 +53975,10 @@ const MutationApplication = () => {
53604
53975
  }),
53605
53976
  propertyDetails = _Digit$Hooks$pt$usePr.data,
53606
53977
  isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
53607
- const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
53608
- sessionFormData = _Digit$Hooks$useSessi7[0],
53609
- setSessionFormData = _Digit$Hooks$useSessi7[1],
53610
- clearSessionFormData = _Digit$Hooks$useSessi7[2];
53978
+ const _Digit$Hooks$useSessi8 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
53979
+ sessionFormData = _Digit$Hooks$useSessi8[0],
53980
+ setSessionFormData = _Digit$Hooks$useSessi8[1],
53981
+ clearSessionFormData = _Digit$Hooks$useSessi8[2];
53611
53982
  useEffect(() => {
53612
53983
  var _applicationDetails$a3;
53613
53984
  const fetchAppData = function () {
@@ -53805,6 +54176,7 @@ const MutationApplication = () => {
53805
54176
  let updatePayload = _extends({}, convertAppData, {
53806
54177
  id: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationData) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.id,
53807
54178
  applicationNo: editApplicationNumber,
54179
+ action: "RESUBMIT_APPLICATION",
53808
54180
  processInstance: _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : _applicationDetails$a7.processInstance, convertAppData === null || convertAppData === void 0 ? void 0 : convertAppData.processInstance, {
53809
54181
  action: "RESUBMIT_APPLICATION"
53810
54182
  })
@@ -54070,7 +54442,13 @@ const MutationApplication = () => {
54070
54442
  }
54071
54443
  }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
54072
54444
  path: path + "/search-connection"
54073
- }, /*#__PURE__*/React.createElement(Step1_SearchConnection, {
54445
+ }, isEditFlow ? /*#__PURE__*/React.createElement(Redirect, {
54446
+ to: {
54447
+ pathname: path + "/consumer-details",
54448
+ search: location.search,
54449
+ state: location.state
54450
+ }
54451
+ }) : /*#__PURE__*/React.createElement(Step1_SearchConnection, {
54074
54452
  t: t,
54075
54453
  defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
54076
54454
  isEditFlow: isEditFlow,
@@ -54088,7 +54466,13 @@ const MutationApplication = () => {
54088
54466
  }
54089
54467
  })), /*#__PURE__*/React.createElement(Route, {
54090
54468
  path: path + "/existing-connection"
54091
- }, /*#__PURE__*/React.createElement(Fragment$2, null, /*#__PURE__*/React.createElement(Step1_ExistingConnection, {
54469
+ }, isEditFlow ? /*#__PURE__*/React.createElement(Redirect, {
54470
+ to: {
54471
+ pathname: path + "/consumer-details",
54472
+ search: location.search,
54473
+ state: location.state
54474
+ }
54475
+ }) : /*#__PURE__*/React.createElement(Fragment$2, null, /*#__PURE__*/React.createElement(Step1_ExistingConnection, {
54092
54476
  t: t,
54093
54477
  applicationDetails: authActiveConnection ? {
54094
54478
  applicationData: authActiveConnection
@@ -54143,7 +54527,11 @@ const MutationApplication = () => {
54143
54527
  exact: true,
54144
54528
  path: path
54145
54529
  }, /*#__PURE__*/React.createElement(Redirect, {
54146
- to: path + "/search-connection"
54530
+ to: {
54531
+ pathname: isEditFlow ? path + "/consumer-details" : path + "/search-connection",
54532
+ search: location.search,
54533
+ state: location.state
54534
+ }
54147
54535
  }))), showToast && /*#__PURE__*/React.createElement(Toast, {
54148
54536
  error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
54149
54537
  warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
@@ -55928,7 +56316,7 @@ const openFilePDF = fileId => {
55928
56316
  }).catch(error => console.error("Error fetching file:", error));
55929
56317
  };
55930
56318
  const CheckPage$4 = _ref2 => {
55931
- var _data$cpt, _data$ConnectionDetai, _data$connectionDetai, _data$ConnectionHolde, _data$connectionHolde, _data$useDetails, _data$bankDetails, _data$DocumentsRequir, _data$documents, _data$djbEmployee, _connectionDetails, _connectionDetails$se, _connectionDetails2, _connectionDetails2$s, _connectionDetails3, _connectionDetails4, _connectionDetails4$c, _connectionDetails5, _connectionDetails5$c, _connectionDetails6, _connectionDetails7, _connectionDetails7$w, _connectionDetails8, _connectionDetails8$w, _connectionDetails9, _connectionDetails0, _connectionDetails0$a, _connectionDetails1, _connectionDetails1$a, _connectionDetails10, _connectionDetails11, _connectionDetails11$, _connectionDetails12, _connectionDetails12$, _connectionDetails13, _connectionDetails14, _connectionDetails14$, _connectionDetails15, _connectionDetails15$, _connectionDetails16, _connectionDetails16$, _connectionDetails17, _connectionDetails18, _connectionDetails19, _connectionDetails20, _holderDetails, _holderDetails2, _holderDetails3, _holderDetails4, _holderDetails4$gende, _holderDetails5, _holderDetails5$gende, _holderDetails6, _holderDetails7, _holderDetails8, _holderDetails8$relat, _holderDetails9, _holderDetails9$relat, _holderDetails0, _holderDetails1, _holderDetails10, _holderDetails11, _propertyAddress, _propertyAddress$zro, _propertyAddress2, _propertyAddress3, _propertyAddress4, _propertyAddress4$add, _propertyAddress5, _propertyAddress5$add, _propertyAddress6, _propertyAddress6$add, _propertyAddress7, _propertyAddress8, _propertyAddress8$cit, _propertyAddress9, _propertyAddress9$cit, _propertyAddress0, _propertyAddress1, _propertyAddress10, _propertyAddress11, _propertyAddress11$lo, _propertyAddress12, _propertyAddress12$lo, _propertyAddress13, _propertyAddress14, _propertyAddress14$su, _propertyAddress15, _propertyAddress15$su, _propertyAddress16, _propertyAddress17, _propertyAddress18, _propertyAddress19, _propertyAddress20, _propertyAddress21, _propertyAddress22, _propertyAddress23, _propertyAddress24, _propertyAddress25, _propertyAddress26, _propertyAddress26$as, _propertyAddress27, _propertyAddress27$as, _propertyAddress28, _propertyAddress29, _propertyAddress29$bl, _propertyAddress30, _propertyAddress30$bl, _propertyAddress31, _propertyAddress32, _propertyAddress32$wa, _propertyAddress33, _propertyAddress33$wa, _propertyAddress34, _propertyAddress35, _propertyAddress35$zo, _propertyAddress36, _propertyAddress36$zo, _propertyAddress37, _propertyAddress38, _propertyAddress39, _propertyAddress40, _propertyAddress41, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _declaration$submitte, _declaration$submitte2, _declaration$signatur;
56319
+ var _data$cpt, _data$ConnectionDetai, _data$connectionDetai, _data$ConnectionHolde, _data$connectionHolde, _data$useDetails, _data$bankDetails, _data$DocumentsRequir, _data$documents, _data$djbEmployee, _data$disability, _connectionDetails, _connectionDetails$se, _connectionDetails2, _connectionDetails2$s, _connectionDetails3, _connectionDetails4, _connectionDetails4$c, _connectionDetails5, _connectionDetails5$c, _connectionDetails6, _connectionDetails7, _connectionDetails7$w, _connectionDetails8, _connectionDetails8$w, _connectionDetails9, _connectionDetails0, _connectionDetails0$a, _connectionDetails1, _connectionDetails1$a, _connectionDetails10, _connectionDetails11, _connectionDetails11$, _connectionDetails12, _connectionDetails12$, _connectionDetails13, _connectionDetails14, _connectionDetails14$, _connectionDetails15, _connectionDetails15$, _connectionDetails16, _connectionDetails16$, _connectionDetails17, _connectionDetails18, _connectionDetails19, _connectionDetails20, _holderDetails, _holderDetails2, _holderDetails3, _holderDetails4, _holderDetails4$gende, _holderDetails5, _holderDetails5$gende, _holderDetails6, _holderDetails7, _holderDetails8, _holderDetails8$relat, _holderDetails9, _holderDetails9$relat, _holderDetails0, _holderDetails1, _holderDetails10, _holderDetails11, _propertyAddress, _propertyAddress$zro, _propertyAddress2, _propertyAddress3, _propertyAddress4, _propertyAddress4$add, _propertyAddress5, _propertyAddress5$add, _propertyAddress6, _propertyAddress6$add, _propertyAddress7, _propertyAddress8, _propertyAddress8$cit, _propertyAddress9, _propertyAddress9$cit, _propertyAddress0, _propertyAddress1, _propertyAddress10, _propertyAddress11, _propertyAddress11$lo, _propertyAddress12, _propertyAddress12$lo, _propertyAddress13, _propertyAddress14, _propertyAddress14$su, _propertyAddress15, _propertyAddress15$su, _propertyAddress16, _propertyAddress17, _propertyAddress18, _propertyAddress19, _propertyAddress20, _propertyAddress21, _propertyAddress22, _propertyAddress23, _propertyAddress24, _propertyAddress25, _propertyAddress26, _propertyAddress26$as, _propertyAddress27, _propertyAddress27$as, _propertyAddress28, _propertyAddress29, _propertyAddress29$bl, _propertyAddress30, _propertyAddress30$bl, _propertyAddress31, _propertyAddress32, _propertyAddress32$wa, _propertyAddress33, _propertyAddress33$wa, _propertyAddress34, _propertyAddress35, _propertyAddress35$zo, _propertyAddress36, _propertyAddress36$zo, _propertyAddress37, _propertyAddress38, _propertyAddress39, _propertyAddress40, _propertyAddress41, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _declaration$submitte, _declaration$submitte2, _declaration$signatur;
55932
56320
  let data = _ref2.data,
55933
56321
  onSubmit = _ref2.onSubmit,
55934
56322
  onEdit = _ref2.onEdit;
@@ -56008,6 +56396,7 @@ const CheckPage$4 = _ref2 => {
56008
56396
  const documents = (data === null || data === void 0 ? void 0 : (_data$DocumentsRequir = data.DocumentsRequired) === null || _data$DocumentsRequir === void 0 ? void 0 : _data$DocumentsRequir.documents) || (data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : _data$documents.documents) || [];
56009
56397
  const declaration = (data === null || data === void 0 ? void 0 : data.declarationData) || (data === null || data === void 0 ? void 0 : data.declaration) || {};
56010
56398
  const djbEmployee = (data === null || data === void 0 ? void 0 : (_data$djbEmployee = data.djbEmployee) === null || _data$djbEmployee === void 0 ? void 0 : _data$djbEmployee.djbEmployee) || (data === null || data === void 0 ? void 0 : data.djbEmployee) || {};
56399
+ const disability = (data === null || data === void 0 ? void 0 : (_data$disability = data.disability) === null || _data$disability === void 0 ? void 0 : _data$disability.disability) || (data === null || data === void 0 ? void 0 : data.disability) || (data === null || data === void 0 ? void 0 : data.additionalDetails) || {};
56011
56400
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
56012
56401
  className: "overflow-y-scroll"
56013
56402
  }, /*#__PURE__*/React.createElement(CardHeader, null, t("WS_COMMON_SUMMARY")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("WS_COMMON_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
@@ -56235,7 +56624,15 @@ const CheckPage$4 = _ref2 => {
56235
56624
  },
56236
56625
  onClick: () => openFilePDF(djbEmployee === null || djbEmployee === void 0 ? void 0 : djbEmployee.document)
56237
56626
  }, /*#__PURE__*/React.createElement(GenericFileIcon, null), " ", t("CS_COMMON_VIEW"))
56238
- }))), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WS_BANK_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
56627
+ }))), /*#__PURE__*/React.createElement(CardSubHeader, null, "Divyangjan/Person with Disability?"), /*#__PURE__*/React.createElement(StatusTable, {
56628
+ style: {
56629
+ marginTop: "10px",
56630
+ marginBottom: "30px"
56631
+ }
56632
+ }, /*#__PURE__*/React.createElement(Row, {
56633
+ label: "Divyangjan/Person with Disability?",
56634
+ text: disability !== null && disability !== void 0 && disability.isDivyangjan ? t("CORE_COMMON_YES") : t("CORE_COMMON_NO")
56635
+ })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WS_BANK_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
56239
56636
  style: {
56240
56637
  marginTop: "10px",
56241
56638
  marginBottom: "30px"
@@ -56378,6 +56775,7 @@ const OLDApplication = () => {
56378
56775
  const _useTranslation = useTranslation(),
56379
56776
  t = _useTranslation.t;
56380
56777
  const history = useHistory();
56778
+ const location = useLocation();
56381
56779
  const _useState = useState(false),
56382
56780
  isEnableLoader = _useState[0],
56383
56781
  setIsEnableLoader = _useState[1];
@@ -56426,9 +56824,12 @@ const OLDApplication = () => {
56426
56824
  let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
56427
56825
  newConfig = _Digit$Hooks$ws$useWS.data,
56428
56826
  isLoading = _Digit$Hooks$ws$useWS.isLoading;
56429
- const _useState5 = useState(new URLSearchParams(useLocation().search).get("propertyId")),
56827
+ const requestedPropertyId = new URLSearchParams(location.search).get("propertyId");
56828
+ const _useState5 = useState(requestedPropertyId),
56430
56829
  propertyId = _useState5[0],
56431
56830
  setPropertyId = _useState5[1];
56831
+ const initialPropertyId = useRef(requestedPropertyId);
56832
+ const verifiedPropertyId = useRef(sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID"));
56432
56833
  const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
56433
56834
  sessionFormData = _Digit$Hooks$useSessi[0],
56434
56835
  setSessionFormData = _Digit$Hooks$useSessi[1],
@@ -56443,9 +56844,16 @@ const OLDApplication = () => {
56443
56844
  propertyIds: propertyId
56444
56845
  },
56445
56846
  tenantId: tenantId,
56446
- enabled: propertyId && propertyId !== "" ? true : false
56847
+ enabled: propertyId && propertyId === requestedPropertyId && propertyId === verifiedPropertyId.current
56447
56848
  }),
56448
56849
  propertyDetails = _Digit$Hooks$pt$usePr.data;
56850
+ useEffect(() => {
56851
+ if (requestedPropertyId !== initialPropertyId.current || requestedPropertyId && requestedPropertyId !== verifiedPropertyId.current) {
56852
+ clearSessionFormData();
56853
+ sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
56854
+ history.replace("/digit-ui/employee/ws/info");
56855
+ }
56856
+ }, [clearSessionFormData, history, requestedPropertyId]);
56449
56857
  useEffect(() => {
56450
56858
  sessionStorage.removeItem("FORMSTATE_ERRORS");
56451
56859
  }, []);
@@ -56455,7 +56863,7 @@ const OLDApplication = () => {
56455
56863
  if (config) {
56456
56864
  var _config$body;
56457
56865
  const allCreateSections = (config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.filter(section => section === null || section === void 0 ? void 0 : section.isCreateConnection)) || [];
56458
- const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSDjbEmployee", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSBankDetails", "WSDocumentsEmployee", "WSDeclaration"];
56866
+ const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSDjbEmployee", "WSDivyangjan", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSBankDetails", "WSDocumentsEmployee", "WSDeclaration"];
56459
56867
  const reorderedBody = [];
56460
56868
  desiredComponentOrder.forEach(compName => {
56461
56869
  const section = allCreateSections.find(s => {
@@ -56521,6 +56929,19 @@ const OLDApplication = () => {
56521
56929
  withoutLabel: true
56522
56930
  }]
56523
56931
  });
56932
+ } else if (compName === "WSDivyangjan") {
56933
+ reorderedBody.push({
56934
+ isCreateConnection: true,
56935
+ body: [{
56936
+ type: "component",
56937
+ key: "disability",
56938
+ component: "WSDivyangjan",
56939
+ withoutLabel: true,
56940
+ texts: {
56941
+ header: "Divyangjan/Person with Disability?"
56942
+ }
56943
+ }]
56944
+ });
56524
56945
  }
56525
56946
  });
56526
56947
  allCreateSections.forEach(section => {
@@ -56785,6 +57206,7 @@ const OLDApplication = () => {
56785
57206
  try {
56786
57207
  var _waterUpdateData$Wate, _waterUpdateData$Wate2, _sewerageUpdateData$S, _sewerageUpdateData$S2;
56787
57208
  clearSessionFormData();
57209
+ sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
56788
57210
  history.push(basePath + "/ws-response?applicationNumber=" + (waterUpdateData === null || waterUpdateData === void 0 ? void 0 : (_waterUpdateData$Wate = waterUpdateData.WaterConnection) === null || _waterUpdateData$Wate === void 0 ? void 0 : (_waterUpdateData$Wate2 = _waterUpdateData$Wate[0]) === null || _waterUpdateData$Wate2 === void 0 ? void 0 : _waterUpdateData$Wate2.applicationNo) + "&applicationNumber1=" + (sewerageUpdateData === null || sewerageUpdateData === void 0 ? void 0 : (_sewerageUpdateData$S = sewerageUpdateData.SewerageConnections) === null || _sewerageUpdateData$S === void 0 ? void 0 : (_sewerageUpdateData$S2 = _sewerageUpdateData$S[0]) === null || _sewerageUpdateData$S2 === void 0 ? void 0 : _sewerageUpdateData$S2.applicationNo));
56789
57211
  return Promise.resolve();
56790
57212
  } catch (e) {
@@ -56848,6 +57270,7 @@ const OLDApplication = () => {
56848
57270
  onSuccess: data => {
56849
57271
  var _data$WaterConnection2, _data$WaterConnection3;
56850
57272
  clearSessionFormData();
57273
+ sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
56851
57274
  history.push(basePath + "/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection2 = data.WaterConnection) === null || _data$WaterConnection2 === void 0 ? void 0 : (_data$WaterConnection3 = _data$WaterConnection2[0]) === null || _data$WaterConnection3 === void 0 ? void 0 : _data$WaterConnection3.applicationNo));
56852
57275
  }
56853
57276
  });
@@ -56896,6 +57319,7 @@ const OLDApplication = () => {
56896
57319
  onSuccess: data => {
56897
57320
  var _data$SewerageConnect2, _data$SewerageConnect3;
56898
57321
  clearSessionFormData();
57322
+ sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
56899
57323
  history.push(basePath + "/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect2 = data.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : (_data$SewerageConnect3 = _data$SewerageConnect2[0]) === null || _data$SewerageConnect3 === void 0 ? void 0 : _data$SewerageConnect3.applicationNo));
56900
57324
  }
56901
57325
  })).then(function () {});
@@ -57121,7 +57545,8 @@ const componentsToRegister = {
57121
57545
  WSSearchIntegrated: SearchIntegrated,
57122
57546
  WSSearchWaterConnectionViewIntegrated: SearchWaterConnectionViewIntegrated,
57123
57547
  WSBulkBillGeneration: BulkBillGeneration,
57124
- WSOLDApplication: OLDApplication
57548
+ WSOLDApplication: OLDApplication,
57549
+ WSDivyangjan: WSDivyangjan
57125
57550
  };
57126
57551
  const initWSComponents = () => {
57127
57552
  Object.entries(componentsToRegister).forEach(_ref3 => {