@djb25/digit-ui-module-ws 1.0.49 → 1.0.51

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$1, 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, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, CardLabel, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, LabelFieldPair, DatePicker, CollapsibleCardPage, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, CardLabelError, WrapUnMaskComponent, MobileNumber, CheckBox, StatusTable, Row, Header, CardSectionHeader, InfoIcon, TextArea, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, PDFSvg, GenericFileIcon, EditIcon, Label, CardSectionSubText, DownloadIcon, CardLabelDesc, VerticalTimeline, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, 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, VerticalTimeline, CollapsibleCardPage, LabelFieldPair, CardLabel, CardLabelError, LayoutWrapper, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, DatePicker, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, WrapUnMaskComponent, MobileNumber, CheckBox, StatusTable, Row, Header, CardSectionHeader, InfoIcon, TextArea, FilterFormField, RemoveableTag, 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$e, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, 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 } from 'react-query';
@@ -1853,6 +1853,29 @@ const checkForNA = function (value) {
1853
1853
  }
1854
1854
  return value && value != null && value !== undefined && value !== "" && value !== "Image" ? value : " NA";
1855
1855
  };
1856
+ const WSCalculationPayload = (data, tenantId) => {
1857
+ var _useDetails$colonyNam, _useDetails$categoryT, _useDetails$propertyC, _useDetails$propertyT, _useDetails$propertyC2, _useDetails$WaterConn, _useDetails$noOfFloor;
1858
+ const useDetails = (data === null || data === void 0 ? void 0 : data.useDetails) || data || {};
1859
+ const payload = {
1860
+ connectionType: (data === null || data === void 0 ? void 0 : data.connectionType) || "METERED",
1861
+ colonyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$colonyNam = useDetails.colonyName) === null || _useDetails$colonyNam === void 0 ? void 0 : _useDetails$colonyNam.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.colonyCategory) || "",
1862
+ categoryType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$categoryT = useDetails.categoryType) === null || _useDetails$categoryT === void 0 ? void 0 : _useDetails$categoryT.code) || "",
1863
+ propertyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC = useDetails.propertyCategory) === null || _useDetails$propertyC === void 0 ? void 0 : _useDetails$propertyC.code) || "",
1864
+ propertyType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyT = useDetails.propertyType) === null || _useDetails$propertyT === void 0 ? void 0 : _useDetails$propertyT.code) || "",
1865
+ usageCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC2 = useDetails.propertyCategory) === null || _useDetails$propertyC2 === void 0 ? void 0 : _useDetails$propertyC2.code) || "",
1866
+ waterConnectionUsageType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$WaterConn = useDetails.WaterConnectionUsageType) === null || _useDetails$WaterConn === void 0 ? void 0 : _useDetails$WaterConn.code) || "",
1867
+ landArea: useDetails !== null && useDetails !== void 0 && useDetails.plotArea ? Number(useDetails.plotArea) : 0,
1868
+ builtUpArea: useDetails !== null && useDetails !== void 0 && useDetails.builtUpArea ? Number(useDetails.builtUpArea) : 0,
1869
+ farArea: useDetails !== null && useDetails !== void 0 && useDetails.farArea ? Number(useDetails.farArea) : 0,
1870
+ numberOfFloors: useDetails !== null && useDetails !== void 0 && (_useDetails$noOfFloor = useDetails.noOfFloors) !== null && _useDetails$noOfFloor !== void 0 && _useDetails$noOfFloor.code ? Number(useDetails.noOfFloors.code) : 0,
1871
+ numberOfStudents: useDetails !== null && useDetails !== void 0 && useDetails.numberOfStudents ? Number(useDetails.numberOfStudents) : 0,
1872
+ numberOfBeds: useDetails !== null && useDetails !== void 0 && useDetails.numberOfBeds ? Number(useDetails.numberOfBeds) : 0
1873
+ };
1874
+ if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofRooms) payload.numberOfRooms = Number(useDetails.NumberofRooms);
1875
+ if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofDwellingUnits) payload.numberOfDwellingUnits = Number(useDetails.NumberofDwellingUnits);
1876
+ if (useDetails !== null && useDetails !== void 0 && useDetails.ServantQuartersRoom) payload.servantQuartersRoom = Number(useDetails.ServantQuartersRoom);
1877
+ return payload;
1878
+ };
1856
1879
 
1857
1880
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1858
1881
 
@@ -9592,6 +9615,722 @@ const WSDisconnectionResponse$1 = props => {
9592
9615
  }))));
9593
9616
  };
9594
9617
 
