@djb25/digit-ui-module-ws 1.0.48 → 1.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10046,7 +10046,7 @@ const BILLSBreadCrumbs = _ref => {
10046
10046
  }));
10047
10047
  };
10048
10048
  const App$1 = _ref2 => {
10049
- 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;
10049
+ 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;
10050
10050
  let path = _ref2.path;
10051
10051
  const location = reactRouterDom.useLocation();
10052
10052
  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");
@@ -10066,21 +10066,22 @@ const App$1 = _ref2 => {
10066
10066
  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");
10067
10067
  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");
10068
10068
  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");
10069
- 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");
10070
- 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");
10071
- 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");
10072
- 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");
10073
- 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");
10074
- 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");
10075
- 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");
10076
- 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");
10077
- 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");
10078
- 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");
10079
- 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");
10080
- 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");
10081
- 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");
10082
- 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");
10083
- 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");
10069
+ 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");
10070
+ 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");
10071
+ 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");
10072
+ 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");
10073
+ 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");
10074
+ 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");
10075
+ 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");
10076
+ 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");
10077
+ 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");
10078
+ 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");
10079
+ 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");
10080
+ 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");
10081
+ 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");
10082
+ 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");
10083
+ 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");
10084
+ 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");
10084
10085
  const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired");
10085
10086
  return /*#__PURE__*/React__default.createElement("div", {
10086
10087
  className: "app-container"
@@ -10220,6 +10221,9 @@ const App$1 = _ref2 => {
10220
10221
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
10221
10222
  path: path + "/modify-application-edit",
10222
10223
  component: WSEditModifyApplication
10224
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
10225
+ path: path + "/mutation-application",
10226
+ component: WSMutationApplication
10223
10227
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
10224
10228
  path: path + "/disconnection-application",
10225
10229
  component: WSDisconnectionDocsRequired
@@ -15060,7 +15064,7 @@ const WSActivationPageDetails = _ref => {
15060
15064
  const _useTranslation = reactI18next.useTranslation(),
15061
15065
  t = _useTranslation.t;
15062
15066
  const filters = getQueryStringParams(location.search);
15063
- const _ref2 = window.location.href.includes("modify") ? React.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()]) : React.useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15067
+ const _ref2 = window.location.href.includes("modify") || window.location.href.includes("mutation") ? React.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()]) : React.useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15064
15068
  activationDetails = _ref2[0],
15065
15069
  setActivationDetails = _ref2[1];
15066
15070
  const _useState = React.useState({
@@ -15160,7 +15164,7 @@ const ConnectionDetails$3 = _props => {
15160
15164
  trigger();
15161
15165
  }, [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]);
15162
15166
  React.useEffect(() => {
15163
- if (window.location.href.includes("modify")) trigger();
15167
+ if (window.location.href.includes("modify") || window.location.href.includes("mutation")) trigger();
15164
15168
  }, [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]);
15165
15169
  React.useEffect(() => {
15166
15170
  var _formState$errors$con;
@@ -15323,7 +15327,7 @@ const ConnectionDetails$3 = _props => {
15323
15327
  }
15324
15328
  }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
15325
15329
  style: errorStyle
15326
- }, 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__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
15330
+ }, 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__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
15327
15331
  style: isMobile && isEmployee ? {
15328
15332
  fontWeight: "700",
15329
15333
  width: "100%"
@@ -20630,7 +20634,7 @@ const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError
20630
20634
  const NUMBER_PATTERN = /^\d+$/;
20631
20635
  const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
20632
20636
  const PropertyWaterConnection = _ref => {
20633
- 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;
20637
+ 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;
20634
20638
  let t = _ref.t,
20635
20639
  config = _ref.config,
20636
20640
  onSelect = _ref.onSelect,
@@ -20647,10 +20651,13 @@ const PropertyWaterConnection = _ref => {
20647
20651
  noOfFloors: null,
20648
20652
  plotArea: "",
20649
20653
  builtUpArea: "",
20654
+ farArea: "",
20650
20655
  SelectYearofConstruction: null,
20651
20656
  NumberofDwellingUnits: "",
20652
20657
  NumberofRooms: "",
20653
- hospitalBeds: ""
20658
+ numberOfBeds: "",
20659
+ numberOfStudents: "",
20660
+ ServantQuartersRoom: ""
20654
20661
  }
20655
20662
  }
20656
20663
  }),
@@ -20688,6 +20695,9 @@ const PropertyWaterConnection = _ref => {
20688
20695
  const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
20689
20696
  const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
20690
20697
  const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
20698
+ const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
20699
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
20700
+ 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
20701
  const yearOptions = React.useMemo(() => {
20692
20702
  const currentYear = new Date().getFullYear();
20693
20703
  const years = [];
@@ -20813,10 +20823,13 @@ const PropertyWaterConnection = _ref => {
20813
20823
  setValue("useDetails.noOfFloors", null);
20814
20824
  setValue("useDetails.plotArea", "");
20815
20825
  setValue("useDetails.builtUpArea", "");
20826
+ setValue("useDetails.farArea", "");
20816
20827
  setValue("useDetails.SelectYearofConstruction", null);
20817
20828
  setValue("useDetails.NumberofDwellingUnits", "");
20818
20829
  setValue("useDetails.NumberofRooms", "");
20819
- setValue("useDetails.hospitalBeds", "");
20830
+ setValue("useDetails.numberOfBeds", "");
20831
+ setValue("useDetails.numberOfStudents", "");
20832
+ setValue("useDetails.ServantQuartersRoom", "");
20820
20833
  }
20821
20834
  }, [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]);
20822
20835
  const lastErrorState = React__default.useRef(null);
@@ -20842,7 +20855,7 @@ const PropertyWaterConnection = _ref => {
20842
20855
  };
20843
20856
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CollapsibleCardPage, {
20844
20857
  title: t("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS") + (config !== null && config !== void 0 && config.isAutomaticFill ? " " + t("(Automatic Fill by Property)") : ""),
20845
- defaultOpen: false,
20858
+ defaultOpen: config !== null && config !== void 0 && config.isAutomaticFill ? false : true,
20846
20859
  style: props.style
20847
20860
  }, /*#__PURE__*/React__default.createElement("div", {
20848
20861
  className: "formcomposer-section-grid"
@@ -20966,7 +20979,21 @@ const PropertyWaterConnection = _ref => {
20966
20979
  disabled: isPropertyFound
20967
20980
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.builtUpArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
20968
20981
  style: errorStyle
20969
- }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_SELECT_YEAR_OF_CONSTRUCTION") + "*"), /*#__PURE__*/React__default.createElement("div", {
20982
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_FAR_AREA")), /*#__PURE__*/React__default.createElement("div", {
20983
+ className: "form-field"
20984
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
20985
+ t: t,
20986
+ inputRef: register({
20987
+ pattern: {
20988
+ value: DECIMAL_PATTERN,
20989
+ message: t("ERR_INVALID_DECIMAL")
20990
+ }
20991
+ }),
20992
+ name: "useDetails.farArea",
20993
+ disabled: isPropertyFound
20994
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.farArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
20995
+ style: errorStyle
20996
+ }, errors.useDetails.farArea.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_SELECT_YEAR_OF_CONSTRUCTION") + "*"), /*#__PURE__*/React__default.createElement("div", {
20970
20997
  className: "form-field"
20971
20998
  }, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
20972
20999
  control: control,
@@ -20983,9 +21010,9 @@ const PropertyWaterConnection = _ref => {
20983
21010
  onBlur: props.onBlur,
20984
21011
  disable: isPropertyFound
20985
21012
  })
20986
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.SelectYearofConstruction) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
21013
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.SelectYearofConstruction) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
20987
21014
  style: errorStyle
