@mseva/digit-ui-module-rentandlease 1.0.51-dev.1.2 → 1.0.51-dev.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { CheckBox, Loader as Loader$2, CloseSvg, RefreshSVG, RadioButtons, SubmitBar, PTIcon, EmployeeModuleCard, Header, MultiLink, Card, CardSubHeader, StatusTable, CardSectionHeader, Row, AppContainer, PrivateRoute, BreadCrumb, Table, Label, MobileNumber, TextInput, DatePicker, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, Dropdown, UploadFile, Modal, FormComposer, Toast, Menu, BackButton, CardHeader, LabelFieldPair, CardLabel, CardLabelError, TextArea, FormStep, Banner, KeyNote, CitizenHomeCard } from '@mseva/digit-ui-react-components';
1
+ import { CheckBox, Loader as Loader$2, CloseSvg, RefreshSVG, RadioButtons, SubmitBar, PTIcon, EmployeeModuleCard, Header, MultiLink, Card, CardSubHeader, StatusTable, CardSectionHeader, Row, AppContainer, PrivateRoute, BreadCrumb, Table, Label, MobileNumber, TextInput, DatePicker, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, Dropdown, UploadFile, Modal, FormComposer, Toast, Menu, CardHeader, LabelFieldPair, CardLabel, CardLabelError, TextArea, FormStep, Banner, KeyNote, CitizenHomeCard } from '@mseva/digit-ui-react-components';
2
2
  import React, { useState, useMemo, useEffect, useCallback, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useParams, useLocation, useRouteMatch, Switch, Link, useHistory } from 'react-router-dom';
@@ -6103,6 +6103,18 @@ const RentAndLeaseCard = () => {
6103
6103
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
6104
6104
  };
6105
6105
 
6106
+ const convertEpochToDate = dateEpoch => {
6107
+ if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
6108
+ return "NA";
6109
+ }
6110
+ const dateFromApi = new Date(dateEpoch);
6111
+ let month = dateFromApi.getMonth() + 1;
6112
+ let day = dateFromApi.getDate();
6113
+ let year = dateFromApi.getFullYear();
6114
+ month = (month > 9 ? "" : "0") + month;
6115
+ day = (day > 9 ? "" : "0") + day;
6116
+ return `${day}/${month}/${year}`;
6117
+ };
6106
6118
  const pdfDownloadLink = (documents = {}, fileStoreId = "", format = "") => {
6107
6119
  let downloadLink = documents[fileStoreId] || "";
6108
6120
  let differentFormats = (downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.split(",")) || [];
@@ -6117,7 +6129,7 @@ const pdfDownloadLink = (documents = {}, fileStoreId = "", format = "") => {
6117
6129
  const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
6118
6130
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
6119
6131
  const getAcknowledgementData = async (application, tenantInfo, t) => {
6120
- var _application$OwnerInf, _application$addition, _application$addition2, _application$addition3, _application$addition4, _application$addition5, _application$addition6, _application$addition7, _application$addition8, _application$addition9, _application$addition0, _application$Document, _application$addition1, _tenantInfo$city;
6132
+ var _application$OwnerInf, _application$addition, _application$addition2, _application$addition3, _application$addition4, _application$addition5, _application$addition6, _application$addition7, _application$addition8, _application$addition9, _application$addition0, _application$addition1, _application$addition10, _application$addition11, _application$addition12, _application$addition13, _application$addition14, _application$addition15, _application$addition16, _application$addition17, _application$addition18, _application$addition19, _application$addition20, _application$addition21, _application$addition22, _application$addition23, _application$addition24, _application$addition25, _application$addition26, _application$addition27, _application$addition28, _application$addition29, _application$Document, _application$addition36, _tenantInfo$city;
6121
6133
  const details = [];
6122
6134
  application === null || application === void 0 ? void 0 : (_application$OwnerInf = application.OwnerInfo) === null || _application$OwnerInf === void 0 ? void 0 : _application$OwnerInf.forEach((owner, index) => {
6123
6135
  var _owner$permanentAddre, _owner$permanentAddre2, _owner$correspondence, _owner$correspondence2;
@@ -6148,44 +6160,70 @@ const getAcknowledgementData = async (application, tenantInfo, t) => {
6148
6160
  value: t(application === null || application === void 0 ? void 0 : application.status) || "NA"
6149
6161
  }, {
6150
6162
  title: t("PROPERTY_ID"),
6151
- value: t(application === null || application === void 0 ? void 0 : (_application$addition = application.additionalDetails) === null || _application$addition === void 0 ? void 0 : _application$addition.propertyId) || "NA"
6163
+ value: t(application === null || application === void 0 ? void 0 : (_application$addition = application.additionalDetails) === null || _application$addition === void 0 ? void 0 : (_application$addition2 = _application$addition.propertyDetails) === null || _application$addition2 === void 0 ? void 0 : (_application$addition3 = _application$addition2[0]) === null || _application$addition3 === void 0 ? void 0 : _application$addition3.propertyId) || "NA"
6152
6164
  }, {
6153
6165
  title: t("PT_ACK_LOCALIZATION_PROPERTY_ADDRESS"),
6154
- value: (application === null || application === void 0 ? void 0 : (_application$addition2 = application.additionalDetails) === null || _application$addition2 === void 0 ? void 0 : _application$addition2.address) || "NA"
6166
+ value: (application === null || application === void 0 ? void 0 : (_application$addition4 = application.additionalDetails) === null || _application$addition4 === void 0 ? void 0 : (_application$addition5 = _application$addition4.propertyDetails) === null || _application$addition5 === void 0 ? void 0 : (_application$addition6 = _application$addition5[0]) === null || _application$addition6 === void 0 ? void 0 : _application$addition6.address) || "NA"
6155
6167
  }, {
6156
6168
  title: t("Allotment Type"),
6157
- value: (application === null || application === void 0 ? void 0 : (_application$addition3 = application.additionalDetails) === null || _application$addition3 === void 0 ? void 0 : _application$addition3.allotmentType) || "NA"
6169
+ value: (application === null || application === void 0 ? void 0 : (_application$addition7 = application.additionalDetails) === null || _application$addition7 === void 0 ? void 0 : (_application$addition8 = _application$addition7.propertyDetails) === null || _application$addition8 === void 0 ? void 0 : (_application$addition9 = _application$addition8[0]) === null || _application$addition9 === void 0 ? void 0 : _application$addition9.allotmentType) || "NA"
6158
6170
  }, {
6159
6171
  title: t("Property Name"),
6160
- value: (application === null || application === void 0 ? void 0 : (_application$addition4 = application.additionalDetails) === null || _application$addition4 === void 0 ? void 0 : _application$addition4.propertyName) || "NA"
6172
+ value: (application === null || application === void 0 ? void 0 : (_application$addition0 = application.additionalDetails) === null || _application$addition0 === void 0 ? void 0 : (_application$addition1 = _application$addition0.propertyDetails) === null || _application$addition1 === void 0 ? void 0 : (_application$addition10 = _application$addition1[0]) === null || _application$addition10 === void 0 ? void 0 : _application$addition10.propertyName) || "NA"
6161
6173
  }, {
6162
6174
  title: t("Property Area"),
6163
- value: `${(application === null || application === void 0 ? void 0 : (_application$addition5 = application.additionalDetails) === null || _application$addition5 === void 0 ? void 0 : _application$addition5.propertySizeOrArea) || "NA"} sq. meters`
6175
+ value: `${(application === null || application === void 0 ? void 0 : (_application$addition11 = application.additionalDetails) === null || _application$addition11 === void 0 ? void 0 : (_application$addition12 = _application$addition11.propertyDetails) === null || _application$addition12 === void 0 ? void 0 : (_application$addition13 = _application$addition12[0]) === null || _application$addition13 === void 0 ? void 0 : _application$addition13.propertySizeOrArea) || "NA"} sq. meters`
6164
6176
  }, {
6165
6177
  title: t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_PROPERTY_TYPE"),
6166
- value: (application === null || application === void 0 ? void 0 : (_application$addition6 = application.additionalDetails) === null || _application$addition6 === void 0 ? void 0 : _application$addition6.propertyType) || "NA"
6178
+ value: (application === null || application === void 0 ? void 0 : (_application$addition14 = application.additionalDetails) === null || _application$addition14 === void 0 ? void 0 : (_application$addition15 = _application$addition14.propertyDetails) === null || _application$addition15 === void 0 ? void 0 : (_application$addition16 = _application$addition15[0]) === null || _application$addition16 === void 0 ? void 0 : _application$addition16.propertyType) || "NA"
6167
6179
  }, {
6168
6180
  title: t("Location Type"),
6169
- value: (application === null || application === void 0 ? void 0 : (_application$addition7 = application.additionalDetails) === null || _application$addition7 === void 0 ? void 0 : _application$addition7.locationType) || "NA"
6181
+ value: (application === null || application === void 0 ? void 0 : (_application$addition17 = application.additionalDetails) === null || _application$addition17 === void 0 ? void 0 : (_application$addition18 = _application$addition17.propertyDetails) === null || _application$addition18 === void 0 ? void 0 : (_application$addition19 = _application$addition18[0]) === null || _application$addition19 === void 0 ? void 0 : _application$addition19.locationType) || "NA"
6170
6182
  }, {
6171
6183
  title: t("Security Deposit"),
6172
- value: `Rs. ${(application === null || application === void 0 ? void 0 : (_application$addition8 = application.additionalDetails) === null || _application$addition8 === void 0 ? void 0 : _application$addition8.securityDeposit) || "NA"}`
6184
+ value: `Rs. ${(application === null || application === void 0 ? void 0 : (_application$addition20 = application.additionalDetails) === null || _application$addition20 === void 0 ? void 0 : (_application$addition21 = _application$addition20.propertyDetails) === null || _application$addition21 === void 0 ? void 0 : (_application$addition22 = _application$addition21[0]) === null || _application$addition22 === void 0 ? void 0 : _application$addition22.securityDeposit) || "NA"}`
6173
6185
  }, {
6174
6186
  title: t("Base Rent"),
6175
- value: `Rs. ${(application === null || application === void 0 ? void 0 : (_application$addition9 = application.additionalDetails) === null || _application$addition9 === void 0 ? void 0 : _application$addition9.baseRent) || "NA"}`
6187
+ value: `Rs. ${(application === null || application === void 0 ? void 0 : (_application$addition23 = application.additionalDetails) === null || _application$addition23 === void 0 ? void 0 : (_application$addition24 = _application$addition23.propertyDetails) === null || _application$addition24 === void 0 ? void 0 : (_application$addition25 = _application$addition24[0]) === null || _application$addition25 === void 0 ? void 0 : _application$addition25.baseRent) || "NA"}`
6176
6188
  }, ...(application !== null && application !== void 0 && application.amountToBeDeducted ? [{
6177
6189
  title: t("Penalty Amount"),
6178
- value: `Rs. ${application === null || application === void 0 ? void 0 : application.amountToBeDeducted}`
6190
+ value: `Rs. ${(application === null || application === void 0 ? void 0 : application.amountToBeDeducted) || 0}`
6179
6191
  }, {
6180
6192
  title: t("Penalty Amount (After Security Deposit)"),
6181
- value: `Rs. ${(application === null || application === void 0 ? void 0 : application.amountToBeDeducted) - ((application === null || application === void 0 ? void 0 : (_application$addition0 = application.additionalDetails) === null || _application$addition0 === void 0 ? void 0 : _application$addition0.securityDeposit) || 0)}`
6193
+ value: `Rs. ${Math.abs(Number(application === null || application === void 0 ? void 0 : (_application$addition26 = application.additionalDetails) === null || _application$addition26 === void 0 ? void 0 : (_application$addition27 = _application$addition26.propertyDetails) === null || _application$addition27 === void 0 ? void 0 : (_application$addition28 = _application$addition27[0]) === null || _application$addition28 === void 0 ? void 0 : _application$addition28.securityDeposit) - (application === null || application === void 0 ? void 0 : application.amountToBeDeducted)) || 0}`
6182
6194
  }] : [])]
6183
6195
  });
6184
- const docDetails = application === null || application === void 0 ? void 0 : (_application$Document = application.Document) === null || _application$Document === void 0 ? void 0 : _application$Document.map((doc, index) => ({
6196
+ if ((application === null || application === void 0 ? void 0 : (_application$addition29 = application.additionalDetails) === null || _application$addition29 === void 0 ? void 0 : _application$addition29.applicationType) === "Legacy") {
6197
+ var _application$addition30, _application$addition31, _application$addition32, _application$addition33, _application$addition34, _application$addition35;
6198
+ details.push({
6199
+ title: t("RAL_ARREAR_DETAILS"),
6200
+ values: [{
6201
+ title: t("Arrears"),
6202
+ value: (application === null || application === void 0 ? void 0 : (_application$addition30 = application.additionalDetails) === null || _application$addition30 === void 0 ? void 0 : _application$addition30.arrear) || "NA"
6203
+ }, {
6204
+ title: t("RAL_START_DATE"),
6205
+ value: convertEpochToDate(application === null || application === void 0 ? void 0 : (_application$addition31 = application.additionalDetails) === null || _application$addition31 === void 0 ? void 0 : _application$addition31.arrearStartDate) || "NA"
6206
+ }, {
6207
+ title: t("RAL_END_DATE"),
6208
+ value: convertEpochToDate(application === null || application === void 0 ? void 0 : (_application$addition32 = application.additionalDetails) === null || _application$addition32 === void 0 ? void 0 : _application$addition32.arrearEndDate) || "NA"
6209
+ }, {
6210
+ title: t("Reason"),
6211
+ value: (application === null || application === void 0 ? void 0 : (_application$addition33 = application.additionalDetails) === null || _application$addition33 === void 0 ? void 0 : (_application$addition34 = _application$addition33.arrearReason) === null || _application$addition34 === void 0 ? void 0 : _application$addition34.name) || "NA"
6212
+ }, {
6213
+ title: t("Remarks"),
6214
+ value: (application === null || application === void 0 ? void 0 : (_application$addition35 = application.additionalDetails) === null || _application$addition35 === void 0 ? void 0 : _application$addition35.remarks) || "NA"
6215
+ }]
6216
+ });
6217
+ }
6218
+ const standardDocs = (application === null || application === void 0 ? void 0 : (_application$Document = application.Document) === null || _application$Document === void 0 ? void 0 : _application$Document.map((doc, index) => ({
6185
6219
  title: t(`${doc.documentType}`) || "NA",
6186
- value: " ",
6187
- link: doc.fileStoreId ? Digit.Utils.getFileUrl(doc.fileStoreId) : ""
6188
- }));
6220
+ value: " "
6221
+ }))) || [];
6222
+ const arrearDoc = application !== null && application !== void 0 && (_application$addition36 = application.additionalDetails) !== null && _application$addition36 !== void 0 && _application$addition36.arrearDoc ? [{
6223
+ title: t("Arrear Doc"),
6224
+ value: " "
6225
+ }] : [];
6226
+ const docDetails = [...standardDocs, ...arrearDoc];
6189
6227
  details.push({
6190
6228
  title: t("BPA_APPLICATION_DOCUMENTS"),
6191
6229
  values: docDetails !== null && docDetails !== void 0 && docDetails.length ? docDetails : [{
@@ -6193,7 +6231,6 @@ const getAcknowledgementData = async (application, tenantInfo, t) => {
6193
6231
  value: "NA"
6194
6232
  }]
6195
6233
  });
6196
- const imageURL = application === null || application === void 0 ? void 0 : (_application$addition1 = application.additionalDetails) === null || _application$addition1 === void 0 ? void 0 : _application$addition1.propertyImage;
6197
6234
  return {
6198
6235
  t: t,
6199
6236
  tenantId: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code,
@@ -6202,8 +6239,7 @@ const getAcknowledgementData = async (application, tenantInfo, t) => {
6202
6239
  phoneNumber: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.contactNumber,
6203
6240
  heading: t("Allotment letter for Rent and Lease Services"),
6204
6241
  applicationNumber: (application === null || application === void 0 ? void 0 : application.applicationNumber) || "NA",
6205
- details,
6206
- imageURL
6242
+ details
6207
6243
  };
6208
6244
  };
6209
6245
 
@@ -6289,7 +6325,7 @@ var b = "function" === typeof Symbol && Symbol.for,
6289
6325
  k = b ? Symbol.for("react.context") : 60110,
6290
6326
  l = b ? Symbol.for("react.async_mode") : 60111,
6291
6327
  m = b ? Symbol.for("react.concurrent_mode") : 60111,
6292
- n = b ? Symbol.for("react.forward_ref") : 60112,
6328
+ n$1 = b ? Symbol.for("react.forward_ref") : 60112,
6293
6329
  p = b ? Symbol.for("react.suspense") : 60113,
6294
6330
  q = b ? Symbol.for("react.suspense_list") : 60120,
6295
6331
  r = b ? Symbol.for("react.memo") : 60115,
@@ -6314,7 +6350,7 @@ function z(a) {
6314
6350
  default:
6315
6351
  switch (a = a && a.$$typeof, a) {
6316
6352
  case k:
6317
- case n:
6353
+ case n$1:
6318
6354
  case t:
6319
6355
  case r:
6320
6356
  case h:
@@ -6336,7 +6372,7 @@ var ConcurrentMode = m;
6336
6372
  var ContextConsumer = k;
6337
6373
  var ContextProvider = h;
6338
6374
  var Element = c;
6339
- var ForwardRef = n;
6375
+ var ForwardRef = n$1;
6340
6376
  var Fragment = e;
6341
6377
  var Lazy = t;
6342
6378
  var Memo = r;
@@ -6358,7 +6394,7 @@ var isElement = function (a) {
6358
6394
  return "object" === typeof a && null !== a && a.$$typeof === c;
6359
6395
  };
6360
6396
  var isForwardRef = function (a) {
6361
- return z(a) === n;
6397
+ return z(a) === n$1;
6362
6398
  };
6363
6399
  var isFragment = function (a) {
6364
6400
  return z(a) === e;
@@ -6382,7 +6418,7 @@ var isSuspense = function (a) {
6382
6418
  return z(a) === p;
6383
6419
  };
6384
6420
  var isValidElementType = function (a) {
6385
- return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
6421
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n$1 || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
6386
6422
  };
6387
6423
  var typeOf = z;
6388
6424
  var reactIs_production_min = {
@@ -7227,6 +7263,7 @@ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles =
7227
7263
  const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
7228
7264
  return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
7229
7265
  };
7266
+ const pattern = /\[#\?.*?\*\*\]/;
7230
7267
  const timelineRows = timeline.map((item, index) => {
7231
7268
  var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
7232
7269
  const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
@@ -7236,7 +7273,8 @@ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles =
7236
7273
  const mobileNumber = (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.mobileNumber) || "N/A";
7237
7274
  const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
7238
7275
  const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
7239
- const comment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
7276
+ const rawComment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
7277
+ const comment = typeof rawComment === "string" ? rawComment.split(pattern)[0] : rawComment;
7240
7278
  const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
7241
7279
  const sla = (item === null || item === void 0 ? void 0 : item.sla) || "N/A";
7242
7280
  const assignedTo = Array.isArray(item === null || item === void 0 ? void 0 : item.assignes) ? item.assignes.map(a => a === null || a === void 0 ? void 0 : a.name).filter(Boolean).join(", ") : "";
@@ -7348,7 +7386,9 @@ function NewApplicationTimeline({
7348
7386
  workflowDetails,
7349
7387
  t,
7350
7388
  tenantId = Digit.ULBService.getCurrentTenantId(),
7351
- timeObj
7389
+ timeObj,
7390
+ empUserName = null,
7391
+ handleSetEmpDesignation = () => {}
7352
7392
  }) {
7353
7393
  var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
7354
7394
  const {
@@ -7423,6 +7463,9 @@ function NewApplicationTimeline({
7423
7463
  const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
7424
7464
  deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
7425
7465
  });
7466
+ if (employeeData && empUserName) {
7467
+ handleSetEmpDesignation(t(deptMap[empUserName]));
7468
+ }
7426
7469
  if (isLoading) return /*#__PURE__*/React.createElement(Loader$2, null);
7427
7470
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
7428
7471
  className: "custom-timeline-container"
@@ -7490,13 +7533,13 @@ function NewApplicationTimeline({
7490
7533
  className: "custom-officer-info"
7491
7534
  }, /*#__PURE__*/React.createElement("div", {
7492
7535
  className: "custom-officer-name"
7493
- }, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA")), (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.emailId) && /*#__PURE__*/React.createElement("div", {
7536
+ }, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("span", {
7537
+ className: "custom-officer-name"
7538
+ }, "- ", t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName]))), (item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.emailId) && /*#__PURE__*/React.createElement("div", {
7494
7539
  className: "custom-officer-email"
7495
7540
  }, /*#__PURE__*/React.createElement("span", {
7496
7541
  className: "custom-email-label"
7497
- }, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.emailId), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.userName] && /*#__PURE__*/React.createElement("div", {
7498
- className: "custom-officer-name"
7499
- }, t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.userName])))), /*#__PURE__*/React.createElement("div", {
7542
+ }, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
7500
7543
  className: "custom-card-column custom-card-column-mid"
7501
7544
  }, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
7502
7545
  className: "custom-action-title"
@@ -7518,9 +7561,13 @@ function NewApplicationTimeline({
7518
7561
  className: "custom-comments-title"
7519
7562
  }, t("Officer Comments")), /*#__PURE__*/React.createElement("div", {
7520
7563
  className: "custom-comment-text"
7521
- }, item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => /*#__PURE__*/React.createElement("p", {
7522
- key: idx
7523
- }, comment)))), (item === null || item === void 0 ? void 0 : (_item$assignes = item.assignes) === null || _item$assignes === void 0 ? void 0 : _item$assignes.length) > 0 && /*#__PURE__*/React.createElement("div", {
7564
+ }, item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => {
7565
+ const pattern = /\[#\?.*?\*\*\]/;
7566
+ const truncatedComment = typeof comment === "string" ? comment === null || comment === void 0 ? void 0 : comment.split(pattern)[0] : comment;
7567
+ return /*#__PURE__*/React.createElement("p", {
7568
+ key: idx
7569
+ }, truncatedComment);
7570
+ }))), (item === null || item === void 0 ? void 0 : (_item$assignes = item.assignes) === null || _item$assignes === void 0 ? void 0 : _item$assignes.length) > 0 && /*#__PURE__*/React.createElement("div", {
7524
7571
  className: "custom-assigned-to-footer"
7525
7572
  }, /*#__PURE__*/React.createElement("h3", {
7526
7573
  className: "custom-comments-title"
@@ -7528,9 +7575,9 @@ function NewApplicationTimeline({
7528
7575
  className: "custom-officer-info"
7529
7576
  }, /*#__PURE__*/React.createElement("div", {
7530
7577
  className: "custom-officer-name"
7531
- }, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name), deptMap[(_item$assignes$2 = item.assignes[0]) === null || _item$assignes$2 === void 0 ? void 0 : _item$assignes$2.userName] && /*#__PURE__*/React.createElement("div", {
7578
+ }, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name, deptMap[(_item$assignes$2 = item.assignes[0]) === null || _item$assignes$2 === void 0 ? void 0 : _item$assignes$2.userName] && /*#__PURE__*/React.createElement("span", {
7532
7579
  className: "custom-officer-email"
7533
- }, t(deptMap[(_item$assignes$3 = item.assignes[0]) === null || _item$assignes$3 === void 0 ? void 0 : _item$assignes$3.userName]))))), (item === null || item === void 0 ? void 0 : item.wfDocuments) && (item === null || item === void 0 ? void 0 : (_item$wfDocuments = item.wfDocuments) === null || _item$wfDocuments === void 0 ? void 0 : _item$wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", {
7580
+ }, "- ", t(deptMap[(_item$assignes$3 = item.assignes[0]) === null || _item$assignes$3 === void 0 ? void 0 : _item$assignes$3.userName])))))), (item === null || item === void 0 ? void 0 : item.wfDocuments) && (item === null || item === void 0 ? void 0 : (_item$wfDocuments = item.wfDocuments) === null || _item$wfDocuments === void 0 ? void 0 : _item$wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", {
7534
7581
  className: "custom-comments-section-no-border"
7535
7582
  }, /*#__PURE__*/React.createElement("h4", {
7536
7583
  className: "custom-comments-title"
@@ -7546,7 +7593,7 @@ function NewApplicationTimeline({
7546
7593
  }
7547
7594
 
7548
7595
  const RALApplicationDetails = () => {
7549
- var _applicationData$Owne, _propertyDetails$fees, _propertyDetails$fees2, _propertyDetails$fees3, _propertyDetails$fees4, _applicationData$Docu;
7596
+ var _applicationData$Owne, _propertyDetails$fees, _propertyDetails$fees2, _propertyDetails$fees3, _propertyDetails$fees4;
7550
7597
  const {
7551
7598
  t
7552
7599
  } = useTranslation();
@@ -7576,6 +7623,7 @@ const RALApplicationDetails = () => {
7576
7623
  setLoader(false);
7577
7624
  }
7578
7625
  };
7626
+ console.log('applicationData', applicationData);
7579
7627
  const {
7580
7628
  data: reciept_data,
7581
7629
  isLoading: recieptDataLoading
@@ -7596,11 +7644,10 @@ const RALApplicationDetails = () => {
7596
7644
  ...applications
7597
7645
  }, tenantInfo, t);
7598
7646
  setTimeout(() => {
7599
- Digit.Utils.pdf.generateFormatted(acknowldgementDataAPI);
7647
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
7600
7648
  setLoader(false);
7601
7649
  }, 0);
7602
7650
  } catch (error) {
7603
- console.error("Error generating acknowledgement:", error);
7604
7651
  setLoader(false);
7605
7652
  }
7606
7653
  };
@@ -7618,17 +7665,12 @@ const RALApplicationDetails = () => {
7618
7665
  try {
7619
7666
  var _response;
7620
7667
  let response = null;
7621
- if (payments !== null && payments !== void 0 && payments.fileStoreId) {
7622
- response = {
7623
- filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
7624
- };
7625
- } else {
7626
- response = await Digit.PaymentService.generatePdf(tenantId, {
7627
- Payments: [{
7628
- ...payments
7629
- }]
7630
- }, "rentandlease-receipt");
7631
- }
7668
+ response = await Digit.PaymentService.generatePdf(tenantId, {
7669
+ Payments: [{
7670
+ ...(payments || {}),
7671
+ AllotmentDetails: [applicationData]
7672
+ }]
7673
+ }, "rentandlease-receipt");
7632
7674
  const fileStore = await Digit.PaymentService.printReciept(tenantId, {
7633
7675
  fileStoreIds: response.filestoreIds[0]
7634
7676
  });
@@ -7668,8 +7710,21 @@ const RALApplicationDetails = () => {
7668
7710
  const getDate = epoch => {
7669
7711
  return Digit.DateUtils.ConvertEpochToDate(epoch);
7670
7712
  };
7713
+ const tValue = value => {
7714
+ if (value === 0 || value === "0") return "0";
7715
+ if (!value) return t("CS_NA");
7716
+ if (typeof value === "object" && value !== null) {
7717
+ return t((value === null || value === void 0 ? void 0 : value.name) || (value === null || value === void 0 ? void 0 : value.code) || "CS_NA");
7718
+ }
7719
+ return t(value);
7720
+ };
7671
7721
  const rawAdditionalDetails = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.additionalDetails) || {};
7672
- const propertyDetails = Array.isArray(rawAdditionalDetails) ? rawAdditionalDetails[0] : rawAdditionalDetails;
7722
+ const propertyDetails = Array.isArray(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails) ? rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails[0] : rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails;
7723
+ const arrearDoc = rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearDoc ? [{
7724
+ documentType: "Arrear Doc",
7725
+ fileStoreId: rawAdditionalDetails.arrearDoc
7726
+ }] : [];
7727
+ const allDocuments = [...((applicationData === null || applicationData === void 0 ? void 0 : applicationData.Document) || []), ...arrearDoc];
7673
7728
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
7674
7729
  className: "cardHeaderWithOptions ral-app-details-header"
7675
7730
  }, /*#__PURE__*/React.createElement(Header, {
@@ -7690,19 +7745,19 @@ const RALApplicationDetails = () => {
7690
7745
  className: "ral-app-details-owner-header"
7691
7746
  }, t("RAL_APPLICANT"), " ", index + 1), /*#__PURE__*/React.createElement(Row, {
7692
7747
  label: t("PT_OWNERSHIP_INFO_NAME"),
7693
- text: (owner === null || owner === void 0 ? void 0 : owner.name) || t("CS_NA")
7748
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.name)
7694
7749
  }), /*#__PURE__*/React.createElement(Row, {
7695
7750
  label: t("CORE_COMMON_PROFILE_EMAIL"),
7696
- text: (owner === null || owner === void 0 ? void 0 : owner.emailId) || t("CS_NA")
7751
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.emailId)
7697
7752
  }), /*#__PURE__*/React.createElement(Row, {
7698
7753
  label: t("CORE_MOBILE_NUMBER"),
7699
- text: (owner === null || owner === void 0 ? void 0 : owner.mobileNo) || t("CS_NA")
7754
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.mobileNo)
7700
7755
  }), /*#__PURE__*/React.createElement(Row, {
7701
7756
  label: t("PT_COMMON_COL_ADDRESS"),
7702
- text: (owner === null || owner === void 0 ? void 0 : (_owner$correspondence = owner.correspondenceAddress) === null || _owner$correspondence === void 0 ? void 0 : _owner$correspondence.addressId) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre = owner.permanentAddress) === null || _owner$permanentAddre === void 0 ? void 0 : _owner$permanentAddre.addressId) || t("CS_NA")
7757
+ text: tValue((owner === null || owner === void 0 ? void 0 : (_owner$correspondence = owner.correspondenceAddress) === null || _owner$correspondence === void 0 ? void 0 : _owner$correspondence.addressId) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre = owner.permanentAddress) === null || _owner$permanentAddre === void 0 ? void 0 : _owner$permanentAddre.addressId))
7703
7758
  }), /*#__PURE__*/React.createElement(Row, {
7704
7759
  label: t("CORE_COMMON_PINCODE"),
7705
- text: (owner === null || owner === void 0 ? void 0 : (_owner$correspondence2 = owner.correspondenceAddress) === null || _owner$correspondence2 === void 0 ? void 0 : _owner$correspondence2.pincode) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre2 = owner.permanentAddress) === null || _owner$permanentAddre2 === void 0 ? void 0 : _owner$permanentAddre2.pincode) || t("CS_NA")
7760
+ text: tValue((owner === null || owner === void 0 ? void 0 : (_owner$correspondence2 = owner.correspondenceAddress) === null || _owner$correspondence2 === void 0 ? void 0 : _owner$correspondence2.pincode) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre2 = owner.permanentAddress) === null || _owner$permanentAddre2 === void 0 ? void 0 : _owner$permanentAddre2.pincode))
7706
7761
  }));