9618
+ const _excluded = ["config", "onSelect", "formData", "formState", "setError", "clearErrors"];
9619
+ const colonyNameOptions = [{
9620
+ code: "A",
9621
+ name: "A"
9622
+ }, {
9623
+ code: "B",
9624
+ name: "B"
9625
+ }, {
9626
+ code: "C",
9627
+ name: "C"
9628
+ }, {
9629
+ code: "D",
9630
+ name: "D"
9631
+ }, {
9632
+ code: "E",
9633
+ name: "E"
9634
+ }, {
9635
+ code: "F",
9636
+ name: "F"
9637
+ }, {
9638
+ code: "G",
9639
+ name: "G"
9640
+ }, {
9641
+ code: "H",
9642
+ name: "H"
9643
+ }];
9644
+ const NUMBER_PATTERN = /^\d+$/;
9645
+ const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
9646
+ const WSCalculation = _ref => {
9647
+ 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, _errors$useDetails10, _errors$useDetails11;
9648
+ let config = _ref.config,
9649
+ onSelect = _ref.onSelect,
9650
+ formData = _ref.formData,
9651
+ setError = _ref.setError,
9652
+ clearErrors = _ref.clearErrors,
9653
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
9654
+ const _useForm = useForm({
9655
+ defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key]) || {
9656
+ useDetails: {
9657
+ propertyCategory: null,
9658
+ propertyType: null,
9659
+ WaterConnectionUsageType: null,
9660
+ plotArea: "",
9661
+ builtUpArea: "",
9662
+ farArea: "",
9663
+ NumberofDwellingUnits: "",
9664
+ NumberofRooms: "",
9665
+ numberOfBeds: "",
9666
+ numberOfStudents: "",
9667
+ ServantQuartersRoom: "",
9668
+ colonyName: ""
9669
+ }
9670
+ }
9671
+ }),
9672
+ control = _useForm.control,
9673
+ register = _useForm.register,
9674
+ errors = _useForm.formState.errors,
9675
+ watch = _useForm.watch,
9676
+ setValue = _useForm.setValue;
9677
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9678
+ const _useTranslation = useTranslation(),
9679
+ t = _useTranslation.t;
9680
+ const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSCalculater({
9681
+ tenantId
9682
+ }),
9683
+ calculateCharges = _Digit$Hooks$ws$useWS.mutate;
9684
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "PropertyNewUsageType"]),
9685
+ ptServicesMastersData = _Digit$Hooks$pt$usePr.data;
9686
+ const _Digit$Hooks$ws$useMD = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]),
9687
+ wsServicesMastersData = _Digit$Hooks$ws$useMD.data;
9688
+ const _useState = useState([]),
9689
+ categoryTypeList = _useState[0],
9690
+ setCategoryTypeList = _useState[1];
9691
+ const _useState2 = useState(null),
9692
+ calculationData = _useState2[0],
9693
+ setCalculationData = _useState2[1];
9694
+ useEffect(() => {
9695
+ var _wsServicesMastersDat;
9696
+ const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.WsCategoryType) || [];
9697
+ categories.forEach(data => data.i18nKey = data.i18nKey || "WS_CATEGORY_" + data.code);
9698
+ setCategoryTypeList(categories);
9699
+ }, [wsServicesMastersData]);
9700
+ useEffect(() => {
9701
+ if (props.register) {
9702
+ props.register({
9703
+ name: "cpt"
9704
+ });
9705
+ }
9706
+ }, [props.register]);
9707
+ const formValue = watch();
9708
+ const watchCategoryType = watch("useDetails.categoryType");
9709
+ const watchPropertyType = watch("useDetails.propertyType");
9710
+ const watchPropertyCategory = watch("useDetails.propertyCategory");
9711
+ const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
9712
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
9713
+ const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
9714
+ const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
9715
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
9716
+ const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
9717
+ const categoryOptions = useMemo(() => {
9718
+ var _ptServicesMastersDat, _ptServicesMastersDat2;
9719
+ 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)) || [];
9720
+ if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
9721
+ options = options.filter(item => item.type === watchCategoryType.code);
9722
+ }
9723
+ return options.map(item => ({
9724
+ code: item.code,
9725
+ name: item.name
9726
+ }));
9727
+ }, [ptServicesMastersData, watchCategoryType]);
9728
+ useEffect(() => {
9729
+ if (watchCategoryType && watchPropertyCategory) {
9730
+ const isCategoryValid = categoryOptions.some(opt => opt.code === watchPropertyCategory.code);
9731
+ if (!isCategoryValid) {
9732
+ setValue("useDetails.propertyCategory", null);
9733
+ }
9734
+ }
9735
+ }, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
9736
+ const propertyTypeOptions = useMemo(() => {
9737
+ var _ptServicesMastersDat3, _ptServicesMastersDat4;
9738
+ 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)) || [];
9739
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9740
+ var _watchPropertyCategor;
9741
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
9742
+ options = options.filter(item => {
9743
+ var _item$type, _watchPropertyCategor2;
9744
+ return ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.toUpperCase()) === ((_watchPropertyCategor2 = watchPropertyCategory.code) === null || _watchPropertyCategor2 === void 0 ? void 0 : _watchPropertyCategor2.toUpperCase());
9745
+ });
9746
+ }
9747
+ }
9748
+ return options.map(item => ({
9749
+ code: item.code,
9750
+ name: item.name
9751
+ }));
9752
+ }, [ptServicesMastersData, watchPropertyCategory]);
9753
+ useEffect(() => {
9754
+ if (watchPropertyCategory && watchPropertyType) {
9755
+ const isTypeValid = propertyTypeOptions.some(opt => opt.code === watchPropertyType.code);
9756
+ if (!isTypeValid) {
9757
+ setValue("useDetails.propertyType", null);
9758
+ }
9759
+ }
9760
+ }, [watchPropertyCategory, propertyTypeOptions, setValue, watchPropertyType]);
9761
+ const usageTypeOptions = useMemo(() => {
9762
+ var _ptServicesMastersDat5, _ptServicesMastersDat6;
9763
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat5 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat5 === void 0 ? void 0 : (_ptServicesMastersDat6 = _ptServicesMastersDat5.PropertyNewUsageType) === null || _ptServicesMastersDat6 === void 0 ? void 0 : _ptServicesMastersDat6.filter(item => item.active)) || [];
9764
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9765
+ var _watchPropertyCategor3;
9766
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor3 = watchPropertyCategory.code) === null || _watchPropertyCategor3 === void 0 ? void 0 : _watchPropertyCategor3.toUpperCase()) !== "MIXED") {
9767
+ options = options.filter(item => {
9768
+ var _item$type2, _watchPropertyCategor4;
9769
+ return ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.toUpperCase()) === ((_watchPropertyCategor4 = watchPropertyCategory.code) === null || _watchPropertyCategor4 === void 0 ? void 0 : _watchPropertyCategor4.toUpperCase());
9770
+ });
9771
+ }
9772
+ }
9773
+ return options.map(item => ({
9774
+ code: item.code,
9775
+ name: item.name
9776
+ }));
9777
+ }, [ptServicesMastersData, watchPropertyCategory]);
9778
+ useEffect(() => {
9779
+ if (watchPropertyType && watchWaterConnectionUsageType) {
9780
+ const isUsageTypeValid = usageTypeOptions.some(opt => opt.code === watchWaterConnectionUsageType.code);
9781
+ if (!isUsageTypeValid) {
9782
+ setValue("useDetails.WaterConnectionUsageType", null);
9783
+ }
9784
+ }
9785
+ }, [watchPropertyType, usageTypeOptions, setValue, watchWaterConnectionUsageType]);
9786
+ const lastSentValue = React.useRef(null);
9787
+ useEffect(() => {
9788
+ if (!lodash.isEqual(lastSentValue.current, formValue)) {
9789
+ lastSentValue.current = lodash.cloneDeep(formValue);
9790
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, formValue);
9791
+ }
9792
+ }, [formValue, config === null || config === void 0 ? void 0 : config.key, onSelect]);
9793
+ useEffect(() => {
9794
+ var _formData$cpt;
9795
+ if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
9796
+ var _details$usageCategor, _details$landArea, _details$superBuiltUp;
9797
+ const details = formData.cpt.details;
9798
+ const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
9799
+ const catType = additionalDetails.categoryType || ((_details$usageCategor = details.usageCategory) !== null && _details$usageCategor !== void 0 && _details$usageCategor.includes("RESIDENTIAL") ? "DOMESTIC" : "NON_DOMESTIC");
9800
+ setValue("useDetails.categoryType", (categoryTypeList === null || categoryTypeList === void 0 ? void 0 : categoryTypeList.find(o => o.code === catType)) || null);
9801
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === (additionalDetails.propertyCategory || details.usageCategory))) || null);
9802
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === (additionalDetails.propertyType || details.propertyType))) || null);
9803
+ setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
9804
+ 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()) || "");
9805
+ 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()) || "");
9806
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || additionalDetails.noOfDwellingUnits || (details === null || details === void 0 ? void 0 : details.noOfDwellingUnits) || "");
9807
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || additionalDetails.noOfRooms || (details === null || details === void 0 ? void 0 : details.noOfRooms) || "");
9808
+ setValue("useDetails.colonyName", additionalDetails.colonyName || "");
9809
+ } else if ((formData === null || formData === void 0 ? void 0 : formData.cpt) === null) {
9810
+ setValue("useDetails.categoryType", null);
9811
+ setValue("useDetails.propertyCategory", null);
9812
+ setValue("useDetails.propertyType", null);
9813
+ setValue("useDetails.WaterConnectionUsageType", null);
9814
+ setValue("useDetails.plotArea", "");
9815
+ setValue("useDetails.builtUpArea", "");
9816
+ setValue("useDetails.farArea", "");
9817
+ setValue("useDetails.NumberofDwellingUnits", "");
9818
+ setValue("useDetails.NumberofRooms", "");
9819
+ setValue("useDetails.numberOfBeds", "");
9820
+ setValue("useDetails.numberOfStudents", "");
9821
+ setValue("useDetails.ServantQuartersRoom", "");
9822
+ setValue("useDetails.colonyName", "");
9823
+ }
9824
+ }, [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, categoryTypeList, setValue]);
9825
+ const lastErrorState = React.useRef(null);
9826
+ useEffect(() => {
9827
+ const hasErrors = Object.keys(errors).length > 0;
9828
+ if (lastErrorState.current !== hasErrors) {
9829
+ lastErrorState.current = hasErrors;
9830
+ if (hasErrors) {
9831
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9832
+ type: "custom",
9833
+ message: "Validation failed"
9834
+ });
9835
+ } else {
9836
+ if (clearErrors) clearErrors(config === null || config === void 0 ? void 0 : config.key);
9837
+ }
9838
+ }
9839
+ }, [errors, config === null || config === void 0 ? void 0 : config.key, setError, clearErrors]);
9840
+ const errorStyle = {
9841
+ width: "70%",
9842
+ marginLeft: "30%",
9843
+ fontSize: "12px",
9844
+ marginTop: "-21px"
9845
+ };
9846
+ const isMobile = window.Digit.Utils.browser.isMobile();
9847
+ const handleSubmit = () => {
9848
+ const payload = WSCalculationPayload(formValue);
9849
+ calculateCharges(payload, {
9850
+ onSuccess: data => {
9851
+ setCalculationData(data);
9852
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, _extends({}, formValue, {
9853
+ payload,
9854
+ calculationResponse: data
9855
+ }));
9856
+ },
9857
+ onError: error => {
9858
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
9859
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9860
+ type: "custom",
9861
+ message: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || t("WS_CALCULATION_FAILED")
9862
+ });
9863
+ }
9864
+ });
9865
+ };
9866
+ const RenderCalculationDetails = _ref2 => {
9867
+ var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
9868
+ let data = _ref2.data;
9869
+ if (!data) return null;
9870
+ const calc = (_data$Calculation = data.Calculation) === null || _data$Calculation === void 0 ? void 0 : _data$Calculation[0];
9871
+ if (!calc) return null;
9872
+ const propertyDetail = ((_calc$calculationDeta = calc.calculationDetail) === null || _calc$calculationDeta === void 0 ? void 0 : _calc$calculationDeta.propertyDetail) || {};
9873
+ const waterDemandDetail = ((_calc$calculationDeta2 = calc.calculationDetail) === null || _calc$calculationDeta2 === void 0 ? void 0 : _calc$calculationDeta2.waterDemandDetail) || {};
9874
+ const infraDetail = ((_calc$calculationDeta3 = calc.calculationDetail) === null || _calc$calculationDeta3 === void 0 ? void 0 : _calc$calculationDeta3.infrastructureChargeDetail) || {};
9875
+ const taxHeadEstimates = calc.taxHeadEstimates || [];
9876
+ const totalAmount = calc.totalAmount;
9877
+ return /*#__PURE__*/React.createElement("div", {
9878
+ className: "ws-calc-details-wrapper"
9879
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
9880
+ className: "ws-calc-detail-card"
9881
+ }, /*#__PURE__*/React.createElement("div", {
9882
+ className: "ws-calc-detail-card-header"
9883
+ }, /*#__PURE__*/React.createElement("span", {
9884
+ className: "ws-calc-detail-card-badge"
9885
+ }, "1"), /*#__PURE__*/React.createElement("h3", {
9886
+ className: "ws-calc-detail-card-title"
9887
+ }, t("WS_PROPERTY_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9888
+ className: "ws-calc-property-box"
9889
+ }, /*#__PURE__*/React.createElement("div", {
9890
+ className: "ws-calc-grid-3"
9891
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9892
+ className: "ws-calc-label"
9893
+ }, t("WS_PROPERTY_TYPE")), /*#__PURE__*/React.createElement("div", {
9894
+ className: "ws-calc-value"
9895
+ }, propertyDetail.propertyType || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9896
+ className: "ws-calc-label"
9897
+ }, t("WS_PROPERTY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9898
+ className: "ws-calc-value"
9899
+ }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9900
+ className: "ws-calc-label"
9901
+ }, t("WS_WATER_CONNECTION_USAGE_TYPE")), /*#__PURE__*/React.createElement("div", {
9902
+ className: "ws-calc-value"
9903
+ }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9904
+ className: "ws-calc-label"
9905
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9906
+ className: "ws-calc-pill"
9907
+ }, propertyDetail.colonyCategory || "-"))), /*#__PURE__*/React.createElement("hr", {
9908
+ className: "ws-calc-hr"
9909
+ }), /*#__PURE__*/React.createElement("div", {
9910
+ className: "ws-calc-grid-4"
9911
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9912
+ className: "ws-calc-label"
9913
+ }, t("WS_LAND_AREA")), /*#__PURE__*/React.createElement("div", {
9914
+ className: "ws-calc-value"
9915
+ }, propertyDetail.landArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9916
+ className: "ws-calc-label"
9917
+ }, t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
9918
+ className: "ws-calc-value"
9919
+ }, propertyDetail.farArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9920
+ className: "ws-calc-label"
9921
+ }, t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
9922
+ className: "ws-calc-value"
9923
+ }, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m."))))), /*#__PURE__*/React.createElement("div", {
9924
+ className: "ws-calc-detail-card"
9925
+ }, /*#__PURE__*/React.createElement("div", {
9926
+ className: "ws-calc-detail-card-header"
9927
+ }, /*#__PURE__*/React.createElement("span", {
9928
+ className: "ws-calc-detail-card-badge"
9929
+ }, "2"), /*#__PURE__*/React.createElement("h3", {
9930
+ className: "ws-calc-detail-card-title"
9931
+ }, t("WS_WATER_DEMAND_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9932
+ className: "ws-calc-split-card"
9933
+ }, /*#__PURE__*/React.createElement("div", {
9934
+ className: "ws-calc-split-left"
9935
+ }, /*#__PURE__*/React.createElement("div", {
9936
+ className: "ws-calc-row"
9937
+ }, /*#__PURE__*/React.createElement("span", {
9938
+ className: "ws-calc-row-label"
9939
+ }, t("WS_MATCHED_NORM_CODE")), /*#__PURE__*/React.createElement("span", {
9940
+ className: "ws-calc-row-value"
9941
+ }, waterDemandDetail.matchedNormCode || "-")), /*#__PURE__*/React.createElement("div", {
9942
+ className: "ws-calc-row"
9943
+ }, /*#__PURE__*/React.createElement("span", {
9944
+ className: "ws-calc-row-label"
9945
+ }, t("WS_MATCHED_NORM_NAME")), /*#__PURE__*/React.createElement("span", {
9946
+ className: "ws-calc-row-value-right"
9947
+ }, waterDemandDetail.matchedNormName || "-")), /*#__PURE__*/React.createElement("div", {
9948
+ className: "ws-calc-row"
9949
+ }, /*#__PURE__*/React.createElement("span", {
9950
+ className: "ws-calc-row-label"
9951
+ }, t("WS_FORMULA_USED")), /*#__PURE__*/React.createElement("span", {
9952
+ className: "ws-calc-row-value"
9953
+ }, waterDemandDetail.formulaUsed || "-")), /*#__PURE__*/React.createElement("div", {
9954
+ className: "ws-calc-row"
9955
+ }, /*#__PURE__*/React.createElement("span", {
9956
+ className: "ws-calc-row-label"
9957
+ }, t("WS_CALCULATED_OCCUPANCY")), /*#__PURE__*/React.createElement("span", {
9958
+ className: "ws-calc-row-value"
9959
+ }, waterDemandDetail.calculatedOccupancy || 0, " Persons")), /*#__PURE__*/React.createElement("div", {
9960
+ className: "ws-calc-row-last"
9961
+ }, /*#__PURE__*/React.createElement("span", {
9962
+ className: "ws-calc-row-label"
9963
+ }, t("WS_LPCD_SELECTED")), /*#__PURE__*/React.createElement("span", {
9964
+ className: "ws-calc-row-value"
9965
+ }, waterDemandDetail.chosenLpcd || 0, " LPD"))), /*#__PURE__*/React.createElement("div", {
9966
+ className: "ws-calc-split-right"
9967
+ }, /*#__PURE__*/React.createElement("div", {
9968
+ className: "ws-calc-row"
9969
+ }, /*#__PURE__*/React.createElement("span", {
9970
+ className: "ws-calc-row-label"
9971
+ }, t("WS_BASE_DEMAND")), /*#__PURE__*/React.createElement("span", {
9972
+ className: "ws-calc-row-value"
9973
+ }, waterDemandDetail.baseDemand || 0, " L/day")), /*#__PURE__*/React.createElement("div", {
9974
+ className: "ws-calc-row",
9975
+ style: {
9976
+ marginBottom: "24px"
9977
+ }
9978
+ }, /*#__PURE__*/React.createElement("span", {
9979
+ className: "ws-calc-row-label"
9980
+ }, t("WS_CONTINGENCY")), /*#__PURE__*/React.createElement("span", {
9981
+ className: "ws-calc-row-value"
9982
+ }, waterDemandDetail.contingencyPercentage || 0, "%")), /*#__PURE__*/React.createElement("div", {
9983
+ className: "ws-calc-highlight-blue"
9984
+ }, /*#__PURE__*/React.createElement("span", {
9985
+ className: "ws-calc-highlight-blue-label"
9986
+ }, t("WS_TOTAL_WATER_DEMAND")), /*#__PURE__*/React.createElement("span", {
9987
+ className: "ws-calc-highlight-blue-value"
9988
+ }, waterDemandDetail.totalWaterDemandLPD || 0, " L/day"))))), /*#__PURE__*/React.createElement("div", {
9989
+ className: "ws-calc-detail-card"
9990
+ }, /*#__PURE__*/React.createElement("div", {
9991
+ className: "ws-calc-detail-card-header"
9992
+ }, /*#__PURE__*/React.createElement("span", {
9993
+ className: "ws-calc-detail-card-badge"
9994
+ }, "3"), /*#__PURE__*/React.createElement("h3", {
9995
+ className: "ws-calc-detail-card-title"
9996
+ }, t("WS_INFRASTRUCTURE_CHARGE_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9997
+ className: "ws-calc-split-card"
9998
+ }, /*#__PURE__*/React.createElement("div", {
9999
+ className: "ws-calc-split-left"
10000
+ }, /*#__PURE__*/React.createElement("div", {
10001
+ className: "ws-calc-row"
10002
+ }, /*#__PURE__*/React.createElement("span", {
10003
+ className: "ws-calc-row-label"
10004
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("span", {
10005
+ className: "ws-calc-row-value"
10006
+ }, infraDetail.colonyCategory || "-")), /*#__PURE__*/React.createElement("div", {
10007
+ className: "ws-calc-row"
10008
+ }, /*#__PURE__*/React.createElement("span", {
10009
+ className: "ws-calc-row-label"
10010
+ }, t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10011
+ className: "ws-calc-row-value"
10012
+ }, infraDetail.plotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10013
+ className: "ws-calc-row"
10014
+ }, /*#__PURE__*/React.createElement("span", {
10015
+ className: "ws-calc-row-label"
10016
+ }, t("WS_MINIMUM_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10017
+ className: "ws-calc-row-value"
10018
+ }, infraDetail.minimumPlotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10019
+ className: "ws-calc-row"
10020
+ }, /*#__PURE__*/React.createElement("span", {
10021
+ className: "ws-calc-row-label"
10022
+ }, t("WS_WATER_RATE")), /*#__PURE__*/React.createElement("span", {
10023
+ className: "ws-calc-row-value"
10024
+ }, "\u20B9 ", infraDetail.waterRatePerLPD || 0, " / LPD")), /*#__PURE__*/React.createElement("div", {
10025
+ className: "ws-calc-row-last"
10026
+ }, /*#__PURE__*/React.createElement("span", {
10027
+ className: "ws-calc-row-label"
10028
+ }, t("WS_SEWER_RATE")), /*#__PURE__*/React.createElement("span", {
10029
+ className: "ws-calc-row-value"
10030
+ }, "\u20B9 ", infraDetail.sewerRatePerLPD || 0, " / LPD"))), /*#__PURE__*/React.createElement("div", {
10031
+ className: "ws-calc-split-right"
10032
+ }, /*#__PURE__*/React.createElement("div", {
10033
+ className: "ws-calc-row"
10034
+ }, /*#__PURE__*/React.createElement("span", {
10035
+ className: "ws-calc-row-label"
10036
+ }, t("WS_WATER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10037
+ className: "ws-calc-row-value"
10038
+ }, "\u20B9 ", ((_infraDetail$waterCom = infraDetail.waterComponentIFC) === null || _infraDetail$waterCom === void 0 ? void 0 : _infraDetail$waterCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10039
+ className: "ws-calc-row"
10040
+ }, /*#__PURE__*/React.createElement("span", {
10041
+ className: "ws-calc-row-label"
10042
+ }, t("WS_SEWER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10043
+ className: "ws-calc-row-value"
10044
+ }, "\u20B9 ", ((_infraDetail$sewerCom = infraDetail.sewerComponentIFC) === null || _infraDetail$sewerCom === void 0 ? void 0 : _infraDetail$sewerCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10045
+ className: "ws-calc-row"
10046
+ }, /*#__PURE__*/React.createElement("span", {
10047
+ className: "ws-calc-row-label"
10048
+ }, t("WS_GROSS_IFC")), /*#__PURE__*/React.createElement("span", {
10049
+ className: "ws-calc-row-value"
10050
+ }, "\u20B9 ", ((_infraDetail$grossIFC = infraDetail.grossIFC) === null || _infraDetail$grossIFC === void 0 ? void 0 : _infraDetail$grossIFC.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10051
+ className: "ws-calc-row"
10052
+ }, /*#__PURE__*/React.createElement("span", {
10053
+ className: "ws-calc-row-label"
10054
+ }, t("WS_REBATE"), " (", infraDetail.rebatePercentage || 0, "%)"), /*#__PURE__*/React.createElement("span", {
10055
+ className: "ws-calc-row-value-red"
10056
+ }, "- \u20B9 ", ((_infraDetail$rebateAm = infraDetail.rebateAmount) === null || _infraDetail$rebateAm === void 0 ? void 0 : _infraDetail$rebateAm.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10057
+ className: "ws-calc-highlight-green"
10058
+ }, /*#__PURE__*/React.createElement("span", {
10059
+ className: "ws-calc-highlight-green-label"
10060
+ }, t("WS_NET_INFRASTRUCTURE_CHARGE")), /*#__PURE__*/React.createElement("span", {
10061
+ className: "ws-calc-highlight-green-value"
10062
+ }, "\u20B9 ", ((_infraDetail$netIFC = infraDetail.netIFC) === null || _infraDetail$netIFC === void 0 ? void 0 : _infraDetail$netIFC.toLocaleString("en-IN")) || 0))))), /*#__PURE__*/React.createElement("div", {
10063
+ className: "ws-calc-detail-card",
10064
+ style: {
10065
+ marginBottom: "0"
10066
+ }
10067
+ }, /*#__PURE__*/React.createElement("div", {
10068
+ className: "ws-calc-detail-card-header"
10069
+ }, /*#__PURE__*/React.createElement("span", {
10070
+ className: "ws-calc-detail-card-badge"
10071
+ }, "4"), /*#__PURE__*/React.createElement("h3", {
10072
+ className: "ws-calc-detail-card-title"
10073
+ }, t("WS_FEE_SUMMARY"))), /*#__PURE__*/React.createElement("div", {
10074
+ className: "ws-calc-split-card",
10075
+ style: {
10076
+ marginBottom: "0"
10077
+ }
10078
+ }, /*#__PURE__*/React.createElement("div", {
10079
+ className: "ws-calc-split-left",
10080
+ style: {
10081
+ display: "flex",
10082
+ flexDirection: "column",
10083
+ justifyContent: "center"
10084
+ }
10085
+ }, taxHeadEstimates.map((taxHead, index) => {
10086
+ var _taxHead$estimateAmou;
10087
+ return /*#__PURE__*/React.createElement("div", {
10088
+ key: index,
10089
+ className: "ws-calc-row"
10090
+ }, /*#__PURE__*/React.createElement("span", {
10091
+ className: "ws-calc-row-label"
10092
+ }, t(taxHead.taxHeadCode)), /*#__PURE__*/React.createElement("span", {
10093
+ className: "ws-calc-row-value"
10094
+ }, "\u20B9 ", (_taxHead$estimateAmou = taxHead.estimateAmount) === null || _taxHead$estimateAmou === void 0 ? void 0 : _taxHead$estimateAmou.toLocaleString("en-IN")));
10095
+ })), /*#__PURE__*/React.createElement("div", {
10096
+ className: "ws-calc-highlight-purple"
10097
+ }, /*#__PURE__*/React.createElement("span", {
10098
+ className: "ws-calc-highlight-purple-label"
10099
+ }, t("WS_TOTAL_AMOUNT_PAYABLE")), /*#__PURE__*/React.createElement("span", {
10100
+ className: "ws-calc-highlight-purple-value"
10101
+ }, "\u20B9 ", totalAmount === null || totalAmount === void 0 ? void 0 : totalAmount.toLocaleString("en-IN")))))));
10102
+ };
10103
+ return /*#__PURE__*/React.createElement("div", {
10104
+ className: "employee-form-section-wrapper"
10105
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
10106
+ config: [{
10107
+ timeLine: [{
10108
+ actions: t("WS_CALCULATION"),
10109
+ currentStep: 1
10110
+ }]
10111
+ }],
10112
+ showFinalStep: false
10113
+ }), /*#__PURE__*/React.createElement("div", {
10114
+ style: {
10115
+ flex: 1
10116
+ }
10117
+ }, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
10118
+ title: t("WS_CALCULATION"),
10119
+ defaultOpen: true,
10120
+ style: props.style
10121
+ }, /*#__PURE__*/React.createElement("div", {
10122
+ className: "formcomposer-section-grid"
10123
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_CATEGORY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10124
+ className: "form-field"
10125
+ }, /*#__PURE__*/React.createElement(Controller, {
10126
+ control: control,
10127
+ name: "useDetails.categoryType",
10128
+ rules: {
10129
+ required: t("REQUIRED_FIELD")
10130
+ },
10131
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10132
+ option: categoryTypeList,
10133
+ optionKey: "i18nKey",
10134
+ selected: props.value,
10135
+ select: props.onChange,
10136
+ t: t,
10137
+ onBlur: props.onBlur
10138
+ })
10139
+ }))), (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, {
10140
+ style: errorStyle
10141
+ }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_CATEGORY") + "*"), /*#__PURE__*/React.createElement("div", {
10142
+ className: "form-field"
10143
+ }, /*#__PURE__*/React.createElement(Controller, {
10144
+ control: control,
10145
+ name: "useDetails.propertyCategory",
10146
+ rules: {
10147
+ required: t("REQUIRED_FIELD")
10148
+ },
10149
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10150
+ option: categoryOptions,
10151
+ optionKey: "name",
10152
+ selected: props.value,
10153
+ select: props.onChange,
10154
+ t: t,
10155
+ onBlur: props.onBlur
10156
+ })
10157
+ }))), (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, {
10158
+ style: errorStyle
10159
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10160
+ className: "form-field"
10161
+ }, /*#__PURE__*/React.createElement(Controller, {
10162
+ control: control,
10163
+ name: "useDetails.propertyType",
10164
+ rules: {
10165
+ required: t("REQUIRED_FIELD")
10166
+ },
10167
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10168
+ option: propertyTypeOptions,
10169
+ optionKey: "name",
10170
+ selected: props.value,
10171
+ select: props.onChange,
10172
+ t: t,
10173
+ onBlur: props.onBlur
10174
+ })
10175
+ }))), (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, {
10176
+ style: errorStyle
10177
+ }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_WATER_CONNECTION_USAGE_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10178
+ className: "form-field"
10179
+ }, /*#__PURE__*/React.createElement(Controller, {
10180
+ control: control,
10181
+ name: "useDetails.WaterConnectionUsageType",
10182
+ rules: {
10183
+ required: t("REQUIRED_FIELD")
10184
+ },
10185
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10186
+ option: usageTypeOptions,
10187
+ optionKey: "name",
10188
+ selected: props.value,
10189
+ select: props.onChange,
10190
+ t: t,
10191
+ onBlur: props.onBlur
10192
+ })
10193
+ }))), (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, {
10194
+ style: errorStyle
10195
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_COLONY_NAME") + "*"), /*#__PURE__*/React.createElement("div", {
10196
+ className: "form-field"
10197
+ }, /*#__PURE__*/React.createElement(Controller, {
10198
+ control: control,
10199
+ name: "useDetails.colonyName",
10200
+ rules: {
10201
+ required: t("REQUIRED_FIELD")
10202
+ },
10203
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10204
+ option: colonyNameOptions,
10205
+ optionKey: "name",
10206
+ selected: props.value,
10207
+ select: props.onChange,
10208
+ t: t,
10209
+ onBlur: props.onBlur
10210
+ })
10211
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.colonyName) && /*#__PURE__*/React.createElement(CardLabelError, {
10212
+ style: errorStyle
10213
+ }, errors.useDetails.colonyName.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("div", {
10214
+ className: "form-field"
10215
+ }, /*#__PURE__*/React.createElement(TextInput, {
10216
+ t: t,
10217
+ inputRef: register({
10218
+ pattern: {
10219
+ value: DECIMAL_PATTERN,
10220
+ message: t("ERR_INVALID_DECIMAL")
10221
+ }
10222
+ }),
10223
+ name: "useDetails.plotArea"
10224
+ }))), (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, {
10225
+ style: errorStyle
10226
+ }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
10227
+ className: "form-field"
10228
+ }, /*#__PURE__*/React.createElement(TextInput, {
10229
+ t: t,
10230
+ inputRef: register({
10231
+ pattern: {
10232
+ value: DECIMAL_PATTERN,
10233
+ message: t("ERR_INVALID_DECIMAL")
10234
+ }
10235
+ }),
10236
+ name: "useDetails.builtUpArea"
10237
+ }))), (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, {
10238
+ style: errorStyle
10239
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
10240
+ className: "form-field"
10241
+ }, /*#__PURE__*/React.createElement(TextInput, {
10242
+ t: t,
10243
+ inputRef: register({
10244
+ pattern: {
10245
+ value: DECIMAL_PATTERN,
10246
+ message: t("ERR_INVALID_DECIMAL")
10247
+ }
10248
+ }),
10249
+ name: "useDetails.farArea"
10250
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.farArea) && /*#__PURE__*/React.createElement(CardLabelError, {
10251
+ style: errorStyle
10252
+ }, errors.useDetails.farArea.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
10253
+ className: "form-field"
10254
+ }, /*#__PURE__*/React.createElement(TextInput, {
10255
+ t: t,
10256
+ inputRef: register({
10257
+ pattern: {
10258
+ value: NUMBER_PATTERN,
10259
+ message: t("ERR_INVALID_NUMBER")
10260
+ }
10261
+ }),
10262
+ name: "useDetails.NumberofDwellingUnits"
10263
+ }))) : null, isDwellingUnit && (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, {
10264
+ style: errorStyle
10265
+ }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React.createElement("div", {
10266
+ className: "form-field"
10267
+ }, /*#__PURE__*/React.createElement(TextInput, {
10268
+ t: t,
10269
+ inputRef: register({
10270
+ pattern: {
10271
+ value: NUMBER_PATTERN,
10272
+ message: t("ERR_INVALID_NUMBER")
10273
+ },
10274
+ required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
10275
+ }),
10276
+ name: "useDetails.NumberofRooms"
10277
+ }))) : 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, {
10278
+ style: errorStyle
10279
+ }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_BEDS") + "*"), /*#__PURE__*/React.createElement("div", {
10280
+ className: "form-field"
10281
+ }, /*#__PURE__*/React.createElement(TextInput, {
10282
+ t: t,
10283
+ inputRef: register({
10284
+ pattern: {
10285
+ value: NUMBER_PATTERN,
10286
+ message: t("ERR_INVALID_NUMBER")
10287
+ },
10288
+ required: isHospitalProperty ? t("REQUIRED_FIELD") : false
10289
+ }),
10290
+ name: "useDetails.numberOfBeds"
10291
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.numberOfBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
10292
+ style: errorStyle
10293
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
10294
+ className: "form-field"
10295
+ }, /*#__PURE__*/React.createElement(TextInput, {
10296
+ t: t,
10297
+ inputRef: register({
10298
+ pattern: {
10299
+ value: NUMBER_PATTERN,
10300
+ message: t("ERR_INVALID_NUMBER")
10301
+ }
10302
+ }),
10303
+ name: "useDetails.numberOfStudents"
10304
+ }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
10305
+ style: errorStyle
10306
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React.createElement("div", {
10307
+ className: "form-field"
10308
+ }, /*#__PURE__*/React.createElement(TextInput, {
10309
+ t: t,
10310
+ inputRef: register({
10311
+ pattern: {
10312
+ value: NUMBER_PATTERN,
10313
+ message: t("ERR_INVALID_NUMBER")
10314
+ }
10315
+ }),
10316
+ name: "useDetails.ServantQuartersRoom"
10317
+ }))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.ServantQuartersRoom) && /*#__PURE__*/React.createElement(CardLabelError, {
10318
+ style: errorStyle
10319
+ }, errors.useDetails.ServantQuartersRoom.message))), /*#__PURE__*/React.createElement("div", {
10320
+ style: {
10321
+ display: "flex",
10322
+ marginTop: "24px",
10323
+ marginBottom: "32px",
10324
+ justifyContent: isMobile ? "center" : "flex-end"
10325
+ }
10326
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
10327
+ label: t("ES_COMMON_CALCULATE"),
10328
+ onSubmit: handleSubmit
10329
+ })), calculationData && /*#__PURE__*/React.createElement(RenderCalculationDetails, {
10330
+ data: calculationData
10331
+ })));
10332
+ };
10333
+
9595
10334
  const BILLSBreadCrumbs = _ref => {
9596
10335
  var _applicationDetails$a, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a13, _applicationDetails$a14, _reciept_data$Payment2;
9597
10336
  const getRecieptSearch = function (tenantId, payments, consumerCodes, receiptKey) {
@@ -10017,6 +10756,10 @@ const BILLSBreadCrumbs = _ref => {
10017
10756
  path: "/digit-ui/employee/ws/water/bulk-bil",
10018
10757
  label: t("CS_TITLE_BULK_BILL"),
10019
10758
  show: location.pathname.includes("/ws/water/bulk-bill") ? true : false
10759
+ }, {
10760
+ path: "/digit-ui/employee/ws/water/calculation",
10761
+ label: t("WS_CALCULATION"),
10762
+ show: location.pathname.includes("/ws/water/calculation") ? true : false
10020
10763
  }];
10021
10764
  let lastCrumbIndex = findLastIndex(crumbs, "show", true);
10022
10765
  crumbs[lastCrumbIndex] = _extends({}, crumbs[lastCrumbIndex], {
@@ -10043,7 +10786,7 @@ const BILLSBreadCrumbs = _ref => {
10043
10786
  }));
10044
10787
  };