20988
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
21015
+ }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
20989
21016
  className: "form-field"
20990
21017
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
20991
21018
  t: t,
@@ -20997,7 +21024,7 @@ const PropertyWaterConnection = _ref => {
20997
21024
  }),
20998
21025
  name: "useDetails.NumberofDwellingUnits",
20999
21026
  disabled: isPropertyFound
21000
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
21027
+ }))) : 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__default.createElement(digitUiReactComponents.CardLabelError, {
21001
21028
  style: errorStyle
21002
21029
  }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React__default.createElement("div", {
21003
21030
  className: "form-field"
@@ -21012,7 +21039,7 @@ const PropertyWaterConnection = _ref => {
21012
21039
  }),
21013
21040
  name: "useDetails.NumberofRooms",
21014
21041
  disabled: isPropertyFound
21015
- }))) : 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__default.createElement(digitUiReactComponents.CardLabelError, {
21042
+ }))) : null, isHotelRestaurantProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.NumberofRooms) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
21016
21043
  style: errorStyle
21017
21044
  }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_BEDS") + "*"), /*#__PURE__*/React__default.createElement("div", {
21018
21045
  className: "form-field"
@@ -21025,11 +21052,39 @@ const PropertyWaterConnection = _ref => {
21025
21052
  },
21026
21053
  required: isHospitalProperty ? t("REQUIRED_FIELD") : false
21027
21054
  }),
21028
- name: "useDetails.hospitalBeds",
21055
+ name: "useDetails.numberOfBeds",
21029
21056
  disabled: isPropertyFound
21030
- }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.hospitalBeds) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
21057
+ }))) : 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__default.createElement(digitUiReactComponents.CardLabelError, {
21031
21058
  style: errorStyle
21032
- }, errors.useDetails.hospitalBeds.message)));
21059
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React__default.createElement("div", {
21060
+ className: "form-field"
21061
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21062
+ t: t,
21063
+ inputRef: register({
21064
+ pattern: {
21065
+ value: NUMBER_PATTERN,
21066
+ message: t("ERR_INVALID_NUMBER")
21067
+ }
21068
+ }),
21069
+ name: "useDetails.numberOfStudents",
21070
+ disabled: isPropertyFound
21071
+ }))) : 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__default.createElement(digitUiReactComponents.CardLabelError, {
21072
+ style: errorStyle
21073
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React__default.createElement("div", {
21074
+ className: "form-field"
21075
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21076
+ t: t,
21077
+ inputRef: register({
21078
+ pattern: {
21079
+ value: NUMBER_PATTERN,
21080
+ message: t("ERR_INVALID_NUMBER")
21081
+ }
21082
+ }),
21083
+ name: "useDetails.ServantQuartersRoom",
21084
+ disabled: isPropertyFound
21085
+ }))) : 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__default.createElement(digitUiReactComponents.CardLabelError, {
21086
+ style: errorStyle
21087
+ }, errors.useDetails.ServantQuartersRoom.message)));
21033
21088
  };
21034
21089
 