7707
7762
  }) : /*#__PURE__*/React.createElement(Row, {
7708
7763
  label: t("OWNER"),
@@ -7711,66 +7766,83 @@ const RALApplicationDetails = () => {
7711
7766
  className: "ral-card-subheader-24"
7712
7767
  }, t("ES_TITILE_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
7713
7768
  label: t("APPLICATION_NUMBER"),
7714
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber) || t("CS_NA")
7769
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber)
7715
7770
  }), /*#__PURE__*/React.createElement(Row, {
7716
7771
  label: t("RENT_LEASE_PROPERTY_ID"),
7717
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyId) || t("CS_NA")
7772
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyId)
7718
7773
  }), /*#__PURE__*/React.createElement(Row, {
7719
7774
  label: t("RENT_LEASE_PROPERTY_NAME"),
7720
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyName) || t("CS_NA")
7775
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyName)
7721
7776
  }), /*#__PURE__*/React.createElement(Row, {
7722
7777
  label: t("RAL_ALLOTMENT_TYPE"),
7723
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.allotmentType) || t("CS_NA")
7778
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.allotmentType)
7724
7779
  }), /*#__PURE__*/React.createElement(Row, {
7725
7780
  label: t("RENT_LEASE_PROPERTY_TYPE"),
7726
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyType) || t("CS_NA")
7781
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyType)
7727
7782
  }), /*#__PURE__*/React.createElement(Row, {
7728
7783
  label: t("WS_PROPERTY_ADDRESS_LABEL"),
7729
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address) || t("CS_NA")
7784
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address)
7730
7785
  }), /*#__PURE__*/React.createElement(Row, {
7731
7786
  label: t("RAL_PROPERTY_AMOUNT"),
7732
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.baseRent) || t("CS_NA")
7787
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.baseRent)
7733
7788
  }), /*#__PURE__*/React.createElement(Row, {
7734
7789
  label: t("PENALTY_TYPE"),
7735
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.penaltyType) || t("CS_NA")
7790
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.penaltyType)
7736
7791
  }), /*#__PURE__*/React.createElement(Row, {
7737
7792
  label: t("RAL_FEE_CYCLE"),
7738
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees === void 0 ? void 0 : (_propertyDetails$fees2 = _propertyDetails$fees[0]) === null || _propertyDetails$fees2 === void 0 ? void 0 : _propertyDetails$fees2.toUpperCase()) + (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees3 = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees3 === void 0 ? void 0 : (_propertyDetails$fees4 = _propertyDetails$fees3.slice(1)) === null || _propertyDetails$fees4 === void 0 ? void 0 : _propertyDetails$fees4.toLowerCase()) || t("CS_NA")
7793
+ text: propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.feesPeriodCycle ? tValue((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees === void 0 ? void 0 : (_propertyDetails$fees2 = _propertyDetails$fees[0]) === null || _propertyDetails$fees2 === void 0 ? void 0 : _propertyDetails$fees2.toUpperCase()) + (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees3 = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees3 === void 0 ? void 0 : (_propertyDetails$fees4 = _propertyDetails$fees3.slice(1)) === null || _propertyDetails$fees4 === void 0 ? void 0 : _propertyDetails$fees4.toLowerCase())) : t("CS_NA")
7739
7794
  }), /*#__PURE__*/React.createElement(Row, {
7740
7795
  label: t("PROPERTY_SIZE"),
7741
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertySizeOrArea) || t("CS_NA")
7796
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertySizeOrArea)
7742
7797
  }), /*#__PURE__*/React.createElement(Row, {
7743
7798
  label: t("RENT_LEASE_LOCATION_TYPE"),
7744
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.locationType) || t("CS_NA")
7799
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.locationType)
7745
7800
  }), /*#__PURE__*/React.createElement(Row, {
7746
7801
  label: t("RAL_START_DATE"),
7747
- text: getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.startDate) || t("CS_NA")
7802
+ text: tValue(getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.startDate))
7748
7803
  }), /*#__PURE__*/React.createElement(Row, {
7749
7804
  label: t("RAL_END_DATE"),
7750
- text: getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.endDate) || t("CS_NA")
7805
+ text: tValue(getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.endDate))
7751
7806
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) > 0 && /*#__PURE__*/React.createElement(Row, {
7752
7807
  label: t("RAL_PROPERTY_PENALTY"),
7753
- text: applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted
7754
- }), /*#__PURE__*/React.createElement(Row, {
7808
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted)
7809
+ }), (rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.applicationType) !== "Legacy" && /*#__PURE__*/React.createElement(Row, {
7755
7810
  label: t("SECURITY_DEPOSIT"),
7756
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit) || t("CS_NA")
7811
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit)
7757
7812
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit) > 0 && /*#__PURE__*/React.createElement(Row, {
7758
7813
  label: t("RAL_AMOUNT_TO_TAKE_FROM_CITIZEN"),
7759
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit)
7814
+ text: tValue((applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit))
7760
7815
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund) > 0 && /*#__PURE__*/React.createElement(Row, {
7761
7816
  label: t("RAL_AMOUNT_TO_REFUND"),
7762
- text: applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund
7817
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund)
7763
7818
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber) && /*#__PURE__*/React.createElement(Row, {
7764
7819
  label: t("RENT_LEASE_TRADE_LICENSE_NUMBER"),
7765
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber) || t("CS_NA")
7766
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
7820
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber)
7821
+ })), (rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.applicationType) === "Legacy" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, {
7822
+ className: "ral-card-subheader-24"
7823
+ }, t("RAL_ARREAR_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
7824
+ label: t("Arrears"),
7825
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.arrear)
7826
+ }), /*#__PURE__*/React.createElement(Row, {
7827
+ label: t("RAL_START_DATE"),
7828
+ text: rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearStartDate ? getDate(rawAdditionalDetails.arrearStartDate) : t("CS_NA")
7829
+ }), /*#__PURE__*/React.createElement(Row, {
7830
+ label: t("RAL_END_DATE"),
7831
+ text: rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearEndDate ? getDate(rawAdditionalDetails.arrearEndDate) : t("CS_NA")
7832
+ }), /*#__PURE__*/React.createElement(Row, {
7833
+ label: t("Reason"),
7834
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.arrearReason)
7835
+ }), /*#__PURE__*/React.createElement(Row, {
7836
+ label: t("Remarks"),
7837
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.remarks)
7838
+ }))), /*#__PURE__*/React.createElement(CardSubHeader, {
7767
7839
  className: "ral-card-subheader-24-margin"
7768
7840
  }, t("CS_COMMON_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Card, {
7769
7841
  className: "ral-app-details-docs-card"
7770
- }, (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$Docu = applicationData.Document) === null || _applicationData$Docu === void 0 ? void 0 : _applicationData$Docu.length) > 0 ? applicationData.Document.map((doc, index) => /*#__PURE__*/React.createElement("div", {
7842
+ }, (allDocuments === null || allDocuments === void 0 ? void 0 : allDocuments.length) > 0 ? allDocuments.map((doc, index) => /*#__PURE__*/React.createElement("div", {
7771
7843
  key: index
7772
7844
  }, /*#__PURE__*/React.createElement(RALDocuments, {
7773
- value: applicationData.Document,
7845
+ value: allDocuments,
7774
7846
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
7775
7847
  index: index
7776
7848
  }), t(doc === null || doc === void 0 ? void 0 : doc.documentType))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), /*#__PURE__*/React.createElement(NewApplicationTimeline, {
@@ -8175,8 +8247,8 @@ const DesktopInbox = ({
8175
8247
  Cell: ({
8176
8248
  row
8177
8249
  }) => {
8178
- var _row$original4, _row$original4$search, _row$original4$search2, _row$original4$search3;
8179
- return GetCell(`${(_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : (_row$original4$search = _row$original4.searchData) === null || _row$original4$search === void 0 ? void 0 : (_row$original4$search2 = _row$original4$search.additionalDetails) === null || _row$original4$search2 === void 0 ? void 0 : (_row$original4$search3 = _row$original4$search2[0]) === null || _row$original4$search3 === void 0 ? void 0 : _row$original4$search3["propertyName"]}`);
8250
+ var _row$original4, _row$original4$search, _row$original4$search2, _row$original4$search3, _row$original4$search4;
8251
+ return GetCell(`${(_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : (_row$original4$search = _row$original4.searchData) === null || _row$original4$search === void 0 ? void 0 : (_row$original4$search2 = _row$original4$search.additionalDetails) === null || _row$original4$search2 === void 0 ? void 0 : (_row$original4$search3 = _row$original4$search2.propertyDetails) === null || _row$original4$search3 === void 0 ? void 0 : (_row$original4$search4 = _row$original4$search3[0]) === null || _row$original4$search4 === void 0 ? void 0 : _row$original4$search4["propertyName"]}`);
8180
8252
  },
8181
8253
  mobileCell: original => {
8182
8254
  var _original$searchData2, _original$searchData3, _original$searchData4;
@@ -8188,11 +8260,11 @@ const DesktopInbox = ({
8188
8260
  row
8189
8261
  }) => {
8190
8262
  var _row$original5, _row$original5$search, _row$original5$search2, _row$original5$search3;
8191
- return GetCell(`${(_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : (_row$original5$search = _row$original5.searchData) === null || _row$original5$search === void 0 ? void 0 : (_row$original5$search2 = _row$original5$search.additionalDetails) === null || _row$original5$search2 === void 0 ? void 0 : (_row$original5$search3 = _row$original5$search2[0]) === null || _row$original5$search3 === void 0 ? void 0 : _row$original5$search3["allotmentType"]}`);
8263
+ return GetCell(`${(_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : (_row$original5$search = _row$original5.searchData) === null || _row$original5$search === void 0 ? void 0 : (_row$original5$search2 = _row$original5$search.additionalDetails) === null || _row$original5$search2 === void 0 ? void 0 : (_row$original5$search3 = _row$original5$search2.propertyDetails[0]) === null || _row$original5$search3 === void 0 ? void 0 : _row$original5$search3["allotmentType"]}`);
8192
8264
  },
8193
8265
  mobileCell: original => {
8194
8266
  var _original$searchData5, _original$searchData6, _original$searchData7;
8195
- return GetMobCell(`${original === null || original === void 0 ? void 0 : (_original$searchData5 = original.searchData) === null || _original$searchData5 === void 0 ? void 0 : (_original$searchData6 = _original$searchData5.additionalDetails) === null || _original$searchData6 === void 0 ? void 0 : (_original$searchData7 = _original$searchData6[0]) === null || _original$searchData7 === void 0 ? void 0 : _original$searchData7["allotmentType"]}`);
8267
+ return GetMobCell(`${original === null || original === void 0 ? void 0 : (_original$searchData5 = original.searchData) === null || _original$searchData5 === void 0 ? void 0 : (_original$searchData6 = _original$searchData5.additionalDetails) === null || _original$searchData6 === void 0 ? void 0 : (_original$searchData7 = _original$searchData6.propertyDetails[0]) === null || _original$searchData7 === void 0 ? void 0 : _original$searchData7["allotmentType"]}`);
8196
8268
  }
8197
8269
  }, {
8198
8270
  Header: t("RENT_AMOUNT "),
@@ -8200,11 +8272,11 @@ const DesktopInbox = ({
8200
8272
  row
8201
8273
  }) => {
8202
8274
  var _row$original6, _row$original6$search, _row$original6$search2, _row$original6$search3;
8203
- return GetCell(`${(_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : (_row$original6$search = _row$original6.searchData) === null || _row$original6$search === void 0 ? void 0 : (_row$original6$search2 = _row$original6$search.additionalDetails) === null || _row$original6$search2 === void 0 ? void 0 : (_row$original6$search3 = _row$original6$search2[0]) === null || _row$original6$search3 === void 0 ? void 0 : _row$original6$search3["baseRent"]}`);
8275
+ return GetCell(`${(_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : (_row$original6$search = _row$original6.searchData) === null || _row$original6$search === void 0 ? void 0 : (_row$original6$search2 = _row$original6$search.additionalDetails) === null || _row$original6$search2 === void 0 ? void 0 : (_row$original6$search3 = _row$original6$search2.propertyDetails[0]) === null || _row$original6$search3 === void 0 ? void 0 : _row$original6$search3["baseRent"]}`);
8204
8276
  },
8205
8277
  mobileCell: original => {
8206
8278
  var _original$searchData8, _original$searchData9, _original$searchData0;
8207
- return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData8 = original.searchData) === null || _original$searchData8 === void 0 ? void 0 : (_original$searchData9 = _original$searchData8.additionalDetails) === null || _original$searchData9 === void 0 ? void 0 : (_original$searchData0 = _original$searchData9[0]) === null || _original$searchData0 === void 0 ? void 0 : _original$searchData0["baseRent"]) || "-";
8279
+ return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData8 = original.searchData) === null || _original$searchData8 === void 0 ? void 0 : (_original$searchData9 = _original$searchData8.additionalDetails) === null || _original$searchData9 === void 0 ? void 0 : (_original$searchData0 = _original$searchData9.propertyDetails[0]) === null || _original$searchData0 === void 0 ? void 0 : _original$searchData0["baseRent"]) || "-";
8208
8280
  }
8209
8281
  }, {
8210
8282
  Header: t("CS_CREATED_DATE"),
@@ -8510,19 +8582,19 @@ const MobileInbox = ({
8510
8582
  Header: t("RENT_LEASE_PROPERTY_NAME"),
8511
8583
  mobileCell: original => {
8512
8584
  var _original$searchData2, _original$searchData3, _original$searchData4;
8513
- return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData2 = original.searchData) === null || _original$searchData2 === void 0 ? void 0 : (_original$searchData3 = _original$searchData2.additionalDetails) === null || _original$searchData3 === void 0 ? void 0 : (_original$searchData4 = _original$searchData3[0]) === null || _original$searchData4 === void 0 ? void 0 : _original$searchData4["propertyName"]);
8585
+ return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData2 = original.searchData) === null || _original$searchData2 === void 0 ? void 0 : (_original$searchData3 = _original$searchData2.additionalDetails) === null || _original$searchData3 === void 0 ? void 0 : (_original$searchData4 = _original$searchData3.propertyDetails[0]) === null || _original$searchData4 === void 0 ? void 0 : _original$searchData4["propertyName"]);
8514
8586
  }
8515
8587
  }, {
8516
8588
  Header: t("RAL_ALLOTMENT_TYPE"),
8517
8589
  mobileCell: original => {
8518
8590
  var _original$searchData5, _original$searchData6, _original$searchData7;
8519
- return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData5 = original.searchData) === null || _original$searchData5 === void 0 ? void 0 : (_original$searchData6 = _original$searchData5.additionalDetails) === null || _original$searchData6 === void 0 ? void 0 : (_original$searchData7 = _original$searchData6[0]) === null || _original$searchData7 === void 0 ? void 0 : _original$searchData7["allotmentType"]);
8591
+ return GetMobCell(original === null || original === void 0 ? void 0 : (_original$searchData5 = original.searchData) === null || _original$searchData5 === void 0 ? void 0 : (_original$searchData6 = _original$searchData5.additionalDetails) === null || _original$searchData6 === void 0 ? void 0 : (_original$searchData7 = _original$searchData6.propertyDetails[0]) === null || _original$searchData7 === void 0 ? void 0 : _original$searchData7["allotmentType"]);
8520
8592
  }
