@djb25/digit-ui-module-commonpt 1.0.7 → 1.0.8

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,4 +1,4 @@
1
- import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, Header, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, Label, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
1
+ import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, Header, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, Label, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useLayoutEffect, useMemo, useRef, Fragment as Fragment$1, memo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useHistory, useRouteMatch, Switch, Route, Link, useParams } from 'react-router-dom';
@@ -5898,7 +5898,7 @@ var lodash = createCommonjsModule(function (module, exports) {
5898
5898
  });
5899
5899
 
5900
5900
  const setAddressDetailsLW = data => {
5901
- var _address$city, _address$city2, _address$locality, _address$locality2, _address$locality3, _address$locality4, _address$zro, _address$addressType;
5901
+ var _address$city, _address$city2, _address$locality, _address$locality2, _address$locality3, _address$locality4, _address$zro, _address$addressType, _address$subLocality, _address$wardRemark;
5902
5902
  let {
5903
5903
  locationDet,
5904
5904
  propertyAddress
@@ -5925,7 +5925,9 @@ const setAddressDetailsLW = data => {
5925
5925
  block: address === null || address === void 0 ? void 0 : address.block,
5926
5926
  zone: address === null || address === void 0 ? void 0 : address.zone,
5927
5927
  zroLocation: (address === null || address === void 0 ? void 0 : (_address$zro = address.zro) === null || _address$zro === void 0 ? void 0 : _address$zro.code) || (address === null || address === void 0 ? void 0 : address.zro),
5928
- addressType: (address === null || address === void 0 ? void 0 : (_address$addressType = address.addressType) === null || _address$addressType === void 0 ? void 0 : _address$addressType.code) || (address === null || address === void 0 ? void 0 : address.addressType)
5928
+ addressType: (address === null || address === void 0 ? void 0 : (_address$addressType = address.addressType) === null || _address$addressType === void 0 ? void 0 : _address$addressType.code) || (address === null || address === void 0 ? void 0 : address.addressType),
5929
+ subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || (address === null || address === void 0 ? void 0 : (_address$subLocality = address.subLocality) === null || _address$subLocality === void 0 ? void 0 : _address$subLocality.name) || (address === null || address === void 0 ? void 0 : address.subLocality),
5930
+ wardRemark: (address === null || address === void 0 ? void 0 : address.wardRemark) || (address === null || address === void 0 ? void 0 : (_address$wardRemark = address.wardRemark) === null || _address$wardRemark === void 0 ? void 0 : _address$wardRemark.name) || (address === null || address === void 0 ? void 0 : address.wardRemark)
5929
5931
  };
5930
5932
  data.address = propAddress;
5931
5933
  return data;
@@ -6017,7 +6019,7 @@ const setPropertyDetailsLW = data => {
6017
6019
  return data;
6018
6020
  };
6019
6021
  const convertToPropertyLightWeight = (data = {}) => {
6020
- var _data$propertyDetails, _data$propertyDetails2, _data, _data$owners2, _data$owners2$, _data$propertyDetails3, _data$propertyDetails4, _data$waterConnection, _data$waterConnection2, _data$waterConnection3, _data$useDetails, _data$useDetails$Wate, _data$waterConnection4, _data$waterConnection5, _data$waterConnection6, _data$useDetails2, _data$useDetails2$Sel, _data$waterConnection7, _data$waterConnection8, _data$useDetails3, _data$waterConnection9, _data$waterConnection0, _data$useDetails4, _data$waterConnection1, _data$waterConnection10, _data$waterConnection11, _data$useDetails5, _data$useDetails5$noO, _data$waterConnection12, _data$waterConnection13, _data$useDetails6, _data$waterConnection14, _data$waterConnection15, _data$useDetails7, _data$waterConnection16, _data$waterConnection17, _data$useDetails8;
6022
+ var _data$propertyDetails, _data$propertyDetails2, _data, _data$owners2, _data$owners2$, _data$propertyDetails3, _data$propertyDetails4, _data$waterConnection, _data$waterConnection2, _data$waterConnection3, _data$useDetails, _data$useDetails$cate, _data$waterConnection4, _data$waterConnection5, _data$waterConnection6, _data$useDetails2, _data$useDetails2$Wat, _data$waterConnection7, _data$waterConnection8, _data$waterConnection9, _data$useDetails3, _data$useDetails3$Sel, _data$waterConnection0, _data$waterConnection1, _data$useDetails4, _data$waterConnection10, _data$waterConnection11, _data$useDetails5, _data$waterConnection12, _data$waterConnection13, _data$waterConnection14, _data$useDetails6, _data$useDetails6$noO, _data$waterConnection15, _data$waterConnection16, _data$useDetails7, _data$waterConnection17, _data$waterConnection18, _data$useDetails8, _data$waterConnection19, _data$waterConnection20, _data$useDetails9;
6021
6023
  data = setOwnerDetailsLW(data);
6022
6024
  data = setAddressDetailsLW(data);
6023
6025
  data = setPropertyDetailsLW(data);
@@ -6061,14 +6063,15 @@ const convertToPropertyLightWeight = (data = {}) => {
6061
6063
  isRainwaterHarvesting: false,
6062
6064
  propertyType: propertyType,
6063
6065
  propertyCategory: (_data$propertyDetails4 = data.propertyDetails) === null || _data$propertyDetails4 === void 0 ? void 0 : _data$propertyDetails4.usageCategory,
6064
- waterConnectionUsageType: ((_data$waterConnection = data.waterConnection) === null || _data$waterConnection === void 0 ? void 0 : (_data$waterConnection2 = _data$waterConnection.useDetails) === null || _data$waterConnection2 === void 0 ? void 0 : (_data$waterConnection3 = _data$waterConnection2.WaterConnectionUsageType) === null || _data$waterConnection3 === void 0 ? void 0 : _data$waterConnection3.code) || ((_data$useDetails = data.useDetails) === null || _data$useDetails === void 0 ? void 0 : (_data$useDetails$Wate = _data$useDetails.WaterConnectionUsageType) === null || _data$useDetails$Wate === void 0 ? void 0 : _data$useDetails$Wate.code),
6065
- yearOfConstruction: ((_data$waterConnection4 = data.waterConnection) === null || _data$waterConnection4 === void 0 ? void 0 : (_data$waterConnection5 = _data$waterConnection4.useDetails) === null || _data$waterConnection5 === void 0 ? void 0 : (_data$waterConnection6 = _data$waterConnection5.SelectYearofConstruction) === null || _data$waterConnection6 === void 0 ? void 0 : _data$waterConnection6.value) || ((_data$useDetails2 = data.useDetails) === null || _data$useDetails2 === void 0 ? void 0 : (_data$useDetails2$Sel = _data$useDetails2.SelectYearofConstruction) === null || _data$useDetails2$Sel === void 0 ? void 0 : _data$useDetails2$Sel.value),
6066
- numberOfDwellingUnits: ((_data$waterConnection7 = data.waterConnection) === null || _data$waterConnection7 === void 0 ? void 0 : (_data$waterConnection8 = _data$waterConnection7.useDetails) === null || _data$waterConnection8 === void 0 ? void 0 : _data$waterConnection8.NumberofDwellingUnits) || ((_data$useDetails3 = data.useDetails) === null || _data$useDetails3 === void 0 ? void 0 : _data$useDetails3.NumberofDwellingUnits),
6067
- numberOfRooms: ((_data$waterConnection9 = data.waterConnection) === null || _data$waterConnection9 === void 0 ? void 0 : (_data$waterConnection0 = _data$waterConnection9.useDetails) === null || _data$waterConnection0 === void 0 ? void 0 : _data$waterConnection0.NumberofRooms) || ((_data$useDetails4 = data.useDetails) === null || _data$useDetails4 === void 0 ? void 0 : _data$useDetails4.NumberofRooms),
6068
- numberOfFloors: ((_data$waterConnection1 = data.waterConnection) === null || _data$waterConnection1 === void 0 ? void 0 : (_data$waterConnection10 = _data$waterConnection1.useDetails) === null || _data$waterConnection10 === void 0 ? void 0 : (_data$waterConnection11 = _data$waterConnection10.noOfFloors) === null || _data$waterConnection11 === void 0 ? void 0 : _data$waterConnection11.code) || ((_data$useDetails5 = data.useDetails) === null || _data$useDetails5 === void 0 ? void 0 : (_data$useDetails5$noO = _data$useDetails5.noOfFloors) === null || _data$useDetails5$noO === void 0 ? void 0 : _data$useDetails5$noO.code) || 1,
6069
- plotArea: ((_data$waterConnection12 = data.waterConnection) === null || _data$waterConnection12 === void 0 ? void 0 : (_data$waterConnection13 = _data$waterConnection12.useDetails) === null || _data$waterConnection13 === void 0 ? void 0 : _data$waterConnection13.plotArea) || ((_data$useDetails6 = data.useDetails) === null || _data$useDetails6 === void 0 ? void 0 : _data$useDetails6.plotArea),
6070
- builtUpArea: ((_data$waterConnection14 = data.waterConnection) === null || _data$waterConnection14 === void 0 ? void 0 : (_data$waterConnection15 = _data$waterConnection14.useDetails) === null || _data$waterConnection15 === void 0 ? void 0 : _data$waterConnection15.builtUpArea) || ((_data$useDetails7 = data.useDetails) === null || _data$useDetails7 === void 0 ? void 0 : _data$useDetails7.builtUpArea),
6071
- numberOfBeds: ((_data$waterConnection16 = data.waterConnection) === null || _data$waterConnection16 === void 0 ? void 0 : (_data$waterConnection17 = _data$waterConnection16.useDetails) === null || _data$waterConnection17 === void 0 ? void 0 : _data$waterConnection17.hospitalBeds) || ((_data$useDetails8 = data.useDetails) === null || _data$useDetails8 === void 0 ? void 0 : _data$useDetails8.hospitalBeds),
6066
+ categoryType: ((_data$waterConnection = data.waterConnection) === null || _data$waterConnection === void 0 ? void 0 : (_data$waterConnection2 = _data$waterConnection.useDetails) === null || _data$waterConnection2 === void 0 ? void 0 : (_data$waterConnection3 = _data$waterConnection2.categoryType) === null || _data$waterConnection3 === void 0 ? void 0 : _data$waterConnection3.code) || ((_data$useDetails = data.useDetails) === null || _data$useDetails === void 0 ? void 0 : (_data$useDetails$cate = _data$useDetails.categoryType) === null || _data$useDetails$cate === void 0 ? void 0 : _data$useDetails$cate.code),
6067
+ waterConnectionUsageType: ((_data$waterConnection4 = data.waterConnection) === null || _data$waterConnection4 === void 0 ? void 0 : (_data$waterConnection5 = _data$waterConnection4.useDetails) === null || _data$waterConnection5 === void 0 ? void 0 : (_data$waterConnection6 = _data$waterConnection5.WaterConnectionUsageType) === null || _data$waterConnection6 === void 0 ? void 0 : _data$waterConnection6.code) || ((_data$useDetails2 = data.useDetails) === null || _data$useDetails2 === void 0 ? void 0 : (_data$useDetails2$Wat = _data$useDetails2.WaterConnectionUsageType) === null || _data$useDetails2$Wat === void 0 ? void 0 : _data$useDetails2$Wat.code),
6068
+ yearOfConstruction: ((_data$waterConnection7 = data.waterConnection) === null || _data$waterConnection7 === void 0 ? void 0 : (_data$waterConnection8 = _data$waterConnection7.useDetails) === null || _data$waterConnection8 === void 0 ? void 0 : (_data$waterConnection9 = _data$waterConnection8.SelectYearofConstruction) === null || _data$waterConnection9 === void 0 ? void 0 : _data$waterConnection9.value) || ((_data$useDetails3 = data.useDetails) === null || _data$useDetails3 === void 0 ? void 0 : (_data$useDetails3$Sel = _data$useDetails3.SelectYearofConstruction) === null || _data$useDetails3$Sel === void 0 ? void 0 : _data$useDetails3$Sel.value),
6069
+ numberOfDwellingUnits: ((_data$waterConnection0 = data.waterConnection) === null || _data$waterConnection0 === void 0 ? void 0 : (_data$waterConnection1 = _data$waterConnection0.useDetails) === null || _data$waterConnection1 === void 0 ? void 0 : _data$waterConnection1.NumberofDwellingUnits) || ((_data$useDetails4 = data.useDetails) === null || _data$useDetails4 === void 0 ? void 0 : _data$useDetails4.NumberofDwellingUnits),
6070
+ numberOfRooms: ((_data$waterConnection10 = data.waterConnection) === null || _data$waterConnection10 === void 0 ? void 0 : (_data$waterConnection11 = _data$waterConnection10.useDetails) === null || _data$waterConnection11 === void 0 ? void 0 : _data$waterConnection11.NumberofRooms) || ((_data$useDetails5 = data.useDetails) === null || _data$useDetails5 === void 0 ? void 0 : _data$useDetails5.NumberofRooms),
6071
+ numberOfFloors: ((_data$waterConnection12 = data.waterConnection) === null || _data$waterConnection12 === void 0 ? void 0 : (_data$waterConnection13 = _data$waterConnection12.useDetails) === null || _data$waterConnection13 === void 0 ? void 0 : (_data$waterConnection14 = _data$waterConnection13.noOfFloors) === null || _data$waterConnection14 === void 0 ? void 0 : _data$waterConnection14.code) || ((_data$useDetails6 = data.useDetails) === null || _data$useDetails6 === void 0 ? void 0 : (_data$useDetails6$noO = _data$useDetails6.noOfFloors) === null || _data$useDetails6$noO === void 0 ? void 0 : _data$useDetails6$noO.code) || 1,
6072
+ plotArea: ((_data$waterConnection15 = data.waterConnection) === null || _data$waterConnection15 === void 0 ? void 0 : (_data$waterConnection16 = _data$waterConnection15.useDetails) === null || _data$waterConnection16 === void 0 ? void 0 : _data$waterConnection16.plotArea) || ((_data$useDetails7 = data.useDetails) === null || _data$useDetails7 === void 0 ? void 0 : _data$useDetails7.plotArea),
6073
+ builtUpArea: ((_data$waterConnection17 = data.waterConnection) === null || _data$waterConnection17 === void 0 ? void 0 : (_data$waterConnection18 = _data$waterConnection17.useDetails) === null || _data$waterConnection18 === void 0 ? void 0 : _data$waterConnection18.builtUpArea) || ((_data$useDetails8 = data.useDetails) === null || _data$useDetails8 === void 0 ? void 0 : _data$useDetails8.builtUpArea),
6074
+ numberOfBeds: ((_data$waterConnection19 = data.waterConnection) === null || _data$waterConnection19 === void 0 ? void 0 : (_data$waterConnection20 = _data$waterConnection19.useDetails) === null || _data$waterConnection20 === void 0 ? void 0 : _data$waterConnection20.hospitalBeds) || ((_data$useDetails9 = data.useDetails) === null || _data$useDetails9 === void 0 ? void 0 : _data$useDetails9.hospitalBeds),
6072
6075
  owners: [...(data.owners || []).map((owner, index) => {
6073
6076
  var _owner$gender3, _owner$gender4, _owner$ownerType2, _owner$relationship2, _owner$inistitutetype2;
6074
6077
  return {
@@ -6107,7 +6110,7 @@ const convertToPropertyLightWeight = (data = {}) => {
6107
6110
  return formdata;
6108
6111
  };
6109
6112
  const convertToUpdatePropertyLightWeight = (data = {}) => {
6110
- var _data$propertyDetails5, _data$propertyDetails6, _data$waterConnection18, _data$waterConnection19, _data$waterConnection20, _data$useDetails9, _data$useDetails9$Wat, _data$waterConnection21, _data$waterConnection22, _data$waterConnection23, _data$useDetails0, _data$useDetails0$Sel, _data$waterConnection24, _data$waterConnection25, _data$useDetails1, _data$waterConnection26, _data$waterConnection27, _data$useDetails10, _data$waterConnection28, _data$waterConnection29, _data$waterConnection30, _data$useDetails11, _data$useDetails11$no, _data$waterConnection31, _data$waterConnection32, _data$useDetails12, _data$waterConnection33, _data$waterConnection34, _data$useDetails13, _data$waterConnection35, _data$waterConnection36, _data$useDetails14, _formdata$Property, _data3, _formdata$Property3;
6113
+ var _data$propertyDetails5, _data$propertyDetails6, _data$waterConnection21, _data$waterConnection22, _data$waterConnection23, _data$useDetails0, _data$useDetails0$cat, _data$waterConnection24, _data$waterConnection25, _data$waterConnection26, _data$useDetails1, _data$useDetails1$Wat, _data$waterConnection27, _data$waterConnection28, _data$waterConnection29, _data$useDetails10, _data$useDetails10$Se, _data$waterConnection30, _data$waterConnection31, _data$useDetails11, _data$waterConnection32, _data$waterConnection33, _data$useDetails12, _data$waterConnection34, _data$waterConnection35, _data$waterConnection36, _data$useDetails13, _data$useDetails13$no, _data$waterConnection37, _data$waterConnection38, _data$useDetails14, _data$waterConnection39, _data$waterConnection40, _data$useDetails15, _data$waterConnection41, _data$waterConnection42, _data$useDetails16, _formdata$Property, _data3, _formdata$Property3;
6111
6114
  data = setOwnerDetailsLW(data);
6112
6115
  data = setAddressDetailsLW(data);
6113
6116
  data = setPropertyDetailsLW(data);
@@ -6153,14 +6156,15 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6153
6156
  noOfFloors: noOfFloors,
6154
6157
  additionalDetails: {
6155
6158
  isRainwaterHarvesting: false,
6156
- waterConnectionUsageType: ((_data$waterConnection18 = data.waterConnection) === null || _data$waterConnection18 === void 0 ? void 0 : (_data$waterConnection19 = _data$waterConnection18.useDetails) === null || _data$waterConnection19 === void 0 ? void 0 : (_data$waterConnection20 = _data$waterConnection19.WaterConnectionUsageType) === null || _data$waterConnection20 === void 0 ? void 0 : _data$waterConnection20.code) || ((_data$useDetails9 = data.useDetails) === null || _data$useDetails9 === void 0 ? void 0 : (_data$useDetails9$Wat = _data$useDetails9.WaterConnectionUsageType) === null || _data$useDetails9$Wat === void 0 ? void 0 : _data$useDetails9$Wat.code),
6157
- yearOfConstruction: ((_data$waterConnection21 = data.waterConnection) === null || _data$waterConnection21 === void 0 ? void 0 : (_data$waterConnection22 = _data$waterConnection21.useDetails) === null || _data$waterConnection22 === void 0 ? void 0 : (_data$waterConnection23 = _data$waterConnection22.SelectYearofConstruction) === null || _data$waterConnection23 === void 0 ? void 0 : _data$waterConnection23.value) || ((_data$useDetails0 = data.useDetails) === null || _data$useDetails0 === void 0 ? void 0 : (_data$useDetails0$Sel = _data$useDetails0.SelectYearofConstruction) === null || _data$useDetails0$Sel === void 0 ? void 0 : _data$useDetails0$Sel.value),
6158
- numberOfDwellingUnits: ((_data$waterConnection24 = data.waterConnection) === null || _data$waterConnection24 === void 0 ? void 0 : (_data$waterConnection25 = _data$waterConnection24.useDetails) === null || _data$waterConnection25 === void 0 ? void 0 : _data$waterConnection25.NumberofDwellingUnits) || ((_data$useDetails1 = data.useDetails) === null || _data$useDetails1 === void 0 ? void 0 : _data$useDetails1.NumberofDwellingUnits),
6159
- numberOfRooms: ((_data$waterConnection26 = data.waterConnection) === null || _data$waterConnection26 === void 0 ? void 0 : (_data$waterConnection27 = _data$waterConnection26.useDetails) === null || _data$waterConnection27 === void 0 ? void 0 : _data$waterConnection27.NumberofRooms) || ((_data$useDetails10 = data.useDetails) === null || _data$useDetails10 === void 0 ? void 0 : _data$useDetails10.NumberofRooms),
6160
- numberOfFloors: ((_data$waterConnection28 = data.waterConnection) === null || _data$waterConnection28 === void 0 ? void 0 : (_data$waterConnection29 = _data$waterConnection28.useDetails) === null || _data$waterConnection29 === void 0 ? void 0 : (_data$waterConnection30 = _data$waterConnection29.noOfFloors) === null || _data$waterConnection30 === void 0 ? void 0 : _data$waterConnection30.code) || ((_data$useDetails11 = data.useDetails) === null || _data$useDetails11 === void 0 ? void 0 : (_data$useDetails11$no = _data$useDetails11.noOfFloors) === null || _data$useDetails11$no === void 0 ? void 0 : _data$useDetails11$no.code) || 1,
6161
- plotArea: ((_data$waterConnection31 = data.waterConnection) === null || _data$waterConnection31 === void 0 ? void 0 : (_data$waterConnection32 = _data$waterConnection31.useDetails) === null || _data$waterConnection32 === void 0 ? void 0 : _data$waterConnection32.plotArea) || ((_data$useDetails12 = data.useDetails) === null || _data$useDetails12 === void 0 ? void 0 : _data$useDetails12.plotArea),
6162
- builtUpArea: ((_data$waterConnection33 = data.waterConnection) === null || _data$waterConnection33 === void 0 ? void 0 : (_data$waterConnection34 = _data$waterConnection33.useDetails) === null || _data$waterConnection34 === void 0 ? void 0 : _data$waterConnection34.builtUpArea) || ((_data$useDetails13 = data.useDetails) === null || _data$useDetails13 === void 0 ? void 0 : _data$useDetails13.builtUpArea),
6163
- hospitalBeds: ((_data$waterConnection35 = data.waterConnection) === null || _data$waterConnection35 === void 0 ? void 0 : (_data$waterConnection36 = _data$waterConnection35.useDetails) === null || _data$waterConnection36 === void 0 ? void 0 : _data$waterConnection36.hospitalBeds) || ((_data$useDetails14 = data.useDetails) === null || _data$useDetails14 === void 0 ? void 0 : _data$useDetails14.hospitalBeds),
6159
+ categoryType: ((_data$waterConnection21 = data.waterConnection) === null || _data$waterConnection21 === void 0 ? void 0 : (_data$waterConnection22 = _data$waterConnection21.useDetails) === null || _data$waterConnection22 === void 0 ? void 0 : (_data$waterConnection23 = _data$waterConnection22.categoryType) === null || _data$waterConnection23 === void 0 ? void 0 : _data$waterConnection23.code) || ((_data$useDetails0 = data.useDetails) === null || _data$useDetails0 === void 0 ? void 0 : (_data$useDetails0$cat = _data$useDetails0.categoryType) === null || _data$useDetails0$cat === void 0 ? void 0 : _data$useDetails0$cat.code),
6160
+ waterConnectionUsageType: ((_data$waterConnection24 = data.waterConnection) === null || _data$waterConnection24 === void 0 ? void 0 : (_data$waterConnection25 = _data$waterConnection24.useDetails) === null || _data$waterConnection25 === void 0 ? void 0 : (_data$waterConnection26 = _data$waterConnection25.WaterConnectionUsageType) === null || _data$waterConnection26 === void 0 ? void 0 : _data$waterConnection26.code) || ((_data$useDetails1 = data.useDetails) === null || _data$useDetails1 === void 0 ? void 0 : (_data$useDetails1$Wat = _data$useDetails1.WaterConnectionUsageType) === null || _data$useDetails1$Wat === void 0 ? void 0 : _data$useDetails1$Wat.code),
6161
+ yearOfConstruction: ((_data$waterConnection27 = data.waterConnection) === null || _data$waterConnection27 === void 0 ? void 0 : (_data$waterConnection28 = _data$waterConnection27.useDetails) === null || _data$waterConnection28 === void 0 ? void 0 : (_data$waterConnection29 = _data$waterConnection28.SelectYearofConstruction) === null || _data$waterConnection29 === void 0 ? void 0 : _data$waterConnection29.value) || ((_data$useDetails10 = data.useDetails) === null || _data$useDetails10 === void 0 ? void 0 : (_data$useDetails10$Se = _data$useDetails10.SelectYearofConstruction) === null || _data$useDetails10$Se === void 0 ? void 0 : _data$useDetails10$Se.value),
6162
+ numberOfDwellingUnits: ((_data$waterConnection30 = data.waterConnection) === null || _data$waterConnection30 === void 0 ? void 0 : (_data$waterConnection31 = _data$waterConnection30.useDetails) === null || _data$waterConnection31 === void 0 ? void 0 : _data$waterConnection31.NumberofDwellingUnits) || ((_data$useDetails11 = data.useDetails) === null || _data$useDetails11 === void 0 ? void 0 : _data$useDetails11.NumberofDwellingUnits),
6163
+ numberOfRooms: ((_data$waterConnection32 = data.waterConnection) === null || _data$waterConnection32 === void 0 ? void 0 : (_data$waterConnection33 = _data$waterConnection32.useDetails) === null || _data$waterConnection33 === void 0 ? void 0 : _data$waterConnection33.NumberofRooms) || ((_data$useDetails12 = data.useDetails) === null || _data$useDetails12 === void 0 ? void 0 : _data$useDetails12.NumberofRooms),
6164
+ numberOfFloors: ((_data$waterConnection34 = data.waterConnection) === null || _data$waterConnection34 === void 0 ? void 0 : (_data$waterConnection35 = _data$waterConnection34.useDetails) === null || _data$waterConnection35 === void 0 ? void 0 : (_data$waterConnection36 = _data$waterConnection35.noOfFloors) === null || _data$waterConnection36 === void 0 ? void 0 : _data$waterConnection36.code) || ((_data$useDetails13 = data.useDetails) === null || _data$useDetails13 === void 0 ? void 0 : (_data$useDetails13$no = _data$useDetails13.noOfFloors) === null || _data$useDetails13$no === void 0 ? void 0 : _data$useDetails13$no.code) || 1,
6165
+ plotArea: ((_data$waterConnection37 = data.waterConnection) === null || _data$waterConnection37 === void 0 ? void 0 : (_data$waterConnection38 = _data$waterConnection37.useDetails) === null || _data$waterConnection38 === void 0 ? void 0 : _data$waterConnection38.plotArea) || ((_data$useDetails14 = data.useDetails) === null || _data$useDetails14 === void 0 ? void 0 : _data$useDetails14.plotArea),
6166
+ builtUpArea: ((_data$waterConnection39 = data.waterConnection) === null || _data$waterConnection39 === void 0 ? void 0 : (_data$waterConnection40 = _data$waterConnection39.useDetails) === null || _data$waterConnection40 === void 0 ? void 0 : _data$waterConnection40.builtUpArea) || ((_data$useDetails15 = data.useDetails) === null || _data$useDetails15 === void 0 ? void 0 : _data$useDetails15.builtUpArea),
6167
+ hospitalBeds: ((_data$waterConnection41 = data.waterConnection) === null || _data$waterConnection41 === void 0 ? void 0 : (_data$waterConnection42 = _data$waterConnection41.useDetails) === null || _data$waterConnection42 === void 0 ? void 0 : _data$waterConnection42.hospitalBeds) || ((_data$useDetails16 = data.useDetails) === null || _data$useDetails16 === void 0 ? void 0 : _data$useDetails16.hospitalBeds),
6164
6168
  owners: [...data.owners.map((owner, index) => {
6165
6169
  var _owner$gender6, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6166
6170
  return {
@@ -6440,10 +6444,10 @@ const rowContainerStyle = {
6440
6444
  justifyContent: "space-between"
6441
6445
  };
6442
6446
  const BannerPicker = props => {
6443
- var _props$data;
6447
+ var _props$data, _props$data$Propertie, _props$data$Propertie2;
6444
6448
  return /*#__PURE__*/React.createElement(Banner, {
6445
6449
  message: GetActionMessage(props),
6446
- applicationNumber: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.Properties[0].acknowldgementNumber,
6450
+ applicationNumber: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : (_props$data$Propertie = _props$data.Properties) === null || _props$data$Propertie === void 0 ? void 0 : (_props$data$Propertie2 = _props$data$Propertie[0]) === null || _props$data$Propertie2 === void 0 ? void 0 : _props$data$Propertie2.acknowldgementNumber,
6447
6451
  info: props.isSuccess ? props.t("PT_APPLICATION_NO") : "",
6448
6452
  successful: props.isSuccess
6449
6453
  });
@@ -6455,7 +6459,7 @@ const PTAcknowledgement = ({
6455
6459
  redirectUrl,
6456
6460
  userType
6457
6461
  }) => {
6458
- var _location$state, _location$state2, _mdmsConfig$PropertyT, _data, _data$locationDet, _data$locationDet2, _data$locationDet2$ci, _data2, _data2$locationDet, _data$locationDet3, _data$locationDet3$ci, _responseData$Propert;
6462
+ var _location$state, _location$state2, _formData$cptNewPrope2, _formData$cptNewPrope3, _mdmsConfig$PropertyT, _data, _data$locationDet, _data$locationDet2, _data$locationDet2$ci, _data2, _data2$locationDet, _data$locationDet3, _data$locationDet3$ci, _responseData$Propert4;
6459
6463
  const {
6460
6464
  t
6461
6465
  } = useTranslation();
@@ -6468,7 +6472,7 @@ const PTAcknowledgement = ({
6468
6472
  var _formData$cptNewPrope;
6469
6473
  data = formData === null || formData === void 0 ? void 0 : (_formData$cptNewPrope = formData.cptNewProperty) === null || _formData$cptNewPrope === void 0 ? void 0 : _formData$cptNewPrope.property;
6470
6474
  }
6471
- const propertyFromState = location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.property;
6475
+ const propertyFromState = (location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.property) || (onSelect && formData !== null && formData !== void 0 && (_formData$cptNewPrope2 = formData.cptNewProperty) !== null && _formData$cptNewPrope2 !== void 0 && _formData$cptNewPrope2.property ? formData === null || formData === void 0 ? void 0 : (_formData$cptNewPrope3 = formData.cptNewProperty) === null || _formData$cptNewPrope3 === void 0 ? void 0 : _formData$cptNewPrope3.property : null);
6472
6476
  let createNUpdate = false;
6473
6477
  let {
6474
6478
  data: mdmsConfig,
@@ -6523,23 +6527,23 @@ const PTAcknowledgement = ({
6523
6527
  } catch (er) {}
6524
6528
  }
6525
6529
  }, [mutation.isSuccess]);
6530
+ const isMutationLoading = propertyFromState ? false : mutation.isLoading || mutation.isIdle;
6531
+ const isMutationSuccess = propertyFromState ? true : mutation.isSuccess;
6532
+ const responseData = propertyFromState ? {
6533
+ Properties: [propertyFromState]
6534
+ } : mutation.data;
6526
6535
  const onNext = () => {
6527
6536
  if (onSelect) {
6528
- if (mutation.isSuccess) {
6529
- var _mutation$data, _mutation$data2, _mutation$data3;
6530
- sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data = mutation.data) === null || _mutation$data === void 0 ? void 0 : _mutation$data.Properties[0]));
6531
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data2 = mutation.data) === null || _mutation$data2 === void 0 ? void 0 : _mutation$data2.Properties[0]));
6537
+ if (isMutationSuccess) {
6538
+ var _responseData$Propert, _responseData$Propert2, _responseData$Propert3;
6539
+ sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert = responseData.Properties) === null || _responseData$Propert === void 0 ? void 0 : _responseData$Propert[0]));
6540
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert2 = responseData.Properties) === null || _responseData$Propert2 === void 0 ? void 0 : _responseData$Propert2[0]));
6532
6541
  onSelect("cpt", {
6533
- details: mutation === null || mutation === void 0 ? void 0 : (_mutation$data3 = mutation.data) === null || _mutation$data3 === void 0 ? void 0 : _mutation$data3.Properties[0]
6542
+ details: responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert3 = responseData.Properties) === null || _responseData$Propert3 === void 0 ? void 0 : _responseData$Propert3[0]
6534
6543
  });
6535
6544
  }
6536
6545
  }
6537
6546
  };
6538
- const isMutationLoading = propertyFromState ? false : mutation.isLoading || mutation.isIdle;
6539
- const isMutationSuccess = propertyFromState ? true : mutation.isSuccess;
6540
- const responseData = propertyFromState ? {
6541
- Properties: [propertyFromState]
6542
- } : mutation.data;
6543
6547
  return isMutationLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
6544
6548
  t: t,
6545
6549
  data: responseData,
@@ -6549,7 +6553,7 @@ const PTAcknowledgement = ({
6549
6553
  rowContainerStyle: rowContainerStyle,
6550
6554
  last: true,
6551
6555
  label: t("PT_COMMON_TABLE_COL_PT_ID"),
6552
- text: responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert = responseData.Properties[0]) === null || _responseData$Propert === void 0 ? void 0 : _responseData$Propert.propertyId,
6556
+ text: responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert4 = responseData.Properties[0]) === null || _responseData$Propert4 === void 0 ? void 0 : _responseData$Propert4.propertyId,
6553
6557
  textStyle: {
6554
6558
  whiteSpace: "pre",
6555
6559
  width: "200%"
@@ -6564,8 +6568,8 @@ const PTAcknowledgement = ({
6564
6568
  const redirectUrlFromQuery = queryParams.get("redirectToUrl");
6565
6569
  const finalRedirectUrl = redirectUrl && redirectUrl !== "undefined" ? redirectUrl : redirectUrlFromQuery && redirectUrlFromQuery !== "undefined" ? redirectUrlFromQuery : null;
6566
6570
  if (finalRedirectUrl) {
6567
- var _responseData$Propert2, _responseData$Propert3, _location$state3;
6568
- history.push(`${finalRedirectUrl}?propertyId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert2 = responseData.Properties[0]) === null || _responseData$Propert2 === void 0 ? void 0 : _responseData$Propert2.propertyId}&tenantId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert3 = responseData.Properties[0]) === null || _responseData$Propert3 === void 0 ? void 0 : _responseData$Propert3.tenantId}`, {
6571
+ var _responseData$Propert5, _responseData$Propert6, _location$state3;
6572
+ history.push(`${finalRedirectUrl}?propertyId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert5 = responseData.Properties[0]) === null || _responseData$Propert5 === void 0 ? void 0 : _responseData$Propert5.propertyId}&tenantId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert6 = responseData.Properties[0]) === null || _responseData$Propert6 === void 0 ? void 0 : _responseData$Propert6.tenantId}`, {
6569
6573
  ...(location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.prevState)
6570
6574
  });
6571
6575
  }
@@ -17834,6 +17838,174 @@ const PropertyAssemblyDetails = ({
17834
17838
  }, errors === null || errors === void 0 ? void 0 : (_errors$usageCategory2 = errors.usageCategoryMajor) === null || _errors$usageCategory2 === void 0 ? void 0 : _errors$usageCategory2.message));
17835
17839
  };
17836
17840
 
17841
+ const getAddress = (address, t) => {
17842
+ 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}` : " "}`;
17843
+ };
17844
+ const PropertySearchNSummary = ({
17845
+ config,
17846
+ onSelect,
17847
+ userType,
17848
+ formData,
17849
+ setError,
17850
+ formState,
17851
+ clearErrors
17852
+ }) => {
17853
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3;
17854
+ const {
17855
+ t
17856
+ } = useTranslation();
17857
+ const history = useHistory();
17858
+ let {
17859
+ pathname,
17860
+ state
17861
+ } = useLocation();
17862
+ state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
17863
+ const isEditScreen = pathname.includes("/modify-application/");
17864
+ const tenantId = Digit.ULBService.getCurrentTenantId();
17865
+ const isEmpNewApplication = window.location.href.includes("/employee/tl/new-application");
17866
+ const isEmpRenewLicense = window.location.href.includes("/employee/tl/renew-application-details") || window.location.href.includes("/employee/tl/edit-application-details");
17867
+ const search = useLocation().search;
17868
+ const urlPropertyId = new URLSearchParams(search).get("propertyId");
17869
+ const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cptId = formData.cptId) === null || _formData$cptId === void 0 ? void 0 : _formData$cptId.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || "");
17870
+ const [searchPropertyId, setSearchPropertyId] = useState(urlPropertyId !== "null" ? urlPropertyId : "");
17871
+ const [showToast, setShowToast] = useState(null);
17872
+ const isMobile = window.Digit.Utils.browser.isMobile();
17873
+ const serachParams = window.location.href.includes("?") ? window.location.href.substring(window.location.href.indexOf("?") + 1, window.location.href.length) : "";
17874
+ const {
17875
+ isLoading,
17876
+ isError,
17877
+ error,
17878
+ data: propertyDetails
17879
+ } = Digit.Hooks.pt.usePropertySearch({
17880
+ filters: {
17881
+ propertyIds: searchPropertyId
17882
+ },
17883
+ tenantId: tenantId
17884
+ }, {
17885
+ filters: {
17886
+ propertyIds: searchPropertyId
17887
+ },
17888
+ tenantId: tenantId,
17889
+ enabled: searchPropertyId ? true : false,
17890
+ privacy: Digit.Utils.getPrivacyObject()
17891
+ });
17892
+ useEffect(() => {
17893
+ if (propertyId && (window.location.href.includes("/renew-application-details/") || window.location.href.includes("/edit-application-details/"))) setSearchPropertyId(propertyId);
17894
+ }, [propertyId]);
17895
+ useEffect(() => {
17896
+ var _propertyDetails$Prop;
17897
+ if (isLoading == false && error && error == true || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
17898
+ setShowToast({
17899
+ error: true,
17900
+ label: "PT_ENTER_VALID_PROPERTY_ID"
17901
+ });
17902
+ }
17903
+ }, [error, propertyDetails]);
17904
+ useEffect(() => {
17905
+ onSelect("cpt", {
17906
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]
17907
+ });
17908
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
17909
+ localStorage.setItem("pgrProperty", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
17910
+ }, [propertyDetails, pathname]);
17911
+ const searchProperty = () => {
17912
+ if (!propertyId) {
17913
+ setShowToast({
17914
+ error: true,
17915
+ label: "PT_ENTER_PROPERTY_ID_AND_SEARCH"
17916
+ });
17917
+ }
17918
+ setSearchPropertyId(propertyId);
17919
+ if (window.location.pathname.includes("/tl/new-application")) {
17920
+ history.push(`/digit-ui/employee/tl/new-application?propertyId=${propertyId}`);
17921
+ const scrollConst = 1600;
17922
+ setTimeout(() => window.scrollTo(0, scrollConst), 0);
17923
+ } else if (window.location.pathname.includes("/ws/new-application")) history.push(`/digit-ui/employee/ws/new-application?propertyId=${propertyId}`);
17924
+ };
17925
+ const clearSearch = () => {
17926
+ setPropertyId("");
17927
+ setSearchPropertyId("");
17928
+ onSelect(config === null || config === void 0 ? void 0 : config.key, {
17929
+ id: ""
17930
+ });
17931
+ onSelect("cpt", null);
17932
+ };
17933
+ if (isEditScreen) {
17934
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
17935
+ }
17936
+ let propertyAddress = "";
17937
+ if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
17938
+ var _propertyDetails$Prop2;
17939
+ propertyAddress = getAddress(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
17940
+ }
17941
+ const getInputStyles = () => {
17942
+ if (window.location.href.includes("/ws/")) {
17943
+ return {
17944
+ fontWeight: "700"
17945
+ };
17946
+ } else return {};
17947
+ };
17948
+ if (window.location.href.includes("/ws/")) ;
17949
+ return /*#__PURE__*/React.createElement(React.Fragment, null, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
17950
+ style: getInputStyles()
17951
+ }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
17952
+ style: {
17953
+ display: "flex",
17954
+ gap: "12px"
17955
+ }
17956
+ }, /*#__PURE__*/React.createElement(TextInput, {
17957
+ key: config === null || config === void 0 ? void 0 : config.key,
17958
+ value: propertyId,
17959
+ onChange: e => {
17960
+ setPropertyId(e.target.value);
17961
+ onSelect(config === null || config === void 0 ? void 0 : config.key, {
17962
+ id: e.target.value
17963
+ });
17964
+ },
17965
+ style: {
17966
+ width: "80%",
17967
+ float: "left"
17968
+ },
17969
+ placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
17970
+ }), /*#__PURE__*/React.createElement("button", {
17971
+ className: "submit-bar",
17972
+ type: "button",
17973
+ style: {
17974
+ color: "white"
17975
+ },
17976
+ onClick: searchProperty
17977
+ }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("button", {
17978
+ className: "submit-bar",
17979
+ type: "button",
17980
+ style: {
17981
+ color: "white"
17982
+ },
17983
+ onClick: clearSearch
17984
+ }, `${t("CLEAR")}`), /*#__PURE__*/React.createElement("span", {
17985
+ onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
17986
+ ...state,
17987
+ ...formData
17988
+ })
17989
+ }, /*#__PURE__*/React.createElement("button", {
17990
+ className: "submit-bar",
17991
+ type: "button",
17992
+ style: {
17993
+ color: "white"
17994
+ }
17995
+ }, t("CPT_CREATE_PROPERTY"))))), showToast && /*#__PURE__*/React.createElement(Toast, {
17996
+ isDleteBtn: true,
17997
+ labelstyle: {
17998
+ width: "100%"
17999
+ },
18000
+ error: showToast.error,
18001
+ warning: showToast.warning,
18002
+ label: t(showToast.label),
18003
+ onClose: () => {
18004
+ setShowToast(null);
18005
+ }
18006
+ })));
18007
+ };
18008
+
17837
18009
  const PropertyLocationDetails = ({
17838
18010
  address,
17839
18011
  actionCancelOnSubmit,
@@ -17864,13 +18036,25 @@ const PropertyLocationDetails = ({
17864
18036
  assembly: (address === null || address === void 0 ? void 0 : address.assembly) || "",
17865
18037
  block: (address === null || address === void 0 ? void 0 : address.block) || "",
17866
18038
  zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
17867
- zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || ""
18039
+ zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || "",
18040
+ subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || "",
18041
+ wardRemarks: (address === null || address === void 0 ? void 0 : address.wardRemarks) || ""
17868
18042
  });
17869
18043
  const isPropertyFound = window.location.href.includes("ws/old-application");
18044
+ useEffect(() => {
18045
+ if (props.register) {
18046
+ props.register({
18047
+ name: "cpt"
18048
+ });
18049
+ props.register({
18050
+ name: "cptId"
18051
+ });
18052
+ }
18053
+ }, [props.register]);
17870
18054
  useEffect(() => {
17871
18055
  var _formDataProp$cpt;
17872
18056
  if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && _formDataProp$cpt.details) {
17873
- var _addressData$locality, _addressData$geoLocat, _addressData$geoLocat2, _addressData$locality2, _addressData$geoLocat3, _addressData$geoLocat4, _addressData$locality3, _addressData$addition, _addressData$addition2, _addressData$addition3, _addressData$addition4, _addressData$addition5, _addressData$addition6, _addressData$addition7;
18057
+ var _addressData$locality, _addressData$geoLocat, _addressData$geoLocat2, _addressData$locality2, _addressData$geoLocat3, _addressData$geoLocat4, _addressData$locality3, _addressData$addition, _addressData$addition2, _addressData$addition3, _addressData$addition4, _addressData$addition5, _addressData$addition6, _addressData$addition7, _addressData$addition8, _addressData$addition9;
17874
18058
  const details = formDataProp.cpt.details;
17875
18059
  const addressData = details.address || {};
17876
18060
  const additionalDetails = details.additionalDetails || {};
@@ -17897,6 +18081,8 @@ const PropertyLocationDetails = ({
17897
18081
  zone: additionalDetails.zone || ((_addressData$addition4 = addressData.additionalDetails) === null || _addressData$addition4 === void 0 ? void 0 : _addressData$addition4.zone) || "",
17898
18082
  zroLocation: zroCode,
17899
18083
  zro: zroValue,
18084
+ subLocality: addressData.subLocality || "",
18085
+ wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.wardRemarks) || "",
17900
18086
  address: {
17901
18087
  ...addressData,
17902
18088
  city: addressData.city || "",
@@ -17909,13 +18095,40 @@ const PropertyLocationDetails = ({
17909
18095
  longitude: lng,
17910
18096
  zroLocation: zroCode,
17911
18097
  zro: zroValue,
17912
- assembly: additionalDetails.assembly || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.assembly) || "",
17913
- block: additionalDetails.block || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.block) || "",
17914
- zone: additionalDetails.zone || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.zone) || ""
18098
+ assembly: additionalDetails.assembly || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.assembly) || "",
18099
+ block: additionalDetails.block || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.block) || "",
18100
+ zone: additionalDetails.zone || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.zone) || "",
18101
+ subLocality: addressData.subLocality || "",
18102
+ wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition9 = addressData.additionalDetails) === null || _addressData$addition9 === void 0 ? void 0 : _addressData$addition9.wardRemarks) || ""
17915
18103
  }