21035
21090
  const WSPropertyWaterConnection = props => {
@@ -28950,8 +29005,10 @@ const WSFeeEstimation = _ref => {
28950
29005
  };
28951
29006
 
28952
29007
  const ViewBreakup = _ref => {
28953
- var _wsAdditionalDetails$, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6;
28954
- let wsAdditionalDetails = _ref.wsAdditionalDetails;
29008
+ var _breakUpData$calculat, _breakUpData$calculat2, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29009
+ let wsAdditionalDetails = _ref.wsAdditionalDetails,
29010
+ print = _ref.print,
29011
+ download = _ref.download;
28955
29012
  const _useTranslation = reactI18next.useTranslation(),
28956
29013
  t = _useTranslation.t;
28957
29014
  const _useState = React.useState(false),
@@ -28960,6 +29017,44 @@ const ViewBreakup = _ref => {
28960
29017
  const _useState2 = React.useState({}),
28961
29018
  breakUpData = _useState2[0],
28962
29019
  setBreakUpData = _useState2[1];
29020
+ const breakupRef = React.useRef(null);
29021
+ const formatNumber = function (value, maximumFractionDigits) {
29022
+ if (maximumFractionDigits === void 0) {
29023
+ maximumFractionDigits = 2;
29024
+ }
29025
+ return Number(value || 0).toLocaleString("en-IN", {
29026
+ maximumFractionDigits
29027
+ });
29028
+ };
29029
+ const formatCurrency = value => /*#__PURE__*/React__default.createElement("span", null, "\u20B9", formatNumber(value));
29030
+ const DetailRows = _ref2 => {
29031
+ let rows = _ref2.rows;
29032
+ return rows.map(_ref3 => {
29033
+ let label = _ref3.label,
29034
+ value = _ref3.value,
29035
+ _ref3$currency = _ref3.currency,
29036
+ currency = _ref3$currency === void 0 ? false : _ref3$currency,
29037
+ _ref3$unit = _ref3.unit,
29038
+ unit = _ref3$unit === void 0 ? "" : _ref3$unit,
29039
+ _ref3$isText = _ref3.isText,
29040
+ isText = _ref3$isText === void 0 ? false : _ref3$isText;
29041
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
29042
+ className: "border-none",
29043
+ rowContainerStyle: {
29044
+ margin: "0px"
29045
+ },
29046
+ labelStyle: {
29047
+ width: "50%"
29048
+ },
29049
+ key: label,
29050
+ label: label,
29051
+ text: currency ? formatCurrency(value) : isText ? value || "-" : "" + formatNumber(value) + unit,
29052
+ textStyle: {
29053
+ textAlign: "right"
29054
+ }
29055
+ });
29056
+ });
29057
+ };
28963
29058
  const Heading = props => {
28964
29059
  return /*#__PURE__*/React__default.createElement("h1", {
28965
29060
  className: "heading-m"
@@ -28982,21 +29077,181 @@ const ViewBreakup = _ref => {
28982
29077
  }, /*#__PURE__*/React__default.createElement(Close, null));
28983
29078
  };
28984
29079
  const onPopupOpen = () => {
28985
- var _sessionBillFormData$;
28986
- let breakupData = wsAdditionalDetails.additionalDetails.data || {};
29080
+ var _wsAdditionalDetails$, _sessionBillFormData$;
29081
+ let breakupData = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$ === void 0 ? void 0 : _wsAdditionalDetails$.data) || {};
28987
29082
  const sessionBillData = sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA");
28988
29083
  const sessionBillFormData = sessionBillData ? JSON.parse(sessionBillData) : {};
28989
29084
  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;
28990
29085
  setBreakUpData(breakupData);
28991
29086
  showPopUp(true);
28992
29087
  };
29088
+ const getBreakupReportDetails = () => {
29089
+ var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
29090
+ const amountRows = function (rows) {
29091
+ if (rows === void 0) {
29092
+ rows = [];
29093
+ }
29094
+ return rows.map(row => ({
29095
+ title: t(row === null || row === void 0 ? void 0 : row.taxHeadCode),
29096
+ value: "\u20B9" + formatNumber(row === null || row === void 0 ? void 0 : row.amount)
29097
+ }));
29098
+ };
29099
+ 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];
29100
+ 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(" ") || "-";
29101
+ const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
29102
+ 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) || "-";
29103
+ return [{
29104
+ title: "Applicant Details",
29105
+ values: [{
29106
+ title: "Application Number",
29107
+ value: appNumber
29108
+ }, {
29109
+ title: "Applicant Name",
29110
+ value: applicantName
29111
+ }, {
29112
+ title: "Mobile Number",
29113
+ value: mobileNumber
29114
+ }]
29115
+ }, {
29116
+ title: t("WS_APPLICATION_FEE_HEADER"),
29117
+ 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) || [])])
29118
+ }, {
29119
+ title: "Taxes",
29120
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29121
+ }, {
29122
+ title: "Water demand details",
29123
+ values: waterDemandRows.map(_ref4 => {
29124
+ let label = _ref4.label,
29125
+ value = _ref4.value,
29126
+ currency = _ref4.currency,
29127
+ unit = _ref4.unit,
29128
+ isText = _ref4.isText;
29129
+ return {
29130
+ title: label,
29131
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29132
+ };
29133
+ })
29134
+ }, {
29135
+ title: "Infrastructure charge details",
29136
+ values: infrastructureChargeRows.map(_ref5 => {
29137
+ let label = _ref5.label,
29138
+ value = _ref5.value,
29139
+ currency = _ref5.currency,
29140
+ unit = _ref5.unit,
29141
+ isText = _ref5.isText;
29142
+ return {
29143
+ title: label,
29144
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29145
+ };
29146
+ })
29147
+ }, {
29148
+ title: "Total",
29149
+ values: [{
29150
+ title: t("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),
29151
+ value: "\u20B9" + formatNumber(breakUpData === null || breakUpData === void 0 ? void 0 : breakUpData.totalAmount)
29152
+ }]
29153
+ }].filter(section => section.values.length > 0);
29154
+ };
29155
+ const generateBreakupReport = mode => {
29156
+ var _Digit$Utils, _Digit$Utils$pdf;
29157
+ 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;
29158
+ if (typeof generateReport === "function") {
29159
+ return generateReport({
29160
+ tenantId: Digit.ULBService.getCurrentTenantId(),
29161
+ heading: t("WS_CALCULATION_BREAKUP"),
29162
+ details: getBreakupReportDetails(),
29163
+ t,
29164
+ mode
29165
+ });
29166
+ }
29167
+ return mode === "download" ? Digit.Download.PDF(breakupRef, t("WS_CALCULATION_BREAKUP")) : null;
29168
+ };
29169
+ const handleDownload = () => generateBreakupReport("download");
29170
+ const handlePrint = () => {
29171
+ var _Digit$Utils2, _Digit$Utils2$pdf, _breakupRef$current, _window$mSewaApp, _window$mSewaApp$isMs;
29172
+ 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) {
29173
+ return generateBreakupReport("print");
29174
+ }
29175
+ const content = (_breakupRef$current = breakupRef.current) === null || _breakupRef$current === void 0 ? void 0 : _breakupRef$current.innerHTML;
29176
+ if (!content) return;
29177
+ 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)) {
29178
+ window.mSewaApp.downloadBase64File(window.btoa(unescape(encodeURIComponent(content))), t("WS_CALCULATION_BREAKUP"));
29179
+ return;
29180
+ }
29181
+ const printWindow = window.open("", "");
29182
+ if (!printWindow) return;
29183
+ printWindow.document.write("<html><body>" + content + "</body></html>");
29184
+ printWindow.document.close();
29185
+ printWindow.focus();
29186
+ printWindow.print();
29187
+ };
29188
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.waterDemandDetail;
29189
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.infrastructureChargeDetail;
29190
+ const waterDemandRows = waterDemandDetail ? [{
29191
+ label: "Calculated occupancy",
29192
+ value: waterDemandDetail.calculatedOccupancy,
29193
+ unit: " person"
29194
+ }, {
29195
+ label: "Applied LPCD",
29196
+ value: waterDemandDetail.chosenLpcd,
29197
+ unit: " LPD"
29198
+ }, {
29199
+ label: "Base demand",
29200
+ value: waterDemandDetail.baseDemand,
29201
+ unit: " LPD"
29202
+ }, {
29203
+ label: "Contingency/Floating Occupancy",
29204
+ value: waterDemandDetail.contingencyPercentage,
29205
+ unit: "%"
29206
+ }, {
29207
+ label: "Total water demand",
29208
+ value: waterDemandDetail.totalWaterDemandLPD,
29209
+ unit: " LPD"
29210
+ }] : [];
29211
+ const infrastructureChargeRows = infrastructureChargeDetail ? [{
29212
+ label: "Colony category",
29213
+ value: infrastructureChargeDetail.colonyCategory,
29214
+ isText: true
29215
+ }, {
29216
+ label: "Plot area",
29217
+ value: infrastructureChargeDetail.plotArea,
29218
+ unit: " (sq. meter.)"
29219
+ }, {
29220
+ label: "Water rate",
29221
+ value: infrastructureChargeDetail.waterRatePerLPD,
29222
+ currency: true
29223
+ }, {
29224
+ label: "Sewer rate",
29225
+ value: infrastructureChargeDetail.sewerRatePerLPD,
29226
+ currency: true
29227
+ }, {
29228
+ label: "Water Infra Charges",
29229
+ value: infrastructureChargeDetail.waterComponentIFC,
29230
+ currency: true
29231
+ }, {
29232
+ label: "Sewer Infra Charges",
29233
+ value: infrastructureChargeDetail.sewerComponentIFC,
29234
+ currency: true
29235
+ }, {
29236
+ label: "Rebate",
29237
+ value: infrastructureChargeDetail.rebatePercentage,
29238
+ unit: "%"
29239
+ }, {
29240
+ label: "Rebate amount",
29241
+ value: infrastructureChargeDetail.rebateAmount,
29242
+ currency: true
29243
+ }, {
29244
+ label: "Net IFC",
29245
+ value: infrastructureChargeDetail.netIFC,
29246
+ currency: true
29247
+ }] : [];
28993
29248
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
28994
29249
  style: {
28995
29250
  lineHeight: "19px",
28996
29251
  maxWidth: "950px",
28997
29252
  minWidth: "280px"
28998
29253
  }