8521
8593
  }, {
8522
8594
  Header: t("RENT_AMOUNT "),
8523
8595
  mobileCell: original => {
8524
8596
  var _original$searchData8, _original$searchData9, _original$searchData0;
8525
- return GetMobCell((original === null || original === void 0 ? void 0 : (_original$searchData8 = original.searchData) === null || _original$searchData8 === void 0 ? void 0 : (_original$searchData9 = _original$searchData8.additionalDetails) === null || _original$searchData9 === void 0 ? void 0 : (_original$searchData0 = _original$searchData9[0]) === null || _original$searchData0 === void 0 ? void 0 : _original$searchData0["baseRent"]) || "-");
8597
+ return GetMobCell((original === null || original === void 0 ? void 0 : (_original$searchData8 = original.searchData) === null || _original$searchData8 === void 0 ? void 0 : (_original$searchData9 = _original$searchData8.additionalDetails) === null || _original$searchData9 === void 0 ? void 0 : (_original$searchData0 = _original$searchData9.propertyDetails[0]) === null || _original$searchData0 === void 0 ? void 0 : _original$searchData0["baseRent"]) || "-");
8526
8598
  }
8527
8599
  }, {
8528
8600
  Header: t("CS_CREATED_DATE"),
@@ -9145,7 +9217,7 @@ const RALModal = ({
9145
9217
  };
9146
9218
 
9147
9219
  const RALApplicationDetails$1 = () => {
9148
- var _workflowDetails$data, _user$info, _user$info$roles, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _actions, _actions2, _applicationData$Owne, _propertyDetails$fees, _propertyDetails$fees2, _propertyDetails$fees3, _propertyDetails$fees4, _applicationData$Docu2, _actions3, _workflowDetails$data7;
9220
+ var _workflowDetails$data, _user$info, _user$info$roles, _user$info2, _user$info2$roles$fin, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _actions, _actions2, _applicationData$Owne, _propertyDetails$fees, _propertyDetails$fees2, _propertyDetails$fees3, _propertyDetails$fees4, _actions3, _workflowDetails$data7;
9149
9221
  const {
9150
9222
  t
9151
9223
  } = useTranslation();
@@ -9160,6 +9232,13 @@ const RALApplicationDetails$1 = () => {
9160
9232
  const [displayMenu, setDisplayMenu] = useState(false);
9161
9233
  const [selectedAction, setSelectedAction] = useState(null);
9162
9234
  const [showModal, setShowModal] = useState(false);
9235
+ const [showOptions, setShowOptions] = useState(false);
9236
+ const {
9237
+ data: storeData
9238
+ } = Digit.Hooks.useStore.getInitData();
9239
+ const {
9240
+ tenants
9241
+ } = storeData || {};
9163
9242
  const [getEmployees, setEmployees] = useState([]);
9164
9243
  const history = useHistory();
9165
9244
  const [getWorkflowService, setWorkflowService] = useState([]);
@@ -9191,13 +9270,24 @@ const RALApplicationDetails$1 = () => {
9191
9270
  fetchApplications(filters);
9192
9271
  }
9193
9272
  }, []);
9273
+ const {
9274
+ data: reciept_data,
9275
+ isLoading: recieptDataLoading
9276
+ } = Digit.Hooks.useRecieptSearch({
9277
+ tenantId: tenantId,
9278
+ businessService: "rl-services",
9279
+ consumerCodes: acknowledgementIds,
9280
+ isEmployee: false
9281
+ }, {
9282
+ enabled: acknowledgementIds ? true : false
9283
+ });
9284
+ console.log('reciept_data', reciept_data);
9194
9285
  const workflowDetails = Digit.Hooks.useWorkflowDetails({
9195
9286
  tenantId,
9196
9287
  id: acknowledgementIds,
9197
9288
  moduleCode: "RENT_N_LEASE_NEW",
9198
9289
  role: "EMPLOYEE"
9199
9290
  });
9200
- console.log("workflowDetails", workflowDetails);
9201
9291
  if (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data = workflowDetails.data) !== null && _workflowDetails$data !== void 0 && _workflowDetails$data.actionState && !workflowDetails.isLoading) {
9202
9292
  workflowDetails.data.actionState.nextActions = workflowDetails.data.nextActions;
9203
9293
  }
@@ -9207,10 +9297,77 @@ const RALApplicationDetails$1 = () => {
9207
9297
  }, 2000);
9208
9298
  return () => clearTimeout(timer);
9209
9299
  };
9300
+ console.log('applicationData', applicationData);
9210
9301
  const rawAdditionalDetails = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.additionalDetails) || {};
9211
- const propertyDetails = Array.isArray(rawAdditionalDetails) ? rawAdditionalDetails[0] : rawAdditionalDetails;
9302
+ const propertyDetails = Array.isArray(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails) ? rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails[0] : rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.propertyDetails;
9303
+ const arrearDoc = rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearDoc ? [{
9304
+ documentType: "Arrear Doc",
9305
+ fileStoreId: rawAdditionalDetails.arrearDoc
9306
+ }] : [];
9307
+ const allDocuments = [...((applicationData === null || applicationData === void 0 ? void 0 : applicationData.Document) || []), ...arrearDoc];
9212
9308
  let user = Digit.UserService.getUser();
9213
9309
  const userRoles = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
9310
+ const isCemp = user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : (_user$info2$roles$fin = _user$info2.roles.find(role => role.code === "RL_CEMP")) === null || _user$info2$roles$fin === void 0 ? void 0 : _user$info2$roles$fin.code;
9311
+ const getAcknowledgement = async () => {
9312
+ setLoader(true);
9313
+ try {
9314
+ const applications = applicationData;
9315
+ const tenantInfo = tenants.find(tenant => tenant.code === tenantId);
9316
+ const acknowldgementDataAPI = await getAcknowledgementData({
9317
+ ...applications
9318
+ }, tenantInfo, t);
9319
+ setTimeout(() => {
9320
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
9321
+ setLoader(false);
9322
+ }, 0);
9323
+ } catch (error) {
9324
+ setLoader(false);
9325
+ }
9326
+ };
9327
+ async function getRecieptSearch({
9328
+ tenantId,
9329
+ payments,
9330
+ ...params
9331
+ }) {
9332
+ setLoader(true);
9333
+ try {
9334
+ var _response;
9335
+ let response = null;
9336
+ response = await Digit.PaymentService.generatePdf(tenantId, {
9337
+ Payments: [{
9338
+ ...(payments || {}),
9339
+ AllotmentDetails: [applicationData]
9340
+ }]
9341
+ }, "rentandlease-receipt");
9342
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
9343
+ fileStoreIds: response.filestoreIds[0]
9344
+ });
9345
+ window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
9346
+ setLoader(false);
9347
+ } catch (error) {
9348
+ console.error(error);
9349
+ setLoader(false);
9350
+ }
9351
+ }
9352
+ const dowloadOptions = [];
9353
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
9354
+ dowloadOptions.push({
9355
+ label: t("PTR_FEE_RECIEPT"),
9356
+ onClick: () => {
9357
+ var _reciept_data$Payment;
9358
+ return getRecieptSearch({
9359
+ tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
9360
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
9361
+ });
9362
+ }
9363
+ });
9364
+ if ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.status) === "APPROVED" || (applicationData === null || applicationData === void 0 ? void 0 : applicationData.status) === "CLOSED") {
9365
+ dowloadOptions.push({
9366
+ label: t("CHB_DOWNLOAD_ACK_FORM"),
9367
+ onClick: () => getAcknowledgement()
9368
+ });
9369
+ }
9370
+ }
9214
9371
  let actions = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : (_workflowDetails$data3 = _workflowDetails$data2.actionState) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.nextActions) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.filter(e => {
9215
9372
  return ((userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => {
9216
9373
  var _e$roles;
@@ -9250,6 +9407,14 @@ const RALApplicationDetails$1 = () => {
9250
9407
  const getDate = epoch => {
9251
9408
  return Digit.DateUtils.ConvertEpochToDate(epoch);
9252
9409
  };
9410
+ const tValue = value => {
9411
+ if (value === 0 || value === "0") return "0";
9412
+ if (!value) return t("CS_NA");
9413
+ if (typeof value === "object" && value !== null) {
9414
+ return t((value === null || value === void 0 ? void 0 : value.name) || (value === null || value === void 0 ? void 0 : value.code) || "CS_NA");
9415
+ }
9416
+ return t(value);
9417
+ };
9253
9418
  function onActionSelect(action) {
9254
9419
  var _ref, _action$state, _filterRoles$;
9255
9420
  const payload = {
@@ -9437,7 +9602,12 @@ const RALApplicationDetails$1 = () => {
9437
9602
  className: "cardHeaderWithOptions ral-app-details-header"
9438
9603
  }, /*#__PURE__*/React.createElement(Header, {
9439
9604
  className: "ral-header-32"
9440
- }, t("RENT_LEASE_APPLICATION_DETAILS"))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
9605
+ }, t("RENT_LEASE_APPLICATION_DETAILS")), isCemp && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
9606
+ className: "multilinkWrapper",
9607
+ onHeadClick: () => setShowOptions(!showOptions),
9608
+ displayOptions: showOptions,
9609
+ options: dowloadOptions
9610
+ })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
9441
9611
  className: "ral-card-subheader-24"
9442
9612
  }, t("RAL_CITIZEN_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, applicationData !== null && applicationData !== void 0 && (_applicationData$Owne = applicationData.OwnerInfo) !== null && _applicationData$Owne !== void 0 && _applicationData$Owne.length ? applicationData.OwnerInfo.map((owner, index) => {
9443
9613
  var _owner$correspondence, _owner$permanentAddre, _owner$correspondence2, _owner$permanentAddre2;
@@ -9448,19 +9618,19 @@ const RALApplicationDetails$1 = () => {
9448
9618
  className: "ral-app-details-owner-header"
9449
9619
  }, t("RAL_APPLICANT"), " ", index + 1), /*#__PURE__*/React.createElement(Row, {
9450
9620
  label: t("PT_OWNERSHIP_INFO_NAME"),
9451
- text: (owner === null || owner === void 0 ? void 0 : owner.name) || t("CS_NA")
9621
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.name)
9452
9622
  }), /*#__PURE__*/React.createElement(Row, {
9453
9623
  label: t("CORE_COMMON_PROFILE_EMAIL"),
9454
- text: (owner === null || owner === void 0 ? void 0 : owner.emailId) || t("CS_NA")
9624
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.emailId)
9455
9625
  }), /*#__PURE__*/React.createElement(Row, {
9456
9626
  label: t("CORE_MOBILE_NUMBER"),
9457
- text: (owner === null || owner === void 0 ? void 0 : owner.mobileNo) || t("CS_NA")
9627
+ text: tValue(owner === null || owner === void 0 ? void 0 : owner.mobileNo)
9458
9628
  }), /*#__PURE__*/React.createElement(Row, {
9459
9629
  label: t("PT_COMMON_COL_ADDRESS"),
9460
- text: (owner === null || owner === void 0 ? void 0 : (_owner$correspondence = owner.correspondenceAddress) === null || _owner$correspondence === void 0 ? void 0 : _owner$correspondence.addressId) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre = owner.permanentAddress) === null || _owner$permanentAddre === void 0 ? void 0 : _owner$permanentAddre.addressId) || t("CS_NA")
9630
+ text: tValue((owner === null || owner === void 0 ? void 0 : (_owner$correspondence = owner.correspondenceAddress) === null || _owner$correspondence === void 0 ? void 0 : _owner$correspondence.addressId) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre = owner.permanentAddress) === null || _owner$permanentAddre === void 0 ? void 0 : _owner$permanentAddre.addressId))
9461
9631
  }), /*#__PURE__*/React.createElement(Row, {
9462
9632
  label: t("CORE_COMMON_PINCODE"),
9463
- text: (owner === null || owner === void 0 ? void 0 : (_owner$correspondence2 = owner.correspondenceAddress) === null || _owner$correspondence2 === void 0 ? void 0 : _owner$correspondence2.pincode) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre2 = owner.permanentAddress) === null || _owner$permanentAddre2 === void 0 ? void 0 : _owner$permanentAddre2.pincode) || t("CS_NA")
9633
+ text: tValue((owner === null || owner === void 0 ? void 0 : (_owner$correspondence2 = owner.correspondenceAddress) === null || _owner$correspondence2 === void 0 ? void 0 : _owner$correspondence2.pincode) || (owner === null || owner === void 0 ? void 0 : (_owner$permanentAddre2 = owner.permanentAddress) === null || _owner$permanentAddre2 === void 0 ? void 0 : _owner$permanentAddre2.pincode))
9464
9634
  }));