17916
18104
  });
18105
+ } else if ((formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt) === null) {
18106
+ const clearedData = {
18107
+ addressType: "",
18108
+ pincode: "",
18109
+ city: "",
18110
+ locality: "",
18111
+ streetName: "",
18112
+ houseNo: "",
18113
+ houseName: "",
18114
+ landmark: "",
18115
+ addressLine1: "",
18116
+ addressLine2: "",
18117
+ latitude: "",
18118
+ longitude: "",
18119
+ assembly: "",
18120
+ block: "",
18121
+ zone: "",
18122
+ zroLocation: "",
18123
+ subLocality: "",
18124
+ wardRemarks: "",
18125
+ zro: "",
18126
+ address: {}
18127
+ };
18128
+ setFormData(clearedData);
18129
+ onSelect((config === null || config === void 0 ? void 0 : config.key) || "address", clearedData);
17917
18130
  }
17918
- }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt2 = formDataProp.cpt) === null || _formDataProp$cpt2 === void 0 ? void 0 : _formDataProp$cpt2.details]);
18131
+ }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt2 = formDataProp.cpt) === null || _formDataProp$cpt2 === void 0 ? void 0 : _formDataProp$cpt2.details, formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt]);
17919
18132
  useEffect(() => {
17920
18133
  if (showToast) {
17921
18134
  const timer = setTimeout(() => {
@@ -17932,11 +18145,23 @@ const PropertyLocationDetails = ({
17932
18145
  boxShadow: "none",
17933
18146
  ...props.style
17934
18147
  }
18148
+ }, !window.location.href.includes("create-application/create-property") && /*#__PURE__*/React.createElement(PropertySearchNSummary, {
18149
+ config: config,
18150
+ onSelect: onSelect,
18151
+ formData: formDataProp,
18152
+ userType: window.location.href.includes("/employee/") ? "employee" : "citizen"
18153
+ }), /*#__PURE__*/React.createElement("div", {
18154
+ style: {
18155
+ marginTop: "20px"
18156
+ }
17935
18157
  }, /*#__PURE__*/React.createElement(AddressDetails, {
17936
18158
  t: t,
17937
18159
  formData: formData,
17938
18160
  onSelect: (key, data) => {
17939
- setFormData(data);
18161
+ setFormData(prev => ({
18162
+ ...prev,
18163
+ ...data
18164
+ }));
17940
18165
  onSelect(key, data);
17941
18166
  },
17942
18167
  config: {
@@ -17947,7 +18172,7 @@ const PropertyLocationDetails = ({
17947
18172
  showZRO: true,
17948
18173
  disable: isPropertyFound,
17949
18174
  hideNextButton: true
17950
- })));
18175
+ }))));
17951
18176
  };
17952
18177
 
17953
18178
  const PropertyOwnerDetails = ({
@@ -18414,7 +18639,7 @@ const PropertyWaterConnection = ({
18414
18639
  clearErrors,
18415
18640
  ...props
18416
18641
  }) => {
18417
- var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0;
18642
+ var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1;
18418
18643
  const {
18419
18644
  control,
18420
18645
  register,
@@ -18445,11 +18670,30 @@ const PropertyWaterConnection = ({
18445
18670
  isLoading: isWSServicesMastersLoading,
18446
18671
  data: ptServicesMastersData
18447
18672
  } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "NoOfFloors", "PropertyNewUsageType"]);
18673
+ const {
18674
+ data: wsServicesMastersData
18675
+ } = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]);
18676
+ const [categoryTypeList, setCategoryTypeList] = useState([]);
18677
+ useEffect(() => {
18678
+ var _wsServicesMastersDat;
18679
+ const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.WsCategoryType) || [];
18680
+ categories.forEach(data => data.i18nKey = data.i18nKey || `WS_CATEGORY_${data.code}`);
18681
+ setCategoryTypeList(categories);
18682
+ }, [wsServicesMastersData]);
18448
18683
  const isPropertyFound = window.location.href.includes("ws/old-application");
18684
+ useEffect(() => {
18685
+ if (props.register) {
18686
+ props.register({
18687
+ name: "cpt"
18688
+ });
18689
+ }
18690
+ }, [props.register]);
18449
18691
  const formValue = watch();
18692
+ const watchCategoryType = watch("useDetails.categoryType");
18450
18693
  const watchPropertyType = watch("useDetails.propertyType");
18451
18694
  const watchPropertyCategory = watch("useDetails.propertyCategory");
18452
18695
  const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
18696
+ const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
18453
18697
  const yearOptions = useMemo(() => {
18454
18698
  const currentYear = new Date().getFullYear();
18455
18699
  const years = [];
@@ -18463,11 +18707,23 @@ const PropertyWaterConnection = ({
18463
18707
  }, []);
18464
18708
  const categoryOptions = useMemo(() => {
18465
18709
  var _ptServicesMastersDat, _ptServicesMastersDat2;
18466
- return ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat === void 0 ? void 0 : (_ptServicesMastersDat2 = _ptServicesMastersDat.PropertyCategory) === null || _ptServicesMastersDat2 === void 0 ? void 0 : _ptServicesMastersDat2.filter(item => item.active).map(item => ({
18710
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat === void 0 ? void 0 : (_ptServicesMastersDat2 = _ptServicesMastersDat.PropertyCategory) === null || _ptServicesMastersDat2 === void 0 ? void 0 : _ptServicesMastersDat2.filter(item => item.active)) || [];
18711
+ if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
18712
+ options = options.filter(item => item.type === watchCategoryType.code);
18713
+ }
18714
+ return options.map(item => ({
18467
18715
  code: item.code,
18468
18716
  name: item.name
18469
18717
  }));
18470
- }, [ptServicesMastersData]);
18718
+ }, [ptServicesMastersData, watchCategoryType]);
18719
+ useEffect(() => {
18720
+ if (watchCategoryType && watchPropertyCategory) {
18721
+ const isCategoryValid = categoryOptions.some(opt => opt.code === watchPropertyCategory.code);
18722
+ if (!isCategoryValid) {
18723
+ setValue("useDetails.propertyCategory", null);
18724
+ }
18725
+ }
18726
+ }, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
18471
18727
  const propertyTypeOptions = useMemo(() => {
18472
18728
  var _ptServicesMastersDat3, _ptServicesMastersDat4;
18473
18729
  let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat3 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat3 === void 0 ? void 0 : (_ptServicesMastersDat4 = _ptServicesMastersDat3.PropertyType) === null || _ptServicesMastersDat4 === void 0 ? void 0 : _ptServicesMastersDat4.filter(item => item.active)) || [];
@@ -18517,22 +18773,40 @@ const PropertyWaterConnection = ({
18517
18773
  useEffect(() => {
18518
18774
  var _formData$cpt;
18519
18775
  if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
18776
+ var _details$usageCategor, _details$landArea, _details$superBuiltUp;
18520
18777
  const details = formData.cpt.details;
18521
18778
  const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
18522
- setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === additionalDetails.propertyCategory)) || null);
18523
- setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === additionalDetails.propertyType)) || null);
18779
+ const catType = additionalDetails.categoryType || ((_details$usageCategor = details.usageCategory) !== null && _details$usageCategor !== void 0 && _details$usageCategor.includes("RESIDENTIAL") ? "DOMESTIC" : "NON_DOMESTIC");
18780
+ setValue("useDetails.categoryType", (categoryTypeList === null || categoryTypeList === void 0 ? void 0 : categoryTypeList.find(o => o.code === catType)) || null);
18781
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === (additionalDetails.propertyCategory || details.usageCategory))) || null);
18782
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === (additionalDetails.propertyType || details.propertyType))) || null);
18524
18783
  setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