10045
10788
  const App$1 = _ref2 => {
10046
- var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg;
10789
+ var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg, _Digit30, _Digit30$ComponentReg;
10047
10790
  let path = _ref2.path;
10048
10791
  const location = useLocation();
10049
10792
  const WSDocsRequired = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("WSDocsRequired");
@@ -10063,21 +10806,22 @@ const App$1 = _ref2 => {
10063
10806
  const WSConsumptionDetails = (_Digit13 = Digit) === null || _Digit13 === void 0 ? void 0 : (_Digit13$ComponentReg = _Digit13.ComponentRegistryService) === null || _Digit13$ComponentReg === void 0 ? void 0 : _Digit13$ComponentReg.getComponent("WSConsumptionDetails");
10064
10807
  const WSModifyApplication = (_Digit14 = Digit) === null || _Digit14 === void 0 ? void 0 : (_Digit14$ComponentReg = _Digit14.ComponentRegistryService) === null || _Digit14$ComponentReg === void 0 ? void 0 : _Digit14$ComponentReg.getComponent("WSModifyApplication");
10065
10808
  const WSEditModifyApplication = (_Digit15 = Digit) === null || _Digit15 === void 0 ? void 0 : (_Digit15$ComponentReg = _Digit15.ComponentRegistryService) === null || _Digit15$ComponentReg === void 0 ? void 0 : _Digit15$ComponentReg.getComponent("WSEditModifyApplication");
10066
- const WSDisconnectionApplication = (_Digit16 = Digit) === null || _Digit16 === void 0 ? void 0 : (_Digit16$ComponentReg = _Digit16.ComponentRegistryService) === null || _Digit16$ComponentReg === void 0 ? void 0 : _Digit16$ComponentReg.getComponent("WSDisconnectionApplication");
10067
- const WSRestorationApplication = (_Digit17 = Digit) === null || _Digit17 === void 0 ? void 0 : (_Digit17$ComponentReg = _Digit17.ComponentRegistryService) === null || _Digit17$ComponentReg === void 0 ? void 0 : _Digit17$ComponentReg.getComponent("WSRestorationApplication");
10068
- const WSEditApplicationByConfig = (_Digit18 = Digit) === null || _Digit18 === void 0 ? void 0 : (_Digit18$ComponentReg = _Digit18.ComponentRegistryService) === null || _Digit18$ComponentReg === void 0 ? void 0 : _Digit18$ComponentReg.getComponent("WSEditApplicationByConfig");
10069
- const WSBillIAmendMentInbox = (_Digit19 = Digit) === null || _Digit19 === void 0 ? void 0 : (_Digit19$ComponentReg = _Digit19.ComponentRegistryService) === null || _Digit19$ComponentReg === void 0 ? void 0 : _Digit19$ComponentReg.getComponent("WSBillIAmendMentInbox");
10070
- const WSGetDisconnectionDetails = (_Digit20 = Digit) === null || _Digit20 === void 0 ? void 0 : (_Digit20$ComponentReg = _Digit20.ComponentRegistryService) === null || _Digit20$ComponentReg === void 0 ? void 0 : _Digit20$ComponentReg.getComponent("WSGetDisconnectionDetails");
10071
- const WSModifyApplicationDetails = (_Digit21 = Digit) === null || _Digit21 === void 0 ? void 0 : (_Digit21$ComponentReg = _Digit21.ComponentRegistryService) === null || _Digit21$ComponentReg === void 0 ? void 0 : _Digit21$ComponentReg.getComponent("WSModifyApplicationDetails");
10072
- const WSEditDisconnectionApplication = (_Digit22 = Digit) === null || _Digit22 === void 0 ? void 0 : (_Digit22$ComponentReg = _Digit22.ComponentRegistryService) === null || _Digit22$ComponentReg === void 0 ? void 0 : _Digit22$ComponentReg.getComponent("WSEditDisconnectionApplication");
10073
- const WSEditDisconnectionByConfig = (_Digit23 = Digit) === null || _Digit23 === void 0 ? void 0 : (_Digit23$ComponentReg = _Digit23.ComponentRegistryService) === null || _Digit23$ComponentReg === void 0 ? void 0 : _Digit23$ComponentReg.getComponent("WSEditDisconnectionByConfig");
10074
- const WSResubmitDisconnection = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSResubmitDisconnection");
10075
- const WSSearchIntegrated = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSSearchIntegrated");
10076
- const WSBulkBillGeneration = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSBulkBillGeneration");
10077
- const CPTCreateProperty = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("CPTCreateProperty");
10078
- const CPTAcknowledgement = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTAcknowledgement");
10079
- const WSInfoPage = (_Digit29 = Digit) === null || _Digit29 === void 0 ? void 0 : (_Digit29$ComponentReg = _Digit29.ComponentRegistryService) === null || _Digit29$ComponentReg === void 0 ? void 0 : _Digit29$ComponentReg.getComponent("WSInfoPage");
10080
- const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
10809
+ const WSMutationApplication = (_Digit16 = Digit) === null || _Digit16 === void 0 ? void 0 : (_Digit16$ComponentReg = _Digit16.ComponentRegistryService) === null || _Digit16$ComponentReg === void 0 ? void 0 : _Digit16$ComponentReg.getComponent("WSMutationApplication");
10810
+ const WSDisconnectionApplication = (_Digit17 = Digit) === null || _Digit17 === void 0 ? void 0 : (_Digit17$ComponentReg = _Digit17.ComponentRegistryService) === null || _Digit17$ComponentReg === void 0 ? void 0 : _Digit17$ComponentReg.getComponent("WSDisconnectionApplication");
10811
+ const WSRestorationApplication = (_Digit18 = Digit) === null || _Digit18 === void 0 ? void 0 : (_Digit18$ComponentReg = _Digit18.ComponentRegistryService) === null || _Digit18$ComponentReg === void 0 ? void 0 : _Digit18$ComponentReg.getComponent("WSRestorationApplication");
10812
+ const WSEditApplicationByConfig = (_Digit19 = Digit) === null || _Digit19 === void 0 ? void 0 : (_Digit19$ComponentReg = _Digit19.ComponentRegistryService) === null || _Digit19$ComponentReg === void 0 ? void 0 : _Digit19$ComponentReg.getComponent("WSEditApplicationByConfig");
10813
+ const WSBillIAmendMentInbox = (_Digit20 = Digit) === null || _Digit20 === void 0 ? void 0 : (_Digit20$ComponentReg = _Digit20.ComponentRegistryService) === null || _Digit20$ComponentReg === void 0 ? void 0 : _Digit20$ComponentReg.getComponent("WSBillIAmendMentInbox");
10814
+ const WSGetDisconnectionDetails = (_Digit21 = Digit) === null || _Digit21 === void 0 ? void 0 : (_Digit21$ComponentReg = _Digit21.ComponentRegistryService) === null || _Digit21$ComponentReg === void 0 ? void 0 : _Digit21$ComponentReg.getComponent("WSGetDisconnectionDetails");
10815
+ const WSModifyApplicationDetails = (_Digit22 = Digit) === null || _Digit22 === void 0 ? void 0 : (_Digit22$ComponentReg = _Digit22.ComponentRegistryService) === null || _Digit22$ComponentReg === void 0 ? void 0 : _Digit22$ComponentReg.getComponent("WSModifyApplicationDetails");
10816
+ const WSEditDisconnectionApplication = (_Digit23 = Digit) === null || _Digit23 === void 0 ? void 0 : (_Digit23$ComponentReg = _Digit23.ComponentRegistryService) === null || _Digit23$ComponentReg === void 0 ? void 0 : _Digit23$ComponentReg.getComponent("WSEditDisconnectionApplication");
10817
+ const WSEditDisconnectionByConfig = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSEditDisconnectionByConfig");
10818
+ const WSResubmitDisconnection = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSResubmitDisconnection");
10819
+ const WSSearchIntegrated = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSSearchIntegrated");
10820
+ const WSBulkBillGeneration = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("WSBulkBillGeneration");
10821
+ const CPTCreateProperty = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTCreateProperty");
10822
+ const CPTAcknowledgement = (_Digit29 = Digit) === null || _Digit29 === void 0 ? void 0 : (_Digit29$ComponentReg = _Digit29.ComponentRegistryService) === null || _Digit29$ComponentReg === void 0 ? void 0 : _Digit29$ComponentReg.getComponent("CPTAcknowledgement");
10823
+ const WSInfoPage = (_Digit30 = Digit) === null || _Digit30 === void 0 ? void 0 : (_Digit30$ComponentReg = _Digit30.ComponentRegistryService) === null || _Digit30$ComponentReg === void 0 ? void 0 : _Digit30$ComponentReg.getComponent("WSInfoPage");
10824
+ const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/mutation-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
10081
10825
  const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired");
10082
10826
  return /*#__PURE__*/React.createElement("div", {
10083
10827
  className: "app-container"
@@ -10217,6 +10961,9 @@ const App$1 = _ref2 => {
10217
10961
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
10218
10962
  path: path + "/modify-application-edit",
10219
10963
  component: WSEditModifyApplication
10964
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
10965
+ path: path + "/mutation-application",
10966
+ component: WSMutationApplication
10220
10967
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
10221
10968
  path: path + "/disconnection-application",
10222
10969
  component: WSDisconnectionDocsRequired
@@ -10270,6 +11017,11 @@ const App$1 = _ref2 => {
10270
11017
  component: props => /*#__PURE__*/React.createElement(WSBulkBillGeneration, _extends({}, props, {
10271
11018
  parentRoute: path
10272
11019
  }))
11020
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
11021
+ path: path + "/water/calculation",
11022
+ component: props => /*#__PURE__*/React.createElement(WSCalculation, _extends({}, props, {
11023
+ parentRoute: path
11024
+ }))
10273
11025
  }))))));