28999
- }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$ !== void 0 && _wsAdditionalDetails$.isViewBreakup ? /*#__PURE__*/React__default.createElement("div", {
29254
+ }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React__default.createElement("div", {
29000
29255
  onClick: e => onPopupOpen(),
29001
29256
  style: {
29002
29257
  marginTop: "12px"
@@ -29007,6 +29262,9 @@ const ViewBreakup = _ref => {
29007
29262
  headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
29008
29263
  label: t("WS_CALCULATION_BREAKUP")
29009
29264
  }),
29265
+ width: "950px",
29266
+ print: print || handlePrint,
29267
+ download: download || handleDownload,
29010
29268
  headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn, {
29011
29269
  onClick: () => {
29012
29270
  showPopUp(false);
@@ -29022,16 +29280,13 @@ const ViewBreakup = _ref => {
29022
29280
  popupModuleMianStyles: {
29023
29281
  paddingTop: "0px"
29024
29282
  }
29025
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, {
29026
- style: {
29027
- padding: "10px",
29028
- paddingTop: "0px"
29029
- }
29030
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
29283
+ }, /*#__PURE__*/React__default.createElement("div", {
29284
+ ref: breakupRef
29285
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
29031
29286
  style: {
29032
29287
  margin: "10px 0px"
29033
29288
  }
29034
- }, 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__default.createElement(digitUiReactComponents.Row, {
29289
+ }, 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__default.createElement(digitUiReactComponents.Row, {
29035
29290
  className: "border-none",
29036
29291
  rowContainerStyle: {
29037
29292
  margin: "0px"
@@ -29045,11 +29300,7 @@ const ViewBreakup = _ref => {
29045
29300
  textStyle: {
29046
29301
  textAlign: "right"
29047
29302
  }
29048
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
29049
- style: {
29050
- margin: "10px 0px"
29051
- }
29052
- }, 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__default.createElement(digitUiReactComponents.Row, {
29303
+ })), 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__default.createElement(digitUiReactComponents.Row, {
29053
29304
  className: "border-none",
29054
29305
  rowContainerStyle: {
29055
29306
  margin: "0px"
@@ -29063,7 +29314,7 @@ const ViewBreakup = _ref => {
29063
29314
  textStyle: {
29064
29315
  textAlign: "right"
29065
29316
  }
29066
- })), 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__default.createElement(digitUiReactComponents.Row, {
29317
+ })), 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__default.createElement(digitUiReactComponents.Row, {
29067
29318
  className: "border-none",
29068
29319
  rowContainerStyle: {
29069
29320
  margin: "0px"
@@ -29077,6 +29328,18 @@ const ViewBreakup = _ref => {
29077
29328
  textStyle: {
29078
29329
  textAlign: "right"
29079
29330
  }
29331
+ })), waterDemandRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
29332
+ style: {
29333
+ margin: "10px 0px"
29334
+ }
29335
+ }, "Water demand details"), /*#__PURE__*/React__default.createElement(DetailRows, {
29336
+ rows: waterDemandRows
29337
+ })), infrastructureChargeRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
29338
+ style: {
29339
+ margin: "10px 0px"
29340
+ }
29341
+ }, "Infrastructure charge details"), /*#__PURE__*/React__default.createElement(DetailRows, {
29342
+ rows: infrastructureChargeRows
29080
29343
  })), /*#__PURE__*/React__default.createElement("hr", {
29081
29344
  style: {
29082
29345
  color: "#cccccc",
@@ -29099,7 +29362,7 @@ const ViewBreakup = _ref => {
29099
29362
  fontWeight: "700",
29100
29363
  fontSize: "24px"
29101
29364
  }
29102
- })))));
29365
+ }))))));
29103
29366
  };
29104
29367
 
29105
29368
  const checkForNA$1 = value => {
@@ -45297,16 +45560,16 @@ const ApplicationDetails$1 = () => {
45297
45560
  };
45298
45561
 
45299
45562
  const GetConnectionDetails = () => {
45300
- var _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _applicationDetails$a6, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a10, _applicationDetails$a11, _applicationDetails$a12, _mdmsCommonmastersDat, _applicationDetails$a14, _applicationDetails$a17, _applicationDetails$f4, _applicationDetails$p2, _applicationDetails$p3, _applicationDetails$a18, _applicationDetails$a19, _applicationDetails$a20, _applicationDetails$f5, _applicationDetails$f6;
45563
+ var _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _applicationDetails$a6, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a10, _applicationDetails$a11, _applicationDetails$a12, _mdmsCommonmastersDat, _applicationDetails$a14, _applicationDetails$a18, _applicationDetails$f5, _applicationDetails$p3, _applicationDetails$p4, _applicationDetails$a19, _applicationDetails$a20, _applicationDetails$a21, _applicationDetails$f6, _applicationDetails$f7;
45301
45564
  const getBillSearch = function () {
45302
45565
  try {
45303
- const _temp = function (_applicationDetails$f7) {
45304
- if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f7 = applicationDetails.fetchBillsData) === null || _applicationDetails$f7 === void 0 ? void 0 : _applicationDetails$f7.length) > 0) {
45305
- var _applicationDetails$a21;
45566
+ const _temp = function (_applicationDetails$f8) {
45567
+ if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f8 = applicationDetails.fetchBillsData) === null || _applicationDetails$f8 === void 0 ? void 0 : _applicationDetails$f8.length) > 0) {
45568
+ var _applicationDetails$a22;
45306
45569
  const service = serviceType === "WATER" ? "WS" : "SW";
45307
45570
  let wsSearchFilters = {
45308
45571
  isConnectionSearch: true,
45309
- connectionNumber: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a21 = applicationDetails.applicationData) === null || _applicationDetails$a21 === void 0 ? void 0 : _applicationDetails$a21.connectionNo
45572
+ connectionNumber: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a22 = applicationDetails.applicationData) === null || _applicationDetails$a22 === void 0 ? void 0 : _applicationDetails$a22.connectionNo
45310
45573
  };
45311
45574
  return Promise.resolve(Digit.WSService.search({
45312
45575
  tenantId,
@@ -45319,8 +45582,8 @@ const GetConnectionDetails = () => {
45319
45582
  bussinessService: service
45320
45583
  };
45321
45584
  if ((wsConnectionDetails === null || wsConnectionDetails === void 0 ? void 0 : (_wsConnectionDetails$5 = wsConnectionDetails.WaterConnection) === null || _wsConnectionDetails$5 === void 0 ? void 0 : _wsConnectionDetails$5.length) > 0 || (wsConnectionDetails === null || wsConnectionDetails === void 0 ? void 0 : (_wsConnectionDetails$6 = wsConnectionDetails.SewerageConnections) === null || _wsConnectionDetails$6 === void 0 ? void 0 : _wsConnectionDetails$6.length) > 0) {
45322
- var _applicationDetails$a22;
45323
- downloadAndOpenPdf(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a22 = applicationDetails.applicationData) === null || _applicationDetails$a22 === void 0 ? void 0 : _applicationDetails$a22.connectionNo, filters);
45585
+ var _applicationDetails$a23;
45586
+ downloadAndOpenPdf(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a23 = applicationDetails.applicationData) === null || _applicationDetails$a23 === void 0 ? void 0 : _applicationDetails$a23.connectionNo, filters);
45324
45587
  }
45325
45588
  });
45326
45589
  }
@@ -45349,7 +45612,7 @@ const GetConnectionDetails = () => {
45349
45612
  showOptions = _useState3[0],
45350
45613
  setShowOptions = _useState3[1];
45351
45614
  const stateCode = Digit.ULBService.getStateId();
45352
- const actionConfig = ["MODIFY_CONNECTION_BUTTON", "BILL_AMENDMENT_BUTTON", "DISCONNECTION_BUTTON"];
45615
+ const actionConfig = ["MODIFY_CONNECTION_BUTTON", "MUTATION_BUTTON", "BILL_AMENDMENT_BUTTON", "DISCONNECTION_BUTTON"];
45353
45616
  const _Digit$Hooks$ws$useCo = Digit.Hooks.ws.useConnectionDetail(t, tenantId, applicationNumber, serviceType, {
45354
45617
  privacy: Digit.Utils.getPrivacyObject()
45355
45618
  }),
@@ -45451,8 +45714,29 @@ const GetConnectionDetails = () => {
45451
45714
  data: applicationDetails
45452
45715
  }));
45453
45716
  };