9465
9635
  }) : /*#__PURE__*/React.createElement(Row, {
9466
9636
  label: t("OWNER"),
@@ -9469,69 +9639,86 @@ const RALApplicationDetails$1 = () => {
9469
9639
  className: "ral-card-subheader-24"
9470
9640
  }, t("ES_TITILE_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, (applicationData === null || applicationData === void 0 ? void 0 : applicationData.registrationNumber) && /*#__PURE__*/React.createElement(Row, {
9471
9641
  label: t("RAL_REGISTRATION_NUMBER"),
9472
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.registrationNumber) || t("CS_NA")
9642
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.registrationNumber)
9473
9643
  }), /*#__PURE__*/React.createElement(Row, {
9474
9644
  label: t("APPLICATION_NUMBER"),
9475
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber) || t("CS_NA")
9645
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber)
9476
9646
  }), /*#__PURE__*/React.createElement(Row, {
9477
9647
  label: t("RENT_LEASE_PROPERTY_ID"),
9478
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyId) || t("CS_NA")
9648
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyId)
9479
9649
  }), /*#__PURE__*/React.createElement(Row, {
9480
9650
  label: t("RENT_LEASE_PROPERTY_NAME"),
9481
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyName) || t("CS_NA")
9651
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyName)
9482
9652
  }), /*#__PURE__*/React.createElement(Row, {
9483
9653
  label: t("RAL_ALLOTMENT_TYPE"),
9484
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.allotmentType) || t("CS_NA")
9654
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.allotmentType)
9485
9655
  }), /*#__PURE__*/React.createElement(Row, {
9486
9656
  label: t("RENT_LEASE_PROPERTY_TYPE"),
9487
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyType) || t("CS_NA")
9657
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertyType)
9488
9658
  }), /*#__PURE__*/React.createElement(Row, {
9489
9659
  label: t("WS_PROPERTY_ADDRESS_LABEL"),
9490
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address) || t("CS_NA")
9660
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address)
9491
9661
  }), /*#__PURE__*/React.createElement(Row, {
9492
9662
  label: t("RAL_PROPERTY_AMOUNT"),
9493
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.baseRent) || t("CS_NA")
9663
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.baseRent)
9494
9664
  }), /*#__PURE__*/React.createElement(Row, {
9495
9665
  label: t("PENALTY_TYPE"),
9496
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.penaltyType) || t("CS_NA")
9666
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.penaltyType)
9497
9667
  }), /*#__PURE__*/React.createElement(Row, {
9498
9668
  label: t("RAL_FEE_CYCLE"),
9499
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees === void 0 ? void 0 : (_propertyDetails$fees2 = _propertyDetails$fees[0]) === null || _propertyDetails$fees2 === void 0 ? void 0 : _propertyDetails$fees2.toUpperCase()) + (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees3 = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees3 === void 0 ? void 0 : (_propertyDetails$fees4 = _propertyDetails$fees3.slice(1)) === null || _propertyDetails$fees4 === void 0 ? void 0 : _propertyDetails$fees4.toLowerCase()) || t("CS_NA")
9669
+ text: propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.feesPeriodCycle ? tValue((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees === void 0 ? void 0 : (_propertyDetails$fees2 = _propertyDetails$fees[0]) === null || _propertyDetails$fees2 === void 0 ? void 0 : _propertyDetails$fees2.toUpperCase()) + (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$fees3 = propertyDetails.feesPeriodCycle) === null || _propertyDetails$fees3 === void 0 ? void 0 : (_propertyDetails$fees4 = _propertyDetails$fees3.slice(1)) === null || _propertyDetails$fees4 === void 0 ? void 0 : _propertyDetails$fees4.toLowerCase())) : t("CS_NA")
9500
9670
  }), /*#__PURE__*/React.createElement(Row, {
9501
9671
  label: t("PROPERTY_SIZE"),
9502
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertySizeOrArea) || t("CS_NA")
9672
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.propertySizeOrArea)
9503
9673
  }), /*#__PURE__*/React.createElement(Row, {
9504
9674
  label: t("RENT_LEASE_LOCATION_TYPE"),
9505
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.locationType) || t("CS_NA")
9675
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.locationType)
9506
9676
  }), /*#__PURE__*/React.createElement(Row, {
9507
9677
  label: t("RAL_START_DATE"),
9508
- text: getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.startDate) || t("CS_NA")
9678
+ text: tValue(getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.startDate))
9509
9679
  }), /*#__PURE__*/React.createElement(Row, {
9510
9680
  label: t("RAL_END_DATE"),
9511
- text: getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.endDate) || t("CS_NA")
9681
+ text: tValue(getDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.endDate))
9512
9682
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) > 0 && /*#__PURE__*/React.createElement(Row, {
9513
9683
  label: t("RAL_PROPERTY_PENALTY"),
9514
- text: applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted
9515
- }), /*#__PURE__*/React.createElement(Row, {
9684
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted)
9685
+ }), (rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.applicationType) !== "Legacy" && /*#__PURE__*/React.createElement(Row, {
9516
9686
  label: t("SECURITY_DEPOSIT"),
9517
- text: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit) || t("CS_NA")
9687
+ text: tValue(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit)
9518
9688
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit) > 0 && /*#__PURE__*/React.createElement(Row, {
9519
9689
  label: t("RAL_AMOUNT_TO_TAKE_FROM_CITIZEN"),
9520
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit)
9690
+ text: tValue((applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeDeducted) - (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.securityDeposit))
9521
9691
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund) > 0 && /*#__PURE__*/React.createElement(Row, {
9522
9692
  label: t("RAL_AMOUNT_TO_REFUND"),
9523
- text: applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund
9693
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.amountToBeRefund)
9524
9694
  }), (applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber) && /*#__PURE__*/React.createElement(Row, {
9525
9695
  label: t("RENT_LEASE_TRADE_LICENSE_NUMBER"),
9526
- text: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber) || t("CS_NA")
9527
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
9696
+ text: tValue(applicationData === null || applicationData === void 0 ? void 0 : applicationData.tradeLicenseNumber)
9697
+ })), (rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.applicationType) === "Legacy" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, {
9698
+ className: "ral-card-subheader-24"
9699
+ }, t("RAL_ARREAR_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
9700
+ label: t("Arrears"),
9701
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.arrear)
9702
+ }), /*#__PURE__*/React.createElement(Row, {
9703
+ label: t("RAL_START_DATE"),
9704
+ text: rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearStartDate ? getDate(rawAdditionalDetails.arrearStartDate) : t("CS_NA")
9705
+ }), /*#__PURE__*/React.createElement(Row, {
9706
+ label: t("RAL_END_DATE"),
9707
+ text: rawAdditionalDetails !== null && rawAdditionalDetails !== void 0 && rawAdditionalDetails.arrearEndDate ? getDate(rawAdditionalDetails.arrearEndDate) : t("CS_NA")
9708
+ }), /*#__PURE__*/React.createElement(Row, {
9709
+ label: t("Reason"),
9710
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.arrearReason)
9711
+ }), /*#__PURE__*/React.createElement(Row, {
9712
+ label: t("Remarks"),
9713
+ text: tValue(rawAdditionalDetails === null || rawAdditionalDetails === void 0 ? void 0 : rawAdditionalDetails.remarks)
9714
+ }))), /*#__PURE__*/React.createElement(CardSubHeader, {
9528
9715
  className: "ral-card-subheader-24-margin"
9529
9716
  }, t("CS_COMMON_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Card, {
9530
9717
  className: "ral-app-details-docs-card"
9531
- }, (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$Docu2 = applicationData.Document) === null || _applicationData$Docu2 === void 0 ? void 0 : _applicationData$Docu2.length) > 0 ? applicationData.Document.map((doc, index) => /*#__PURE__*/React.createElement("div", {
9718
+ }, (allDocuments === null || allDocuments === void 0 ? void 0 : allDocuments.length) > 0 ? allDocuments.map((doc, index) => /*#__PURE__*/React.createElement("div", {
9532
9719
  key: index
9533
9720
  }, /*#__PURE__*/React.createElement(RALDocuments, {
9534
- value: applicationData.Document,
9721
+ value: allDocuments,
9535
9722
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
9536
9723
  index: index
9537
9724
  }), t(doc === null || doc === void 0 ? void 0 : doc.documentType))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), /*#__PURE__*/React.createElement(NewApplicationTimeline, {
@@ -9587,12 +9774,40 @@ const RALApplicationDetails$1 = () => {
9587
9774
  }));
9588
9775
  };
9589
9776
 
9777
+ const RALBreadCrumbs = ({
9778
+ location,
9779
+ t
9780
+ }) => {
9781
+ const crumbs = [{
9782
+ path: "/digit-ui/employee",
9783
+ content: t("ES_COMMON_HOME"),
9784
+ show: true
9785
+ }, {
9786
+ path: "/digit-ui/employee/rentandlease/inbox",
9787
+ content: t("CS_COMMON_INBOX"),
9788
+ show: location.pathname.includes("/rentandlease/inbox") || location.pathname.includes("/rentAndLease/inbox") ? true : false
9789
+ }, {
9790
+ path: "/digit-ui/employee/rentandlease/allot-property",
9791
+ content: "Allot Property",
9792
+ show: location.pathname.includes("/rentandlease/allot-property") || location.pathname.includes("/rentAndLease/allot-property") ? true : false
9793
+ }, {
9794
+ path: "/digit-ui/employee/rentandlease/property",
9795
+ content: "Application Overview",
9796
+ show: location.pathname.includes("/rentandlease/property") || location.pathname.includes("/rentAndLease/property") ? true : false
9797
+ }];
9798
+ return /*#__PURE__*/React.createElement(BreadCrumb, {
9799
+ crumbs: crumbs
9800
+ });
9801
+ };
9590
9802
  const EmployeeApp = ({
9591
9803
  path,
9592
9804
  url,
9593
9805
  userType
9594
9806
  }) => {
9595
9807
  var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi;
9808
+ const {
9809
+ t
9810
+ } = useTranslation();
9596
9811
  const location = useLocation();
9597
9812
  const inboxInitialState = {
9598
9813
  searchParams: {
@@ -9600,23 +9815,22 @@ const EmployeeApp = ({
9600
9815
  code: "ASSIGNED_TO_ALL",
9601
9816
  name: "ES_INBOX_ASSIGNED_TO_ALL"
9602
9817
  },
9603
- services: ["RENT_N_LEASE_NEW"],
9818
+ services: ["RENT_N_LEASE_NEW", "RENT_AND_LEASE_LG"],
9604
9819
  applicationStatus: [],
9605
9820
  locality: []
9606
9821
  }
9607
9822
  };
9608
9823
  const NewRentAndLeaseStepperForm = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("NewRentAndLeaseStepperForm");
9609
9824
  const RALResponse = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("RALResponse");
9610
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9825
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9611
9826
  className: "ground-container"
9612
9827
  }, /*#__PURE__*/React.createElement("div", {
9613
9828
  style: {
9614
- marginLeft: "-4px",
9615
- display: "flex",
9616
- alignItems: "center"
9829
+ marginLeft: "10px"
9617
9830
  }
9618
- }, /*#__PURE__*/React.createElement(BackButton, {
9619
- location: location
9831
+ }, /*#__PURE__*/React.createElement(RALBreadCrumbs, {
9832
+ location: location,
9833
+ t: t
9620
9834
  })), /*#__PURE__*/React.createElement(PrivateRoute, {
9621
9835
  exact: true,
9622
9836
  path: `${path}/`,
@@ -9629,7 +9843,7 @@ const EmployeeApp = ({
9629
9843
  component: () => /*#__PURE__*/React.createElement(Inbox, {
9630
9844
  useNewInboxAPI: true,
9631
9845
  parentRoute: path,
9632
- businessService: "RENT_N_LEASE_NEW",
9846
+ businessService: "RENT_N_LEASE_NEW,RENT_AND_LEASE_LG",
9633
9847
  moduleCode: "RAL",
9634
9848
  filterComponent: "RAL_INBOX_FILTER",
9635
9849
  initialStates: inboxInitialState,
@@ -9644,7 +9858,7 @@ const EmployeeApp = ({
9644
9858
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
9645
9859
  path: `${path}/response/:applicationNumber`,
9646
9860
  component: RALResponse
9647
- }))));
9861
+ })));
9648
9862
  };
9649
9863
 
9650
9864
  const UPDATE_RENTANDLEASE_NEW_APPLICATION_FORMType = "UPDATE_RENTANDLEASE_NEW_APPLICATION_FORM";
@@ -10313,86 +10527,1195 @@ const NewRentAndLeaseStepperForm = ({
10313
10527
  }));
10314
10528
  };
10315
10529
 