10274
11026
  };
10275
11027
 
@@ -15057,7 +15809,7 @@ const WSActivationPageDetails = _ref => {
15057
15809
  const _useTranslation = useTranslation(),
15058
15810
  t = _useTranslation.t;
15059
15811
  const filters = getQueryStringParams(location.search);
15060
- const _ref2 = window.location.href.includes("modify") ? useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15812
+ const _ref2 = window.location.href.includes("modify") || window.location.href.includes("mutation") ? useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15061
15813
  activationDetails = _ref2[0],
15062
15814
  setActivationDetails = _ref2[1];
15063
15815
  const _useState = useState({
@@ -15157,7 +15909,7 @@ const ConnectionDetails$3 = _props => {
15157
15909
  trigger();
15158
15910
  }, [formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType]);
15159
15911
  useEffect(() => {
15160
- if (window.location.href.includes("modify")) trigger();
15912
+ if (window.location.href.includes("modify") || window.location.href.includes("mutation")) trigger();
15161
15913
  }, [activationDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails, formData === null || formData === void 0 ? void 0 : formData.DocumentsRequired, formData === null || formData === void 0 ? void 0 : formData.connectionDetails, formData === null || formData === void 0 ? void 0 : formData.cpt]);
15162
15914
  useEffect(() => {
15163
15915
  var _formState$errors$con;
@@ -15320,7 +16072,7 @@ const ConnectionDetails$3 = _props => {
15320
16072
  }
15321
16073
  }))), /*#__PURE__*/React.createElement(CardLabelError, {
15322
16074
  style: errorStyle
15323
- }, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
16075
+ }, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") || window.location.href.includes("mutation") ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15324
16076
  style: isMobile && isEmployee ? {
15325
16077
  fontWeight: "700",
15326
16078
  width: "100%"
@@ -20623,18 +21375,18 @@ const WSDjbEmployee = _ref => {
20623
21375
  return /*#__PURE__*/React.createElement(React.Fragment, null, FormContent);
20624
21376
  };
20625
21377
 
20626
- const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
20627
- const NUMBER_PATTERN = /^\d+$/;
20628
- const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
21378
+ const _excluded$1 = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
21379
+ const NUMBER_PATTERN$1 = /^\d+$/;
21380
+ const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
20629
21381
  const PropertyWaterConnection = _ref => {
20630
- 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, _errors$useDetails10, _errors$useDetails11;
21382
+ 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, _errors$useDetails10, _errors$useDetails11, _errors$useDetails12;
20631
21383
  let t = _ref.t,
20632
21384
  config = _ref.config,
20633
21385
  onSelect = _ref.onSelect,
20634
21386
  formData = _ref.formData,
20635
21387
  setError = _ref.setError,
20636
21388
  clearErrors = _ref.clearErrors,
20637
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
21389
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
20638
21390
  const _useForm = useForm({
20639
21391
  defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
20640
21392
  useDetails: {
@@ -20648,8 +21400,9 @@ const PropertyWaterConnection = _ref => {
20648
21400
  SelectYearofConstruction: null,
20649
21401
  NumberofDwellingUnits: "",
20650
21402
  NumberofRooms: "",
20651
- hospitalBeds: "",
20652
- numnberOfStudents: ""
21403
+ numberOfBeds: "",
21404
+ numberOfStudents: "",
21405
+ ServantQuartersRoom: ""
20653
21406
  }
20654
21407
  }
20655
21408
  }),
@@ -20688,6 +21441,8 @@ const PropertyWaterConnection = _ref => {
20688
21441
  const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
20689
21442
  const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
20690
21443
  const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
21444
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
21445
+ const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
20691
21446
  const yearOptions = useMemo(() => {
20692
21447
  const currentYear = new Date().getFullYear();
20693
21448
  const years = [];
@@ -20817,8 +21572,9 @@ const PropertyWaterConnection = _ref => {
20817
21572
  setValue("useDetails.SelectYearofConstruction", null);
20818
21573
  setValue("useDetails.NumberofDwellingUnits", "");
20819
21574
  setValue("useDetails.NumberofRooms", "");
20820
- setValue("useDetails.hospitalBeds", "");
20821
- setValue("useDetails.numnberOfStudents", "");
21575
+ setValue("useDetails.numberOfBeds", "");
21576
+ setValue("useDetails.numberOfStudents", "");
21577
+ setValue("useDetails.ServantQuartersRoom", "");
20822
21578
  }
20823
21579
  }, [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]);
20824
21580
  const lastErrorState = React.useRef(null);
@@ -20946,7 +21702,7 @@ const PropertyWaterConnection = _ref => {
20946
21702
  t: t,
20947
21703
  inputRef: register({
20948
21704
  pattern: {
20949
- value: DECIMAL_PATTERN,
21705
+ value: DECIMAL_PATTERN$1,
20950
21706
  message: t("ERR_INVALID_DECIMAL")
20951
21707
  }
20952
21708
  }),
@@ -20960,7 +21716,7 @@ const PropertyWaterConnection = _ref => {
20960
21716
  t: t,
20961
21717
  inputRef: register({
20962
21718
  pattern: {
20963
- value: DECIMAL_PATTERN,
21719
+ value: DECIMAL_PATTERN$1,
20964
21720
  message: t("ERR_INVALID_DECIMAL")
20965
21721
  }
20966
21722
  }),
@@ -20974,7 +21730,7 @@ const PropertyWaterConnection = _ref => {
20974
21730
  t: t,
20975
21731
  inputRef: register({
20976
21732
  pattern: {
20977
- value: DECIMAL_PATTERN,
21733
+ value: DECIMAL_PATTERN$1,
20978
21734
  message: t("ERR_INVALID_DECIMAL")
20979
21735
  }
20980
21736
  }),
@@ -21001,19 +21757,19 @@ const PropertyWaterConnection = _ref => {
21001
21757
  })
21002
21758
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
21003
21759
  style: errorStyle
21004
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
21760
+ }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
21005
21761
  className: "form-field"
21006
21762
  }, /*#__PURE__*/React.createElement(TextInput, {
21007
21763
  t: t,
21008
21764
  inputRef: register({
21009
21765
  pattern: {
21010
- value: NUMBER_PATTERN,
21766
+ value: NUMBER_PATTERN$1,
21011
21767
  message: t("ERR_INVALID_NUMBER")
21012
21768
  }
21013
21769
  }),
21014
21770
  name: "useDetails.NumberofDwellingUnits",
21015
21771
  disabled: isPropertyFound
21016
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
21772
+ }))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
21017
21773
  style: errorStyle
21018
21774
  }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React.createElement("div", {
21019
21775
  className: "form-field"
@@ -21021,7 +21777,7 @@ const PropertyWaterConnection = _ref => {
21021
21777
  t: t,
21022
21778
  inputRef: register({
21023
21779
  pattern: {
21024
- value: NUMBER_PATTERN,
21780
+ value: NUMBER_PATTERN$1,
21025
21781
  message: t("ERR_INVALID_NUMBER")
21026
21782
  },
21027
21783
  required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
@@ -21036,30 +21792,44 @@ const PropertyWaterConnection = _ref => {
21036
21792
  t: t,
21037
21793
  inputRef: register({
21038
21794
  pattern: {
21039
- value: NUMBER_PATTERN,
21795
+ value: NUMBER_PATTERN$1,
21040
21796
  message: t("ERR_INVALID_NUMBER")
21041
21797
  },
21042
21798
  required: isHospitalProperty ? t("REQUIRED_FIELD") : false
21043
21799
  }),
21044
- name: "useDetails.hospitalBeds",
21800
+ name: "useDetails.numberOfBeds",
21045
21801
  disabled: isPropertyFound
21046
- }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.hospitalBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
21802
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
21047
21803
  style: errorStyle
21048
- }, errors.useDetails.hospitalBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
21804
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
21049
21805
  className: "form-field"
21050
21806
  }, /*#__PURE__*/React.createElement(TextInput, {
21051
21807
  t: t,
21052
21808
  inputRef: register({
21053
21809
  pattern: {
21054
- value: NUMBER_PATTERN,
21810
+ value: NUMBER_PATTERN$1,
21055
21811
  message: t("ERR_INVALID_NUMBER")
21056
21812
  }
21057
21813
  }),
21058
- name: "useDetails.numnberOfStudents",
21814
+ name: "useDetails.numberOfStudents",
21059
21815
  disabled: isPropertyFound
21060
- }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numnberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
21816
+ }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
21061
21817
  style: errorStyle
21062
- }, errors.useDetails.numnberOfStudents.message)));
21818
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React.createElement("div", {
21819
+ className: "form-field"
21820
+ }, /*#__PURE__*/React.createElement(TextInput, {
21821
+ t: t,
21822
+ inputRef: register({
21823
+ pattern: {
21824
+ value: NUMBER_PATTERN$1,
21825
+ message: t("ERR_INVALID_NUMBER")
21826
+ }
21827
+ }),
21828
+ name: "useDetails.ServantQuartersRoom",
21829
+ disabled: isPropertyFound
21830
+ }))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails12 = errors.useDetails) === null || _errors$useDetails12 === void 0 ? void 0 : _errors$useDetails12.ServantQuartersRoom) && /*#__PURE__*/React.createElement(CardLabelError, {
21831
+ style: errorStyle
21832
+ }, errors.useDetails.ServantQuartersRoom.message)));
21063
21833
  };
21064
21834
 
21065
21835
  const WSPropertyWaterConnection = props => {
@@ -22023,7 +22793,7 @@ const SearchFields = _ref => {
22023
22793
  }, t("CS_COMMON_CLEAR_SEARCH"))));
22024
22794
  };
22025
22795
 
22026
- const _excluded$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22796
+ const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22027
22797
  _excluded2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22028
22798
  const MobileSearchApplication = _ref => {
22029
22799
  let Controller = _ref.Controller,
@@ -22070,7 +22840,7 @@ const MobileSearchApplication = _ref => {
22070
22840
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22071
22841
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22072
22842
  tenantId = _ref2.tenantId,
22073
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
22843
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
22074
22844
  const closeMobilePopupModal = props.closeMobilePopupModal;
22075
22845
  switch (currentlyActiveMobileModal) {
22076
22846
  case "SearchFormComponent":
@@ -22505,7 +23275,7 @@ const SearchFields$1 = _ref => {
22505
23275
  }, t("WS_SEARCH_CONNECTION_RESET_BUTTON"))));
22506
23276
  };
22507
23277
 
22508
- const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
23278
+ const _excluded$3 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22509
23279
  _excluded2$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22510