45717
+ const getMutationButton = () => {
45718
+ var _applicationDetails$f2, _applicationDetails$a16, _applicationDetails$p2;
45719
+ if (!checkApplicationStatus) {
45720
+ setshowActionToast({
45721
+ key: "error",
45722
+ label: "CONN_NOT_ACTIVE"
45723
+ });
45724
+ return;
45725
+ }
45726
+ if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f2 = applicationDetails.fetchBillsData[0]) === null || _applicationDetails$f2 === void 0 ? void 0 : _applicationDetails$f2.totalAmount) > 0) {
45727
+ setshowActionToast({
45728
+ key: "error",
45729
+ label: "WS_DUE_AMOUNT_SHOULD_BE_ZERO"
45730
+ });
45731
+ return;
45732
+ }
45733
+ let pathname = "/digit-ui/employee/ws/mutation-application?applicationNumber=" + (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a16 = applicationDetails.applicationData) === null || _applicationDetails$a16 === void 0 ? void 0 : _applicationDetails$a16.connectionNo) + "&service=" + serviceType + "&propertyId=" + (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$p2 = applicationDetails.propertyDetails) === null || _applicationDetails$p2 === void 0 ? void 0 : _applicationDetails$p2.propertyId) + "&from=WS_COMMON_CONNECTION_DETAIL";
45734
+ history.push("" + pathname, JSON.stringify({
45735
+ data: applicationDetails
45736
+ }));
45737
+ };
45454
45738
  const getBillAmendmentButton = () => {
45455
- var _demandData$Demands, _applicationDetails$a16;
45739
+ var _demandData$Demands, _applicationDetails$a17;
45456
45740
  let isBillAmendNotApplicable = false;
45457
45741
  billData === null || billData === void 0 ? void 0 : billData.map(bill => {
45458
45742
  if ((bill === null || bill === void 0 ? void 0 : bill.status) === "INWORKFLOW") {
@@ -45473,7 +45757,7 @@ const GetConnectionDetails = () => {
45473
45757
  });
45474
45758
  return;
45475
45759
  }
45476
- history.push("/digit-ui/employee/ws/required-documents?connectionNumber=" + (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a16 = applicationDetails.applicationData) === null || _applicationDetails$a16 === void 0 ? void 0 : _applicationDetails$a16.connectionNo) + "&tenantId=" + getTenantId + "&service=" + serviceType, JSON.stringify({
45760
+ history.push("/digit-ui/employee/ws/required-documents?connectionNumber=" + (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a17 = applicationDetails.applicationData) === null || _applicationDetails$a17 === void 0 ? void 0 : _applicationDetails$a17.connectionNo) + "&tenantId=" + getTenantId + "&service=" + serviceType, JSON.stringify({
45477
45761
  data: applicationDetails
45478
45762
  }));
45479
45763
  };
@@ -45493,9 +45777,9 @@ const GetConnectionDetails = () => {
45493
45777
  label: "WORKFLOW_IN_PROGRESS"
45494
45778
  });
45495
45779
  } else {
45496
- var _billData$, _applicationDetails$f2;
45780
+ var _billData$, _applicationDetails$f3;
45497
45781
  console.log("due", due, applicationDetails);
45498
- if (((_billData$ = billData[0]) === null || _billData$ === void 0 ? void 0 : _billData$.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f2 = applicationDetails.fetchBillsData) === null || _applicationDetails$f2 === void 0 ? void 0 : _applicationDetails$f2.length) <= 0 || due == "0" || due < 0) {
45782
+ if (((_billData$ = billData[0]) === null || _billData$ === void 0 ? void 0 : _billData$.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f3 = applicationDetails.fetchBillsData) === null || _applicationDetails$f3 === void 0 ? void 0 : _applicationDetails$f3.length) <= 0 || due == "0" || due < 0) {
45499
45783
  Digit.SessionStorage.set("WS_DISCONNECTION", applicationDetails);
45500
45784
  history.push("" + pathname);
45501
45785
  } else {
@@ -45511,8 +45795,8 @@ const GetConnectionDetails = () => {
45511
45795
  label: "WORKFLOW_IN_PROGRESS"
45512
45796
  });
45513
45797
  } else {
45514
- var _billData$2, _applicationDetails$f3;
45515
- if (((_billData$2 = billData[0]) === null || _billData$2 === void 0 ? void 0 : _billData$2.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f3 = applicationDetails.fetchBillsData) === null || _applicationDetails$f3 === void 0 ? void 0 : _applicationDetails$f3.length) <= 0 || due === "0") {
45798
+ var _billData$2, _applicationDetails$f4;
45799
+ if (((_billData$2 = billData[0]) === null || _billData$2 === void 0 ? void 0 : _billData$2.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f4 = applicationDetails.fetchBillsData) === null || _applicationDetails$f4 === void 0 ? void 0 : _applicationDetails$f4.length) <= 0 || due === "0") {
45516
45800
  Digit.SessionStorage.set("WS_DISCONNECTION", applicationDetails);
45517
45801
  history.push("" + pathname);
45518
45802
  } else {
@@ -45523,6 +45807,8 @@ const GetConnectionDetails = () => {
45523
45807
  function onActionSelect(action) {
45524
45808
  if (action === "MODIFY_CONNECTION_BUTTON") {
45525
45809
  getModifyConnectionButton();
45810
+ } else if (action === "MUTATION_BUTTON") {
45811
+ getMutationButton();
45526
45812
  } else if (action === "BILL_AMENDMENT_BUTTON") {
45527
45813
  getBillAmendmentButton();
45528
45814
  } else if (action === "DISCONNECTION_BUTTON") {
@@ -45531,7 +45817,7 @@ const GetConnectionDetails = () => {
45531
45817
  getRestorationButton();
45532
45818
  }
45533
45819
  }
45534
- const checkApplicationStatusForDisconnection = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a17 = applicationDetails.applicationData) === null || _applicationDetails$a17 === void 0 ? void 0 : _applicationDetails$a17.status) === "Active" ? true : false;
45820
+ const checkApplicationStatusForDisconnection = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a18 = applicationDetails.applicationData) === null || _applicationDetails$a18 === void 0 ? void 0 : _applicationDetails$a18.status) === "Active" ? true : false;
45535
45821
  const showAction = checkApplicationStatusForDisconnection ? actionConfig : actionConfig.filter(item => item !== "DISCONNECTION_BUTTON");
45536
45822
  const showActionRestoration = ["RESTORATION_BUTTON"];
45537
45823
  let dowloadOptions = [];
@@ -45545,7 +45831,7 @@ const GetConnectionDetails = () => {
45545
45831
  label: t("WS_CONNECTION_DETAILS"),
45546
45832
  onClick: () => downloadConnectionDetails()
45547
45833
  };