10316
- const RentAndLeasePropertyDetails = ({
10317
- onGoBack,
10318
- goNext,
10319
- currentStepData,
10320
- t,
10321
- validateStep,
10322
- config
10323
- }) => {
10324
- const dispatch = useDispatch();
10325
- const tenantId = window.localStorage.getItem("Employee.tenant-id");
10326
- const filters = {
10327
- tenantId,
10328
- searchType: "1"
10329
- };
10330
- const {
10331
- data,
10332
- isLoading,
10333
- isError
10334
- } = Digit.Hooks.rentandlease.useRentAndLeaseProperties(filters);
10335
- const {
10336
- triggerLoader,
10337
- triggerToast
10338
- } = config === null || config === void 0 ? void 0 : config.currStepConfig[0];
10339
- const propertyTypeOptions = [{
10340
- name: t("ON_RENT"),
10341
- code: "rent",
10342
- i18nKey: "rent"
10343
- }, {
10344
- name: t("ON_LEASE"),
10345
- code: "lease",
10346
- i18nKey: "lease"
10347
- }];
10348
- const propertySpecificOptions = [{
10349
- name: t("COMMERCIAL"),
10350
- code: "Commercial",
10351
- i18nKey: "Commercial"
10352
- }, {
10353
- name: t("RESIDENTIAL"),
10354
- code: "Residential",
10355
- i18nKey: "Residential"
10356
- }];
10357
- const locationTypeOptions = [{
10358
- name: t("PRIME"),
10359
- code: "Prime",
10360
- i18nKey: "Prime"
10361
- }, {
10362
- name: t("NON_PRIME"),
10363
- code: "Non-Prime",
10364
- i18nKey: "Non-Prime"
10365
- }];
10366
- const {
10367
- control,
10368
- handleSubmit,
10369
- setValue,
10370
- watch,
10371
- formState: {
10372
- errors
10530
+ var exif = createCommonjsModule(function (module, exports) {
10531
+ (function () {
10532
+ var debug = false;
10533
+ var EXIF = function (obj) {
10534
+ if (obj instanceof EXIF) return obj;
10535
+ if (!(this instanceof EXIF)) return new EXIF(obj);
10536
+ this.EXIFwrapped = obj;
10537
+ };
10538
+ {
10539
+ if ( module.exports) {
10540
+ exports = module.exports = EXIF;
10541
+ }
10542
+ exports.EXIF = EXIF;
10543
+ }
10544
+ var ExifTags = EXIF.Tags = {
10545
+ 0x9000: "ExifVersion",
10546
+ 0xA000: "FlashpixVersion",
10547
+ 0xA001: "ColorSpace",
10548
+ 0xA002: "PixelXDimension",
10549
+ 0xA003: "PixelYDimension",
10550
+ 0x9101: "ComponentsConfiguration",
10551
+ 0x9102: "CompressedBitsPerPixel",
10552
+ 0x927C: "MakerNote",
10553
+ 0x9286: "UserComment",
10554
+ 0xA004: "RelatedSoundFile",
10555
+ 0x9003: "DateTimeOriginal",
10556
+ 0x9004: "DateTimeDigitized",
10557
+ 0x9290: "SubsecTime",
10558
+ 0x9291: "SubsecTimeOriginal",
10559
+ 0x9292: "SubsecTimeDigitized",
10560
+ 0x829A: "ExposureTime",
10561
+ 0x829D: "FNumber",
10562
+ 0x8822: "ExposureProgram",
10563
+ 0x8824: "SpectralSensitivity",
10564
+ 0x8827: "ISOSpeedRatings",
10565
+ 0x8828: "OECF",
10566
+ 0x9201: "ShutterSpeedValue",
10567
+ 0x9202: "ApertureValue",
10568
+ 0x9203: "BrightnessValue",
10569
+ 0x9204: "ExposureBias",
10570
+ 0x9205: "MaxApertureValue",
10571
+ 0x9206: "SubjectDistance",
10572
+ 0x9207: "MeteringMode",
10573
+ 0x9208: "LightSource",
10574
+ 0x9209: "Flash",
10575
+ 0x9214: "SubjectArea",
10576
+ 0x920A: "FocalLength",
10577
+ 0xA20B: "FlashEnergy",
10578
+ 0xA20C: "SpatialFrequencyResponse",
10579
+ 0xA20E: "FocalPlaneXResolution",
10580
+ 0xA20F: "FocalPlaneYResolution",
10581
+ 0xA210: "FocalPlaneResolutionUnit",
10582
+ 0xA214: "SubjectLocation",
10583
+ 0xA215: "ExposureIndex",
10584
+ 0xA217: "SensingMethod",
10585
+ 0xA300: "FileSource",
10586
+ 0xA301: "SceneType",
10587
+ 0xA302: "CFAPattern",
10588
+ 0xA401: "CustomRendered",
10589
+ 0xA402: "ExposureMode",
10590
+ 0xA403: "WhiteBalance",
10591
+ 0xA404: "DigitalZoomRation",
10592
+ 0xA405: "FocalLengthIn35mmFilm",
10593
+ 0xA406: "SceneCaptureType",
10594
+ 0xA407: "GainControl",
10595
+ 0xA408: "Contrast",
10596
+ 0xA409: "Saturation",
10597
+ 0xA40A: "Sharpness",
10598
+ 0xA40B: "DeviceSettingDescription",
10599
+ 0xA40C: "SubjectDistanceRange",
10600
+ 0xA005: "InteroperabilityIFDPointer",
10601
+ 0xA420: "ImageUniqueID"
10602
+ };
10603
+ var TiffTags = EXIF.TiffTags = {
10604
+ 0x0100: "ImageWidth",
10605
+ 0x0101: "ImageHeight",
10606
+ 0x8769: "ExifIFDPointer",
10607
+ 0x8825: "GPSInfoIFDPointer",
10608
+ 0xA005: "InteroperabilityIFDPointer",
10609
+ 0x0102: "BitsPerSample",
10610
+ 0x0103: "Compression",
10611
+ 0x0106: "PhotometricInterpretation",
10612
+ 0x0112: "Orientation",
10613
+ 0x0115: "SamplesPerPixel",
10614
+ 0x011C: "PlanarConfiguration",
10615
+ 0x0212: "YCbCrSubSampling",
10616
+ 0x0213: "YCbCrPositioning",
10617
+ 0x011A: "XResolution",
10618
+ 0x011B: "YResolution",
10619
+ 0x0128: "ResolutionUnit",
10620
+ 0x0111: "StripOffsets",
10621
+ 0x0116: "RowsPerStrip",
10622
+ 0x0117: "StripByteCounts",
10623
+ 0x0201: "JPEGInterchangeFormat",
10624
+ 0x0202: "JPEGInterchangeFormatLength",
10625
+ 0x012D: "TransferFunction",
10626
+ 0x013E: "WhitePoint",
10627
+ 0x013F: "PrimaryChromaticities",
10628
+ 0x0211: "YCbCrCoefficients",
10629
+ 0x0214: "ReferenceBlackWhite",
10630
+ 0x0132: "DateTime",
10631
+ 0x010E: "ImageDescription",
10632
+ 0x010F: "Make",
10633
+ 0x0110: "Model",
10634
+ 0x0131: "Software",
10635
+ 0x013B: "Artist",
10636
+ 0x8298: "Copyright"
10637
+ };
10638
+ var GPSTags = EXIF.GPSTags = {
10639
+ 0x0000: "GPSVersionID",
10640
+ 0x0001: "GPSLatitudeRef",
10641
+ 0x0002: "GPSLatitude",
10642
+ 0x0003: "GPSLongitudeRef",
10643
+ 0x0004: "GPSLongitude",
10644
+ 0x0005: "GPSAltitudeRef",
10645
+ 0x0006: "GPSAltitude",
10646
+ 0x0007: "GPSTimeStamp",
10647
+ 0x0008: "GPSSatellites",
10648
+ 0x0009: "GPSStatus",
10649
+ 0x000A: "GPSMeasureMode",
10650
+ 0x000B: "GPSDOP",
10651
+ 0x000C: "GPSSpeedRef",
10652
+ 0x000D: "GPSSpeed",
10653
+ 0x000E: "GPSTrackRef",
10654
+ 0x000F: "GPSTrack",
10655
+ 0x0010: "GPSImgDirectionRef",
10656
+ 0x0011: "GPSImgDirection",
10657
+ 0x0012: "GPSMapDatum",
10658
+ 0x0013: "GPSDestLatitudeRef",
10659
+ 0x0014: "GPSDestLatitude",
10660
+ 0x0015: "GPSDestLongitudeRef",
10661
+ 0x0016: "GPSDestLongitude",
10662
+ 0x0017: "GPSDestBearingRef",
10663
+ 0x0018: "GPSDestBearing",
10664
+ 0x0019: "GPSDestDistanceRef",
10665
+ 0x001A: "GPSDestDistance",
10666
+ 0x001B: "GPSProcessingMethod",
10667
+ 0x001C: "GPSAreaInformation",
10668
+ 0x001D: "GPSDateStamp",
10669
+ 0x001E: "GPSDifferential"
10670
+ };
10671
+ var IFD1Tags = EXIF.IFD1Tags = {
10672
+ 0x0100: "ImageWidth",
10673
+ 0x0101: "ImageHeight",
10674
+ 0x0102: "BitsPerSample",
10675
+ 0x0103: "Compression",
10676
+ 0x0106: "PhotometricInterpretation",
10677
+ 0x0111: "StripOffsets",
10678
+ 0x0112: "Orientation",
10679
+ 0x0115: "SamplesPerPixel",
10680
+ 0x0116: "RowsPerStrip",
10681
+ 0x0117: "StripByteCounts",
10682
+ 0x011A: "XResolution",
10683
+ 0x011B: "YResolution",
10684
+ 0x011C: "PlanarConfiguration",
10685
+ 0x0128: "ResolutionUnit",
10686
+ 0x0201: "JpegIFOffset",
10687
+ 0x0202: "JpegIFByteCount",
10688
+ 0x0211: "YCbCrCoefficients",
10689
+ 0x0212: "YCbCrSubSampling",
10690
+ 0x0213: "YCbCrPositioning",
10691
+ 0x0214: "ReferenceBlackWhite"
10692
+ };
10693
+ var StringValues = EXIF.StringValues = {
10694
+ ExposureProgram: {
10695
+ 0: "Not defined",
10696
+ 1: "Manual",
10697
+ 2: "Normal program",
10698
+ 3: "Aperture priority",
10699
+ 4: "Shutter priority",
10700
+ 5: "Creative program",
10701
+ 6: "Action program",
10702
+ 7: "Portrait mode",
10703
+ 8: "Landscape mode"
10704
+ },
10705
+ MeteringMode: {
10706
+ 0: "Unknown",
10707
+ 1: "Average",
10708
+ 2: "CenterWeightedAverage",
10709
+ 3: "Spot",
10710
+ 4: "MultiSpot",
10711
+ 5: "Pattern",
10712
+ 6: "Partial",
10713
+ 255: "Other"
10714
+ },
10715
+ LightSource: {
10716
+ 0: "Unknown",
10717
+ 1: "Daylight",
10718
+ 2: "Fluorescent",
10719
+ 3: "Tungsten (incandescent light)",
10720
+ 4: "Flash",
10721
+ 9: "Fine weather",
10722
+ 10: "Cloudy weather",
10723
+ 11: "Shade",
10724
+ 12: "Daylight fluorescent (D 5700 - 7100K)",
10725
+ 13: "Day white fluorescent (N 4600 - 5400K)",
10726
+ 14: "Cool white fluorescent (W 3900 - 4500K)",
10727
+ 15: "White fluorescent (WW 3200 - 3700K)",
10728
+ 17: "Standard light A",
10729
+ 18: "Standard light B",
10730
+ 19: "Standard light C",
10731
+ 20: "D55",
10732
+ 21: "D65",
10733
+ 22: "D75",
10734
+ 23: "D50",
10735
+ 24: "ISO studio tungsten",
10736
+ 255: "Other"
10737
+ },
10738
+ Flash: {
10739
+ 0x0000: "Flash did not fire",
10740
+ 0x0001: "Flash fired",
10741
+ 0x0005: "Strobe return light not detected",
10742
+ 0x0007: "Strobe return light detected",
10743
+ 0x0009: "Flash fired, compulsory flash mode",
10744
+ 0x000D: "Flash fired, compulsory flash mode, return light not detected",
10745
+ 0x000F: "Flash fired, compulsory flash mode, return light detected",
10746
+ 0x0010: "Flash did not fire, compulsory flash mode",
10747
+ 0x0018: "Flash did not fire, auto mode",
10748
+ 0x0019: "Flash fired, auto mode",
10749
+ 0x001D: "Flash fired, auto mode, return light not detected",
10750
+ 0x001F: "Flash fired, auto mode, return light detected",
10751
+ 0x0020: "No flash function",
10752
+ 0x0041: "Flash fired, red-eye reduction mode",
10753
+ 0x0045: "Flash fired, red-eye reduction mode, return light not detected",
10754
+ 0x0047: "Flash fired, red-eye reduction mode, return light detected",
10755
+ 0x0049: "Flash fired, compulsory flash mode, red-eye reduction mode",
10756
+ 0x004D: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
10757
+ 0x004F: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
10758
+ 0x0059: "Flash fired, auto mode, red-eye reduction mode",
10759
+ 0x005D: "Flash fired, auto mode, return light not detected, red-eye reduction mode",
10760
+ 0x005F: "Flash fired, auto mode, return light detected, red-eye reduction mode"
10761
+ },
10762
+ SensingMethod: {
10763
+ 1: "Not defined",
10764
+ 2: "One-chip color area sensor",
10765
+ 3: "Two-chip color area sensor",
10766
+ 4: "Three-chip color area sensor",
10767
+ 5: "Color sequential area sensor",
10768
+ 7: "Trilinear sensor",
10769
+ 8: "Color sequential linear sensor"
10770
+ },
10771
+ SceneCaptureType: {
10772
+ 0: "Standard",
10773
+ 1: "Landscape",
10774
+ 2: "Portrait",
10775
+ 3: "Night scene"
10776
+ },
10777
+ SceneType: {
10778
+ 1: "Directly photographed"
10779
+ },
10780
+ CustomRendered: {
10781
+ 0: "Normal process",
10782
+ 1: "Custom process"
10783
+ },
10784
+ WhiteBalance: {
10785
+ 0: "Auto white balance",
10786
+ 1: "Manual white balance"
10787
+ },
10788
+ GainControl: {
10789
+ 0: "None",
10790
+ 1: "Low gain up",
10791
+ 2: "High gain up",
10792
+ 3: "Low gain down",
10793
+ 4: "High gain down"
10794
+ },
10795
+ Contrast: {
10796
+ 0: "Normal",
10797
+ 1: "Soft",
10798
+ 2: "Hard"
10799
+ },
10800
+ Saturation: {
10801
+ 0: "Normal",
10802
+ 1: "Low saturation",
10803
+ 2: "High saturation"
10804
+ },
10805
+ Sharpness: {
10806
+ 0: "Normal",
10807
+ 1: "Soft",
10808
+ 2: "Hard"
10809
+ },
10810
+ SubjectDistanceRange: {
10811
+ 0: "Unknown",
10812
+ 1: "Macro",
10813
+ 2: "Close view",
10814
+ 3: "Distant view"
10815
+ },
10816
+ FileSource: {
10817
+ 3: "DSC"
10818
+ },
10819
+ Components: {
10820
+ 0: "",
10821
+ 1: "Y",
10822
+ 2: "Cb",
10823
+ 3: "Cr",
10824
+ 4: "R",
10825
+ 5: "G",
10826
+ 6: "B"
10827
+ }
10828
+ };
10829
+ function imageHasData(img) {
10830
+ return !!img.exifdata;
10831
+ }
10832
+ function base64ToArrayBuffer(base64, contentType) {
10833
+ contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/mi)[1] || '';
10834
+ base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
10835
+ var binary = atob(base64);
10836
+ var len = binary.length;
10837
+ var buffer = new ArrayBuffer(len);
10838
+ var view = new Uint8Array(buffer);
10839
+ for (var i = 0; i < len; i++) {
10840
+ view[i] = binary.charCodeAt(i);
10841
+ }
10842
+ return buffer;
10843
+ }
10844
+ function objectURLToBlob(url, callback) {
10845
+ var http = new XMLHttpRequest();
10846
+ http.open("GET", url, true);
10847
+ http.responseType = "blob";
10848
+ http.onload = function (e) {
10849
+ if (this.status == 200 || this.status === 0) {
10850
+ callback(this.response);
10851
+ }
10852
+ };
10853
+ http.send();
10854
+ }
10855
+ function getImageData(img, callback) {
10856
+ function handleBinaryFile(binFile) {
10857
+ var data = findEXIFinJPEG(binFile);
10858
+ img.exifdata = data || {};
10859
+ var iptcdata = findIPTCinJPEG(binFile);
10860
+ img.iptcdata = iptcdata || {};
10861
+ if (EXIF.isXmpEnabled) {
10862
+ var xmpdata = findXMPinJPEG(binFile);
10863
+ img.xmpdata = xmpdata || {};
10864
+ }
10865
+ if (callback) {
10866
+ callback.call(img);
10867
+ }
10868
+ }
10869
+ if (img.src) {
10870
+ if (/^data\:/i.test(img.src)) {
10871
+ var arrayBuffer = base64ToArrayBuffer(img.src);
10872
+ handleBinaryFile(arrayBuffer);
10873
+ } else if (/^blob\:/i.test(img.src)) {
10874
+ var fileReader = new FileReader();
10875
+ fileReader.onload = function (e) {
10876
+ handleBinaryFile(e.target.result);
10877
+ };
10878
+ objectURLToBlob(img.src, function (blob) {
10879
+ fileReader.readAsArrayBuffer(blob);
10880
+ });
10881
+ } else {
10882
+ var http = new XMLHttpRequest();
10883
+ http.onload = function () {
10884
+ if (this.status == 200 || this.status === 0) {
10885
+ handleBinaryFile(http.response);
10886
+ } else {
10887
+ throw "Could not load image";
10888
+ }
10889
+ http = null;
10890
+ };
10891
+ http.open("GET", img.src, true);
10892
+ http.responseType = "arraybuffer";
10893
+ http.send(null);
10894
+ }
10895
+ } else if (self.FileReader && (img instanceof self.Blob || img instanceof self.File)) {
10896
+ var fileReader = new FileReader();
10897
+ fileReader.onload = function (e) {
10898
+ handleBinaryFile(e.target.result);
10899
+ };
10900
+ fileReader.readAsArrayBuffer(img);
10901
+ }
10373
10902
  }
10374
- } = useForm({
10375
- defaultValues: {
10376
- propertyId: "",
10377
- propertyName: "",
10378
- propertyType: "",
10379
- propertySpecific: "",
10380
- locationType: "",
10381
- allotmentType: "",
10382
- propertySizeOrArea: "",
10383
- baseRent: "",
10384
- securityDeposit: "",
10385
- refundApplicableOnDiscontinuation: null,
10386
- penaltyType: "",
10387
- startDate: "",
10388
- endDate: "",
10389
- incrementApplicable: "",
10390
- incrementPercentage: "",
10391
- incrementCycle: "",
10392
- selectedProperty: null,
10393
- duration: ""
10903
+ function findEXIFinJPEG(file) {
10904
+ var dataView = new DataView(file);
10905
+ if (dataView.getUint8(0) != 0xFF || dataView.getUint8(1) != 0xD8) {
10906
+ return false;
10907
+ }
10908
+ var offset = 2,
10909
+ length = file.byteLength,
10910
+ marker;
10911
+ while (offset < length) {
10912
+ if (dataView.getUint8(offset) != 0xFF) {
10913
+ return false;
10914
+ }
10915
+ marker = dataView.getUint8(offset + 1);
10916
+ if (marker == 225) {
10917
+ return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);
10918
+ } else {
10919
+ offset += 2 + dataView.getUint16(offset + 2);
10920
+ }
10921
+ }
10922
+ }
10923
+ function findIPTCinJPEG(file) {
10924
+ var dataView = new DataView(file);
10925
+ if (dataView.getUint8(0) != 0xFF || dataView.getUint8(1) != 0xD8) {
10926
+ return false;
10927
+ }
10928
+ var offset = 2,
10929
+ length = file.byteLength;
10930
+ var isFieldSegmentStart = function (dataView, offset) {
10931
+ return dataView.getUint8(offset) === 0x38 && dataView.getUint8(offset + 1) === 0x42 && dataView.getUint8(offset + 2) === 0x49 && dataView.getUint8(offset + 3) === 0x4D && dataView.getUint8(offset + 4) === 0x04 && dataView.getUint8(offset + 5) === 0x04;
10932
+ };
10933
+ while (offset < length) {
10934
+ if (isFieldSegmentStart(dataView, offset)) {
10935
+ var nameHeaderLength = dataView.getUint8(offset + 7);
10936
+ if (nameHeaderLength % 2 !== 0) nameHeaderLength += 1;
10937
+ if (nameHeaderLength === 0) {
10938
+ nameHeaderLength = 4;
10939
+ }
10940
+ var startOffset = offset + 8 + nameHeaderLength;
10941
+ var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);
10942
+ return readIPTCData(file, startOffset, sectionLength);
10943
+ }
10944
+ offset++;
10945
+ }
10946
+ }
10947
+ var IptcFieldMap = {
10948
+ 0x78: 'caption',
10949
+ 0x6E: 'credit',
10950
+ 0x19: 'keywords',
10951
+ 0x37: 'dateCreated',
10952
+ 0x50: 'byline',
10953
+ 0x55: 'bylineTitle',
10954
+ 0x7A: 'captionWriter',
10955
+ 0x69: 'headline',
10956
+ 0x74: 'copyright',
10957
+ 0x0F: 'category'
10958
+ };
10959
+ function readIPTCData(file, startOffset, sectionLength) {
10960
+ var dataView = new DataView(file);
10961
+ var data = {};
10962
+ var fieldValue, fieldName, dataSize, segmentType;
10963
+ var segmentStartPos = startOffset;
10964
+ while (segmentStartPos < startOffset + sectionLength) {
10965
+ if (dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos + 1) === 0x02) {
10966
+ segmentType = dataView.getUint8(segmentStartPos + 2);
10967
+ if (segmentType in IptcFieldMap) {
10968
+ dataSize = dataView.getInt16(segmentStartPos + 3);
10969
+ fieldName = IptcFieldMap[segmentType];
10970
+ fieldValue = getStringFromDB(dataView, segmentStartPos + 5, dataSize);
10971
+ if (data.hasOwnProperty(fieldName)) {
10972
+ if (data[fieldName] instanceof Array) {
10973
+ data[fieldName].push(fieldValue);
10974
+ } else {
10975
+ data[fieldName] = [data[fieldName], fieldValue];
10976
+ }
10977
+ } else {
10978
+ data[fieldName] = fieldValue;
10979
+ }
10980
+ }
10981
+ }
10982
+ segmentStartPos++;
10983
+ }
10984
+ return data;
10985
+ }
10986
+ function readTags(file, tiffStart, dirStart, strings, bigEnd) {
10987
+ var entries = file.getUint16(dirStart, !bigEnd),
10988
+ tags = {},
10989
+ entryOffset,
10990
+ tag,
10991
+ i;
10992
+ for (i = 0; i < entries; i++) {
10993
+ entryOffset = dirStart + i * 12 + 2;
10994
+ tag = strings[file.getUint16(entryOffset, !bigEnd)];
10995
+ if (!tag && debug) console.log("Unknown tag: " + file.getUint16(entryOffset, !bigEnd));
10996
+ tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);
10997
+ }
10998
+ return tags;
10999
+ }
11000
+ function readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {
11001
+ var type = file.getUint16(entryOffset + 2, !bigEnd),
11002
+ numValues = file.getUint32(entryOffset + 4, !bigEnd),
11003
+ valueOffset = file.getUint32(entryOffset + 8, !bigEnd) + tiffStart,
11004
+ offset,
11005
+ vals,
11006
+ val,
11007
+ n,
11008
+ numerator,
11009
+ denominator;
11010
+ switch (type) {
11011
+ case 1:
11012
+ case 7:
11013
+ if (numValues == 1) {
11014
+ return file.getUint8(entryOffset + 8, !bigEnd);
11015
+ } else {
11016
+ offset = numValues > 4 ? valueOffset : entryOffset + 8;
11017
+ vals = [];
11018
+ for (n = 0; n < numValues; n++) {
11019
+ vals[n] = file.getUint8(offset + n);
11020
+ }
11021
+ return vals;
11022
+ }
11023
+ case 2:
11024
+ offset = numValues > 4 ? valueOffset : entryOffset + 8;
11025
+ return getStringFromDB(file, offset, numValues - 1);
11026
+ case 3:
11027
+ if (numValues == 1) {
11028
+ return file.getUint16(entryOffset + 8, !bigEnd);
11029
+ } else {
11030
+ offset = numValues > 2 ? valueOffset : entryOffset + 8;
11031
+ vals = [];
11032
+ for (n = 0; n < numValues; n++) {
11033
+ vals[n] = file.getUint16(offset + 2 * n, !bigEnd);
11034
+ }
11035
+ return vals;
11036
+ }
11037
+ case 4:
11038
+ if (numValues == 1) {
11039
+ return file.getUint32(entryOffset + 8, !bigEnd);
11040
+ } else {
11041
+ vals = [];
11042
+ for (n = 0; n < numValues; n++) {
11043
+ vals[n] = file.getUint32(valueOffset + 4 * n, !bigEnd);
11044
+ }
11045
+ return vals;
11046
+ }
11047
+ case 5:
11048
+ if (numValues == 1) {
11049
+ numerator = file.getUint32(valueOffset, !bigEnd);
11050
+ denominator = file.getUint32(valueOffset + 4, !bigEnd);
11051
+ val = new Number(numerator / denominator);
11052
+ val.numerator = numerator;
11053
+ val.denominator = denominator;
11054
+ return val;
11055
+ } else {
11056
+ vals = [];
11057
+ for (n = 0; n < numValues; n++) {
11058
+ numerator = file.getUint32(valueOffset + 8 * n, !bigEnd);
11059
+ denominator = file.getUint32(valueOffset + 4 + 8 * n, !bigEnd);
11060
+ vals[n] = new Number(numerator / denominator);
11061
+ vals[n].numerator = numerator;
11062
+ vals[n].denominator = denominator;
11063
+ }
11064
+ return vals;
11065
+ }
11066
+ case 9:
11067
+ if (numValues == 1) {
11068
+ return file.getInt32(entryOffset + 8, !bigEnd);
11069
+ } else {
11070
+ vals = [];
11071
+ for (n = 0; n < numValues; n++) {
11072
+ vals[n] = file.getInt32(valueOffset + 4 * n, !bigEnd);
11073
+ }
11074
+ return vals;
11075
+ }
11076
+ case 10:
11077
+ if (numValues == 1) {
11078
+ return file.getInt32(valueOffset, !bigEnd) / file.getInt32(valueOffset + 4, !bigEnd);
11079
+ } else {
11080
+ vals = [];
11081
+ for (n = 0; n < numValues; n++) {
11082
+ vals[n] = file.getInt32(valueOffset + 8 * n, !bigEnd) / file.getInt32(valueOffset + 4 + 8 * n, !bigEnd);
11083
+ }
11084
+ return vals;
11085
+ }
11086
+ }
11087
+ }
11088
+ function getNextIFDOffset(dataView, dirStart, bigEnd) {
11089
+ var entries = dataView.getUint16(dirStart, !bigEnd);
11090
+ return dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd);
11091
+ }
11092
+ function readThumbnailImage(dataView, tiffStart, firstIFDOffset, bigEnd) {
11093
+ var IFD1OffsetPointer = getNextIFDOffset(dataView, tiffStart + firstIFDOffset, bigEnd);
11094
+ if (!IFD1OffsetPointer) {
11095
+ return {};
11096
+ } else if (IFD1OffsetPointer > dataView.byteLength) {
11097
+ return {};
11098
+ }
11099
+ var thumbTags = readTags(dataView, tiffStart, tiffStart + IFD1OffsetPointer, IFD1Tags, bigEnd);
11100
+ if (thumbTags['Compression']) {
11101
+ switch (thumbTags['Compression']) {
11102
+ case 6:
11103
+ if (thumbTags.JpegIFOffset && thumbTags.JpegIFByteCount) {
11104
+ var tOffset = tiffStart + thumbTags.JpegIFOffset;
11105
+ var tLength = thumbTags.JpegIFByteCount;
11106
+ thumbTags['blob'] = new Blob([new Uint8Array(dataView.buffer, tOffset, tLength)], {
11107
+ type: 'image/jpeg'
11108
+ });
11109
+ }
11110
+ break;
11111
+ case 1:
11112
+ console.log("Thumbnail image format is TIFF, which is not implemented.");
11113
+ break;
11114
+ default:
11115
+ console.log("Unknown thumbnail image format '%s'", thumbTags['Compression']);
11116
+ }
11117
+ } else if (thumbTags['PhotometricInterpretation'] == 2) {
11118
+ console.log("Thumbnail image format is RGB, which is not implemented.");
11119
+ }
11120
+ return thumbTags;
11121
+ }
11122
+ function getStringFromDB(buffer, start, length) {
11123
+ var outstr = "";
11124
+ for (n = start; n < start + length; n++) {
11125
+ outstr += String.fromCharCode(buffer.getUint8(n));
11126
+ }
11127
+ return outstr;
11128
+ }
11129
+ function readEXIFData(file, start) {
11130
+ if (getStringFromDB(file, start, 4) != "Exif") {
11131
+ return false;
11132
+ }
11133
+ var bigEnd,
11134
+ tags,
11135
+ tag,
11136
+ exifData,
11137
+ gpsData,
11138
+ tiffOffset = start + 6;
11139
+ if (file.getUint16(tiffOffset) == 0x4949) {
11140
+ bigEnd = false;
11141
+ } else if (file.getUint16(tiffOffset) == 0x4D4D) {
11142
+ bigEnd = true;
11143
+ } else {
11144
+ return false;
11145
+ }
11146
+ if (file.getUint16(tiffOffset + 2, !bigEnd) != 0x002A) {
11147
+ return false;
11148
+ }
11149
+ var firstIFDOffset = file.getUint32(tiffOffset + 4, !bigEnd);
11150
+ if (firstIFDOffset < 0x00000008) {
11151
+ return false;
11152
+ }
11153
+ tags = readTags(file, tiffOffset, tiffOffset + firstIFDOffset, TiffTags, bigEnd);
11154
+ if (tags.ExifIFDPointer) {
11155
+ exifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);
11156
+ for (tag in exifData) {
11157
+ switch (tag) {
11158
+ case "LightSource":
11159
+ case "Flash":
11160
+ case "MeteringMode":
11161
+ case "ExposureProgram":
11162
+ case "SensingMethod":
11163
+ case "SceneCaptureType":
11164
+ case "SceneType":
11165
+ case "CustomRendered":
11166
+ case "WhiteBalance":
11167
+ case "GainControl":
11168
+ case "Contrast":
11169
+ case "Saturation":
11170
+ case "Sharpness":
11171
+ case "SubjectDistanceRange":
11172
+ case "FileSource":
11173
+ exifData[tag] = StringValues[tag][exifData[tag]];
11174
+ break;
11175
+ case "ExifVersion":
11176
+ case "FlashpixVersion":
11177
+ exifData[tag] = String.fromCharCode(exifData[tag][0], exifData[tag][1], exifData[tag][2], exifData[tag][3]);
11178
+ break;
11179
+ case "ComponentsConfiguration":
11180
+ exifData[tag] = StringValues.Components[exifData[tag][0]] + StringValues.Components[exifData[tag][1]] + StringValues.Components[exifData[tag][2]] + StringValues.Components[exifData[tag][3]];
11181
+ break;
11182
+ }
11183
+ tags[tag] = exifData[tag];
11184
+ }
11185
+ }
11186
+ if (tags.GPSInfoIFDPointer) {
11187
+ gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);
11188
+ for (tag in gpsData) {
11189
+ switch (tag) {
11190
+ case "GPSVersionID":
11191
+ gpsData[tag] = gpsData[tag][0] + "." + gpsData[tag][1] + "." + gpsData[tag][2] + "." + gpsData[tag][3];
11192
+ break;
11193
+ }
11194
+ tags[tag] = gpsData[tag];
11195
+ }
11196
+ }
11197
+ tags['thumbnail'] = readThumbnailImage(file, tiffOffset, firstIFDOffset, bigEnd);
11198
+ return tags;
11199
+ }
11200
+ function findXMPinJPEG(file) {
11201
+ if (!('DOMParser' in self)) {
11202
+ return;
11203
+ }
11204
+ var dataView = new DataView(file);
11205
+ if (dataView.getUint8(0) != 0xFF || dataView.getUint8(1) != 0xD8) {
11206
+ return false;
11207
+ }
11208
+ var offset = 2,
11209
+ length = file.byteLength,
11210
+ dom = new DOMParser();
11211
+ while (offset < length - 4) {
11212
+ if (getStringFromDB(dataView, offset, 4) == "http") {
11213
+ var startOffset = offset - 1;
11214
+ var sectionLength = dataView.getUint16(offset - 2) - 1;
11215
+ var xmpString = getStringFromDB(dataView, startOffset, sectionLength);
11216
+ var xmpEndIndex = xmpString.indexOf('xmpmeta>') + 8;
11217
+ xmpString = xmpString.substring(xmpString.indexOf('<x:xmpmeta'), xmpEndIndex);
11218
+ var indexOfXmp = xmpString.indexOf('x:xmpmeta') + 10;
11219
+ xmpString = xmpString.slice(0, indexOfXmp) + 'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" ' + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' + 'xmlns:tiff="http://ns.adobe.com/tiff/1.0/" ' + 'xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" ' + 'xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" ' + 'xmlns:exif="http://ns.adobe.com/exif/1.0/" ' + 'xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" ' + 'xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" ' + 'xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" ' + 'xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" ' + 'xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" ' + xmpString.slice(indexOfXmp);
11220
+ var domDocument = dom.parseFromString(xmpString, 'text/xml');
11221
+ return xml2Object(domDocument);
11222
+ } else {
11223
+ offset++;
11224
+ }
11225
+ }
11226
+ }
11227
+ function xml2json(xml) {
11228
+ var json = {};
11229
+ if (xml.nodeType == 1) {
11230
+ if (xml.attributes.length > 0) {
11231
+ json['@attributes'] = {};
11232
+ for (var j = 0; j < xml.attributes.length; j++) {
11233
+ var attribute = xml.attributes.item(j);
11234
+ json['@attributes'][attribute.nodeName] = attribute.nodeValue;
11235
+ }
11236
+ }
11237
+ } else if (xml.nodeType == 3) {
11238
+ return xml.nodeValue;
11239
+ }
11240
+ if (xml.hasChildNodes()) {
11241
+ for (var i = 0; i < xml.childNodes.length; i++) {
11242
+ var child = xml.childNodes.item(i);
11243
+ var nodeName = child.nodeName;
11244
+ if (json[nodeName] == null) {
11245
+ json[nodeName] = xml2json(child);
11246
+ } else {
11247
+ if (json[nodeName].push == null) {
11248
+ var old = json[nodeName];
11249
+ json[nodeName] = [];
11250
+ json[nodeName].push(old);
11251
+ }
11252
+ json[nodeName].push(xml2json(child));
11253
+ }
11254
+ }
11255
+ }
11256
+ return json;
11257
+ }
11258
+ function xml2Object(xml) {
11259
+ try {
11260
+ var obj = {};
11261
+ if (xml.children.length > 0) {
11262
+ for (var i = 0; i < xml.children.length; i++) {
11263
+ var item = xml.children.item(i);
11264
+ var attributes = item.attributes;
11265
+ for (var idx in attributes) {
11266
+ var itemAtt = attributes[idx];
11267
+ var dataKey = itemAtt.nodeName;
11268
+ var dataValue = itemAtt.nodeValue;
11269
+ if (dataKey !== undefined) {
11270
+ obj[dataKey] = dataValue;
11271
+ }
11272
+ }
11273
+ var nodeName = item.nodeName;
11274
+ if (typeof obj[nodeName] == "undefined") {
11275
+ obj[nodeName] = xml2json(item);
11276
+ } else {
11277
+ if (typeof obj[nodeName].push == "undefined") {
11278
+ var old = obj[nodeName];
11279
+ obj[nodeName] = [];
11280
+ obj[nodeName].push(old);
11281
+ }
11282
+ obj[nodeName].push(xml2json(item));
11283
+ }
11284
+ }
11285
+ } else {
11286
+ obj = xml.textContent;
11287
+ }
11288
+ return obj;
11289
+ } catch (e) {
11290
+ console.log(e.message);
11291
+ }
11292
+ }
11293
+ EXIF.enableXmp = function () {
11294
+ EXIF.isXmpEnabled = true;
11295
+ };
11296
+ EXIF.disableXmp = function () {
11297
+ EXIF.isXmpEnabled = false;
11298
+ };
11299
+ EXIF.getData = function (img, callback) {
11300
+ if ((self.Image && img instanceof self.Image || self.HTMLImageElement && img instanceof self.HTMLImageElement) && !img.complete) return false;
11301
+ if (!imageHasData(img)) {
11302
+ getImageData(img, callback);
11303
+ } else {
11304
+ if (callback) {
11305
+ callback.call(img);
11306
+ }
11307
+ }
11308
+ return true;
11309
+ };
11310
+ EXIF.getTag = function (img, tag) {
11311
+ if (!imageHasData(img)) return;
11312
+ return img.exifdata[tag];
11313
+ };
11314
+ EXIF.getIptcTag = function (img, tag) {
11315
+ if (!imageHasData(img)) return;
11316
+ return img.iptcdata[tag];
11317
+ };
11318
+ EXIF.getAllTags = function (img) {
11319
+ if (!imageHasData(img)) return {};
11320
+ var a,
11321
+ data = img.exifdata,
11322
+ tags = {};
11323
+ for (a in data) {
11324
+ if (data.hasOwnProperty(a)) {
11325
+ tags[a] = data[a];
11326
+ }
11327
+ }
11328
+ return tags;
11329
+ };
11330
+ EXIF.getAllIptcTags = function (img) {
11331
+ if (!imageHasData(img)) return {};
11332
+ var a,
11333
+ data = img.iptcdata,
11334
+ tags = {};
11335
+ for (a in data) {
11336
+ if (data.hasOwnProperty(a)) {
11337
+ tags[a] = data[a];
11338
+ }
11339
+ }
11340
+ return tags;
11341
+ };
11342
+ EXIF.pretty = function (img) {
11343
+ if (!imageHasData(img)) return "";
11344
+ var a,
11345
+ data = img.exifdata,
11346
+ strPretty = "";
11347
+ for (a in data) {
11348
+ if (data.hasOwnProperty(a)) {
11349
+ if (typeof data[a] == "object") {
11350
+ if (data[a] instanceof Number) {
11351
+ strPretty += a + " : " + data[a] + " [" + data[a].numerator + "/" + data[a].denominator + "]\r\n";
11352
+ } else {
11353
+ strPretty += a + " : [" + data[a].length + " values]\r\n";
11354
+ }
11355
+ } else {
11356
+ strPretty += a + " : " + data[a] + "\r\n";
11357
+ }
11358
+ }
11359
+ }
11360
+ return strPretty;
11361
+ };
11362
+ EXIF.readFromBinaryFile = function (file) {
11363
+ return findEXIFinJPEG(file);
11364
+ };
11365
+ }).call(commonjsGlobal);
11366
+ });
11367
+
11368
+ const ChallanDocuments = ({
11369
+ t,
11370
+ config,
11371
+ onSelect,
11372
+ userType,
11373
+ formData,
11374
+ setError: setFormError,
11375
+ clearErrors: clearFormErrors,
11376
+ formState,
11377
+ data,
11378
+ isLoading,
11379
+ error,
11380
+ setError
11381
+ }) => {
11382
+ var _formData$documents, _data$Challan2, _data$Challan2$Docume;
11383
+ const [documents, setDocuments] = useState((formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : _formData$documents.documents) || []);
11384
+ const [enableSubmit, setEnableSubmit] = useState(true);
11385
+ const [checkRequiredFields, setCheckRequiredFields] = useState(false);
11386
+ const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
11387
+ const handleSubmit = () => {
11388
+ let document = formData.documents;
11389
+ let documentStep;
11390
+ documentStep = {
11391
+ ...document,
11392
+ documents: documents
11393
+ };
11394
+ onSelect(config.key, documentStep);
11395
+ };
11396
+ useEffect(() => {
11397
+ if (documents) onSelect(documents);
11398
+ }, [documents]);
11399
+ useEffect(() => {
11400
+ var _formData$documents2;
11401
+ const incomingDocs = (formData === null || formData === void 0 ? void 0 : (_formData$documents2 = formData.documents) === null || _formData$documents2 === void 0 ? void 0 : _formData$documents2.documents) || [];
11402
+ if (Array.isArray(incomingDocs) && incomingDocs.length > 0 && documents.length === 0) {
11403
+ setDocuments(incomingDocs);
11404
+ }
11405
+ }, [formData]);
11406
+ useEffect(() => {
11407
+ var _data$Challan, _data$Challan$Documen;
11408
+ let count = 0;
11409
+ data === null || data === void 0 ? void 0 : (_data$Challan = data.Challan) === null || _data$Challan === void 0 ? void 0 : (_data$Challan$Documen = _data$Challan.Documents) === null || _data$Challan$Documen === void 0 ? void 0 : _data$Challan$Documen.map(doc => {
11410
+ doc.hasDropdown = true;
11411
+ let isRequired = false;
11412
+ documents === null || documents === void 0 ? void 0 : documents.map(data => {
11413
+ if (doc.required && data !== null && data !== void 0 && data.documentType.includes(doc.code)) isRequired = true;
11414
+ });
11415
+ if (!isRequired && doc.required) count = count + 1;
11416
+ });
11417
+ if ((count == "0" || count == 0) && (documents === null || documents === void 0 ? void 0 : documents.length) > 0) setEnableSubmit(false);else setEnableSubmit(true);
11418
+ }, [documents, checkRequiredFields]);
11419
+ return /*#__PURE__*/React.createElement("div", null, !isLoading ? /*#__PURE__*/React.createElement("div", null, data === null || data === void 0 ? void 0 : (_data$Challan2 = data.Challan) === null || _data$Challan2 === void 0 ? void 0 : (_data$Challan2$Docume = _data$Challan2.Documents) === null || _data$Challan2$Docume === void 0 ? void 0 : _data$Challan2$Docume.map((document, index) => {
11420
+ return /*#__PURE__*/React.createElement(PTRSelectDocument, {
11421
+ key: index,
11422
+ document: document,
11423
+ t: t,
11424
+ error: error,
11425
+ setError: setError,
11426
+ setDocuments: setDocuments,
11427
+ documents: documents,
11428
+ setCheckRequiredFields: setCheckRequiredFields,
11429
+ handleSubmit: handleSubmit
11430
+ });
11431
+ }), error && /*#__PURE__*/React.createElement(Toast, {
11432
+ isDleteBtn: true,
11433
+ label: error,
11434
+ onClose: () => setError(null),
11435
+ error: true
11436
+ })) : /*#__PURE__*/React.createElement(Loader$1, null));
11437
+ };
11438
+ function PTRSelectDocument({
11439
+ t,
11440
+ document: doc,
11441
+ setDocuments,
11442
+ setError,
11443
+ documents,
11444
+ action,
11445
+ formData,
11446
+ handleSubmit,
11447
+ id
11448
+ }) {
11449
+ const filteredDocument = documents === null || documents === void 0 ? void 0 : documents.filter(item => {
11450
+ var _item$documentType;
11451
+ return item === null || item === void 0 ? void 0 : (_item$documentType = item.documentType) === null || _item$documentType === void 0 ? void 0 : _item$documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code);
11452
+ })[0];
11453
+ const tenantId = Digit.ULBService.getCurrentTenantId();
11454
+ const [selectedDocument, setSelectedDocument] = useState(() => {
11455
+ var _doc$dropdownData2;
11456
+ if (filteredDocument) {
11457
+ var _doc$dropdownData, _match$code;
11458
+ const match = doc === null || doc === void 0 ? void 0 : (_doc$dropdownData = doc.dropdownData) === null || _doc$dropdownData === void 0 ? void 0 : _doc$dropdownData.find(e => e.code === filteredDocument.documentType);
11459
+ return match ? {
11460
+ ...match,
11461
+ i18nKey: (_match$code = match.code) === null || _match$code === void 0 ? void 0 : _match$code.replaceAll(".", "_")
11462
+ } : {};
11463
+ }
11464
+ if ((doc === null || doc === void 0 ? void 0 : (_doc$dropdownData2 = doc.dropdownData) === null || _doc$dropdownData2 === void 0 ? void 0 : _doc$dropdownData2.length) === 1) {
11465
+ var _onlyOption$code;
11466
+ const onlyOption = doc.dropdownData[0];
11467
+ return {
11468
+ ...onlyOption,
11469
+ i18nKey: (_onlyOption$code = onlyOption.code) === null || _onlyOption$code === void 0 ? void 0 : _onlyOption$code.replaceAll(".", "_")
11470
+ };
11471
+ }
11472
+ return {};
11473
+ });
11474
+ const [file, setFile] = useState(null);
11475
+ const [uploadedFile, setUploadedFile] = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.filestoreId) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null);
11476
+ useEffect(() => {
11477
+ const fsId = (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.filestoreId) || (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId);
11478
+ if (fsId && fsId !== uploadedFile) {
11479
+ setUploadedFile(fsId);
11480
+ }
11481
+ }, [filteredDocument]);
11482
+ function selectfile(e) {
11483
+ const file = e.target.files[0];
11484
+ if (!file) return;
11485
+ setFile(file);
11486
+ updateDocument(selectedDocument, {});
11487
+ }
11488
+ function updateDocument(selectedDocument, extraFields = {}) {
11489
+ setDocuments(() => [{
11490
+ documentType: "arrearDoc",
11491
+ filestoreId: extraFields.filestoreId || null,
11492
+ documentUid: extraFields.documentUid || null
11493
+ }]);
11494
+ }
11495
+ const {
11496
+ dropdownData
11497
+ } = doc;
11498
+ var dropDownData = dropdownData;
11499
+ const [isHidden, setHidden] = useState(false);
11500
+ const [getLoading, setLoading] = useState(false);
11501
+ useEffect(() => {
11502
+ if (action === "update") {
11503
+ var _formData$originalDat, _formData$originalDat2;
11504
+ const originalDoc = formData === null || formData === void 0 ? void 0 : (_formData$originalDat = formData.originalData) === null || _formData$originalDat === void 0 ? void 0 : (_formData$originalDat2 = _formData$originalDat.documents) === null || _formData$originalDat2 === void 0 ? void 0 : _formData$originalDat2.filter(e => e.documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code))[0];
11505
+ const docType = dropDownData.filter(e => e.code === (originalDoc === null || originalDoc === void 0 ? void 0 : originalDoc.documentType)).map(e => {
11506
+ var _e$code;
11507
+ return {
11508
+ ...e,
11509
+ i18nKey: e === null || e === void 0 ? void 0 : (_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.replaceAll(".", "_")
11510
+ };
11511
+ })[0];
11512
+ if (!docType) setHidden(true);else {
11513
+ setSelectedDocument(docType);
11514
+ setUploadedFile(originalDoc === null || originalDoc === void 0 ? void 0 : originalDoc.fileStoreId);
11515
+ }
11516
+ }
11517
+ }, []);
11518
+ useEffect(() => {
11519
+ if (!(doc !== null && doc !== void 0 && doc.hasDropdown)) {
11520
+ var _doc$code;
11521
+ setSelectedDocument({
11522
+ code: doc === null || doc === void 0 ? void 0 : doc.code,
11523
+ i18nKey: doc === null || doc === void 0 ? void 0 : (_doc$code = doc.code) === null || _doc$code === void 0 ? void 0 : _doc$code.replaceAll(".", "_")
11524
+ });
11525
+ }
11526
+ }, []);
11527
+ useEffect(() => {
11528
+ (async () => {
11529
+ setError(null);
11530
+ if (file) {
11531
+ setLoading(true);
11532
+ if (file.size >= 5242880) {
11533
+ setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
11534
+ } else {
11535
+ try {
11536
+ var _response$data, _response$data$files;
11537
+ setUploadedFile(null);
11538
+ const response = await Digit.UploadServices.Filestorage("PTR", file, Digit.ULBService.getStateId());
11539
+ setLoading(false);
11540
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
11541
+ const fsId = response.data.files[0].fileStoreId;
11542
+ setUploadedFile(fsId);
11543
+ updateDocument(selectedDocument, {
11544
+ filestoreId: fsId,
11545
+ documentUid: fsId
11546
+ });
11547
+ } else {
11548
+ setError(t("CS_FILE_UPLOAD_ERROR"));
11549
+ }
11550
+ } catch (err) {
11551
+ setLoading(false);
11552
+ setError(t("CS_FILE_UPLOAD_ERROR"));
11553
+ }
11554
+ }
11555
+ }
11556
+ })();
11557
+ }, [file]);
11558
+ useEffect(() => {
11559
+ if (isHidden) setUploadedFile(null);
11560
+ }, [isHidden]);
11561
+ return /*#__PURE__*/React.createElement("div", {
11562
+ className: "challan-documents"
11563
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, {
11564
+ className: "challan-label-field"
11565
+ }, /*#__PURE__*/React.createElement(CardLabel, {
11566
+ className: "challan-card-label"
11567
+ }, t(doc === null || doc === void 0 ? void 0 : doc.code), " ", /*#__PURE__*/React.createElement("span", {
11568
+ className: "requiredField"
11569
+ }, " ", (doc === null || doc === void 0 ? void 0 : doc.required) && " *")), /*#__PURE__*/React.createElement("div", {
11570
+ className: "field",
11571
+ style: {
11572
+ width: "100%"
11573
+ }
11574
+ }, /*#__PURE__*/React.createElement(UploadFile, {
11575
+ onUpload: selectfile,
11576
+ onDelete: () => {
11577
+ setUploadedFile(null);
11578
+ },
11579
+ id: id,
11580
+ message: uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
11581
+ textStyles: {
11582
+ width: "100%"
11583
+ },
11584
+ inputStyles: {
11585
+ width: "280px"
11586
+ },
11587
+ accept: ".pdf, .jpeg, .jpg, .png",
11588
+ buttonType: "button",
11589
+ error: !uploadedFile
11590
+ }))), getLoading && /*#__PURE__*/React.createElement(Loader$1, {
11591
+ page: true
11592
+ }));
11593
+ }
11594
+
11595
+ const RentAndLeasePropertyDetails = ({
11596
+ onGoBack,
11597
+ goNext,
11598
+ currentStepData,
11599
+ validateStep,
11600
+ config
11601
+ }) => {
11602
+ var _watch, _watch2;
11603
+ const dispatch = useDispatch();
11604
+ const tenantId = window.localStorage.getItem("Employee.tenant-id");
11605
+ const [documentsData, setDocumentsData] = useState([]);
11606
+ const [error, setError] = useState(null);
11607
+ const {
11608
+ t
11609
+ } = useTranslation();
11610
+ const propertyTypeOptions = [{
11611
+ name: t("ON_RENT"),
11612
+ code: "rent",
11613
+ i18nKey: "rent"
11614
+ }, {
11615
+ name: t("ON_LEASE"),
11616
+ code: "lease",
11617
+ i18nKey: "lease"
11618
+ }, {
11619
+ name: t("ON_DEED"),
11620
+ code: "deed",
11621
+ i18nKey: "deed"
11622
+ }];
11623
+ const applicationTypeOptions = [{
11624
+ name: t("Legacy"),
11625
+ code: "Legacy"
11626
+ }, {
11627
+ name: t("New"),
11628
+ code: "new"
11629
+ }];
11630
+ const propertySpecificOptions = [{
11631
+ name: t("COMMERCIAL"),
11632
+ code: "Commercial",
11633
+ i18nKey: "Commercial"
11634
+ }, {
11635
+ name: t("RESIDENTIAL"),
11636
+ code: "Residential",
11637
+ i18nKey: "Residential"
11638
+ }];
11639
+ const locationTypeOptions = [{
11640
+ name: t("PRIME"),
11641
+ code: "Prime",
11642
+ i18nKey: "Prime"
11643
+ }, {
11644
+ name: t("NON_PRIME"),
11645
+ code: "Non-Prime",
11646
+ i18nKey: "Non-Prime"
11647
+ }];
11648
+ const arrearReasonOptions = [{
11649
+ name: t("PREVIOUS DUES"),
11650
+ code: "PREVIOUS DUES"
11651
+ }, {
11652
+ name: t("UNDER DISPUTE"),
11653
+ code: "UNDER DISPUTE"
11654
+ }, {
11655
+ name: t("COURT CASE"),
11656
+ code: "COURT CASE"
11657
+ }];
11658
+ const filters = {
11659
+ tenantId,
11660
+ searchType: "1"
11661
+ };
11662
+ const {
11663
+ data,
11664
+ isLoading,
11665
+ isError
11666
+ } = Digit.Hooks.rentandlease.useRentAndLeaseProperties(filters);
11667
+ const {
11668
+ triggerLoader,
11669
+ triggerToast
11670
+ } = config === null || config === void 0 ? void 0 : config.currStepConfig[0];
11671
+ const {
11672
+ control,
11673
+ handleSubmit,
11674
+ setValue,
11675
+ watch,
11676
+ clearErrors,
11677
+ formState: {
11678
+ errors
11679
+ }
11680
+ } = useForm({
11681
+ defaultValues: {
11682
+ applicationType: {
11683
+ name: t("Legacy"),
11684
+ code: "Legacy"
11685
+ },
11686
+ propertyId: "",
11687
+ propertyName: "",
11688
+ propertyType: "",
11689
+ propertySpecific: "",
11690
+ locationType: "",
11691
+ allotmentType: "",
11692
+ propertySizeOrArea: "",
11693
+ baseRent: "",
11694
+ securityDeposit: "",
11695
+ refundApplicableOnDiscontinuation: null,
11696
+ penaltyType: "",
11697
+ startDate: "",
11698
+ endDate: "",
11699
+ incrementApplicable: "",
11700
+ incrementPercentage: "",
11701
+ incrementCycle: "",
11702
+ selectedProperty: null,
11703
+ duration: ""
10394
11704
  }
10395
11705
  });
11706
+ const docUploadData = {
11707
+ Challan: {
11708
+ Documents: [{
11709
+ code: "arrearDoc",
11710
+ documentType: "ID_PROOF",
11711
+ required: watch("arrear") > 0 ? true : false,
11712
+ active: true,
11713
+ description: "ID proof of offender",
11714
+ maxSizeMB: 2,
11715
+ hasDropdown: true
11716
+ }]
11717
+ }
11718
+ };
10396
11719
  const selectedPropertyType = watch("propertyType");
10397
11720
  const selectedPropertySpecific = watch("propertySpecific");
10398
11721
  const selectedLocationType = watch("locationType");
@@ -10406,6 +11729,16 @@ const RentAndLeasePropertyDetails = ({
10406
11729
  setFilteredProperties(properties);
10407
11730
  }
10408
11731
  }, [data, selectedPropertyType, selectedPropertySpecific, selectedLocationType]);