23280
  const MobileSearchWater = _ref => {
22511
23281
  let Controller = _ref.Controller,
@@ -22550,7 +23320,7 @@ const MobileSearchWater = _ref => {
22550
23320
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22551
23321
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22552
23322
  tenantId = _ref2.tenantId,
22553
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
23323
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
22554
23324
  const closeMobilePopupModal = props.closeMobilePopupModal;
22555
23325
  switch (currentlyActiveMobileModal) {
22556
23326
  case "SearchFormComponent":
@@ -23785,6 +24555,10 @@ const WSCard = () => {
23785
24555
  label: t("WS_WATER_APPLICATION_SEARCH"),
23786
24556
  link: "/digit-ui/employee/ws/water/search-application",
23787
24557
  roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
24558
+ }, {
24559
+ label: t("WS_CALCULATION"),
24560
+ link: "/digit-ui/employee/ws/water/calculation",
24561
+ roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
23788
24562
  }]
23789
24563
  };
23790
24564
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
@@ -28980,8 +29754,10 @@ const WSFeeEstimation = _ref => {
28980
29754
  };
28981
29755
 
28982
29756
  const ViewBreakup = _ref => {
28983
- var _wsAdditionalDetails$, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6;
28984
- let wsAdditionalDetails = _ref.wsAdditionalDetails;
29757
+ var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29758
+ let wsAdditionalDetails = _ref.wsAdditionalDetails,
29759
+ print = _ref.print,
29760
+ download = _ref.download;
28985
29761
  const _useTranslation = useTranslation(),
28986
29762
  t = _useTranslation.t;
28987
29763
  const _useState = useState(false),
@@ -28990,6 +29766,44 @@ const ViewBreakup = _ref => {
28990
29766
  const _useState2 = useState({}),
28991
29767
  breakUpData = _useState2[0],
28992
29768
  setBreakUpData = _useState2[1];
29769
+ const breakupRef = useRef(null);
29770
+ const formatNumber = function (value, maximumFractionDigits) {
29771
+ if (maximumFractionDigits === void 0) {
29772
+ maximumFractionDigits = 2;
29773
+ }
29774
+ return Number(value || 0).toLocaleString("en-IN", {
29775
+ maximumFractionDigits
29776
+ });
29777
+ };
29778
+ const formatCurrency = value => /*#__PURE__*/React.createElement("span", null, "\u20B9", formatNumber(value));
29779
+ const DetailRows = _ref2 => {
29780
+ let rows = _ref2.rows;
29781
+ return rows.map(_ref3 => {
29782
+ let label = _ref3.label,
29783
+ value = _ref3.value,
29784
+ _ref3$currency = _ref3.currency,
29785
+ currency = _ref3$currency === void 0 ? false : _ref3$currency,
29786
+ _ref3$unit = _ref3.unit,
29787
+ unit = _ref3$unit === void 0 ? "" : _ref3$unit,
29788
+ _ref3$isText = _ref3.isText,
29789
+ isText = _ref3$isText === void 0 ? false : _ref3$isText;
29790
+ return /*#__PURE__*/React.createElement(Row, {
29791
+ className: "border-none",
29792
+ rowContainerStyle: {
29793
+ margin: "0px"
29794
+ },
29795
+ labelStyle: {
29796
+ width: "50%"
29797
+ },
29798
+ key: label,
29799
+ label: label,
29800
+ text: currency ? formatCurrency(value) : isText ? value || "-" : "" + formatNumber(value) + unit,
29801
+ textStyle: {
29802
+ textAlign: "right"
29803
+ }
29804
+ });
29805
+ });
29806
+ };
28993
29807
  const Heading = props => {
28994
29808
  return /*#__PURE__*/React.createElement("h1", {
28995
29809
  className: "heading-m"
@@ -29012,21 +29826,244 @@ const ViewBreakup = _ref => {
29012
29826
  }, /*#__PURE__*/React.createElement(Close, null));
29013
29827
  };
29014
29828
  const onPopupOpen = () => {
29015
- var _sessionBillFormData$;
29016
- let breakupData = wsAdditionalDetails.additionalDetails.data || {};
29829
+ var _wsAdditionalDetails$, _sessionBillFormData$;
29830
+ let breakupData = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$ === void 0 ? void 0 : _wsAdditionalDetails$.data) || {};
29017
29831
  const sessionBillData = sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA");
29018
29832
  const sessionBillFormData = sessionBillData ? JSON.parse(sessionBillData) : {};
29019
29833
  if (sessionBillFormData !== null && sessionBillFormData !== void 0 && (_sessionBillFormData$ = sessionBillFormData.value) !== null && _sessionBillFormData$ !== void 0 && _sessionBillFormData$.totalAmount) breakupData = sessionBillFormData === null || sessionBillFormData === void 0 ? void 0 : sessionBillFormData.value;
29020
29834
  setBreakUpData(breakupData);
29021
29835
  showPopUp(true);
29022
29836
  };
29837
+ const getBreakupReportDetails = () => {
29838
+ var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
29839
+ const amountRows = function (rows) {
29840
+ if (rows === void 0) {
29841
+ rows = [];
29842
+ }
29843
+ return rows.map(row => ({
29844
+ title: t(row === null || row === void 0 ? void 0 : row.taxHeadCode),
29845
+ value: "\u20B9" + formatNumber(row === null || row === void 0 ? void 0 : row.amount)
29846
+ }));
29847
+ };
29848
+ const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : (_wsAdditionalDetails$4 = _wsAdditionalDetails$3.connectionHolders) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4[0];
29849
+ const applicantName = [connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName].filter(Boolean).join(" ") || "-";
29850
+ const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
29851
+ const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$5 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : (_wsAdditionalDetails$6 = _wsAdditionalDetails$5.data) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : _wsAdditionalDetails$6.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$7 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : _wsAdditionalDetails$7.applicationNumber) || "-";
29852
+ return [{
29853
+ title: "Applicant Details",
29854
+ values: [{
29855
+ title: "Application Number",
29856
+ value: appNumber
29857
+ }, {
29858
+ title: "Applicant Name",
29859
+ value: applicantName
29860
+ }, {
29861
+ title: "Mobile Number",
29862
+ value: mobileNumber
29863
+ }]
29864
+ }, {
29865
+ title: t("WS_APPLICATION_FEE_HEADER"),
29866
+ values: amountRows([...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : _breakUpData$billSlab.FEE) || []), ...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab2 = breakUpData.billSlabData) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.CHARGES) || [])])
29867
+ }, {
29868
+ title: "Property details",
29869
+ values: propertyRows.map(_ref4 => {
29870
+ let label = _ref4.label,
29871
+ value = _ref4.value,
29872
+ currency = _ref4.currency,
29873
+ unit = _ref4.unit,
29874
+ isText = _ref4.isText;
29875
+ return {
29876
+ title: label,
29877
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29878
+ };
29879
+ })
29880
+ }, {
29881
+ title: "Taxes",
29882
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29883
+ }, {
29884
+ title: "Water demand details",
29885
+ values: waterDemandRows.map(_ref5 => {
29886
+ let label = _ref5.label,
29887
+ value = _ref5.value,
29888
+ currency = _ref5.currency,
29889
+ unit = _ref5.unit,
29890
+ isText = _ref5.isText;
29891
+ return {
29892
+ title: label,
29893
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29894
+ };
29895
+ })
29896
+ }, {
29897
+ title: "Infrastructure charge details",
29898
+ values: infrastructureChargeRows.map(_ref6 => {
29899
+ let label = _ref6.label,
29900
+ value = _ref6.value,
29901
+ currency = _ref6.currency,
29902
+ unit = _ref6.unit,
29903
+ isText = _ref6.isText;
29904
+ return {
29905
+ title: label,
29906
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29907
+ };
29908
+ })
29909
+ }, {
29910
+ title: "Total",
29911
+ values: [{
29912
+ title: t("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),
29913
+ value: "\u20B9" + formatNumber(breakUpData === null || breakUpData === void 0 ? void 0 : breakUpData.totalAmount)
29914
+ }]
29915
+ }].filter(section => section.values.length > 0);
29916
+ };
29917
+ const generateBreakupReport = mode => {
29918
+ var _Digit$Utils, _Digit$Utils$pdf;
29919
+ const generateReport = (_Digit$Utils = Digit.Utils) === null || _Digit$Utils === void 0 ? void 0 : (_Digit$Utils$pdf = _Digit$Utils.pdf) === null || _Digit$Utils$pdf === void 0 ? void 0 : _Digit$Utils$pdf.generateCalculationBreakupReport;
29920
+ if (typeof generateReport === "function") {
29921
+ return generateReport({
29922
+ tenantId: Digit.ULBService.getCurrentTenantId(),
29923
+ heading: t("WS_CALCULATION_BREAKUP"),
29924
+ details: getBreakupReportDetails(),
29925
+ t,
29926
+ mode
29927
+ });
29928
+ }
29929
+ return mode === "download" ? Digit.Download.PDF(breakupRef, t("WS_CALCULATION_BREAKUP")) : null;
29930
+ };
29931
+ const handleDownload = () => generateBreakupReport("download");
29932
+ const handlePrint = () => {
29933
+ var _Digit$Utils2, _Digit$Utils2$pdf, _breakupRef$current, _window$mSewaApp, _window$mSewaApp$isMs;
29934
+ if ((_Digit$Utils2 = Digit.Utils) !== null && _Digit$Utils2 !== void 0 && (_Digit$Utils2$pdf = _Digit$Utils2.pdf) !== null && _Digit$Utils2$pdf !== void 0 && _Digit$Utils2$pdf.generateCalculationBreakupReport) {
29935
+ return generateBreakupReport("print");
29936
+ }
29937
+ const content = (_breakupRef$current = breakupRef.current) === null || _breakupRef$current === void 0 ? void 0 : _breakupRef$current.innerHTML;
29938
+ if (!content) return;
29939
+ if ((_window$mSewaApp = window.mSewaApp) !== null && _window$mSewaApp !== void 0 && (_window$mSewaApp$isMs = _window$mSewaApp.isMsewaApp) !== null && _window$mSewaApp$isMs !== void 0 && _window$mSewaApp$isMs.call(_window$mSewaApp)) {
29940
+ window.mSewaApp.downloadBase64File(window.btoa(unescape(encodeURIComponent(content))), t("WS_CALCULATION_BREAKUP"));
29941
+ return;
29942
+ }
29943
+ const printWindow = window.open("", "");
29944
+ if (!printWindow) return;
29945
+ printWindow.document.write("<html><body>" + content + "</body></html>");
29946
+ printWindow.document.close();
29947
+ printWindow.focus();
29948
+ printWindow.print();
29949
+ };
29950
+ const propertyDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.propertyDetail;
29951
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.waterDemandDetail;
29952
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat3 = breakUpData.calculationDetail) === null || _breakUpData$calculat3 === void 0 ? void 0 : _breakUpData$calculat3.infrastructureChargeDetail;
29953
+ const propertyRows = propertyDetail ? [{
29954
+ label: "Property ID",
29955
+ value: propertyDetail.propertyId,
29956
+ isText: true
29957
+ }, {
29958
+ label: "Property type",
29959
+ value: propertyDetail.propertyType,
29960
+ isText: true
29961
+ }, {
29962
+ label: "Plot area",
29963
+ value: propertyDetail.landArea,
29964
+ unit: " (sq. meter.)"
29965
+ }, {
29966
+ label: "Built-up area",
29967
+ value: propertyDetail.superBuiltUpArea,
29968
+ unit: " (sq. meter.)"
29969
+ }, {
29970
+ label: "farArea",
29971
+ value: propertyDetail.farArea,
29972
+ isText: true
29973
+ }, {
29974
+ label: "coveredArea",
29975
+ value: propertyDetail.coveredArea,
29976
+ isText: true
29977
+ }, {
29978
+ label: "numberOfDwellingUnits",
29979
+ value: propertyDetail.numberOfDwellingUnits,
29980
+ isText: true
29981
+ }, {
29982
+ label: "numberOfBeds",
29983
+ value: propertyDetail.numberOfBeds,
29984
+ isText: true
29985
+ }, {
29986
+ label: "numberOfRooms",
29987
+ value: propertyDetail.numberOfRooms,
29988
+ isText: true
29989
+ }, {
29990
+ label: "numberOfStudents",
29991
+ value: propertyDetail.numberOfStudents,
29992
+ isText: true
29993
+ }, {
29994
+ label: "numberOfStaff",
29995
+ value: propertyDetail.numberOfStaff,
29996
+ isText: true
29997
+ }, {
29998
+ label: "Usage category",
29999
+ value: propertyDetail.usageCategory,
30000
+ isText: true
30001
+ }] : [];
30002
+ const waterDemandRows = waterDemandDetail ? [{
30003
+ label: "Calculated occupancy",
30004
+ value: waterDemandDetail.calculatedOccupancy,
30005
+ unit: " person"
30006
+ }, {
30007
+ label: "Applied LPCD",
30008
+ value: waterDemandDetail.chosenLpcd,
30009
+ unit: " LPD"
30010
+ }, {
30011
+ label: "Base demand",
30012
+ value: waterDemandDetail.baseDemand,
30013
+ unit: " LPD"
30014
+ }, {
30015
+ label: "Contingency/Floating Occupancy",
30016
+ value: waterDemandDetail.contingencyPercentage,
30017
+ unit: "%"
30018
+ }, {
30019
+ label: "Total water demand",
30020
+ value: waterDemandDetail.totalWaterDemandLPD,
30021
+ unit: " LPD"
30022
+ }] : [];
30023
+ const infrastructureChargeRows = infrastructureChargeDetail ? [{
30024
+ label: "Colony category",
30025
+ value: infrastructureChargeDetail.colonyCategory,
30026
+ isText: true
30027
+ }, {
30028
+ label: "Plot area",
30029
+ value: infrastructureChargeDetail.plotArea,
30030
+ unit: " (sq. meter.)"
30031
+ }, {
30032
+ label: "Water rate",
30033
+ value: infrastructureChargeDetail.waterRatePerLPD,
30034
+ currency: true
30035
+ }, {
30036
+ label: "Sewer rate",
30037
+ value: infrastructureChargeDetail.sewerRatePerLPD,
30038
+ currency: true
30039
+ }, {
30040
+ label: "Water Infra Charges",
30041
+ value: infrastructureChargeDetail.waterComponentIFC,
30042
+ currency: true
30043
+ }, {
30044
+ label: "Sewer Infra Charges",
30045
+ value: infrastructureChargeDetail.sewerComponentIFC,
30046
+ currency: true
30047
+ }, {
30048
+ label: "Rebate",
30049
+ value: infrastructureChargeDetail.rebatePercentage,
30050
+ unit: "%"
30051
+ }, {
30052
+ label: "Rebate amount",
30053
+ value: infrastructureChargeDetail.rebateAmount,
30054
+ currency: true
30055
+ }, {
30056
+ label: "Net IFC",
30057
+ value: infrastructureChargeDetail.netIFC,
30058
+ currency: true
30059
+ }] : [];
29023
30060
  return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
29024
30061
  style: {
29025
30062
  lineHeight: "19px",
29026
30063
  maxWidth: "950px",
29027
30064
  minWidth: "280px"
29028
30065
  }
29029
- }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$ !== void 0 && _wsAdditionalDetails$.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
30066
+ }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
29030
30067
  onClick: e => onPopupOpen(),
29031
30068
  style: {
29032
30069
  marginTop: "12px"
@@ -29037,6 +30074,9 @@ const ViewBreakup = _ref => {
29037
30074
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
29038
30075
  label: t("WS_CALCULATION_BREAKUP")
29039
30076
  }),
30077
+ width: "950px",
30078
+ print: print || handlePrint,
30079
+ download: download || handleDownload,
29040
30080
  headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn, {
29041
30081
  onClick: () => {
29042
30082
  showPopUp(false);
@@ -29052,16 +30092,13 @@ const ViewBreakup = _ref => {
29052
30092
  popupModuleMianStyles: {
29053
30093
  paddingTop: "0px"
29054
30094
  }
29055
- }, /*#__PURE__*/React.createElement(StatusTable, {
29056
- style: {
29057
- padding: "10px",
29058
- paddingTop: "0px"
29059
- }
29060
- }, /*#__PURE__*/React.createElement(CardSectionHeader, {
30095
+ }, /*#__PURE__*/React.createElement("div", {
30096
+ ref: breakupRef
30097
+ }, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29061
30098
  style: {
29062
30099
  margin: "10px 0px"
29063
30100
  }
29064
- }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : (_breakUpData$billSlab2 = _breakUpData$billSlab.FEE) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.map(data => /*#__PURE__*/React.createElement(Row, {
30101
+ }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab4 = breakUpData.billSlabData) === null || _breakUpData$billSlab4 === void 0 ? void 0 : (_breakUpData$billSlab5 = _breakUpData$billSlab4.FEE) === null || _breakUpData$billSlab5 === void 0 ? void 0 : _breakUpData$billSlab5.map(data => /*#__PURE__*/React.createElement(Row, {
29065
30102
  className: "border-none",
29066
30103
  rowContainerStyle: {
29067
30104
  margin: "0px"
@@ -29075,11 +30112,7 @@ const ViewBreakup = _ref => {
29075
30112
  textStyle: {
29076
30113
  textAlign: "right"
29077
30114
  }
29078
- })), /*#__PURE__*/React.createElement(CardSectionHeader, {
29079
- style: {
29080
- margin: "10px 0px"
29081
- }
29082
- }, t("WS_SERVICE_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : (_breakUpData$billSlab4 = _breakUpData$billSlab3.CHARGES) === null || _breakUpData$billSlab4 === void 0 ? void 0 : _breakUpData$billSlab4.map(data => /*#__PURE__*/React.createElement(Row, {
30115
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab6 = breakUpData.billSlabData) === null || _breakUpData$billSlab6 === void 0 ? void 0 : (_breakUpData$billSlab7 = _breakUpData$billSlab6.CHARGES) === null || _breakUpData$billSlab7 === void 0 ? void 0 : _breakUpData$billSlab7.map(data => /*#__PURE__*/React.createElement(Row, {
29083
30116
  className: "border-none",
29084
30117
  rowContainerStyle: {
29085
30118
  margin: "0px"
@@ -29093,7 +30126,7 @@ const ViewBreakup = _ref => {
29093
30126
  textStyle: {
29094
30127
  textAlign: "right"
29095
30128
  }
29096
- })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab5 = breakUpData.billSlabData) === null || _breakUpData$billSlab5 === void 0 ? void 0 : (_breakUpData$billSlab6 = _breakUpData$billSlab5.TAX) === null || _breakUpData$billSlab6 === void 0 ? void 0 : _breakUpData$billSlab6.map(data => /*#__PURE__*/React.createElement(Row, {
30129
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab8 = breakUpData.billSlabData) === null || _breakUpData$billSlab8 === void 0 ? void 0 : (_breakUpData$billSlab9 = _breakUpData$billSlab8.TAX) === null || _breakUpData$billSlab9 === void 0 ? void 0 : _breakUpData$billSlab9.map(data => /*#__PURE__*/React.createElement(Row, {
29097
30130
  className: "border-none",
29098
30131
  rowContainerStyle: {
29099
30132
  margin: "0px"
@@ -29107,6 +30140,24 @@ const ViewBreakup = _ref => {
29107
30140
  textStyle: {
29108
30141
  textAlign: "right"
29109
30142
  }
30143
+ })), propertyRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
30144
+ style: {
30145
+ margin: "10px 0px"
30146
+ }
30147
+ }, "Property details"), /*#__PURE__*/React.createElement(DetailRows, {
30148
+ rows: propertyRows
30149
+ })), waterDemandRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
30150
+ style: {
30151
+ margin: "10px 0px"
30152
+ }
30153
+ }, "Water demand details"), /*#__PURE__*/React.createElement(DetailRows, {
30154
+ rows: waterDemandRows
30155
+ })), infrastructureChargeRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
30156
+ style: {
30157
+ margin: "10px 0px"
30158
+ }
30159
+ }, "Infrastructure charge details"), /*#__PURE__*/React.createElement(DetailRows, {
30160
+ rows: infrastructureChargeRows
29110
30161
  })), /*#__PURE__*/React.createElement("hr", {
29111
30162
  style: {
29112
30163
  color: "#cccccc",
@@ -29129,7 +30180,7 @@ const ViewBreakup = _ref => {
29129
30180
  fontWeight: "700",
29130
30181
  fontSize: "24px"
29131
30182
  }
29132
- })))));
30183
+ }))))));
29133
30184
  };