18525
18784
  setValue("useDetails.noOfFloors", (floorOptions === null || floorOptions === void 0 ? void 0 : floorOptions.find(o => {
18526
18785
  var _details$noOfFloors;
18527
- return o.code === (((_details$noOfFloors = details.noOfFloors) === null || _details$noOfFloors === void 0 ? void 0 : _details$noOfFloors.toString()) || additionalDetails.noOfFloors);
18786
+ const val1 = additionalDetails.numberOfFloors;
18787
+ const val2 = additionalDetails.noOfFloors;
18788
+ const val3 = (_details$noOfFloors = details.noOfFloors) === null || _details$noOfFloors === void 0 ? void 0 : _details$noOfFloors.toString();
18789
+ return o.code === val1 || o.code === val2 || o.code === val3 || val3 && o.code === `${val3}_FLOOR`;
18528
18790
  })) || null);
18529
- setValue("useDetails.plotArea", additionalDetails.plotArea || "");
18530
- setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || "");
18791
+ setValue("useDetails.plotArea", additionalDetails.plotArea || (details === null || details === void 0 ? void 0 : (_details$landArea = details.landArea) === null || _details$landArea === void 0 ? void 0 : _details$landArea.toString()) || "");
18792
+ setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || (details === null || details === void 0 ? void 0 : (_details$superBuiltUp = details.superBuiltUpArea) === null || _details$superBuiltUp === void 0 ? void 0 : _details$superBuiltUp.toString()) || "");
18531
18793
  setValue("useDetails.SelectYearofConstruction", (yearOptions === null || yearOptions === void 0 ? void 0 : yearOptions.find(o => o.value === additionalDetails.yearOfConstruction)) || null);