45548
- if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f4 = applicationDetails.fetchBillsData) === null || _applicationDetails$f4 === void 0 ? void 0 : _applicationDetails$f4.length) > 0) dowloadOptions = [appFeeDownloadReceipt, connectionDetailsReceipt];else dowloadOptions = [connectionDetailsReceipt];
45834
+ if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f5 = applicationDetails.fetchBillsData) === null || _applicationDetails$f5 === void 0 ? void 0 : _applicationDetails$f5.length) > 0) dowloadOptions = [appFeeDownloadReceipt, connectionDetailsReceipt];else dowloadOptions = [connectionDetailsReceipt];
45549
45835
  const Close = () => /*#__PURE__*/React__default.createElement("svg", {
45550
45836
  xmlns: "http://www.w3.org/2000/svg",
45551
45837
  viewBox: "0 0 24 24",
@@ -45611,7 +45897,7 @@ const GetConnectionDetails = () => {
45611
45897
  isDataLoading: isLoading,
45612
45898
  applicationData: applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData,
45613
45899
  mutate: mutate,
45614
- businessService: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$p2 = applicationDetails.processInstancesDetails) === null || _applicationDetails$p2 === void 0 ? void 0 : (_applicationDetails$p3 = _applicationDetails$p2[0]) === null || _applicationDetails$p3 === void 0 ? void 0 : _applicationDetails$p3.businessService,
45900
+ businessService: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$p3 = applicationDetails.processInstancesDetails) === null || _applicationDetails$p3 === void 0 ? void 0 : (_applicationDetails$p4 = _applicationDetails$p3[0]) === null || _applicationDetails$p4 === void 0 ? void 0 : _applicationDetails$p4.businessService,
45615
45901
  moduleCode: "WS",
45616
45902
  showToast: showToast,
45617
45903
  setShowToast: setShowToast,
@@ -45629,7 +45915,7 @@ const GetConnectionDetails = () => {
45629
45915
  ref: actionMenuRef,
45630
45916
  label: t("WF_TAKE_ACTION"),
45631
45917
  onSubmit: () => setDisplayMenu(!displayMenu)
45632
- })) : applicationDetails !== null && applicationDetails !== void 0 && (_applicationDetails$a18 = applicationDetails.applicationData) !== null && _applicationDetails$a18 !== void 0 && _applicationDetails$a18.isDisconnectionTemporary && (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a19 = applicationDetails.applicationData) === null || _applicationDetails$a19 === void 0 ? void 0 : _applicationDetails$a19.status) !== "Active" && (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a20 = applicationDetails.applicationData) === null || _applicationDetails$a20 === void 0 ? void 0 : _applicationDetails$a20.applicationStatus) == "DISCONNECTION_EXECUTED" ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, displayMenu ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
45918
+ })) : applicationDetails !== null && applicationDetails !== void 0 && (_applicationDetails$a19 = applicationDetails.applicationData) !== null && _applicationDetails$a19 !== void 0 && _applicationDetails$a19.isDisconnectionTemporary && (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a20 = applicationDetails.applicationData) === null || _applicationDetails$a20 === void 0 ? void 0 : _applicationDetails$a20.status) !== "Active" && (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a21 = applicationDetails.applicationData) === null || _applicationDetails$a21 === void 0 ? void 0 : _applicationDetails$a21.applicationStatus) == "DISCONNECTION_EXECUTED" ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, displayMenu ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
45633
45919
  options: showActionRestoration,
45634
45920
  localeKeyPrefix: "WS",
45635
45921
  t: t,
@@ -45685,7 +45971,7 @@ const GetConnectionDetails = () => {
45685
45971
  className: "modal-header-ws"
45686
45972
  }, t("WS_CLEAR_DUES_DISCONNECTION_SUB_HEADER_LABEL"), " "), /*#__PURE__*/React__default.createElement("div", {
45687
45973
  className: "modal-body-ws"
45688
- }, /*#__PURE__*/React__default.createElement("span", null, t("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"), ": \u20B9", due ? due : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f5 = applicationDetails.fetchBillsData) === null || _applicationDetails$f5 === void 0 ? void 0 : (_applicationDetails$f6 = _applicationDetails$f5[0]) === null || _applicationDetails$f6 === void 0 ? void 0 : _applicationDetails$f6.totalAmount))) : null, showActionToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
45974
+ }, /*#__PURE__*/React__default.createElement("span", null, t("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"), ": \u20B9", due ? due : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f6 = applicationDetails.fetchBillsData) === null || _applicationDetails$f6 === void 0 ? void 0 : (_applicationDetails$f7 = _applicationDetails$f6[0]) === null || _applicationDetails$f7 === void 0 ? void 0 : _applicationDetails$f7.totalAmount))) : null, showActionToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
45689
45975
  error: showActionToast.key,
45690
45976
  label: t("" + showActionToast.label),
45691
45977
  onClose: closeBillToast
@@ -45797,9 +46083,11 @@ const ActivateConnection = () => {
45797
46083
  }
45798
46084
  }, []);
45799
46085
  React.useEffect(() => {
45800
- if (!isLoading) {
46086
+ if (!isLoading && newConfig && Array.isArray(newConfig)) {
45801
46087
  const config = newConfig.find(conf => conf.hideInCitizen);
45802
- setConfig(config);
46088
+ if (config) {
46089
+ setConfig(config);
46090
+ }
45803
46091
  }
45804
46092
  }, [newConfig]);
45805
46093
  React.useEffect(() => {
@@ -46308,16 +46596,18 @@ const EditApplication$1 = () => {
46308
46596
  }),
46309
46597
  propertyDetails = _Digit$Hooks$pt$usePr.data;
46310
46598
  React.useEffect(() => {
46311
- if (!isConfigLoading) {
46312
- var _config$body;
46599
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
46313
46600
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEdit);
46314
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
46315
- let bodyDetails = [];
46316
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46317
- if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
46318
- });
46319
- config.body = bodyDetails;
46320
- setConfig(config);
46601
+ if (config) {
46602
+ var _config$body;
46603
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
46604
+ let bodyDetails = [];
46605
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46606
+ if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
46607
+ });
46608
+ config.body = bodyDetails;
46609
+ setConfig(config);
46610
+ }
46321
46611
  }
46322
46612
  }, [newConfig]);
46323
46613
  React.useEffect(() => {
@@ -46970,19 +47260,21 @@ const ModifyApplication = () => {
46970
47260
  }),
46971
47261
  propertyDetails = _Digit$Hooks$pt$usePr.data;
46972
47262
  React.useEffect(() => {
46973
- if (!isConfigLoading) {
46974
- var _config$body;
47263
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
46975
47264
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
46976
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
46977
- let bodyDetails = [];
46978
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46979
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
46980
- });
46981
- bodyDetails.forEach(bdyData => {
46982
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
46983
- });
46984
- config.body = bodyDetails;
46985
- setConfig(config);
47265
+ if (config) {
47266
+ var _config$body;
47267
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47268
+ let bodyDetails = [];
47269
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47270
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47271
+ });
47272
+ bodyDetails.forEach(bdyData => {
47273
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47274
+ });
47275
+ config.body = bodyDetails;
47276
+ setConfig(config);
47277
+ }
46986
47278
  }
46987
47279
  }, [newConfig]);
46988
47280
  React.useEffect(() => {
@@ -47287,19 +47579,21 @@ const EditModifyApplication = () => {
47287
47579
  }),
47288
47580
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47289
47581
  React.useEffect(() => {
47290
- if (!isConfigLoading) {
47291
- var _config$body;
47582
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47292
47583
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47293
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47294
- let bodyDetails = [];
47295
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47296
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47297
- });
47298
- bodyDetails.forEach(bdyData => {
47299
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47300
- });
47301
- config.body = bodyDetails;
47302
- setConfig(config);
47584
+ if (config) {
47585
+ var _config$body;
47586
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47587
+ let bodyDetails = [];
47588
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47589
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47590
+ });
47591
+ bodyDetails.forEach(bdyData => {
47592
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47593
+ });
47594
+ config.body = bodyDetails;
47595
+ setConfig(config);
47596
+ }
47303
47597
  }
47304
47598
  }, [newConfig]);
47305
47599
  React.useEffect(() => {
@@ -47424,6 +47718,289 @@ const EditModifyApplication = () => {
47424
47718
  }));
47425
47719
  };
47426
47720
 