11732
+ useEffect(() => {
11733
+ const startDate = watch("arrearStartDate");
11734
+ if (startDate) {
11735
+ const end = new Date(startDate);
11736
+ end.setFullYear(end.getFullYear() + 1);
11737
+ setValue("arrearEndDate", end.toISOString().split("T")[0], {
11738
+ shouldValidate: true
11739
+ });
11740
+ }
11741
+ }, [watch("arrearStartDate")]);
10409
11742
  const todayISO = new Date().toISOString().split("T")[0];
10410
11743
  const minStartDate = new Date();
10411
11744
  minStartDate.setMonth(minStartDate.getMonth() - 11);
@@ -10427,6 +11760,18 @@ const RentAndLeasePropertyDetails = ({
10427
11760
  });
10428
11761
  };
10429
11762
  const onSubmit = async data => {
11763
+ var _data$applicationType, _documentsData$;
11764
+ const applicationType = data === null || data === void 0 ? void 0 : (_data$applicationType = data.applicationType) === null || _data$applicationType === void 0 ? void 0 : _data$applicationType.code;
11765
+ if (applicationType === "Legacy" && (data === null || data === void 0 ? void 0 : data.arrear) > 0 && !(documentsData !== null && documentsData !== void 0 && (_documentsData$ = documentsData[0]) !== null && _documentsData$ !== void 0 && _documentsData$.filestoreId)) {
11766
+ alert("Please upload arrear document");
11767
+ return;
11768
+ }
11769
+ if (applicationType === "Legacy") {
11770
+ var _documentsData$2;
11771
+ data["arrearDoc"] = documentsData === null || documentsData === void 0 ? void 0 : (_documentsData$2 = documentsData[0]) === null || _documentsData$2 === void 0 ? void 0 : _documentsData$2.filestoreId;
11772
+ } else {
11773
+ delete data["arrearDoc"];
11774
+ }
10430
11775
  if (validateStep) {
10431
11776
  const validationErrors = validateStep(data);
10432
11777
  if (Object.keys(validationErrors).length > 0) return;
@@ -10449,6 +11794,13 @@ const RentAndLeasePropertyDetails = ({
10449
11794
  shouldValidate: true
10450
11795
  });
10451
11796
  });
11797
+ if (propertyDetails.arrearDoc) {
11798
+ setDocumentsData([{
11799
+ documentType: "arrearDoc",
11800
+ filestoreId: propertyDetails.arrearDoc,
11801
+ documentUid: propertyDetails.arrearDoc
11802
+ }]);
11803
+ }
10452
11804
  }
10453
11805
  }, [currentStepData, setValue]);