18532
- setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || "");
18533
- setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || "");
18534
- }
18535
- }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, setValue]);
18794
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || additionalDetails.noOfDwellingUnits || (details === null || details === void 0 ? void 0 : details.noOfDwellingUnits) || "");
18795
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || additionalDetails.noOfRooms || (details === null || details === void 0 ? void 0 : details.noOfRooms) || "");
18796
+ } else if ((formData === null || formData === void 0 ? void 0 : formData.cpt) === null) {
18797
+ setValue("useDetails.categoryType", null);
18798
+ setValue("useDetails.propertyCategory", null);
18799
+ setValue("useDetails.propertyType", null);
18800
+ setValue("useDetails.WaterConnectionUsageType", null);
18801
+ setValue("useDetails.noOfFloors", null);
18802
+ setValue("useDetails.plotArea", "");
18803
+ setValue("useDetails.builtUpArea", "");
18804
+ setValue("useDetails.SelectYearofConstruction", null);
18805
+ setValue("useDetails.NumberofDwellingUnits", "");
18806
+ setValue("useDetails.NumberofRooms", "");
18807
+ setValue("useDetails.hospitalBeds", "");
18808
+ }
18809
+ }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, formData === null || formData === void 0 ? void 0 : formData.cpt, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, categoryTypeList, setValue]);
18536
18810
  const lastErrorState = React.useRef(null);