47721
+ const MutationApplication = () => {
47722
+ var _state, _details, _details2, _details2$application;
47723
+ const _useTranslation = reactI18next.useTranslation(),
47724
+ t = _useTranslation.t;
47725
+ let _useLocation = reactRouterDom.useLocation(),
47726
+ state = _useLocation.state;
47727
+ state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
47728
+ const history = reactRouterDom.useHistory();
47729
+ let filters = getQueryStringParams(location.search);
47730
+ const _useState = React.useState(false),
47731
+ canSubmit = _useState[0],
47732
+ setSubmitValve = _useState[1];
47733
+ const _useState2 = React.useState(null),
47734
+ showToast = _useState2[0],
47735
+ setShowToast = _useState2[1];
47736
+ const _useState3 = React.useState({}),
47737
+ appData = _useState3[0],
47738
+ setAppData = _useState3[1];
47739
+ const _useState4 = React.useState({
47740
+ head: "",
47741
+ body: []
47742
+ }),
47743
+ config = _useState4[0],
47744
+ setConfig = _useState4[1];
47745
+ const _useState5 = React.useState(true),
47746
+ enabledLoader = _useState5[0],
47747
+ setEnabledLoader = _useState5[1];
47748
+ const _useState6 = React.useState(false),
47749
+ isAppDetailsPage = _useState6[0];
47750
+ const _useState7 = React.useState(false),
47751
+ isEnableLoader = _useState7[0],
47752
+ setIsEnableLoader = _useState7[1];
47753
+ let tenantId = Digit.ULBService.getCurrentTenantId();
47754
+ const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
47755
+ const stateId = Digit.ULBService.getStateId();
47756
+ let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
47757
+ newConfig = _Digit$Hooks$ws$useWS.data,
47758
+ isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
47759
+ let details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
47760
+ 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, {
47761
+ privacy: Digit.Utils.getPrivacyObject()
47762
+ }),
47763
+ applicationDetails = _Digit$Hooks$ws$useWS2.data;
47764
+ details = applicationDetails;
47765
+ const _useState8 = React.useState(new URLSearchParams(reactRouterDom.useLocation().search).get("propertyId")),
47766
+ propertyId = _useState8[0],
47767
+ setPropertyId = _useState8[1];
47768
+ const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
47769
+ sessionFormData = _Digit$Hooks$useSessi[0],
47770
+ setSessionFormData = _Digit$Hooks$useSessi[1],
47771
+ clearSessionFormData = _Digit$Hooks$useSessi[2];
47772
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
47773
+ filters: {
47774
+ propertyIds: propertyId
47775
+ },
47776
+ tenantId: tenantId
47777
+ }, {
47778
+ filters: {
47779
+ propertyIds: propertyId
47780
+ },
47781
+ tenantId: tenantId,
47782
+ enabled: propertyId && propertyId != "" ? true : false,
47783
+ privacy: Digit.Utils.getPrivacyObject()
47784
+ }),
47785
+ propertyDetails = _Digit$Hooks$pt$usePr.data;
47786
+ React.useEffect(() => {
47787
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47788
+ const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47789
+ if (config) {
47790
+ var _config$body;
47791
+ config.head = "WS_WATER_AND_SEWERAGE_MUTATION_CONNECTION_LABEL";
47792
+ let bodyDetails = [];
47793
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47794
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47795
+ });
47796
+ bodyDetails.forEach(bdyData => {
47797
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47798
+ });
47799
+ config.body = bodyDetails;
47800
+ setConfig(config);
47801
+ }
47802
+ }
47803
+ }, [newConfig]);
47804
+ React.useEffect(() => {
47805
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
47806
+ !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);
47807
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47808
+ React.useEffect(function () {
47809
+ try {
47810
+ const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
47811
+ const _temp = function (_details3, _details3$application) {
47812
+ if ((_details3 = details) !== null && _details3 !== void 0 && (_details3$application = _details3.applicationData) !== null && _details3$application !== void 0 && _details3$application.id) {
47813
+ return Promise.resolve(convertApplicationData(details, serviceType, true, undefined, t)).then(function (convertAppData) {
47814
+ setSessionFormData(_extends({}, sessionFormData, convertAppData));
47815
+ setAppData(_extends({}, convertAppData));
47816
+ sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
47817
+ });
47818
+ }
47819
+ }();
47820
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
47821
+ } catch (e) {
47822
+ return Promise.reject(e);
47823
+ }
47824
+ }, [details, applicationDetails]);
47825
+ React.useEffect(() => {
47826
+ var _propertyDetails$Prop;
47827
+ setSessionFormData(_extends({}, sessionFormData, {
47828
+ cpt: {
47829
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
47830
+ }
47831
+ }));
47832
+ }, [propertyDetails]);
47833
+ React.useEffect(() => {
47834
+ var _sessionFormData$Conn, _sessionFormData$Conn2;
47835
+ 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) {
47836
+ setEnabledLoader(false);
47837
+ }
47838
+ }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47839
+ React.useEffect(() => {
47840
+ const timer = setTimeout(() => {
47841
+ var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
47842
+ 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());
47843
+ }, 3000);
47844
+ return () => clearTimeout(timer);
47845
+ }, [isAppDetailsPage]);
47846
+ const _Digit$Hooks$ws$useWa = Digit.Hooks.ws.useWaterCreateAPI("WATER"),
47847
+ waterMutation = _Digit$Hooks$ws$useWa.mutate;
47848
+ const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("WATER");
47849
+ const _Digit$Hooks$ws$useWa2 = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),
47850
+ sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
47851
+ const _Digit$Hooks$ws$useWS4 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
47852
+ const onFormValueChange = (setValue, formData, formState) => {
47853
+ var _formData$cpt, _formData$cpt$details;
47854
+ if (!lodash.isEqual(sessionFormData, formData)) {
47855
+ setSessionFormData(_extends({}, sessionFormData, formData));
47856
+ }
47857
+ 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);
47858
+ };
47859
+ const onSubmit = function (data) {
47860
+ try {
47861
+ var _data$cpt, _propertyDetails$Prop2;
47862
+ 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])) {
47863
+ var _data$cpt2;
47864
+ if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.details) || !propertyDetails) {
47865
+ setShowToast({
47866
+ key: "error",
47867
+ message: "ERR_INVALID_PROPERTY_ID"
47868
+ });
47869
+ return Promise.resolve();
47870
+ }
47871
+ }
47872
+ const _temp7 = function () {
47873
+ if (!canSubmit) {
47874
+ setShowToast({
47875
+ warning: true,
47876
+ message: "PLEASE_FILL_MANDATORY_DETAILS"
47877
+ });
47878
+ setTimeout(() => {
47879
+ setShowToast(false);
47880
+ }, 3000);
47881
+ } else {
47882
+ var _data$cpt3;
47883
+ if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details)) {
47884
+ var _propertyDetails$Prop3;
47885
+ data.cpt = {
47886
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3[0]
47887
+ };
47888
+ }
47889
+ const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
47890
+ return Promise.resolve(convertModifyApplicationDetails(data, details, "APPLY_MUTATION")).then(function (convertAppData) {
47891
+ function _temp6() {
47892
+ const _temp4 = function () {
47893
+ if (serviceType !== "WATER") {
47894
+ const _temp3 = function () {
47895
+ if (sewerageMutation) {
47896
+ setIsEnableLoader(true);
47897
+ return Promise.resolve(sewerageMutation(reqDetails, {
47898
+ onError: (error, variables) => {
47899
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
47900
+ setIsEnableLoader(false);
47901
+ setShowToast({
47902
+ key: "error",
47903
+ 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
47904
+ });
47905
+ setTimeout(closeToastOfError, 5000);
47906
+ },
47907
+ onSuccess: function (data, variables) {
47908
+ try {
47909
+ var _data$SewerageConnect, _data$SewerageConnect2;
47910
+ clearSessionFormData();
47911
+ 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));
47912
+ return Promise.resolve();
47913
+ } catch (e) {
47914
+ return Promise.reject(e);
47915
+ }
47916
+ }
47917
+ })).then(function () {});
47918
+ }
47919
+ }();
47920
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
47921
+ }
47922
+ }();
47923
+ if (_temp4 && _temp4.then) return _temp4.then(function () {});
47924
+ }
47925
+ convertAppData.applicationType = serviceType == "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
47926
+ const reqDetails = serviceType == "WATER" ? {
47927
+ WaterConnection: convertAppData,
47928
+ reconnectRequest: false,
47929
+ disconnectRequest: false
47930
+ } : {
47931
+ SewerageConnection: convertAppData,
47932
+ reconnectRequest: false,
47933
+ disconnectRequest: false
47934
+ };
47935
+ const _temp5 = function () {
47936
+ if (serviceType == "WATER") {
47937
+ const _temp2 = function () {
47938
+ if (waterMutation) {
47939
+ setIsEnableLoader(true);
47940
+ return Promise.resolve(waterMutation(reqDetails, {
47941
+ onError: (error, variables) => {
47942
+ var _error$response3, _error$response3$data, _error$response3$data2, _error$response4, _error$response4$data, _error$response4$data2;
47943
+ setIsEnableLoader(false);
47944
+ setShowToast({
47945
+ key: "error",
47946
+ 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
47947
+ });
47948
+ setTimeout(closeToastOfError, 5000);
47949
+ },
47950
+ onSuccess: function (data, variables) {
47951
+ try {
47952
+ var _data$WaterConnection, _data$WaterConnection2;
47953
+ clearSessionFormData();
47954
+ 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));
47955
+ return Promise.resolve();
47956
+ } catch (e) {
47957
+ return Promise.reject(e);
47958
+ }
47959
+ }
47960
+ })).then(function () {});
47961
+ }
47962
+ }();
47963
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
47964
+ }
47965
+ }();
47966
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
47967
+ });
47968
+ }
47969
+ }();
47970
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
47971
+ } catch (e) {
47972
+ return Promise.reject(e);
47973
+ }
47974
+ };
47975
+ const closeToastOfError = () => {
47976
+ setShowToast(null);
47977
+ };
47978
+ const closeToast = () => {
47979
+ setShowToast(null);
47980
+ };
47981
+ if (enabledLoader || isEnableLoader || isConfigLoading) {
47982
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
47983
+ }
47984
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
47985
+ style: {
47986
+ marginLeft: "15px"
47987
+ }
47988
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, t(config.head))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
47989
+ config: config.body,
47990
+ userType: "employee",
47991
+ onFormValueChange: onFormValueChange,
47992
+ label: t("CS_COMMON_SUBMIT"),
47993
+ onSubmit: onSubmit,
47994
+ defaultValues: sessionFormData,
47995
+ appData: appData
47996
+ }), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
47997
+ isDleteBtn: true,
47998
+ error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? true : false,
47999
+ label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
48000
+ onClose: closeToast
48001
+ }));
48002
+ };
48003
+
47427
48004
  const getPath$5 = (path, params) => {
47428
48005
  params && Object.keys(params).map(key => {
47429
48006
  path = path.replace(":" + key, params[key]);
@@ -47666,16 +48243,18 @@ const WSEditApplicationByConfig = () => {
47666
48243
  }),
47667
48244
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47668
48245
  React.useEffect(() => {
47669
- if (!isConfigLoading) {
47670
- var _config$body;
48246
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47671
48247
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEditByConfig);
47672
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
47673
- let bodyDetails = [];
47674
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47675
- if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
47676
- });
47677
- config.body = bodyDetails;
47678
- setConfig(config);
48248
+ if (config) {
48249
+ var _config$body;
48250
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
48251
+ let bodyDetails = [];
48252
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48253
+ if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
48254
+ });
48255
+ config.body = bodyDetails;
48256
+ setConfig(config);
48257
+ }
47679
48258
  }