10454
11806
  useEffect(() => {
@@ -10493,12 +11845,41 @@ const RentAndLeasePropertyDetails = ({
10493
11845
  triggerToast("ERROR_WHILE_FETCHING_PROPERTIES", true);
10494
11846
  }
10495
11847
  }, [isError, triggerToast]);
11848
+ const handleDocumentsSelect = data => {
11849
+ setDocumentsData(data);
11850
+ };
11851
+ useEffect(() => {
11852
+ if (watch("arrear") <= 0) {
11853
+ clearErrors(["arrearStartDate", "arrearEndDate", "arrearReason", "remarks"]);
11854
+ }
11855
+ }, [watch("arrear")]);
10496
11856
  return /*#__PURE__*/React.createElement("form", {
10497
11857
  onSubmit: handleSubmit(onSubmit)
10498
11858
  }, /*#__PURE__*/React.createElement(CardSectionHeader, {
10499
11859
  className: "card-section-header"
10500
11860
  }, t("ES_TITILE_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
10501
11861
  className: "card-label-smaller"
11862
+ }, t("PT_COMMON_TABLE_COL_APP_TYPE"), " ", /*#__PURE__*/React.createElement("span", {
11863
+ className: "mandatory-asterisk"
11864
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
11865
+ control: control,
11866
+ name: "applicationType",
11867
+ rules: {
11868
+ required: t("RENT_LEASE_APPLICATION_TYPE_REQUIRED")
11869
+ },
11870
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
11871
+ className: "form-field",
11872
+ select: props.onChange,
11873
+ selected: props.value,
11874
+ option: applicationTypeOptions,
11875
+ defaultValues: true,
11876
+ optionKey: "name",
11877
+ t: t
11878
+ })
11879
+ })), errors.applicationType && /*#__PURE__*/React.createElement(CardLabelError, {
11880
+ className: "ral-error-label"
11881
+ }, getErrorMessage("applicationType")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
11882
+ className: "card-label-smaller"
10502
11883
  }, t("RENT_LEASE_PROPERTY_TYPE"), " ", /*#__PURE__*/React.createElement("span", {
10503
11884
  className: "mandatory-asterisk"
10504
11885
  }, "*")), /*#__PURE__*/React.createElement(Controller, {
@@ -10745,7 +12126,7 @@ const RentAndLeasePropertyDetails = ({
10745
12126
  t: t,
10746
12127
  disabled: true
10747
12128
  })
10748
- }))), errors.penaltyType && /*#__PURE__*/React.createElement(CardLabelError, null, getErrorMessage("penaltyType")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("RAL_SECURITY_AMOUNT"), " ", /*#__PURE__*/React.createElement("span", {
12129
+ }))), errors.penaltyType && /*#__PURE__*/React.createElement(CardLabelError, null, getErrorMessage("penaltyType")), ((_watch = watch("applicationType")) === null || _watch === void 0 ? void 0 : _watch.code) != "Legacy" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("RAL_SECURITY_AMOUNT"), " ", /*#__PURE__*/React.createElement("span", {
10749
12130
  className: "mandatory-asterisk"
10750
12131
  }, "*")), /*#__PURE__*/React.createElement("div", {
10751
12132
  className: "form-field"
@@ -10766,7 +12147,158 @@ const RentAndLeasePropertyDetails = ({
10766
12147
  })
10767
12148
  }))), errors.securityDeposit && /*#__PURE__*/React.createElement(CardLabelError, {
10768
12149
  className: "ral-error-label"
10769
- }, getErrorMessage("securityDeposit")), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
12150
+ }, getErrorMessage("securityDeposit"))), ((_watch2 = watch("applicationType")) === null || _watch2 === void 0 ? void 0 : _watch2.code) == "Legacy" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Arrears"), " ", /*#__PURE__*/React.createElement("span", {
12151
+ className: "mandatory-asterisk"
12152
+ }, "*")), /*#__PURE__*/React.createElement("div", {
12153
+ className: "form-field"
12154
+ }, /*#__PURE__*/React.createElement(Controller, {
12155
+ control: control,
12156
+ name: "arrear",
12157
+ rules: {
12158
+ required: t("RENT_LEASE_ARREAR_REQUIRED")
12159
+ },
12160
+ render: ({
12161
+ value,
12162
+ onChange
12163
+ }) => /*#__PURE__*/React.createElement(TextInput, {
12164
+ type: "number",
12165
+ value: value || "",
12166
+ onChange: e => onChange(e.target.value)
12167
+ })
12168
+ }))), errors.arrear && /*#__PURE__*/React.createElement(CardLabelError, {
12169
+ className: "ral-error-label"
12170
+ }, getErrorMessage("arrear")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("RAL_START_DATE"), " ", watch("arrear") > 0 && /*#__PURE__*/React.createElement("span", {
12171
+ className: "mandatory-asterisk"
12172
+ }, "*")), /*#__PURE__*/React.createElement("div", {
12173
+ className: "form-field"
12174
+ }, /*#__PURE__*/React.createElement(Controller, {
12175
+ control: control,
12176
+ name: "arrearStartDate",
12177
+ rules: {
12178
+ validate: value => {
12179
+ const arrear = watch("arrear");
12180
+ if (arrear > 0 && !value) {
12181
+ return t("RENT_LEASE_RAL_START_DATE_REQUIRED");
12182
+ }
12183
+ return true;
12184
+ }
12185
+ },
12186
+ render: ({
12187
+ value,
12188
+ onChange
12189
+ }) => /*#__PURE__*/React.createElement(TextInput, {
12190
+ type: "date",
12191
+ min: minStartDateISO,
12192
+ value: value || "",
12193
+ onChange: e => {
12194
+ onChange(e);
12195
+ }
12196
+ })
12197
+ }))), errors.arrearStartDate && /*#__PURE__*/React.createElement(CardLabelError, {
12198
+ className: "ral-error-label"
12199
+ }, getErrorMessage("arrearStartDate")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("RAL_END_DATE"), " ", watch("arrear") > 0 && /*#__PURE__*/React.createElement("span", {
12200
+ className: "mandatory-asterisk"
12201
+ }, "*")), /*#__PURE__*/React.createElement("div", {
12202
+ className: "form-field"
12203
+ }, /*#__PURE__*/React.createElement(Controller, {
12204
+ control: control,
12205
+ name: "arrearEndDate",
12206
+ rules: {
12207
+ validate: value => {
12208
+ const arrear = watch("arrear");
12209
+ if (arrear > 0 && !value) {
12210
+ return t("RENT_LEASE_RAL_END_DATE_REQUIRED");
12211
+ }
12212
+ return true;
12213
+ }
12214
+ },
12215
+ render: ({
12216
+ value,
12217
+ onChange
12218
+ }) => {
12219
+ return /*#__PURE__*/React.createElement(TextInput, {
12220
+ type: "date",
12221
+ value: value || "",
12222
+ onChange: e => onChange(e.target.value)
12223
+ });
12224
+ }
12225
+ }))), errors.arrearEndDate && /*#__PURE__*/React.createElement(CardLabelError, {
12226
+ className: "ral-error-label"
12227
+ }, getErrorMessage("arrearEndDate")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12228
+ className: "card-label-smaller"
12229
+ }, t("Reason"), " ", watch("arrear") > 0 && /*#__PURE__*/React.createElement("span", {
12230
+ className: "mandatory-asterisk"
12231
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12232
+ control: control,
12233
+ name: "arrearReason",
12234
+ rules: {
12235
+ validate: value => {
12236
+ const arrear = watch("arrear");
12237
+ if (arrear > 0 && !value) {
12238
+ return t("RENT_LEASE_REASON_REQUIRED");
12239
+ }
12240
+ return true;
12241
+ }
12242
+ },
12243
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12244
+ className: "form-field",
12245
+ select: props.onChange,
12246
+ selected: props.value,
12247
+ option: arrearReasonOptions,
12248
+ defaultValues: true,
12249
+ optionKey: "name",
12250
+ t: t
12251
+ })
12252
+ })), errors.arrearReason && /*#__PURE__*/React.createElement(CardLabelError, {
12253
+ className: "ral-error-label"
12254
+ }, getErrorMessage("arrearReason")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12255
+ className: "card-label-smaller"
12256
+ }, t("Remarks"), " ", watch("arrear") > 0 && /*#__PURE__*/React.createElement("span", {
12257
+ className: "mandatory-asterisk"
12258
+ }, "*")), /*#__PURE__*/React.createElement("div", {
12259
+ className: "form-field"
12260
+ }, /*#__PURE__*/React.createElement(Controller, {
12261
+ control: control,
12262
+ name: "remarks",
12263
+ rules: {
12264
+ validate: value => {
12265
+ const arrear = watch("arrear");
12266
+ if (arrear > 0 && !(value !== null && value !== void 0 && value.trim())) {
12267
+ return t("RENT_LEASE_REMARKS_REQUIRED");
12268
+ }
12269
+ return true;
12270
+ }
12271
+ },
12272
+ render: ({
12273
+ value,
12274
+ onChange
12275
+ }) => /*#__PURE__*/React.createElement(TextInput, {
12276
+ type: "text",
12277
+ value: value || "",
12278
+ onChange: e => onChange(e.target.value),
12279
+ t: t
12280
+ })
12281
+ }))), errors.remarks && /*#__PURE__*/React.createElement(CardLabelError, {
12282
+ className: "ral-error-label"
12283
+ }, getErrorMessage("remarks")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ChallanDocuments, {
12284
+ t: t,
12285
+ config: {
12286
+ key: "documents"
12287
+ },
12288
+ onSelect: handleDocumentsSelect,
12289
+ userType: "CITIZEN",
12290
+ formData: {
12291
+ documents: {
12292
+ documents: documentsData
12293
+ }
12294
+ },
12295
+ setError: setError,
12296
+ error: error,
12297
+ clearErrors: () => {},
12298
+ formState: {},
12299
+ data: docUploadData,
12300
+ isLoading: isLoading
12301
+ }))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
10770
12302
  label: t("Back"),
10771
12303
  className: "ral-back-btn",
10772
12304
  onSubmit: onGoBack
@@ -10857,9 +12389,11 @@ const RentAndLeaseCitizenDetails = ({
10857
12389
  const buildAllotmentPayload = ({
10858
12390
  propertyDetails,
10859
12391
  applicants,
12392
+ additionalDetails,
10860
12393
  tenantId,
10861
12394
  previousApplicationNumber: _previousApplicationNumber = null
10862
12395
  }) => {
12396
+ var _propertyDetails$pena;
10863
12397
  const startDateEpoch = propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.startDate ? new Date(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.startDate).getTime() : null;
10864
12398
  const endDateEpoch = propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.endDate ? new Date(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.endDate).getTime() : null;
10865
12399
  return {
@@ -10868,7 +12402,7 @@ const RentAndLeaseCitizenDetails = ({
10868
12402
  previousApplicationNumber: _previousApplicationNumber,
10869
12403
  startDate: startDateEpoch,
10870
12404
  endDate: endDateEpoch,
10871
- penaltyType: propertyDetails.penaltyType,
12405
+ penaltyType: typeof propertyDetails.penaltyType === "object" ? (_propertyDetails$pena = propertyDetails.penaltyType) === null || _propertyDetails$pena === void 0 ? void 0 : _propertyDetails$pena.code : propertyDetails.penaltyType,
10872
12406
  workflow: {
10873
12407
  action: "INITIATE",
10874
12408
  comments: "",
@@ -10890,11 +12424,14 @@ const RentAndLeaseCitizenDetails = ({
10890
12424
  addressId: a === null || a === void 0 ? void 0 : a.address
10891
12425
  }
10892
12426
  };
10893
- })
12427
+ }),
12428
+ ...(additionalDetails ? {
12429
+ additionalDetails: additionalDetails
12430
+ } : {})
10894
12431
  };
10895
12432
  };
10896
12433
  const onSubmit = async data => {
10897
- var _currentStepData$Crea, _currentStepData$Crea2, _currentStepData$Crea3;
12434
+ var _currentStepData$prop, _currentStepData$prop2, _currentStepData$prop3, _currentStepData$prop4, _currentStepData$prop5, _currentStepData$prop6, _currentStepData$prop7, _currentStepData$prop8, _currentStepData$prop9, _currentStepData$prop0, _currentStepData$prop1, _currentStepData$Crea, _currentStepData$Crea2, _currentStepData$Crea3;
10898
12435
  if (validateStep) {
10899
12436
  var _Object$keys;
10900
12437
  const validationErrors = validateStep(data);
@@ -10906,9 +12443,20 @@ const RentAndLeaseCitizenDetails = ({
10906
12443
  triggerToast(t("RAL_DUPLICATE_MOBILE_ERROR"), true);
10907
12444
  return;
10908
12445
  }
12446
+ const applicationType = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop = currentStepData.propertyDetails) === null || _currentStepData$prop === void 0 ? void 0 : (_currentStepData$prop2 = _currentStepData$prop.applicationType) === null || _currentStepData$prop2 === void 0 ? void 0 : _currentStepData$prop2.code;
12447
+ const additionalDetails = applicationType === "Legacy" ? {
12448
+ arrear: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop3 = currentStepData.propertyDetails) === null || _currentStepData$prop3 === void 0 ? void 0 : _currentStepData$prop3.arrear,
12449
+ arrearDoc: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop4 = currentStepData.propertyDetails) === null || _currentStepData$prop4 === void 0 ? void 0 : _currentStepData$prop4.arrearDoc,
12450
+ arrearEndDate: currentStepData !== null && currentStepData !== void 0 && (_currentStepData$prop5 = currentStepData.propertyDetails) !== null && _currentStepData$prop5 !== void 0 && _currentStepData$prop5.arrearEndDate ? new Date(currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop6 = currentStepData.propertyDetails) === null || _currentStepData$prop6 === void 0 ? void 0 : _currentStepData$prop6.arrearEndDate).getTime() : null,
12451
+ arrearStartDate: currentStepData !== null && currentStepData !== void 0 && (_currentStepData$prop7 = currentStepData.propertyDetails) !== null && _currentStepData$prop7 !== void 0 && _currentStepData$prop7.arrearStartDate ? new Date(currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop8 = currentStepData.propertyDetails) === null || _currentStepData$prop8 === void 0 ? void 0 : _currentStepData$prop8.arrearStartDate).getTime() : null,
12452
+ arrearReason: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop9 = currentStepData.propertyDetails) === null || _currentStepData$prop9 === void 0 ? void 0 : (_currentStepData$prop0 = _currentStepData$prop9.arrearReason) === null || _currentStepData$prop0 === void 0 ? void 0 : _currentStepData$prop0.code,
12453
+ applicationType: applicationType,
12454
+ remarks: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$prop1 = currentStepData.propertyDetails) === null || _currentStepData$prop1 === void 0 ? void 0 : _currentStepData$prop1.remarks
12455
+ } : null;
10909
12456
  const payload = buildAllotmentPayload({
10910
12457
  propertyDetails: currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.propertyDetails,
10911
12458
  applicants: data === null || data === void 0 ? void 0 : data.applicants,
12459
+ additionalDetails,
10912
12460
  tenantId
10913
12461
  });
10914
12462
  const existingPropertyAlloted = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$Crea = currentStepData.CreatedResponse) === null || _currentStepData$Crea === void 0 ? void 0 : (_currentStepData$Crea2 = _currentStepData$Crea.AllotmentDetails) === null || _currentStepData$Crea2 === void 0 ? void 0 : (_currentStepData$Crea3 = _currentStepData$Crea2[0]) === null || _currentStepData$Crea3 === void 0 ? void 0 : _currentStepData$Crea3.applicationNumber;
@@ -11421,7 +12969,7 @@ const NewRentAndLeaseStepFormFour = ({
11421
12969
  } = CreatedResponse || {};
11422
12970
  let formData = {};
11423
12971
  if (id) {
11424
- var _CreatedResponse$Allo, _CreatedResponse$Allo2, _CreatedResponse$Allo3, _CreatedResponse$Allo4, _updatedPropertyDetai, _updatedPropertyDetai2, _updatedPropertyDetai3, _CreatedResponse$Allo5, _CreatedResponse$Allo6, _CreatedResponse$Allo7, _CreatedResponse$Allo8, _CreatedResponse$Allo9, _CreatedResponse$Allo0, _CreatedResponse$Allo1, _CreatedResponse$Allo10, _CreatedResponse$Allo11, _updatedPropertyDetai4;
12972
+ var _CreatedResponse$Allo, _CreatedResponse$Allo2, _CreatedResponse$Allo3, _CreatedResponse$Allo4, _updatedPropertyDetai, _updatedPropertyDetai2, _updatedPropertyDetai3, _updatedPropertyDetai4, _CreatedResponse$Allo5, _CreatedResponse$Allo6, _CreatedResponse$Allo7, _CreatedResponse$Allo8, _CreatedResponse$Allo9, _CreatedResponse$Allo0, _CreatedResponse$Allo1, _updatedPropertyDetai5, _CreatedResponse$Allo10, _CreatedResponse$Allo11, _updatedPropertyDetai6;
11425
12973
  const originalOwners = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo === void 0 ? void 0 : (_CreatedResponse$Allo2 = _CreatedResponse$Allo[0]) === null || _CreatedResponse$Allo2 === void 0 ? void 0 : _CreatedResponse$Allo2.OwnerInfo) || [];
11426
12974
  const updatedApplicants = (updatedApplicantDetails === null || updatedApplicantDetails === void 0 ? void 0 : updatedApplicantDetails.applicants) || [];
11427
12975
  const mergedOwnerInfo = updatedApplicants.map((applicant, index) => {
@@ -11447,22 +12995,33 @@ const NewRentAndLeaseStepFormFour = ({
11447
12995
  });
11448
12996
  const rawAdditionalDetails = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo3 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo3 === void 0 ? void 0 : (_CreatedResponse$Allo4 = _CreatedResponse$Allo3[0]) === null || _CreatedResponse$Allo4 === void 0 ? void 0 : _CreatedResponse$Allo4.additionalDetails) || {};
11449
12997
  const originalAdditionalDetails = Array.isArray(rawAdditionalDetails) ? rawAdditionalDetails[0] : rawAdditionalDetails;
11450
- const mergedAdditionalDetails = {
12998
+ const applicationType = (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai = updatedPropertyDetails.applicationType) === null || _updatedPropertyDetai === void 0 ? void 0 : _updatedPropertyDetai.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.applicationType);
12999
+ const additionalDetails = applicationType === "Legacy" ? {
11451
13000
  ...originalAdditionalDetails,
11452
13001
  ...updatedPropertyDetails,
11453
- allotmentType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai = updatedPropertyDetails.propertyType) === null || _updatedPropertyDetai === void 0 ? void 0 : _updatedPropertyDetai.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.allotmentType),
11454
- propertyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai2 = updatedPropertyDetails.propertySpecific) === null || _updatedPropertyDetai2 === void 0 ? void 0 : _updatedPropertyDetai2.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.propertyType),
11455
- locationType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai3 = updatedPropertyDetails.locationType) === null || _updatedPropertyDetai3 === void 0 ? void 0 : _updatedPropertyDetai3.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.locationType)
11456
- };
13002
+ arrearDoc: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearDoc) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearDoc),
13003
+ arrearStartDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.arrearStartDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearStartDate).getTime() : originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearStartDate,
13004
+ arrearEndDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.arrearEndDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearEndDate).getTime() : originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearEndDate,
13005
+ allotmentType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai2 = updatedPropertyDetails.propertyType) === null || _updatedPropertyDetai2 === void 0 ? void 0 : _updatedPropertyDetai2.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.allotmentType),
13006
+ propertyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai3 = updatedPropertyDetails.propertySpecific) === null || _updatedPropertyDetai3 === void 0 ? void 0 : _updatedPropertyDetai3.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.propertyType),
13007
+ locationType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai4 = updatedPropertyDetails.locationType) === null || _updatedPropertyDetai4 === void 0 ? void 0 : _updatedPropertyDetai4.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.locationType),
13008
+ applicationType: applicationType,
13009
+ securityDeposit: null
13010
+ } : null;
11457
13011
  const allotmentIdForNewDocs = CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo5 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo5 === void 0 ? void 0 : (_CreatedResponse$Allo6 = _CreatedResponse$Allo5[0]) === null || _CreatedResponse$Allo6 === void 0 ? void 0 : _CreatedResponse$Allo6.id;
11458
13012
  formData = {
11459
13013
  ...(CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo7 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo7 === void 0 ? void 0 : _CreatedResponse$Allo7[0]),
11460
13014
  startDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.startDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.startDate).getTime() : CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo8 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo8 === void 0 ? void 0 : (_CreatedResponse$Allo9 = _CreatedResponse$Allo8[0]) === null || _CreatedResponse$Allo9 === void 0 ? void 0 : _CreatedResponse$Allo9.startDate,
11461
13015
  endDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.endDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.endDate).getTime() : CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo0 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo0 === void 0 ? void 0 : (_CreatedResponse$Allo1 = _CreatedResponse$Allo0[0]) === null || _CreatedResponse$Allo1 === void 0 ? void 0 : _CreatedResponse$Allo1.endDate,
11462
- penaltyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) || (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo10 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo10 === void 0 ? void 0 : (_CreatedResponse$Allo11 = _CreatedResponse$Allo10[0]) === null || _CreatedResponse$Allo11 === void 0 ? void 0 : _CreatedResponse$Allo11.penaltyType),
13016
+ penaltyType: typeof (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) === "object" ? updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai5 = updatedPropertyDetails.penaltyType) === null || _updatedPropertyDetai5 === void 0 ? void 0 : _updatedPropertyDetai5.code : (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) || (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo10 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo10 === void 0 ? void 0 : (_CreatedResponse$Allo11 = _CreatedResponse$Allo10[0]) === null || _CreatedResponse$Allo11 === void 0 ? void 0 : _CreatedResponse$Allo11.penaltyType),
11463
13017
  OwnerInfo: mergedOwnerInfo,