18537
18811
  useEffect(() => {
18538
18812
  const hasErrors = Object.keys(errors).length > 0;
@@ -18560,7 +18834,26 @@ const PropertyWaterConnection = ({
18560
18834
  style: props.style
18561
18835
  }, /*#__PURE__*/React.createElement("div", {
18562
18836
  className: "formcomposer-section-grid"
18563
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18837
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CATEGORY_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18838
+ className: "form-field"
18839
+ }, /*#__PURE__*/React.createElement(Controller, {
18840
+ control: control,
18841
+ name: "useDetails.categoryType",
18842
+ rules: {
18843
+ required: t("REQUIRED_FIELD")
18844
+ },
18845
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18846
+ option: categoryTypeList,
18847
+ optionKey: "i18nKey",
18848
+ selected: props.value,
18849
+ select: props.onChange,
18850
+ t: t,
18851
+ onBlur: props.onBlur,
18852
+ disable: isPropertyFound
18853
+ })
18854
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails = errors.useDetails) === null || _errors$useDetails === void 0 ? void 0 : _errors$useDetails.categoryType) && /*#__PURE__*/React.createElement(CardLabelError, {
18855
+ style: errorStyle
18856
+ }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18564
18857
  className: "form-field"
18565
18858
  }, /*#__PURE__*/React.createElement(Controller, {
18566
18859
  control: control,
@@ -18577,7 +18870,7 @@ const PropertyWaterConnection = ({
18577
18870
  onBlur: props.onBlur,
18578
18871
  disable: isPropertyFound
18579
18872
  })
18580
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails = errors.useDetails) === null || _errors$useDetails === void 0 ? void 0 : _errors$useDetails.propertyCategory) && /*#__PURE__*/React.createElement(CardLabelError, {
18873
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.propertyCategory) && /*#__PURE__*/React.createElement(CardLabelError, {
18581
18874
  style: errorStyle
18582
18875
  }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18583
18876
  className: "form-field"
@@ -18596,7 +18889,7 @@ const PropertyWaterConnection = ({
18596
18889
  onBlur: props.onBlur,
18597
18890
  disable: isPropertyFound
18598
18891
  })
18599
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.propertyType) && /*#__PURE__*/React.createElement(CardLabelError, {
18892
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.propertyType) && /*#__PURE__*/React.createElement(CardLabelError, {
18600
18893
  style: errorStyle
18601
18894
  }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_WATER_CONNECTION_USAGE_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18602
18895
  className: "form-field"
@@ -18615,7 +18908,7 @@ const PropertyWaterConnection = ({
18615
18908
  onBlur: props.onBlur,
18616
18909
  disable: isPropertyFound
18617
18910
  })
18618
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.WaterConnectionUsageType) && /*#__PURE__*/React.createElement(CardLabelError, {
18911
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.WaterConnectionUsageType) && /*#__PURE__*/React.createElement(CardLabelError, {
18619
18912
  style: errorStyle
18620
18913
  }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_FLOORS")}`), /*#__PURE__*/React.createElement("div", {
18621
18914
  className: "form-field"
@@ -18631,7 +18924,7 @@ const PropertyWaterConnection = ({
18631
18924
  onBlur: props.onBlur,
18632
18925
  disable: isPropertyFound
18633
18926
  })
18634
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.noOfFloors) && /*#__PURE__*/React.createElement(CardLabelError, {
18927
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.noOfFloors) && /*#__PURE__*/React.createElement(CardLabelError, {
18635
18928
  style: errorStyle
18636
18929
  }, errors.useDetails.noOfFloors.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PLOT_AREA")}`), /*#__PURE__*/React.createElement("div", {
18637
18930
  className: "form-field"
@@ -18645,7 +18938,7 @@ const PropertyWaterConnection = ({
18645
18938
  }),
18646
18939
  name: "useDetails.plotArea",
18647
18940
  disabled: isPropertyFound
18648
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.plotArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18941
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.plotArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18649
18942
  style: errorStyle
18650
18943
  }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_BUILT_UP_AREA")}`), /*#__PURE__*/React.createElement("div", {
18651
18944
  className: "form-field"
@@ -18659,7 +18952,7 @@ const PropertyWaterConnection = ({
18659
18952
  }),
18660
18953
  name: "useDetails.builtUpArea",
18661
18954
  disabled: isPropertyFound
18662
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.builtUpArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18955
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.builtUpArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18663
18956
  style: errorStyle
18664
18957
  }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_SELECT_YEAR_OF_CONSTRUCTION")}*`), /*#__PURE__*/React.createElement("div", {
18665
18958
  className: "form-field"
@@ -18678,7 +18971,7 @@ const PropertyWaterConnection = ({
18678
18971
  onBlur: props.onBlur,
18679
18972
  disable: isPropertyFound
18680
18973
  })
18681
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
18974
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
18682
18975
  style: errorStyle
18683
18976
  }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}*`), /*#__PURE__*/React.createElement("div", {
18684
18977
  className: "form-field"
@@ -18693,9 +18986,9 @@ const PropertyWaterConnection = ({
18693
18986
  }),
18694
18987
  name: "useDetails.NumberofDwellingUnits",
18695
18988
  disabled: isPropertyFound
18696
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
18989
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
18697
18990
  style: errorStyle
18698
- }, errors.useDetails.NumberofDwellingUnits.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_ROOMS")}*`), /*#__PURE__*/React.createElement("div", {
18991
+ }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_ROOMS")}*`), /*#__PURE__*/React.createElement("div", {
18699
18992
  className: "form-field"
18700
18993
  }, /*#__PURE__*/React.createElement(TextInput, {
18701
18994
  t: t,
@@ -18704,11 +18997,11 @@ const PropertyWaterConnection = ({
18704
18997
  value: NUMBER_PATTERN,
18705
18998
  message: t("ERR_INVALID_NUMBER")
18706
18999
  },
18707
- required: t("REQUIRED_FIELD")
19000
+ required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
18708
19001
  }),
18709
19002
  name: "useDetails.NumberofRooms",
18710
19003
  disabled: isPropertyFound
18711
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofRooms) && /*#__PURE__*/React.createElement(CardLabelError, {
19004
+ }))) : null, isHotelRestaurantProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofRooms) && /*#__PURE__*/React.createElement(CardLabelError, {
18712
19005
  style: errorStyle
18713
19006
  }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_BEDS")}*`), /*#__PURE__*/React.createElement("div", {
18714
19007
  className: "form-field"
@@ -18723,7 +19016,7 @@ const PropertyWaterConnection = ({
18723
19016
  }),
18724
19017
  name: "useDetails.hospitalBeds",
18725
19018
  disabled: isPropertyFound
18726
- }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.hospitalBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
19019
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.hospitalBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
18727
19020
  style: errorStyle