47680
48259
  }, [newConfig]);
47681
48260
  React.useEffect(() => {
@@ -48284,16 +48863,18 @@ const EditDisconnectionByConfig = () => {
48284
48863
  sessionFormData = _Digit$Hooks$useSessi[0],
48285
48864
  setSessionFormData = _Digit$Hooks$useSessi[1];
48286
48865
  React.useEffect(() => {
48287
- if (!isLoading && !isConfigLoading) {
48288
- var _config$body;
48866
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48289
48867
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48290
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48291
- let bodyDetails = [];
48292
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48293
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48294
- });
48295
- config.body = bodyDetails;
48296
- setConfig(config);
48868
+ if (config) {
48869
+ var _config$body;
48870
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48871
+ let bodyDetails = [];
48872
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48873
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48874
+ });
48875
+ config.body = bodyDetails;
48876
+ setConfig(config);
48877
+ }
48297
48878
  }
48298
48879
  }, [applicationDetails, isLoading, newConfig]);
48299
48880
  React.useEffect(function () {
@@ -48418,16 +48999,18 @@ const EditDisconnectionByConfig$1 = () => {
48418
48999
  sessionFormData = _Digit$Hooks$useSessi[0],
48419
49000
  setSessionFormData = _Digit$Hooks$useSessi[1];
48420
49001
  React.useEffect(() => {
48421
- if (!isLoading && !isConfigLoading) {
48422
- var _config$body;
49002
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48423
49003
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48424
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48425
- let bodyDetails = [];
48426
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48427
- if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
48428
- });
48429
- config.body = bodyDetails;
48430
- setConfig(config);
49004
+ if (config) {
49005
+ var _config$body;
49006
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49007
+ let bodyDetails = [];
49008
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49009
+ if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
49010
+ });
49011
+ config.body = bodyDetails;
49012
+ setConfig(config);
49013
+ }
48431
49014
  }
48432
49015
  }, [applicationDetails, isLoading, newConfig]);
48433
49016
  React.useEffect(function () {
@@ -48557,16 +49140,18 @@ const ResubmitDisconnection = () => {
48557
49140
  const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(serviceType),
48558
49141
  mutate = _Digit$Hooks$ws$useWS2.mutate;
48559
49142
  React.useEffect(() => {
48560
- if (!isLoading && !isConfigLoading) {
48561
- var _config$body;
49143
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48562
49144
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48563
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48564
- let bodyDetails = [];
48565
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48566
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48567
- });
48568
- config.body = bodyDetails;
48569
- setConfig(config);
49145
+ if (config) {
49146
+ var _config$body;
49147
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49148
+ let bodyDetails = [];
49149
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49150
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
49151
+ });
49152
+ config.body = bodyDetails;
49153
+ setConfig(config);
49154
+ }
48570
49155
  }
48571
49156
  }, [applicationDetails, isLoading, newConfig]);
48572
49157
  React.useEffect(function () {
@@ -49710,7 +50295,7 @@ const OLDApplication = () => {
49710
50295
  withoutLabel: true,
49711
50296
  isAutomaticFill: true,
49712
50297
  texts: {
49713
- header: "PT_LOCATION_DETAILS " + t("(Automatic Fill by Property)")
50298
+ header: "" + t("PT_LOCATION_DETAILS_AUTOMATIC_FILL_BY_PROPERTY")
49714
50299
  },
49715
50300
  defaultOpen: false
49716
50301
  }]
@@ -50352,6 +50937,7 @@ const componentsToRegister = {
50352
50937
  WSConsumptionDetails: ConsumptionDetails,
50353
50938
  WSModifyApplication: ModifyApplication,
50354
50939
  WSEditModifyApplication: EditModifyApplication,
50940
+ WSMutationApplication: MutationApplication,
50355
50941
  WSDisconnectionApplication: DisconnectionApplication,
50356
50942
  WSRestorationApplication: DisconnectionApplication$1,
50357
50943
  WSEditApplicationByConfig: WSEditApplicationByConfig,