29134
30185
 
29135
30186
  const checkForNA$1 = value => {
@@ -33824,7 +34875,7 @@ const WSPropertyLocationDetails = props => {
33824
34875
  return /*#__PURE__*/React.createElement(PropertyLocationDetails, props);
33825
34876
  };
33826
34877
 
33827
- const _excluded$3 = ["errors"],
34878
+ const _excluded$4 = ["errors"],
33828
34879
  _excluded2$2 = ["register", "control", "watch", "setValue", "unregister", "handleSubmit", "formState", "getValues", "reset"];
33829
34880
  const ApplicationBillAmendment = () => {
33830
34881
  var _data$BillingService, _data$BillingService$, _data$BillingService2, _data$BillingService3, _state, _state$data, _state$data$applicati, _state$data$applicati2, _state$data$applicati3, _billSearchData, _billSearchData$filte, _billSearchData2, _state9, _state9$data, _errors$WS_REDUCED_AM, _errors$WS_ADDITIONAL, _billSearchData3, _errors$effectiveTill, _errors$effectiveTill2, _state12, _state12$data;
@@ -33881,7 +34932,7 @@ const ApplicationBillAmendment = () => {
33881
34932
  handleSubmit = _useForm.handleSubmit,
33882
34933
  _useForm$formState = _useForm.formState,
33883
34934
  errors = _useForm$formState.errors,
33884
- rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$3),
34935
+ rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$4),
33885
34936
  getValues = _useForm.getValues,
33886
34937
  methods = _objectWithoutPropertiesLoose(_useForm, _excluded2$2);
33887
34938
  const _Digit$Hooks$ws$useAp = Digit.Hooks.ws.useApplicationActionsBillAmendUpdate(),
@@ -34746,8 +35797,8 @@ const DECLARATION_POINTS = ["I understand that sanction of connection does not a
34746
35797
  const NAME_PATTERN = /^[a-zA-Z\s.'-]{1,50}$/;
34747
35798
  const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
34748
35799
  const MOBILE_PATTERN = /^[6-9][0-9]{9}$/;
34749
- const NUMBER_PATTERN$1 = /^\d+$/;
34750
- const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
35800
+ const NUMBER_PATTERN$2 = /^\d+$/;
35801
+ const DECIMAL_PATTERN$2 = /^\d+(\.\d{1,2})?$/;
34751
35802
  const IFSC_PATTERN = /^[A-Z]{4}0[A-Z0-9]{6}$/;
34752
35803
  const ACCOUNT_PATTERN = /^[0-9]{9,18}$/;
34753
35804
  const COLLAPSIBLE_CONTENT_TAB = "__WS_SECTION_CONTENT__";
@@ -37016,7 +38067,7 @@ const NewApplication = () => {
37016
38067
  errorStyle: !!getFieldError("useDetails.plotArea"),
37017
38068
  inputRef: register({
37018
38069
  pattern: {
37019
- value: DECIMAL_PATTERN$1,
38070
+ value: DECIMAL_PATTERN$2,
37020
38071
  message: "Enter a valid numeric value."
37021
38072
  },
37022
38073
  required: "Plot Area is required."
@@ -37030,7 +38081,7 @@ const NewApplication = () => {
37030
38081
  errorStyle: !!getFieldError("useDetails.builtUpArea"),
37031
38082
  inputRef: register({
37032
38083
  pattern: {
37033
- value: DECIMAL_PATTERN$1,
38084
+ value: DECIMAL_PATTERN$2,
37034
38085
  message: "Enter a valid numeric value."
37035
38086
  },
37036
38087
  required: "Built Up Area is required."
@@ -37061,7 +38112,7 @@ const NewApplication = () => {
37061
38112
  errorStyle: !!getFieldError("useDetails.NumberofDwellingUnits"),
37062
38113
  inputRef: register({
37063
38114
  pattern: {
37064
- value: DECIMAL_PATTERN$1,
38115
+ value: DECIMAL_PATTERN$2,
37065
38116
  message: "Enter a valid numeric value."
37066
38117
  },
37067
38118
  required: "Built Up Area is required."
@@ -37075,7 +38126,7 @@ const NewApplication = () => {
37075
38126
  errorStyle: !!getFieldError("useDetails.NumberofRooms"),
37076
38127
  inputRef: register({
37077
38128
  pattern: {
37078
- value: DECIMAL_PATTERN$1,
38129
+ value: DECIMAL_PATTERN$2,
37079
38130
  message: "Enter a valid numeric value."
37080
38131
  },
37081
38132
  required: "Built Up Area is required."
@@ -37089,7 +38140,7 @@ const NewApplication = () => {
37089
38140
  errorStyle: !!getFieldError("useDetails.hospitalBeds"),
37090
38141
  inputRef: register({
37091
38142
  pattern: {
37092
- value: NUMBER_PATTERN$1,
38143
+ value: NUMBER_PATTERN$2,
37093
38144
  message: "Enter a valid whole number."
37094
38145
  },
37095
38146
  required: isHospitalProperty ? "No. of Beds is required for Hospital / Nursing Home." : false
@@ -45850,9 +46901,11 @@ const ActivateConnection = () => {
45850
46901
  }
45851
46902
  }, []);
45852
46903
  useEffect(() => {
45853
- if (!isLoading) {
46904
+ if (!isLoading && newConfig && Array.isArray(newConfig)) {
45854
46905
  const config = newConfig.find(conf => conf.hideInCitizen);
45855
- setConfig(config);
46906
+ if (config) {
46907
+ setConfig(config);
46908
+ }
45856
46909
  }
45857
46910
  }, [newConfig]);
45858
46911
  useEffect(() => {
@@ -46361,16 +47414,18 @@ const EditApplication$1 = () => {
46361
47414
  }),
46362
47415
  propertyDetails = _Digit$Hooks$pt$usePr.data;
46363
47416
  useEffect(() => {
46364
- if (!isConfigLoading) {
46365
- var _config$body;
47417
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
46366
47418
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEdit);
46367
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
46368
- let bodyDetails = [];
46369
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46370
- if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
46371
- });
46372
- config.body = bodyDetails;
46373
- setConfig(config);
47419
+ if (config) {
47420
+ var _config$body;
47421
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
47422
+ let bodyDetails = [];
47423
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47424
+ if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
47425
+ });
47426
+ config.body = bodyDetails;
47427
+ setConfig(config);
47428
+ }
46374
47429
  }
46375
47430
  }, [newConfig]);
46376
47431
  useEffect(() => {
@@ -47023,19 +48078,21 @@ const ModifyApplication = () => {
47023
48078
  }),
47024
48079
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47025
48080
  useEffect(() => {
47026
- if (!isConfigLoading) {
47027
- var _config$body;
48081
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47028
48082
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47029
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47030
- let bodyDetails = [];
47031
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47032
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47033
- });
47034
- bodyDetails.forEach(bdyData => {
47035
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47036
- });
47037
- config.body = bodyDetails;
47038
- setConfig(config);
48083
+ if (config) {
48084
+ var _config$body;
48085
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
48086
+ let bodyDetails = [];
48087
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48088
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
48089
+ });
48090
+ bodyDetails.forEach(bdyData => {
48091
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
48092
+ });
48093
+ config.body = bodyDetails;
48094
+ setConfig(config);
48095
+ }
47039
48096
  }
47040
48097
  }, [newConfig]);
47041
48098
  useEffect(() => {
@@ -47126,8 +48183,529 @@ const ModifyApplication = () => {
47126
48183
  };
47127
48184
  }
47128
48185
  const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
47129
- return Promise.resolve(convertModifyApplicationDetails(data, details)).then(function (convertAppData) {
47130
- var _data$ConnectionDetai, _data$ConnectionDetai2, _data$ConnectionDetai3, _data$ConnectionDetai4, _formData;
48186
+ return Promise.resolve(convertModifyApplicationDetails(data, details)).then(function (convertAppData) {
48187
+ var _data$ConnectionDetai, _data$ConnectionDetai2, _data$ConnectionDetai3, _data$ConnectionDetai4, _formData;
48188
+ function _temp6() {
48189
+ const _temp4 = function () {
48190
+ if (serviceType !== "WATER") {
48191
+ const _temp3 = function () {
48192
+ if (sewerageMutation) {
48193
+ setIsEnableLoader(true);
48194
+ return Promise.resolve(sewerageMutation(reqDetails, {
48195
+ onError: (error, variables) => {
48196
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
48197
+ setIsEnableLoader(false);
48198
+ setShowToast({
48199
+ key: "error",
48200
+ message: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && (_error$response$data$ = _error$response$data.Errors) !== null && _error$response$data$ !== void 0 && (_error$response$data$2 = _error$response$data$[0]) !== null && _error$response$data$2 !== void 0 && _error$response$data$2.message ? error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message : error
48201
+ });
48202
+ setTimeout(closeToastOfError, 5000);
48203
+ },
48204
+ onSuccess: function (data, variables) {
48205
+ try {
48206
+ var _data$SewerageConnect;
48207
+ return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0], "SEWERAGE")).then(function (response) {
48208
+ let sewerageConnectionUpdate = {
48209
+ SewerageConnection: response,
48210
+ reconnectRequest: false,
48211
+ disconnectRequest: false
48212
+ };
48213
+ return Promise.resolve(sewerageUpdateMutation(sewerageConnectionUpdate, {
48214
+ onError: (error, variables) => {
48215
+ setIsEnableLoader(false);
48216
+ setShowToast({
48217
+ key: "error",
48218
+ message: error !== null && error !== void 0 && error.message ? error.message : error
48219
+ });
48220
+ setTimeout(closeToastOfError, 5000);
48221
+ },
48222
+ onSuccess: (data, variables) => {
48223
+ var _data$SewerageConnect2, _data$SewerageConnect3;
48224
+ clearSessionFormData();
48225
+ history.push("/digit-ui/employee/ws/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));
48226
+ }
48227
+ })).then(function () {});
48228
+ });
48229
+ } catch (e) {
48230
+ return Promise.reject(e);
48231
+ }
48232
+ }
48233
+ })).then(function () {});
48234
+ }
48235
+ }();
48236
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
48237
+ }
48238
+ }();
48239
+ if (_temp4 && _temp4.then) return _temp4.then(function () {});
48240
+ }
48241
+ const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai3 = data.ConnectionDetails) === null || _data$ConnectionDetai3 === void 0 ? void 0 : (_data$ConnectionDetai4 = _data$ConnectionDetai3[0]) === null || _data$ConnectionDetai4 === void 0 ? void 0 : _data$ConnectionDetai4.applicationType) === "WATER_RECONNECTION" ? {
48242
+ WaterConnection: convertAppData,
48243
+ reconnectRequest: true,
48244
+ disconnectRequest: false
48245
+ } : {
48246
+ WaterConnection: convertAppData,
48247
+ reconnectRequest: false,
48248
+ disconnectRequest: false
48249
+ } : ((_formData = formData) === null || _formData === void 0 ? void 0 : _formData.applicationType) === "SEWERAGE_RECONNECTION" ? {
48250
+ SewerageConnection: convertAppData,
48251
+ reconnectRequest: true,
48252
+ disconnectRequest: false
48253
+ } : {
48254
+ SewerageConnection: convertAppData,
48255
+ reconnectRequest: false,
48256
+ disconnectRequest: false
48257
+ };
48258
+ const _temp5 = function () {
48259
+ if (serviceType == "WATER") {
48260
+ const _temp2 = function () {
48261
+ if (waterMutation) {
48262
+ setIsEnableLoader(true);
48263
+ return Promise.resolve(waterMutation(reqDetails, {
48264
+ onError: (error, variables) => {
48265
+ var _error$response3, _error$response3$data, _error$response3$data2, _error$response4, _error$response4$data, _error$response4$data2;
48266
+ setIsEnableLoader(false);
48267
+ setShowToast({
48268
+ key: "error",
48269
+ message: error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && (_error$response3$data = _error$response3.data) !== null && _error$response3$data !== void 0 && (_error$response3$data2 = _error$response3$data.Errors) !== null && _error$response3$data2 !== void 0 && _error$response3$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.Errors) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2[0].message : error
48270
+ });
48271
+ setTimeout(closeToastOfError, 5000);
48272
+ },
48273
+ onSuccess: function (data, variables) {
48274
+ try {
48275
+ var _data$WaterConnection;
48276
+ return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0], "WATER")).then(function (response) {
48277
+ let waterConnectionUpdate = {
48278
+ WaterConnection: response,
48279
+ reconnectRequest: false,
48280
+ disconnectRequest: false
48281
+ };
48282
+ waterUpdateMutation(waterConnectionUpdate, {
48283
+ onError: (error, variables) => {
48284
+ var _error$response5, _error$response5$data, _error$response5$data2, _error$response6, _error$response6$data, _error$response6$data2;
48285
+ setIsEnableLoader(false);
48286
+ setShowToast({
48287
+ key: "error",
48288
+ message: error !== null && error !== void 0 && (_error$response5 = error.response) !== null && _error$response5 !== void 0 && (_error$response5$data = _error$response5.data) !== null && _error$response5$data !== void 0 && (_error$response5$data2 = _error$response5$data.Errors) !== null && _error$response5$data2 !== void 0 && _error$response5$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : _error$response6$data2[0].message : error
48289
+ });
48290
+ setTimeout(closeToastOfError, 5000);
48291
+ },
48292
+ onSuccess: (data, variables) => {
48293
+ var _data$WaterConnection2, _data$WaterConnection3;
48294
+ clearSessionFormData();
48295
+ history.push("/digit-ui/employee/ws/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));
48296
+ }
48297
+ });
48298
+ });
48299
+ } catch (e) {
48300
+ return Promise.reject(e);
48301
+ }
48302
+ }
48303
+ })).then(function () {});
48304
+ }
48305
+ }();
48306
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
48307
+ }
48308
+ }();
48309
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
48310
+ });
48311
+ }
48312
+ }();
48313
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
48314
+ } catch (e) {
48315
+ return Promise.reject(e);
48316
+ }
48317
+ };
48318
+ const closeToast = () => {
48319
+ setShowToast(null);
48320
+ };
48321
+ if (enabledLoader || isEnableLoader || isConfigLoading) {
48322
+ return /*#__PURE__*/React.createElement(Loader, null);
48323
+ }
48324
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
48325
+ style: {
48326
+ marginLeft: "15px"
48327
+ }
48328
+ }, /*#__PURE__*/React.createElement(Header, null, t(config.head))), /*#__PURE__*/React.createElement(FormComposer, {
48329
+ config: config.body,
48330
+ userType: "employee",
48331
+ onFormValueChange: onFormValueChange,
48332
+ label: t("CS_COMMON_SUBMIT"),
48333
+ onSubmit: onSubmit,
48334
+ defaultValues: sessionFormData,
48335
+ appData: appData
48336
+ }), showToast && /*#__PURE__*/React.createElement(Toast, {
48337
+ isDleteBtn: true,
48338
+ error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? true : false,
48339
+ label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
48340
+ onClose: closeToast
48341
+ }));
48342
+ };
48343
+
48344
+ const EditModifyApplication = () => {
48345
+ var _state;
48346
+ const _useTranslation = useTranslation(),
48347
+ t = _useTranslation.t;
48348
+ let _useLocation = useLocation(),
48349
+ state = _useLocation.state;
48350
+ state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
48351
+ const history = useHistory();
48352
+ let filters = getQueryStringParams(location.search);
48353
+ const _useState = useState(false),
48354
+ canSubmit = _useState[0],
48355
+ setSubmitValve = _useState[1];
48356
+ const _useState2 = useState(null),
48357
+ showToast = _useState2[0],
48358
+ setShowToast = _useState2[1];
48359
+ const _useState3 = useState({}),
48360
+ setAppData = _useState3[1];
48361
+ const _useState4 = useState({
48362
+ head: "",
48363
+ body: []
48364
+ }),
48365
+ config = _useState4[0],
48366
+ setConfig = _useState4[1];
48367
+ const _useState5 = useState(true),
48368
+ enabledLoader = _useState5[0],
48369
+ setEnabledLoader = _useState5[1];
48370
+ const _useState6 = useState(false),
48371
+ isAppDetailsPage = _useState6[0],
48372
+ setIsAppDetailsPage = _useState6[1];
48373
+ const tenantId = Digit.ULBService.getCurrentTenantId();
48374
+ const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
48375
+ const details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
48376
+ const stateId = Digit.ULBService.getStateId();
48377
+ let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
48378
+ newConfig = _Digit$Hooks$ws$useWS.data,
48379
+ isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
48380
+ const _useState7 = useState(new URLSearchParams(useLocation().search).get("propertyId")),
48381
+ propertyId = _useState7[0],
48382
+ setPropertyId = _useState7[1];
48383
+ const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
48384
+ sessionFormData = _Digit$Hooks$useSessi[0],
48385
+ setSessionFormData = _Digit$Hooks$useSessi[1];
48386
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
48387
+ filters: {
48388
+ propertyIds: propertyId
48389
+ },
48390
+ tenantId: tenantId
48391
+ }, {
48392
+ filters: {
48393
+ propertyIds: propertyId
48394
+ },
48395
+ tenantId: tenantId,
48396
+ enabled: propertyId && propertyId != "" ? true : false
48397
+ }),
48398
+ propertyDetails = _Digit$Hooks$pt$usePr.data;
48399
+ useEffect(() => {
48400
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
48401
+ const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
48402
+ if (config) {
48403
+ var _config$body;
48404
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
48405
+ let bodyDetails = [];
48406
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48407
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
48408
+ });
48409
+ bodyDetails.forEach(bdyData => {
48410
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
48411
+ });
48412
+ config.body = bodyDetails;
48413
+ setConfig(config);
48414
+ }
48415
+ }
48416
+ }, [newConfig]);
48417
+ useEffect(() => {
48418
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
48419
+ !propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
48420
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
48421
+ useEffect(function () {
48422
+ try {
48423
+ const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
48424
+ const _temp = function (_details$applicationD) {
48425
+ if (details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id && !IsDetailsExists) {
48426
+ return Promise.resolve(convertApplicationData(details, serviceType, true, false, t)).then(function (convertAppData) {
48427
+ setSessionFormData(_extends({}, sessionFormData, convertAppData));
48428
+ setAppData(_extends({}, convertAppData));
48429
+ sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
48430
+ });
48431
+ }
48432
+ }();
48433
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
48434
+ } catch (e) {
48435
+ return Promise.reject(e);
48436
+ }
48437
+ }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
48438
+ useEffect(() => {
48439
+ var _propertyDetails$Prop;
48440
+ setSessionFormData(_extends({}, sessionFormData, {
48441
+ cpt: {
48442
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
48443
+ }
48444
+ }));
48445
+ }, [propertyDetails]);
48446
+ useEffect(() => {
48447
+ var _sessionFormData$Conn, _sessionFormData$Conn2;
48448
+ if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
48449
+ setEnabledLoader(false);
48450
+ }
48451
+ }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
48452
+ useEffect(() => {
48453
+ const timer = setTimeout(() => {
48454
+ var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
48455
+ if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase()) + "&mode=MODIFY";
48456
+ }, 3000);
48457
+ return () => clearTimeout(timer);
48458
+ }, [isAppDetailsPage]);
48459
+ const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(filters === null || filters === void 0 ? void 0 : filters.service),
48460
+ mutate = _Digit$Hooks$ws$useWS2.mutate;
48461
+ const onFormValueChange = (setValue, formData, formState) => {
48462
+ var _formData$cpt, _formData$cpt$details;
48463
+ if (!lodash.isEqual(sessionFormData, formData)) {
48464
+ setSessionFormData(_extends({}, sessionFormData, formData));
48465
+ }
48466
+ if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
48467
+ };
48468
+ const onSubmit = function (data) {
48469
+ try {
48470
+ const _temp2 = function () {
48471
+ if (!canSubmit) {
48472
+ setShowToast({
48473
+ warning: true,
48474
+ message: "PLEASE_FILL_MANDATORY_DETAILS"
48475
+ });
48476
+ setTimeout(() => {
48477
+ setShowToast(false);
48478
+ }, 3000);
48479
+ } else {
48480
+ const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
48481
+ return Promise.resolve(convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION")).then(function (convertAppData) {
48482
+ var _data$ConnectionDetai, _data$ConnectionDetai2;
48483
+ const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? {
48484
+ WaterConnection: convertAppData
48485
+ } : {
48486
+ SewerageConnection: convertAppData
48487
+ };
48488
+ if (mutate) {
48489
+ mutate(reqDetails, {
48490
+ onError: (error, variables) => {
48491
+ setShowToast({
48492
+ key: "error",
48493
+ message: error !== null && error !== void 0 && error.message ? error.message : error
48494
+ });
48495
+ setTimeout(closeToastOfError, 5000);
48496
+ },
48497
+ onSuccess: (data, variables) => {
48498
+ setShowToast({
48499
+ key: false,
48500
+ message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"
48501
+ });
48502
+ setIsAppDetailsPage(true);
48503
+ }
48504
+ });
48505
+ }
48506
+ });
48507
+ }
48508
+ }();
48509
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
48510
+ } catch (e) {
48511
+ return Promise.reject(e);
48512
+ }
48513
+ };
48514
+ const closeToast = () => {
48515
+ setShowToast(null);
48516
+ };
48517
+ if (enabledLoader || isConfigLoading) {
48518
+ return /*#__PURE__*/React.createElement(Loader, null);
48519
+ }
48520
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
48521
+ style: {
48522
+ marginLeft: "15px"
48523
+ }
48524
+ }, /*#__PURE__*/React.createElement(Header, null, t(config.head))), /*#__PURE__*/React.createElement(FormComposer, {
48525
+ config: config.body,
48526
+ userType: "employee",
48527
+ onFormValueChange: onFormValueChange,
48528
+ label: t("CS_COMMON_SUBMIT"),
48529
+ onSubmit: onSubmit,
48530
+ defaultValues: sessionFormData
48531
+ }), showToast && /*#__PURE__*/React.createElement(Toast, {
48532
+ error: showToast.key,
48533
+ label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
48534
+ onClose: closeToast,
48535
+ isDleteBtn: true
48536
+ }));
48537
+ };
48538
+
48539
+ const MutationApplication = () => {
48540
+ var _state, _details, _details2, _details2$application;
48541
+ const _useTranslation = useTranslation(),
48542
+ t = _useTranslation.t;
48543
+ let _useLocation = useLocation(),
48544
+ state = _useLocation.state;
48545
+ state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
48546
+ const history = useHistory();
48547
+ let filters = getQueryStringParams(location.search);
48548
+ const _useState = useState(false),
48549
+ canSubmit = _useState[0],
48550
+ setSubmitValve = _useState[1];
48551
+ const _useState2 = useState(null),
48552
+ showToast = _useState2[0],
48553
+ setShowToast = _useState2[1];
48554
+ const _useState3 = useState({}),
48555
+ appData = _useState3[0],
48556
+ setAppData = _useState3[1];
48557
+ const _useState4 = useState({
48558
+ head: "",
48559
+ body: []
48560
+ }),
48561
+ config = _useState4[0],
48562
+ setConfig = _useState4[1];
48563
+ const _useState5 = useState(true),
48564
+ enabledLoader = _useState5[0],
48565
+ setEnabledLoader = _useState5[1];
48566
+ const _useState6 = useState(false),
48567
+ isAppDetailsPage = _useState6[0];
48568
+ const _useState7 = useState(false),
48569
+ isEnableLoader = _useState7[0],
48570
+ setIsEnableLoader = _useState7[1];
48571
+ let tenantId = Digit.ULBService.getCurrentTenantId();
48572
+ const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
48573
+ const stateId = Digit.ULBService.getStateId();
48574
+ let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
48575
+ newConfig = _Digit$Hooks$ws$useWS.data,
48576
+ isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
48577
+ let details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
48578
+ let _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, (_details = details) === null || _details === void 0 ? void 0 : _details.applicationNo, (_details2 = details) === null || _details2 === void 0 ? void 0 : (_details2$application = _details2.applicationData) === null || _details2$application === void 0 ? void 0 : _details2$application.serviceType, {
48579
+ privacy: Digit.Utils.getPrivacyObject()
48580
+ }),
48581
+ applicationDetails = _Digit$Hooks$ws$useWS2.data;
48582
+ details = applicationDetails;
48583
+ const _useState8 = useState(new URLSearchParams(useLocation().search).get("propertyId")),
48584
+ propertyId = _useState8[0],
48585
+ setPropertyId = _useState8[1];
48586
+ const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
48587
+ sessionFormData = _Digit$Hooks$useSessi[0],
48588
+ setSessionFormData = _Digit$Hooks$useSessi[1],
48589
+ clearSessionFormData = _Digit$Hooks$useSessi[2];
48590
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
48591
+ filters: {
48592
+ propertyIds: propertyId
48593
+ },
48594
+ tenantId: tenantId
48595
+ }, {
48596
+ filters: {
48597
+ propertyIds: propertyId
48598
+ },
48599
+ tenantId: tenantId,
48600
+ enabled: propertyId && propertyId != "" ? true : false,
48601
+ privacy: Digit.Utils.getPrivacyObject()
48602
+ }),
48603
+ propertyDetails = _Digit$Hooks$pt$usePr.data;
48604
+ useEffect(() => {
48605
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
48606
+ const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
48607
+ if (config) {
48608
+ var _config$body;
48609
+ config.head = "WS_WATER_AND_SEWERAGE_MUTATION_CONNECTION_LABEL";
48610
+ let bodyDetails = [];
48611
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48612
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
48613
+ });
48614
+ bodyDetails.forEach(bdyData => {
48615
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
48616
+ });
48617
+ config.body = bodyDetails;
48618
+ setConfig(config);
48619
+ }
48620
+ }
48621
+ }, [newConfig]);
48622
+ useEffect(() => {
48623
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
48624
+ !propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
48625
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
48626
+ useEffect(function () {
48627
+ try {
48628
+ const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
48629
+ const _temp = function (_details3, _details3$application) {
48630
+ if ((_details3 = details) !== null && _details3 !== void 0 && (_details3$application = _details3.applicationData) !== null && _details3$application !== void 0 && _details3$application.id) {
48631
+ return Promise.resolve(convertApplicationData(details, serviceType, true, undefined, t)).then(function (convertAppData) {
48632
+ setSessionFormData(_extends({}, sessionFormData, convertAppData));
48633
+ setAppData(_extends({}, convertAppData));
48634
+ sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
48635
+ });
48636
+ }
48637
+ }();
48638
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
48639
+ } catch (e) {
48640
+ return Promise.reject(e);
48641
+ }
48642
+ }, [details, applicationDetails]);
48643
+ useEffect(() => {
48644
+ var _propertyDetails$Prop;
48645
+ setSessionFormData(_extends({}, sessionFormData, {
48646
+ cpt: {
48647
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
48648
+ }
48649
+ }));
48650
+ }, [propertyDetails]);
48651
+ useEffect(() => {
48652
+ var _sessionFormData$Conn, _sessionFormData$Conn2;
48653
+ if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
48654
+ setEnabledLoader(false);
48655
+ }
48656
+ }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
48657
+ useEffect(() => {
48658
+ const timer = setTimeout(() => {
48659
+ var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
48660
+ if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase());
48661
+ }, 3000);
48662
+ return () => clearTimeout(timer);
48663
+ }, [isAppDetailsPage]);
48664
+ const _Digit$Hooks$ws$useWa = Digit.Hooks.ws.useWaterCreateAPI("WATER"),
48665
+ waterMutation = _Digit$Hooks$ws$useWa.mutate;
48666
+ const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("WATER");
48667
+ const _Digit$Hooks$ws$useWa2 = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),
48668
+ sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
48669
+ const _Digit$Hooks$ws$useWS4 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
48670
+ const onFormValueChange = (setValue, formData, formState) => {
48671
+ var _formData$cpt, _formData$cpt$details;
48672
+ if (!lodash.isEqual(sessionFormData, formData)) {
48673
+ setSessionFormData(_extends({}, sessionFormData, formData));
48674
+ }
48675
+ if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
48676
+ };
48677
+ const onSubmit = function (data) {
48678
+ try {
48679
+ var _data$cpt, _propertyDetails$Prop2;
48680
+ if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop2 = propertyDetails.Properties) !== null && _propertyDetails$Prop2 !== void 0 && _propertyDetails$Prop2[0])) {
48681
+ var _data$cpt2;
48682
+ if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.details) || !propertyDetails) {
48683
+ setShowToast({
48684
+ key: "error",
48685
+ message: "ERR_INVALID_PROPERTY_ID"
48686
+ });
48687
+ return Promise.resolve();
48688
+ }
48689
+ }
48690
+ const _temp7 = function () {
48691
+ if (!canSubmit) {
48692
+ setShowToast({
48693
+ warning: true,
48694
+ message: "PLEASE_FILL_MANDATORY_DETAILS"
48695
+ });
48696
+ setTimeout(() => {
48697
+ setShowToast(false);
48698
+ }, 3000);
48699
+ } else {
48700
+ var _data$cpt3;
48701
+ if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details)) {
48702
+ var _propertyDetails$Prop3;
48703
+ data.cpt = {
48704
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3[0]
48705
+ };
48706
+ }
48707
+ const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
48708
+ return Promise.resolve(convertModifyApplicationDetails(data, details, "APPLY_MUTATION")).then(function (convertAppData) {
47131
48709
  function _temp6() {
47132
48710
  const _temp4 = function () {
47133
48711
  if (serviceType !== "WATER") {
@@ -47146,29 +48724,10 @@ const ModifyApplication = () => {
47146
48724
  },
47147
48725
  onSuccess: function (data, variables) {
47148
48726
  try {
47149
- var _data$SewerageConnect;
47150
- return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0], "SEWERAGE")).then(function (response) {
47151
- let sewerageConnectionUpdate = {
47152
- SewerageConnection: response,
47153
- reconnectRequest: false,
47154
- disconnectRequest: false
47155
- };
47156
- return Promise.resolve(sewerageUpdateMutation(sewerageConnectionUpdate, {
47157
- onError: (error, variables) => {
47158
- setIsEnableLoader(false);
47159
- setShowToast({
47160
- key: "error",
47161
- message: error !== null && error !== void 0 && error.message ? error.message : error
47162
- });
47163
- setTimeout(closeToastOfError, 5000);
47164
- },
47165
- onSuccess: (data, variables) => {
47166
- var _data$SewerageConnect2, _data$SewerageConnect3;
47167
- clearSessionFormData();
47168
- history.push("/digit-ui/employee/ws/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));
47169
- }
47170
- })).then(function () {});
47171
- });
48727
+ var _data$SewerageConnect, _data$SewerageConnect2;
48728
+ clearSessionFormData();
48729
+ history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect[0]) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.applicationNo));
48730
+ return Promise.resolve();
47172
48731
  } catch (e) {
47173
48732
  return Promise.reject(e);
47174
48733
  }
@@ -47181,18 +48740,11 @@ const ModifyApplication = () => {
47181
48740
  }();
47182
48741
  if (_temp4 && _temp4.then) return _temp4.then(function () {});
47183
48742
  }