18728
19021
  }, errors.useDetails.hospitalBeds.message)));
18729
19022
  };
@@ -19246,249 +19539,6 @@ const PropertyDetails = ({
19246
19539
  }))));
19247
19540
  };
19248
19541
 
19249
- const getAddress = (address, t) => {
19250
- 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}` : " "}`;
19251
- };
19252
- const PropertySearchNSummary = ({
19253
- config,
19254
- onSelect,
19255
- userType,
19256
- formData,
19257
- setError,
19258
- formState,
19259
- clearErrors
19260
- }) => {
19261
- var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
19262
- const {
19263
- t
19264
- } = useTranslation();
19265
- const history = useHistory();
19266
- let {
19267
- pathname,
19268
- state
19269
- } = useLocation();
19270
- state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
19271
- const isEditScreen = pathname.includes("/modify-application/");
19272
- const tenantId = Digit.ULBService.getCurrentTenantId();
19273
- const isEmpNewApplication = window.location.href.includes("/employee/tl/new-application");
19274
- const isEmpRenewLicense = window.location.href.includes("/employee/tl/renew-application-details") || window.location.href.includes("/employee/tl/edit-application-details");
19275
- const search = useLocation().search;
19276
- const urlPropertyId = new URLSearchParams(search).get("propertyId");
19277
- const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cptId = formData.cptId) === null || _formData$cptId === void 0 ? void 0 : _formData$cptId.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || "");
19278
- const [searchPropertyId, setSearchPropertyId] = useState(urlPropertyId !== "null" ? urlPropertyId : "");
19279
- const [showToast, setShowToast] = useState(null);
19280
- const isMobile = window.Digit.Utils.browser.isMobile();
19281
- const serachParams = window.location.href.includes("?") ? window.location.href.substring(window.location.href.indexOf("?") + 1, window.location.href.length) : "";
19282
- const {
19283
- isLoading,
19284
- isError,
19285
- error,
19286
- data: propertyDetails
19287
- } = Digit.Hooks.pt.usePropertySearch({
19288
- filters: {
19289
- propertyIds: searchPropertyId
19290
- },
19291
- tenantId: tenantId
19292
- }, {
19293
- filters: {
19294
- propertyIds: searchPropertyId
19295
- },
19296
- tenantId: tenantId,
19297
- enabled: searchPropertyId ? true : false,
19298
- privacy: Digit.Utils.getPrivacyObject()
19299
- });
19300
- useEffect(() => {
19301
- if (propertyId && (window.location.href.includes("/renew-application-details/") || window.location.href.includes("/edit-application-details/"))) setSearchPropertyId(propertyId);
19302
- }, [propertyId]);
19303
- useEffect(() => {
19304
- var _propertyDetails$Prop;
19305
- if (isLoading == false && error && error == true || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
19306
- setShowToast({
19307
- error: true,
19308
- label: "PT_ENTER_VALID_PROPERTY_ID"
19309
- });
19310
- }
19311
- }, [error, propertyDetails]);
19312
- useEffect(() => {
19313
- onSelect("cpt", {
19314
- details: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]
19315
- });
19316
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
19317
- localStorage.setItem("pgrProperty", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
19318
- }, [propertyDetails, pathname]);
19319
- const searchProperty = () => {
19320
- if (!propertyId) {
19321
- setShowToast({
19322
- error: true,
19323
- label: "PT_ENTER_PROPERTY_ID_AND_SEARCH"
19324
- });
19325
- }
19326
- setSearchPropertyId(propertyId);
19327
- if (window.location.pathname.includes("/tl/new-application")) {
19328
- history.push(`/digit-ui/employee/tl/new-application?propertyId=${propertyId}`);
19329
- const scrollConst = 1600;
19330
- setTimeout(() => window.scrollTo(0, scrollConst), 0);
19331
- } else if (window.location.pathname.includes("/ws/new-application")) history.push(`/digit-ui/employee/ws/new-application?propertyId=${propertyId}`);
19332
- };
19333
- if (isEditScreen) {
19334
- return /*#__PURE__*/React.createElement(React.Fragment, null);
19335
- }
19336
- let propertyAddress = "";
19337
- if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19338
- var _propertyDetails$Prop2;
19339
- propertyAddress = getAddress(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
19340
- }
19341
- const getInputStyles = () => {
19342
- if (window.location.href.includes("/ws/")) {
19343
- return {
19344
- fontWeight: "700"
19345
- };
19346
- } else return {};
19347
- };
19348
- const getOwnerNames = propertyData => {
19349
- var _propertyData$owners, _getActiveOwners$sort, _getActiveOwners$sort2;
19350
- const getActiveOwners = propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$owners = propertyData.owners) === null || _propertyData$owners === void 0 ? void 0 : _propertyData$owners.filter(owner => owner === null || owner === void 0 ? void 0 : owner.active);
19351
- const getOwnersList = (_getActiveOwners$sort = getActiveOwners.sort((a, b) => {
19352
- var _a$additionalDetails, _b$additionalDetails;
19353
- return (a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) - (b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence);
19354
- })) === null || _getActiveOwners$sort === void 0 ? void 0 : (_getActiveOwners$sort2 = _getActiveOwners$sort.map(activeOwner => activeOwner === null || activeOwner === void 0 ? void 0 : activeOwner.name)) === null || _getActiveOwners$sort2 === void 0 ? void 0 : _getActiveOwners$sort2.join(",");
19355
- return getOwnersList ? getOwnersList : t("NA");
19356
- };
19357
- if (window.location.href.includes("/ws/")) ;
19358
- return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
19359
- title: t("PT_PROPERTY_DETAILS"),
19360
- defaultOpen: true
19361
- }, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
19362
- style: getInputStyles()
19363
- }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
19364
- style: {
19365
- display: "flex",
19366
- gap: "12px"
19367
- }
19368
- }, /*#__PURE__*/React.createElement(TextInput, {
19369
- key: config.key,
19370
- value: propertyId,
19371
- onChange: e => {
19372
- setPropertyId(e.target.value);
19373
- onSelect(config.key, {
19374
- id: e.target.value
19375
- });
19376
- },
19377
- style: {
19378
- width: "80%",
19379
- float: "left"
19380
- },
19381
- placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
19382
- }), /*#__PURE__*/React.createElement("button", {
19383
- className: "submit-bar",
19384
- type: "button",
19385
- style: {
19386
- color: "white"
19387
- },
19388
- onClick: searchProperty
19389
- }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("span", {
19390
- onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
19391
- ...state,
19392
- ...formData
19393
- })
19394
- }, /*#__PURE__*/React.createElement("button", {
19395
- className: "submit-bar",
19396
- type: "button",
19397
- style: {
19398
- color: "white"
19399
- }
19400
- }, t("CPT_CREATE_PROPERTY"))))), propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
19401
- className: "card-with-background",
19402
- style: {
19403
- margin: "16px 0px",
19404
- padding: "20px",
19405
- boxShadow: "none"
19406
- }
19407
- }, /*#__PURE__*/React.createElement(StatusTable, {
19408
- style: {
19409
- padding: "0",
19410
- margin: "0"
19411
- }
19412
- }, /*#__PURE__*/React.createElement("div", {
19413
- className: "formcomposer-section-grid",
19414
- style: isMobile ? {} : {}
19415
- }, /*#__PURE__*/React.createElement(Row, {
19416
- className: "border-none",
19417
- labelStyle: isMobile ? {
19418
- width: "40%"
19419
- } : {
19420
- width: "30%",
19421
- color: "#505a5f",
19422
- fontWeight: "600"
19423
- },
19424
- textStyle: {
19425
- color: "#000"
19426
- },
19427
- label: t(`PROPERTY_ID`),
19428
- text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
19429
- }), /*#__PURE__*/React.createElement(Row, {
19430
- className: "border-none",
19431
- labelStyle: isMobile ? {
19432
- width: "40%"
19433
- } : {
19434
- width: "30%",
19435
- color: "#505a5f",
19436
- fontWeight: "600"
19437
- },
19438
- textStyle: {
19439
- color: "#000"
19440
- },
19441
- label: t(`OWNER_NAME`),
19442
- text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
19443
- }), /*#__PURE__*/React.createElement(Row, {
19444
- className: "border-none",
19445
- labelStyle: isMobile ? {
19446
- width: "40%"
19447
- } : {
19448
- width: "30%",
19449
- color: "#505a5f",
19450
- fontWeight: "600"
19451
- },
19452
- textStyle: {
19453
- wordBreak: "break-word",
19454
- color: "#000"
19455
- },
19456
- label: t(`PROPERTY_ADDRESS`),
19457
- text: propertyAddress,
19458
- privacy: {
19459
- uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop4 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : (_propertyDetails$Prop5 = _propertyDetails$Prop4.owners) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5[0]) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6.uuid,
19460
- fieldName: ["doorNo", "street", "landmark"],
19461
- model: "Property",
19462
- showValue: true,
19463
- loadData: {
19464
- serviceName: "/property-services/property/_search",
19465
- requestBody: {},
19466
- requestParam: {
19467
- tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.tenantId,
19468
- propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.propertyId
19469
- },
19470
- jsonPath: "Properties[0].address.street",
19471
- d: res => {
19472
- let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
19473
- return resultString;
19474
- },
19475
- isArray: false
19476
- }
19477
- }
19478
- }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19479
- isDleteBtn: true,
19480
- labelstyle: {
19481
- width: "100%"
19482
- },
19483
- error: showToast.error,
19484
- warning: showToast.warning,
19485
- label: t(showToast.label),
19486
- onClose: () => {
19487
- setShowToast(null);
19488
- }
19489
- })));
19490
- };
19491
-
19492
19542
  const CommonPTCard = () => {
19493
19543
  var _propsForModuleCard$l;
19494
19544
  const {