11464
- additionalDetails: [mergedAdditionalDetails],
11465
- propertyId: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.propertyId) || (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai4 = updatedPropertyDetails.selectedProperty) === null || _updatedPropertyDetai4 === void 0 ? void 0 : _updatedPropertyDetai4.propertyId),
13018
+ ...(additionalDetails && {
13019
+ additionalDetails: additionalDetails
13020
+ }),
13021
+ propertyId: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.propertyId) || (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai6 = updatedPropertyDetails.selectedProperty) === null || _updatedPropertyDetai6 === void 0 ? void 0 : _updatedPropertyDetai6.propertyId),
13022
+ ...(applicationType === "Legacy" && {
13023
+ securityDeposit: null
13024
+ }),
11466
13025
  Document: updatedDocuments.map(doc => {
11467
13026
  var _ref, _CreatedResponse$Allo12, _CreatedResponse$Allo13;
11468
13027
  const originalDoc = ((_ref = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo12 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo12 === void 0 ? void 0 : (_CreatedResponse$Allo13 = _CreatedResponse$Allo12[0]) === null || _CreatedResponse$Allo13 === void 0 ? void 0 : _CreatedResponse$Allo13.Document) || []) === null || _ref === void 0 ? void 0 : _ref.find(d => d.documentUid === (doc === null || doc === void 0 ? void 0 : doc.documentUid) || d.fileStoreId === (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || d.documentType === (doc === null || doc === void 0 ? void 0 : doc.documentType))) || {};
@@ -11492,7 +13051,7 @@ const NewRentAndLeaseStepFormFour = ({
11492
13051
  }
11493
13052
  };
11494
13053
  } else {
11495
- var _CreatedResponse$Allo14, _CreatedResponse$Allo15, _CreatedResponse$Allo16, _CreatedResponse$Allo17, _updatedPropertyDetai5, _updatedPropertyDetai6, _updatedPropertyDetai7, _CreatedResponse$Allo18, _CreatedResponse$Allo19, _CreatedResponse$Allo20, _CreatedResponse$Allo21, _CreatedResponse$Allo22, _CreatedResponse$Allo23, _CreatedResponse$Allo24, _updatedPropertyDetai8;
13054
+ var _CreatedResponse$Allo14, _CreatedResponse$Allo15, _CreatedResponse$Allo16, _CreatedResponse$Allo17, _updatedPropertyDetai7, _updatedPropertyDetai8, _updatedPropertyDetai9, _updatedPropertyDetai0, _CreatedResponse$Allo18, _CreatedResponse$Allo19, _CreatedResponse$Allo20, _CreatedResponse$Allo21, _CreatedResponse$Allo22, _updatedPropertyDetai1, _CreatedResponse$Allo23, _CreatedResponse$Allo24, _updatedPropertyDetai10;
11496
13055
  const originalOwners = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo14 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo14 === void 0 ? void 0 : (_CreatedResponse$Allo15 = _CreatedResponse$Allo14[0]) === null || _CreatedResponse$Allo15 === void 0 ? void 0 : _CreatedResponse$Allo15.OwnerInfo) || [];
11497
13056
  const updatedApplicants = (updatedApplicantDetails === null || updatedApplicantDetails === void 0 ? void 0 : updatedApplicantDetails.applicants) || [];
11498
13057
  const mergedOwnerInfo = updatedApplicants.map((applicant, index) => {
@@ -11518,21 +13077,28 @@ const NewRentAndLeaseStepFormFour = ({
11518
13077
  });
11519
13078
  const rawAdditionalDetails = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo16 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo16 === void 0 ? void 0 : (_CreatedResponse$Allo17 = _CreatedResponse$Allo16[0]) === null || _CreatedResponse$Allo17 === void 0 ? void 0 : _CreatedResponse$Allo17.additionalDetails) || {};
11520
13079
  const originalAdditionalDetails = Array.isArray(rawAdditionalDetails) ? rawAdditionalDetails[0] : rawAdditionalDetails;
11521
- const mergedAdditionalDetails = {
13080
+ const applicationType = (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai7 = updatedPropertyDetails.applicationType) === null || _updatedPropertyDetai7 === void 0 ? void 0 : _updatedPropertyDetai7.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.applicationType);
13081
+ const additionalDetails = applicationType === "Legacy" ? {
11522
13082
  ...originalAdditionalDetails,
11523
13083
  ...updatedPropertyDetails,
11524
- allotmentType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai5 = updatedPropertyDetails.propertyType) === null || _updatedPropertyDetai5 === void 0 ? void 0 : _updatedPropertyDetai5.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.allotmentType),
11525
- propertyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai6 = updatedPropertyDetails.propertySpecific) === null || _updatedPropertyDetai6 === void 0 ? void 0 : _updatedPropertyDetai6.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.propertyType),
11526
- locationType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai7 = updatedPropertyDetails.locationType) === null || _updatedPropertyDetai7 === void 0 ? void 0 : _updatedPropertyDetai7.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.locationType)
11527
- };
13084
+ arrearDoc: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearDoc) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearDoc),
13085
+ arrearStartDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.arrearStartDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearStartDate).getTime() : originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearStartDate,
13086
+ arrearEndDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.arrearEndDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.arrearEndDate).getTime() : originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.arrearEndDate,
13087
+ allotmentType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai8 = updatedPropertyDetails.propertyType) === null || _updatedPropertyDetai8 === void 0 ? void 0 : _updatedPropertyDetai8.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.allotmentType),
13088
+ propertyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai9 = updatedPropertyDetails.propertySpecific) === null || _updatedPropertyDetai9 === void 0 ? void 0 : _updatedPropertyDetai9.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.propertyType),
13089
+ locationType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai0 = updatedPropertyDetails.locationType) === null || _updatedPropertyDetai0 === void 0 ? void 0 : _updatedPropertyDetai0.code) || (originalAdditionalDetails === null || originalAdditionalDetails === void 0 ? void 0 : originalAdditionalDetails.locationType),
13090
+ applicationType: applicationType
13091
+ } : null;
11528
13092
  formData = {
11529
13093
  ...(CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo18 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo18 === void 0 ? void 0 : _CreatedResponse$Allo18[0]),
11530
13094
  startDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.startDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.startDate).getTime() : CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo19 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo19 === void 0 ? void 0 : (_CreatedResponse$Allo20 = _CreatedResponse$Allo19[0]) === null || _CreatedResponse$Allo20 === void 0 ? void 0 : _CreatedResponse$Allo20.startDate,
11531
13095
  endDate: updatedPropertyDetails !== null && updatedPropertyDetails !== void 0 && updatedPropertyDetails.endDate ? new Date(updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.endDate).getTime() : CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo21 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo21 === void 0 ? void 0 : (_CreatedResponse$Allo22 = _CreatedResponse$Allo21[0]) === null || _CreatedResponse$Allo22 === void 0 ? void 0 : _CreatedResponse$Allo22.endDate,
11532
- penaltyType: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) || (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo23 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo23 === void 0 ? void 0 : (_CreatedResponse$Allo24 = _CreatedResponse$Allo23[0]) === null || _CreatedResponse$Allo24 === void 0 ? void 0 : _CreatedResponse$Allo24.penaltyType),
13096
+ penaltyType: typeof (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) === "object" ? updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai1 = updatedPropertyDetails.penaltyType) === null || _updatedPropertyDetai1 === void 0 ? void 0 : _updatedPropertyDetai1.code : (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.penaltyType) || (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo23 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo23 === void 0 ? void 0 : (_CreatedResponse$Allo24 = _CreatedResponse$Allo23[0]) === null || _CreatedResponse$Allo24 === void 0 ? void 0 : _CreatedResponse$Allo24.penaltyType),
11533
13097
  OwnerInfo: mergedOwnerInfo,
11534
- additionalDetails: [mergedAdditionalDetails],
11535
- propertyId: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.propertyId) || (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai8 = updatedPropertyDetails.selectedProperty) === null || _updatedPropertyDetai8 === void 0 ? void 0 : _updatedPropertyDetai8.propertyId),
13098
+ ...(additionalDetails && {
13099
+ additionalDetails: additionalDetails
13100
+ }),
13101
+ propertyId: (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : updatedPropertyDetails.propertyId) || (updatedPropertyDetails === null || updatedPropertyDetails === void 0 ? void 0 : (_updatedPropertyDetai10 = updatedPropertyDetails.selectedProperty) === null || _updatedPropertyDetai10 === void 0 ? void 0 : _updatedPropertyDetai10.propertyId),
11536
13102
  Document: updatedDocuments.map(doc => {
11537
13103
  var _ref2, _CreatedResponse$Allo25, _CreatedResponse$Allo26;
11538
13104
  const originalDoc = ((_ref2 = (CreatedResponse === null || CreatedResponse === void 0 ? void 0 : (_CreatedResponse$Allo25 = CreatedResponse.AllotmentDetails) === null || _CreatedResponse$Allo25 === void 0 ? void 0 : (_CreatedResponse$Allo26 = _CreatedResponse$Allo25[0]) === null || _CreatedResponse$Allo26 === void 0 ? void 0 : _CreatedResponse$Allo26.Document) || []) === null || _ref2 === void 0 ? void 0 : _ref2.find(d => d.documentUid === (doc === null || doc === void 0 ? void 0 : doc.documentUid) || d.fileStoreId === (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || d.documentType === (doc === null || doc === void 0 ? void 0 : doc.documentType))) || {};
@@ -11861,14 +13427,26 @@ function RentAndLeaseSelectDocument({
11861
13427
  function RentAndLeaseSummary({
11862
13428
  t
11863
13429
  }) {
11864
- var _formData$applicantDe, _formData$applicantDe2, _formData$applicantDe3, _formData$applicantDe4, _formData$documents, _formData$documents$d;
13430
+ var _formData$applicantDe, _formData$applicantDe2, _formData$applicantDe3, _formData$applicantDe4, _formData$documents, _formData$documents$d, _formData$documents2, _property$application2, _property$arrearReaso, _property$arrearReaso2;
11865
13431
  const formData = useSelector(state => {
11866
13432
  var _state$rentAndLease, _state$rentAndLease$R;
11867
13433
  return ((_state$rentAndLease = state.rentAndLease) === null || _state$rentAndLease === void 0 ? void 0 : (_state$rentAndLease$R = _state$rentAndLease.RentAndLeaseNewApplicationFormReducer) === null || _state$rentAndLease$R === void 0 ? void 0 : _state$rentAndLease$R.formData) || {};
11868
13434
  });
11869
13435
  const applicantDetails = Array.isArray(formData === null || formData === void 0 ? void 0 : (_formData$applicantDe = formData.applicantDetails) === null || _formData$applicantDe === void 0 ? void 0 : _formData$applicantDe.applicants) ? (_formData$applicantDe2 = formData.applicantDetails) === null || _formData$applicantDe2 === void 0 ? void 0 : _formData$applicantDe2.applicants : formData !== null && formData !== void 0 && (_formData$applicantDe3 = formData.applicantDetails) !== null && _formData$applicantDe3 !== void 0 && _formData$applicantDe3.applicants ? [(_formData$applicantDe4 = formData.applicantDetails) === null || _formData$applicantDe4 === void 0 ? void 0 : _formData$applicantDe4.applicants] : [];
11870
13436
  const property = (formData === null || formData === void 0 ? void 0 : formData.propertyDetails) || {};
11871
- const docs = (formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : (_formData$documents$d = _formData$documents.documents) === null || _formData$documents$d === void 0 ? void 0 : _formData$documents$d.documents) || [];
13437
+ const standardDocs = (formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : (_formData$documents$d = _formData$documents.documents) === null || _formData$documents$d === void 0 ? void 0 : _formData$documents$d.documents) || [];
13438
+ const arrearDoc = property.arrearDoc ? [{
13439
+ documentType: "Arrear Doc",
13440
+ fileStoreId: property.arrearDoc
13441
+ }] : [];
13442
+ const docs = [...standardDocs, ...arrearDoc];
13443
+ const mergedDocsObject = {
13444
+ ...(formData === null || formData === void 0 ? void 0 : formData.documents),
13445
+ documents: {
13446
+ ...(formData === null || formData === void 0 ? void 0 : (_formData$documents2 = formData.documents) === null || _formData$documents2 === void 0 ? void 0 : _formData$documents2.documents),
13447
+ documents: docs
13448
+ }
13449
+ };
11872
13450
  const renderRow = (label, value) => /*#__PURE__*/React.createElement("div", {
11873
13451
  className: "ral-summary-row"
11874
13452
  }, /*#__PURE__*/React.createElement("div", {
@@ -11886,7 +13464,9 @@ function RentAndLeaseSummary({
11886
13464
  securityDeposit: t("SECURITY_DEPOSIT"),
11887
13465
  tax_applicable: t("GST_APPLICABLE"),
11888
13466
  refundApplicableOnDiscontinuation: t("REFUND_APPLICABLE"),
11889
- penaltyType: t("PENALTY_TYPE")
13467
+ penaltyType: t("PENALTY_TYPE"),
13468
+ startDate: t("RAL_START_DATE"),
13469
+ endDate: t("RAL_END_DATE")
11890
13470
  };
11891
13471
  return /*#__PURE__*/React.createElement("div", {
11892
13472
  className: "application-summary"
@@ -11907,7 +13487,10 @@ function RentAndLeaseSummary({
11907
13487
  className: "ral-summary-header-row"
11908
13488
  }, /*#__PURE__*/React.createElement("h3", {
11909
13489
  className: "ral-summary-heading"
11910
- }, t("Properties Details"))), Object.entries(propertyLabels).map(([key, label]) => {
13490
+ }, t("Properties Details"))), Object.entries(propertyLabels).filter(([key]) => {
13491
+ var _property$application;
13492
+ return (property === null || property === void 0 ? void 0 : (_property$application = property.applicationType) === null || _property$application === void 0 ? void 0 : _property$application.code) !== "Legacy" || key !== "securityDeposit";
13493
+ }).map(([key, label]) => {
11911
13494
  var _property$selectedPro, _value, _value2;
11912
13495
  let value = (property === null || property === void 0 ? void 0 : (_property$selectedPro = property.selectedProperty) === null || _property$selectedPro === void 0 ? void 0 : _property$selectedPro[key]) || (property === null || property === void 0 ? void 0 : property[key]);
11913
13496
  if ((_value = value) !== null && _value !== void 0 && _value.name) value = value.name;else if ((_value2 = value) !== null && _value2 !== void 0 && _value2.code) value = value.code;
@@ -11917,8 +13500,17 @@ function RentAndLeaseSummary({
11917
13500
  if (key === "tax_applicable") {
11918
13501
  value = value === true ? t("YES") : t("NO");
11919
13502
  }
13503
+ if (typeof value === "number" && (key === "startDate" || key === "endDate")) {
13504
+ value = Digit.DateUtils.ConvertEpochToDate(value);
13505
+ }
11920
13506
  return renderRow(label, value || "NA");
11921
- }))), /*#__PURE__*/React.createElement(Card, {
13507
+ }))), (property === null || property === void 0 ? void 0 : (_property$application2 = property.applicationType) === null || _property$application2 === void 0 ? void 0 : _property$application2.code) === "Legacy" && /*#__PURE__*/React.createElement(Card, {
13508
+ className: "summary-section"
13509
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
13510
+ className: "ral-summary-header-row"
13511
+ }, /*#__PURE__*/React.createElement("h3", {
13512
+ className: "ral-summary-heading"
13513
+ }, t("Additional Details"))), renderRow(t("Arrears"), property === null || property === void 0 ? void 0 : property.arrear), (property === null || property === void 0 ? void 0 : property.arrearStartDate) && renderRow(t("RAL_START_DATE"), typeof property.arrearStartDate === "number" ? Digit.DateUtils.ConvertEpochToDate(property.arrearStartDate) : property.arrearStartDate), (property === null || property === void 0 ? void 0 : property.arrearEndDate) && renderRow(t("RAL_END_DATE"), typeof property.arrearEndDate === "number" ? Digit.DateUtils.ConvertEpochToDate(property.arrearEndDate) : property.arrearEndDate), (property === null || property === void 0 ? void 0 : (_property$arrearReaso = property.arrearReason) === null || _property$arrearReaso === void 0 ? void 0 : _property$arrearReaso.name) && renderRow(t("Reason"), property === null || property === void 0 ? void 0 : (_property$arrearReaso2 = property.arrearReason) === null || _property$arrearReaso2 === void 0 ? void 0 : _property$arrearReaso2.name), (property === null || property === void 0 ? void 0 : property.remarks) && renderRow(t("Remarks"), property === null || property === void 0 ? void 0 : property.remarks))), /*#__PURE__*/React.createElement(Card, {
11922
13514
  className: "summary-section"
11923
13515
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
11924
13516
  className: "ral-summary-header-row"
@@ -11930,7 +13522,7 @@ function RentAndLeaseSummary({
11930
13522
  key: index,
11931
13523
  className: "ral-summary-doc-card"
11932
13524
  }, /*#__PURE__*/React.createElement(RALDocuments, {
11933
- value: formData === null || formData === void 0 ? void 0 : formData.documents,
13525
+ value: mergedDocsObject,
11934
13526
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
11935
13527
  index: index
11936
13528
  })))) : /*#__PURE__*/React.createElement("div", null, t("CS_NO_DOCUMENTS_UPLOADED"))))));
@@ -13731,8 +15323,7 @@ const MyProperties = ({
13731
15323
  }, /*#__PURE__*/React.createElement("div", null, header && /*#__PURE__*/React.createElement(Header, {
13732
15324
  className: "ral-my-properties-header"
13733
15325
  }, t(header), " (", totalCount, ")"), getPropertiesData === null || getPropertiesData === void 0 ? void 0 : getPropertiesData.map((property, index) => {
13734
- var _ref, _ref2;
13735
- console.log("property", property);
15326
+ var _ref, _property$additionalD, _property$additionalD2, _property$additionalD3, _ref2, _property$additionalD4, _property$additionalD5, _property$additionalD6;
13736
15327
  return /*#__PURE__*/React.createElement(Card, {
13737
15328
  key: index
13738
15329
  }, (property === null || property === void 0 ? void 0 : property.registrationNumber) && /*#__PURE__*/React.createElement(KeyNote, {
@@ -13743,13 +15334,13 @@ const MyProperties = ({
13743
15334
  note: (property === null || property === void 0 ? void 0 : property.applicationNumber) || t("CS_NA")
13744
15335
  }), /*#__PURE__*/React.createElement(KeyNote, {
13745
15336
  keyValue: t("RAL_ALLOTMENT_TYPE"),
13746
- note: ((_ref = Array.isArray(property === null || property === void 0 ? void 0 : property.additionalDetails) ? property === null || property === void 0 ? void 0 : property.additionalDetails[0] : property === null || property === void 0 ? void 0 : property.additionalDetails) === null || _ref === void 0 ? void 0 : _ref.allotmentType) || t("CS_NA")
15337
+ note: ((_ref = Array.isArray(property === null || property === void 0 ? void 0 : (_property$additionalD = property.additionalDetails) === null || _property$additionalD === void 0 ? void 0 : _property$additionalD.propertyDetails) ? property === null || property === void 0 ? void 0 : (_property$additionalD2 = property.additionalDetails) === null || _property$additionalD2 === void 0 ? void 0 : _property$additionalD2.propertyDetails[0] : property === null || property === void 0 ? void 0 : (_property$additionalD3 = property.additionalDetails) === null || _property$additionalD3 === void 0 ? void 0 : _property$additionalD3.propertyDetails) === null || _ref === void 0 ? void 0 : _ref.allotmentType) || t("CS_NA")
13747
15338
  }), /*#__PURE__*/React.createElement(KeyNote, {
13748
15339
  keyValue: t("STATUS"),
13749
15340
  note: t(property !== null && property !== void 0 && property.expireFlag ? "Renewed" : property.status)
13750
15341
  }), /*#__PURE__*/React.createElement(KeyNote, {
13751
15342
  keyValue: t("RENT_LEASE_PROPERTY_NAME"),
13752
- note: ((_ref2 = Array.isArray(property === null || property === void 0 ? void 0 : property.additionalDetails) ? property === null || property === void 0 ? void 0 : property.additionalDetails[0] : property === null || property === void 0 ? void 0 : property.additionalDetails) === null || _ref2 === void 0 ? void 0 : _ref2.propertyName) || t("CS_NA")
15343
+ note: ((_ref2 = Array.isArray(property === null || property === void 0 ? void 0 : (_property$additionalD4 = property.additionalDetails) === null || _property$additionalD4 === void 0 ? void 0 : _property$additionalD4.propertyDetails) ? property === null || property === void 0 ? void 0 : (_property$additionalD5 = property.additionalDetails) === null || _property$additionalD5 === void 0 ? void 0 : _property$additionalD5.propertyDetails[0] : property === null || property === void 0 ? void 0 : (_property$additionalD6 = property.additionalDetails) === null || _property$additionalD6 === void 0 ? void 0 : _property$additionalD6.propertyDetails) === null || _ref2 === void 0 ? void 0 : _ref2.propertyName) || t("CS_NA")
13753
15344
  }), /*#__PURE__*/React.createElement("div", {
13754
15345
  className: "ral-my-properties-actions"
13755
15346
  }, /*#__PURE__*/React.createElement(Link, {