47184
- const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai3 = data.ConnectionDetails) === null || _data$ConnectionDetai3 === void 0 ? void 0 : (_data$ConnectionDetai4 = _data$ConnectionDetai3[0]) === null || _data$ConnectionDetai4 === void 0 ? void 0 : _data$ConnectionDetai4.applicationType) === "WATER_RECONNECTION" ? {
47185
- WaterConnection: convertAppData,
47186
- reconnectRequest: true,
47187
- disconnectRequest: false
47188
- } : {
48743
+ convertAppData.applicationType = serviceType == "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
48744
+ const reqDetails = serviceType == "WATER" ? {
47189
48745
  WaterConnection: convertAppData,
47190
48746
  reconnectRequest: false,
47191
48747
  disconnectRequest: false
47192
- } : ((_formData = formData) === null || _formData === void 0 ? void 0 : _formData.applicationType) === "SEWERAGE_RECONNECTION" ? {
47193
- SewerageConnection: convertAppData,
47194
- reconnectRequest: true,
47195
- disconnectRequest: false
47196
48748
  } : {
47197
48749
  SewerageConnection: convertAppData,
47198
48750
  reconnectRequest: false,
@@ -47215,30 +48767,10 @@ const ModifyApplication = () => {
47215
48767
  },
47216
48768
  onSuccess: function (data, variables) {
47217
48769
  try {
47218
- var _data$WaterConnection;
47219
- return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0], "WATER")).then(function (response) {
47220
- let waterConnectionUpdate = {
47221
- WaterConnection: response,
47222
- reconnectRequest: false,
47223
- disconnectRequest: false
47224
- };
47225
- waterUpdateMutation(waterConnectionUpdate, {
47226
- onError: (error, variables) => {
47227
- var _error$response5, _error$response5$data, _error$response5$data2, _error$response6, _error$response6$data, _error$response6$data2;
47228
- setIsEnableLoader(false);
47229
- setShowToast({
47230
- key: "error",
47231
- message: error !== null && error !== void 0 && (_error$response5 = error.response) !== null && _error$response5 !== void 0 && (_error$response5$data = _error$response5.data) !== null && _error$response5$data !== void 0 && (_error$response5$data2 = _error$response5$data.Errors) !== null && _error$response5$data2 !== void 0 && _error$response5$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : _error$response6$data2[0].message : error
47232
- });
47233
- setTimeout(closeToastOfError, 5000);
47234
- },
47235
- onSuccess: (data, variables) => {
47236
- var _data$WaterConnection2, _data$WaterConnection3;
47237
- clearSessionFormData();
47238
- history.push("/digit-ui/employee/ws/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));
47239
- }
47240
- });
47241
- });
48770
+ var _data$WaterConnection, _data$WaterConnection2;
48771
+ clearSessionFormData();
48772
+ history.push("/digit-ui/employee/ws/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection[0]) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.applicationNo));
48773
+ return Promise.resolve();
47242
48774
  } catch (e) {
47243
48775
  return Promise.reject(e);
47244
48776
  }
@@ -47258,6 +48790,9 @@ const ModifyApplication = () => {
47258
48790
  return Promise.reject(e);
47259
48791
  }
47260
48792
  };
48793
+ const closeToastOfError = () => {
48794
+ setShowToast(null);
48795
+ };
47261
48796
  const closeToast = () => {
47262
48797
  setShowToast(null);
47263
48798
  };
@@ -47284,199 +48819,6 @@ const ModifyApplication = () => {
47284
48819
  }));
47285
48820
  };
47286
48821
 
47287
- const EditModifyApplication = () => {
47288
- var _state;
47289
- const _useTranslation = useTranslation(),
47290
- t = _useTranslation.t;
47291
- let _useLocation = useLocation(),
47292
- state = _useLocation.state;
47293
- state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
47294
- const history = useHistory();
47295
- let filters = getQueryStringParams(location.search);
47296
- const _useState = useState(false),
47297
- canSubmit = _useState[0],
47298
- setSubmitValve = _useState[1];
47299
- const _useState2 = useState(null),
47300
- showToast = _useState2[0],
47301
- setShowToast = _useState2[1];
47302
- const _useState3 = useState({}),
47303
- setAppData = _useState3[1];
47304
- const _useState4 = useState({
47305
- head: "",
47306
- body: []
47307
- }),
47308
- config = _useState4[0],
47309
- setConfig = _useState4[1];
47310
- const _useState5 = useState(true),
47311
- enabledLoader = _useState5[0],
47312
- setEnabledLoader = _useState5[1];
47313
- const _useState6 = useState(false),
47314
- isAppDetailsPage = _useState6[0],
47315
- setIsAppDetailsPage = _useState6[1];
47316
- const tenantId = Digit.ULBService.getCurrentTenantId();
47317
- const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
47318
- const details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
47319
- const stateId = Digit.ULBService.getStateId();
47320
- let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
47321
- newConfig = _Digit$Hooks$ws$useWS.data,
47322
- isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
47323
- const _useState7 = useState(new URLSearchParams(useLocation().search).get("propertyId")),
47324
- propertyId = _useState7[0],
47325
- setPropertyId = _useState7[1];
47326
- const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
47327
- sessionFormData = _Digit$Hooks$useSessi[0],
47328
- setSessionFormData = _Digit$Hooks$useSessi[1];
47329
- const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
47330
- filters: {
47331
- propertyIds: propertyId
47332
- },
47333
- tenantId: tenantId
47334
- }, {
47335
- filters: {
47336
- propertyIds: propertyId
47337
- },
47338
- tenantId: tenantId,
47339
- enabled: propertyId && propertyId != "" ? true : false
47340
- }),
47341
- propertyDetails = _Digit$Hooks$pt$usePr.data;
47342
- useEffect(() => {
47343
- if (!isConfigLoading) {
47344
- var _config$body;
47345
- const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47346
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47347
- let bodyDetails = [];
47348
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47349
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47350
- });
47351
- bodyDetails.forEach(bdyData => {
47352
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47353
- });
47354
- config.body = bodyDetails;
47355
- setConfig(config);
47356
- }
47357
- }, [newConfig]);
47358
- useEffect(() => {
47359
- var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
47360
- !propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
47361
- }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47362
- useEffect(function () {
47363
- try {
47364
- const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
47365
- const _temp = function (_details$applicationD) {
47366
- if (details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id && !IsDetailsExists) {
47367
- return Promise.resolve(convertApplicationData(details, serviceType, true, false, t)).then(function (convertAppData) {
47368
- setSessionFormData(_extends({}, sessionFormData, convertAppData));
47369
- setAppData(_extends({}, convertAppData));
47370
- sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
47371
- });
47372
- }
47373
- }();
47374
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
47375
- } catch (e) {
47376
- return Promise.reject(e);
47377
- }
47378
- }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47379
- useEffect(() => {
47380
- var _propertyDetails$Prop;
47381
- setSessionFormData(_extends({}, sessionFormData, {
47382
- cpt: {
47383
- details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
47384
- }
47385
- }));
47386
- }, [propertyDetails]);
47387
- useEffect(() => {
47388
- var _sessionFormData$Conn, _sessionFormData$Conn2;
47389
- if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
47390
- setEnabledLoader(false);
47391
- }
47392
- }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47393
- useEffect(() => {
47394
- const timer = setTimeout(() => {
47395
- var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
47396
- if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase()) + "&mode=MODIFY";
47397
- }, 3000);
47398
- return () => clearTimeout(timer);
47399
- }, [isAppDetailsPage]);
47400
- const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(filters === null || filters === void 0 ? void 0 : filters.service),
47401
- mutate = _Digit$Hooks$ws$useWS2.mutate;
47402
- const onFormValueChange = (setValue, formData, formState) => {
47403
- var _formData$cpt, _formData$cpt$details;
47404
- if (!lodash.isEqual(sessionFormData, formData)) {
47405
- setSessionFormData(_extends({}, sessionFormData, formData));
47406
- }
47407
- if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
47408
- };
47409
- const onSubmit = function (data) {
47410
- try {
47411
- const _temp2 = function () {
47412
- if (!canSubmit) {
47413
- setShowToast({
47414
- warning: true,
47415
- message: "PLEASE_FILL_MANDATORY_DETAILS"
47416
- });
47417
- setTimeout(() => {
47418
- setShowToast(false);
47419
- }, 3000);
47420
- } else {
47421
- const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
47422
- return Promise.resolve(convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION")).then(function (convertAppData) {
47423
- var _data$ConnectionDetai, _data$ConnectionDetai2;
47424
- const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? {
47425
- WaterConnection: convertAppData
47426
- } : {
47427
- SewerageConnection: convertAppData
47428
- };
47429
- if (mutate) {
47430
- mutate(reqDetails, {
47431
- onError: (error, variables) => {
47432
- setShowToast({
47433
- key: "error",
47434
- message: error !== null && error !== void 0 && error.message ? error.message : error
47435
- });
47436
- setTimeout(closeToastOfError, 5000);
47437
- },
47438
- onSuccess: (data, variables) => {
47439
- setShowToast({
47440
- key: false,
47441
- message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"
47442
- });
47443
- setIsAppDetailsPage(true);
47444
- }
47445
- });
47446
- }
47447
- });
47448
- }
47449
- }();
47450
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
47451
- } catch (e) {
47452
- return Promise.reject(e);
47453
- }
47454
- };
47455
- const closeToast = () => {
47456
- setShowToast(null);
47457
- };
47458
- if (enabledLoader || isConfigLoading) {
47459
- return /*#__PURE__*/React.createElement(Loader, null);
47460
- }
47461
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
47462
- style: {
47463
- marginLeft: "15px"
47464
- }
47465
- }, /*#__PURE__*/React.createElement(Header, null, t(config.head))), /*#__PURE__*/React.createElement(FormComposer, {
47466
- config: config.body,
47467
- userType: "employee",
47468
- onFormValueChange: onFormValueChange,
47469
- label: t("CS_COMMON_SUBMIT"),
47470
- onSubmit: onSubmit,
47471
- defaultValues: sessionFormData
47472
- }), showToast && /*#__PURE__*/React.createElement(Toast, {
47473
- error: showToast.key,
47474
- label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
47475
- onClose: closeToast,
47476
- isDleteBtn: true
47477
- }));
47478
- };
47479
-
47480
48822
  const getPath$5 = (path, params) => {
47481
48823
  params && Object.keys(params).map(key => {
47482
48824
  path = path.replace(":" + key, params[key]);
@@ -47719,16 +49061,18 @@ const WSEditApplicationByConfig = () => {
47719
49061
  }),
47720
49062
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47721
49063
  useEffect(() => {
47722
- if (!isConfigLoading) {
47723
- var _config$body;
49064
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47724
49065
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEditByConfig);
47725
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
47726
- let bodyDetails = [];
47727
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47728
- if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
47729
- });
47730
- config.body = bodyDetails;
47731
- setConfig(config);
49066
+ if (config) {
49067
+ var _config$body;
49068
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
49069
+ let bodyDetails = [];
49070
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49071
+ if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
49072
+ });
49073
+ config.body = bodyDetails;
49074
+ setConfig(config);
49075
+ }
47732
49076
  }
47733
49077
  }, [newConfig]);
47734
49078
  useEffect(() => {
@@ -48337,16 +49681,18 @@ const EditDisconnectionByConfig = () => {
48337
49681
  sessionFormData = _Digit$Hooks$useSessi[0],
48338
49682
  setSessionFormData = _Digit$Hooks$useSessi[1];
48339
49683
  useEffect(() => {
48340
- if (!isLoading && !isConfigLoading) {
48341
- var _config$body;
49684
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48342
49685
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48343
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48344
- let bodyDetails = [];
48345
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48346
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48347
- });
48348
- config.body = bodyDetails;
48349
- setConfig(config);
49686
+ if (config) {
49687
+ var _config$body;
49688
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49689
+ let bodyDetails = [];
49690
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49691
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
49692
+ });
49693
+ config.body = bodyDetails;
49694
+ setConfig(config);
49695
+ }
48350
49696
  }
48351
49697
  }, [applicationDetails, isLoading, newConfig]);
48352
49698
  useEffect(function () {
@@ -48471,16 +49817,18 @@ const EditDisconnectionByConfig$1 = () => {
48471
49817
  sessionFormData = _Digit$Hooks$useSessi[0],
48472
49818
  setSessionFormData = _Digit$Hooks$useSessi[1];
48473
49819
  useEffect(() => {
48474
- if (!isLoading && !isConfigLoading) {
48475
- var _config$body;
49820
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48476
49821
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48477
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48478
- let bodyDetails = [];
48479
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48480
- if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
48481
- });
48482
- config.body = bodyDetails;
48483
- setConfig(config);
49822
+ if (config) {
49823
+ var _config$body;
49824
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49825
+ let bodyDetails = [];
49826
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49827
+ if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
49828
+ });
49829
+ config.body = bodyDetails;
49830
+ setConfig(config);
49831
+ }
48484
49832
  }
48485
49833
  }, [applicationDetails, isLoading, newConfig]);
48486
49834
  useEffect(function () {
@@ -48610,16 +49958,18 @@ const ResubmitDisconnection = () => {
48610
49958
  const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(serviceType),
48611
49959
  mutate = _Digit$Hooks$ws$useWS2.mutate;
48612
49960
  useEffect(() => {
48613
- if (!isLoading && !isConfigLoading) {
48614
- var _config$body;
49961
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48615
49962
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48616
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48617
- let bodyDetails = [];
48618
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48619
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48620
- });
48621
- config.body = bodyDetails;
48622
- setConfig(config);
49963
+ if (config) {
49964
+ var _config$body;
49965
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49966
+ let bodyDetails = [];
49967
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49968
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
49969
+ });
49970
+ config.body = bodyDetails;
49971
+ setConfig(config);
49972
+ }
48623
49973
  }
48624
49974
  }, [applicationDetails, isLoading, newConfig]);
48625
49975
  useEffect(function () {
@@ -50405,6 +51755,7 @@ const componentsToRegister = {
50405
51755
  WSConsumptionDetails: ConsumptionDetails,
50406
51756
  WSModifyApplication: ModifyApplication,
50407
51757
  WSEditModifyApplication: EditModifyApplication,
51758
+ WSMutationApplication: MutationApplication,
50408
51759
  WSDisconnectionApplication: DisconnectionApplication,
50409
51760
  WSRestorationApplication: DisconnectionApplication$1,
50410
51761
  WSEditApplicationByConfig: WSEditApplicationByConfig,