@mseva/digit-ui-module-ptr 1.3.4-dev.1.1 → 1.3.4-dev.1.2

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.
@@ -7634,11 +7634,46 @@ var propTypes = createCommonjsModule(function (module) {
7634
7634
  const Loader = ({
7635
7635
  page: _page = false
7636
7636
  }) => {
7637
+ const baseStyle = {
7638
+ display: "flex",
7639
+ justifyContent: "center",
7640
+ alignItems: "center"
7641
+ };
7642
+ const pageStyle = {
7643
+ ...baseStyle,
7644
+ position: "fixed",
7645
+ top: 0,
7646
+ left: 0,
7647
+ width: "100vw",
7648
+ height: "100vh",
7649
+ background: "rgba(255,255,255,0.6)",
7650
+ backdropFilter: "blur(4px)",
7651
+ zIndex: 9999
7652
+ };
7653
+ const moduleStyle = {
7654
+ ...baseStyle,
7655
+ minHeight: "100px",
7656
+ width: "100%",
7657
+ position: "relative"
7658
+ };
7659
+ const spinnerStyle = {
7660
+ width: "64px",
7661
+ height: "64px",
7662
+ border: "8px solid #1976d2",
7663
+ borderTop: "8px solid transparent",
7664
+ borderRadius: "50%",
7665
+ animation: "spin 1.2s linear infinite"
7666
+ };
7637
7667
  return /*#__PURE__*/React.createElement("div", {
7638
- className: `chb-loader-container ${_page ? "chb-page-loader-overlay" : "chb-module-loader-container"}`
7668
+ style: _page ? pageStyle : moduleStyle
7639
7669
  }, /*#__PURE__*/React.createElement("div", {
7640
- className: "chb-spinner"
7641
- }));
7670
+ style: spinnerStyle
7671
+ }), /*#__PURE__*/React.createElement("style", null, `
7672
+ @keyframes spin {
7673
+ 0% { transform: rotate(0deg); }
7674
+ 100% { transform: rotate(360deg); }
7675
+ }
7676
+ `));
7642
7677
  };
7643
7678
  Loader.propTypes = {
7644
7679
  page: propTypes.bool
@@ -7961,7 +7996,11 @@ const PTRCitizenPet = ({
7961
7996
  disabled: checkForRenew
7962
7997
  })
7963
7998
  }), errors.petName && /*#__PURE__*/React.createElement("p", {
7964
- className: "chb-error-text"
7999
+ style: {
8000
+ color: "red",
8001
+ marginTop: "4px",
8002
+ marginBottom: "0"
8003
+ }
7965
8004
  }, getErrorMessage("petName")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
7966
8005
  className: "card-label-smaller"
7967
8006
  }, t("PTR_SEARCH_PET_TYPE"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -7980,7 +8019,11 @@ const PTRCitizenPet = ({
7980
8019
  disable: checkForRenew
7981
8020
  })
7982
8021
  }), errors.petType && /*#__PURE__*/React.createElement("p", {
7983
- className: "chb-error-text"
8022
+ style: {
8023
+ color: "red",
8024
+ marginTop: "4px",
8025
+ marginBottom: "0"
8026
+ }
7984
8027
  }, getErrorMessage("petType")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
7985
8028
  className: "card-label-smaller"
7986
8029
  }, t("PTR_SEARCH_BREED_TYPE"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8003,7 +8046,11 @@ const PTRCitizenPet = ({
8003
8046
  });
8004
8047
  }
8005
8048
  }), errors.breedType && /*#__PURE__*/React.createElement("p", {
8006
- className: "chb-error-text"
8049
+ style: {
8050
+ color: "red",
8051
+ marginTop: "4px",
8052
+ marginBottom: "0"
8053
+ }
8007
8054
  }, getErrorMessage("breedType")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8008
8055
  className: "card-label-smaller"
8009
8056
  }, t("PTR_PET_GENDER"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8022,7 +8069,11 @@ const PTRCitizenPet = ({
8022
8069
  disable: checkForRenew
8023
8070
  })
8024
8071
  }), errors.petGender && /*#__PURE__*/React.createElement("p", {
8025
- className: "chb-error-text"
8072
+ style: {
8073
+ color: "red",
8074
+ marginTop: "4px",
8075
+ marginBottom: "0"
8076
+ }
8026
8077
  }, getErrorMessage("petGender")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8027
8078
  className: "card-label-smaller"
8028
8079
  }, `${t("PTR_COLOR")}`, " *"), /*#__PURE__*/React.createElement("div", {
@@ -8053,7 +8104,11 @@ const PTRCitizenPet = ({
8053
8104
  disabled: checkForRenew
8054
8105
  })
8055
8106
  }), errors.petColor && /*#__PURE__*/React.createElement("p", {
8056
- className: "chb-error-text"
8107
+ style: {
8108
+ color: "red",
8109
+ marginTop: "4px",
8110
+ marginBottom: "0"
8111
+ }
8057
8112
  }, getErrorMessage("petColor")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8058
8113
  className: "card-label-smaller"
8059
8114
  }, t("PTR_PET_AGE"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8092,7 +8147,11 @@ const PTRCitizenPet = ({
8092
8147
  disabled: checkForRenew
8093
8148
  })
8094
8149
  }), errors.petAge && /*#__PURE__*/React.createElement("p", {
8095
- className: "chb-error-text"
8150
+ style: {
8151
+ color: "red",
8152
+ marginTop: "4px",
8153
+ marginBottom: "0"
8154
+ }
8096
8155
  }, getErrorMessage("petAge")), /*#__PURE__*/React.createElement("span", {
8097
8156
  style: {
8098
8157
  fontSize: "12px",
@@ -8128,7 +8187,11 @@ const PTRCitizenPet = ({
8128
8187
  t: t
8129
8188
  })
8130
8189
  }), errors.lastVaccineDate && /*#__PURE__*/React.createElement("p", {
8131
- className: "chb-error-text"
8190
+ style: {
8191
+ color: "red",
8192
+ marginTop: "4px",
8193
+ marginBottom: "0"
8194
+ }
8132
8195
  }, getErrorMessage("lastVaccineDate")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8133
8196
  className: "card-label-smaller"
8134
8197
  }, t("PTR_VACCINATION_NUMBER"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8155,7 +8218,11 @@ const PTRCitizenPet = ({
8155
8218
  t: t
8156
8219
  })
8157
8220
  }), errors.vaccinationNumber && /*#__PURE__*/React.createElement("p", {
8158
- className: "chb-error-text"
8221
+ style: {
8222
+ color: "red",
8223
+ marginTop: "4px",
8224
+ marginBottom: "0"
8225
+ }
8159
8226
  }, getErrorMessage("vaccinationNumber")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8160
8227
  className: "card-label-smaller"
8161
8228
  }, t("PTR_DOCTOR_NAME"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8185,7 +8252,11 @@ const PTRCitizenPet = ({
8185
8252
  t: t
8186
8253
  })
8187
8254
  }), errors.doctorName && /*#__PURE__*/React.createElement("p", {
8188
- className: "chb-error-text"
8255
+ style: {
8256
+ color: "red",
8257
+ marginTop: "4px",
8258
+ marginBottom: "0"
8259
+ }
8189
8260
  }, getErrorMessage("doctorName")))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
8190
8261
  className: "card-label-smaller"
8191
8262
  }, t("PTR_CLINIC_NAME"), " *"), /*#__PURE__*/React.createElement("div", {
@@ -8207,7 +8278,11 @@ const PTRCitizenPet = ({
8207
8278
  t: t
8208
8279
  })
8209
8280
  }), errors.clinicName && /*#__PURE__*/React.createElement("p", {
8210
- className: "chb-error-text"
8281
+ style: {
8282
+ color: "red",
8283
+ marginTop: "4px",
8284
+ marginBottom: "0"
8285
+ }
8211
8286
  }, getErrorMessage("clinicName")))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
8212
8287
  label: "Back",
8213
8288
  style: {
@@ -16799,7 +16874,6 @@ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles =
16799
16874
  const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
16800
16875
  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]) || "";
16801
16876
  };
16802
- const pattern = /\[#\?.*?\*\*\]/;
16803
16877
  const timelineRows = timeline.map((item, index) => {
16804
16878
  var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
16805
16879
  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";
@@ -16809,8 +16883,7 @@ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles =
16809
16883
  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";
16810
16884
  const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
16811
16885
  const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
16812
- const rawComment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
16813
- const comment = typeof rawComment === "string" ? rawComment.split(pattern)[0] : rawComment;
16886
+ const comment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
16814
16887
  const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
16815
16888
  const sla = (item === null || item === void 0 ? void 0 : item.sla) || "N/A";
16816
16889
  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(", ") : "";
@@ -17064,13 +17137,13 @@ function NewApplicationTimeline({
17064
17137
  className: "custom-officer-info"
17065
17138
  }, /*#__PURE__*/React.createElement("div", {
17066
17139
  className: "custom-officer-name"
17067
- }, (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", {
17068
- className: "custom-officer-name"
17069
- }, "- ", 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", {
17140
+ }, (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", {
17070
17141
  className: "custom-officer-email"
17071
17142
  }, /*#__PURE__*/React.createElement("span", {
17072
17143
  className: "custom-email-label"
17073
- }, 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", {
17144
+ }, 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", {
17145
+ className: "custom-officer-name"
17146
+ }, 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", {
17074
17147
  className: "custom-card-column custom-card-column-mid"
17075
17148
  }, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
17076
17149
  className: "custom-action-title"
@@ -17092,13 +17165,9 @@ function NewApplicationTimeline({
17092
17165
  className: "custom-comments-title"
17093
17166
  }, t("Officer Comments")), /*#__PURE__*/React.createElement("div", {
17094
17167
  className: "custom-comment-text"
17095
- }, item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => {
17096
- const pattern = /\[#\?.*?\*\*\]/;
17097
- const truncatedComment = typeof comment === "string" ? comment === null || comment === void 0 ? void 0 : comment.split(pattern)[0] : comment;
17098
- return /*#__PURE__*/React.createElement("p", {
17099
- key: idx
17100
- }, truncatedComment);
17101
- }))), (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", {
17168
+ }, 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", {
17169
+ key: idx
17170
+ }, 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", {
17102
17171
  className: "custom-assigned-to-footer"
17103
17172
  }, /*#__PURE__*/React.createElement("h3", {
17104
17173
  className: "custom-comments-title"
@@ -17106,9 +17175,9 @@ function NewApplicationTimeline({
17106
17175
  className: "custom-officer-info"
17107
17176
  }, /*#__PURE__*/React.createElement("div", {
17108
17177
  className: "custom-officer-name"
17109
- }, (_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", {
17178
+ }, (_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", {
17110
17179
  className: "custom-officer-email"
17111
- }, "- ", 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", {
17180
+ }, 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", {
17112
17181
  className: "custom-comments-section-no-border"
17113
17182
  }, /*#__PURE__*/React.createElement("h4", {
17114
17183
  className: "custom-comments-title"
@@ -21172,7 +21241,11 @@ const SearchApplication = ({
21172
21241
  return /*#__PURE__*/React.createElement("form", {
21173
21242
  onSubmit: handleSubmit(onSubmitInput)
21174
21243
  }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
21175
- className: `search-container ads-search-container ${isInboxPage ? 'ads-search-container--inbox' : 'ads-search-container--revert'}`
21244
+ className: "search-container",
21245
+ style: {
21246
+ width: "auto",
21247
+ marginLeft: isInboxPage ? "24px" : "revert"
21248
+ }
21176
21249
  }, /*#__PURE__*/React.createElement("div", {
21177
21250
  className: "search-complaint-container"
21178
21251
  }, (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement("div", {
@@ -21219,7 +21292,14 @@ const SearchApplication = ({
21219
21292
  control: control,
21220
21293
  defaultValue: ""
21221
21294
  }))), formState !== null && formState !== void 0 && (_formState$dirtyField = formState.dirtyFields) !== null && _formState$dirtyField !== void 0 && _formState$dirtyField[input.name] ? /*#__PURE__*/React.createElement("span", {
21222
- className: "inbox-search-form-error ads-search-error"
21295
+ style: {
21296
+ fontWeight: "700",
21297
+ color: "rgba(212, 53, 28)",
21298
+ paddingLeft: "8px",
21299
+ marginTop: "-20px",
21300
+ fontSize: "12px"
21301
+ },
21302
+ className: "inbox-search-form-error"
21223
21303
  }, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$inp = _formState$errors[input.name]) === null || _formState$errors$inp === void 0 ? void 0 : _formState$errors$inp.message) : null);
21224
21304
  }), isInboxPage && /*#__PURE__*/React.createElement("div", {
21225
21305
  className: "search-action-wrapper",
@@ -21417,10 +21497,14 @@ const ApplicationCard = ({
21417
21497
  let result;
21418
21498
  if (!data || (data === null || data === void 0 ? void 0 : data.length) === 0) {
21419
21499
  result = /*#__PURE__*/React.createElement(Card, {
21420
- className: "chb-margin-top-20"
21500
+ style: {
21501
+ marginTop: 20
21502
+ }
21421
21503
  }, t("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((text, index) => /*#__PURE__*/React.createElement("p", {
21422
21504
  key: index,
21423
- className: "text-center"
21505
+ style: {
21506
+ textAlign: "center"
21507
+ }
21424
21508
  }, text)));
21425
21509
  } else if (data && (data === null || data === void 0 ? void 0 : data.length) > 0) {
21426
21510
  result = /*#__PURE__*/React.createElement(DetailsCard, {
@@ -21812,7 +21896,9 @@ const PTRSearchApplication = ({
21812
21896
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("PTR_SEARCH_PET_APPLICATIONS")), /*#__PURE__*/React.createElement(Card, {
21813
21897
  className: "card-search-heading"
21814
21898
  }, /*#__PURE__*/React.createElement("span", {
21815
- className: "cell-text"
21899
+ style: {
21900
+ color: "#505A5F"
21901
+ }
21816
21902
  }, t("Provide at least one parameter to search for an application"))), /*#__PURE__*/React.createElement(SearchForm, {
21817
21903
  onSubmit: onSubmit,
21818
21904
  handleSubmit: handleSubmit
@@ -21873,7 +21959,9 @@ const PTRSearchApplication = ({
21873
21959
  label: t("ES_COMMON_SEARCH"),
21874
21960
  submit: true
21875
21961
  }), /*#__PURE__*/React.createElement("p", {
21876
- className: "link-button-margin",
21962
+ style: {
21963
+ marginTop: "10px"
21964
+ },
21877
21965
  onClick: () => {
21878
21966
  reset({
21879
21967
  applicationNumber: "",
@@ -21892,10 +21980,14 @@ const PTRSearchApplication = ({
21892
21980
  previousPage();
21893
21981
  }
21894
21982
  }, t(`ES_COMMON_CLEAR_ALL`)))), !isLoading && data !== null && data !== void 0 && data.display ? /*#__PURE__*/React.createElement(Card, {
21895
- className: "chb-margin-top-20"
21983
+ style: {
21984
+ marginTop: 20
21985
+ }
21896
21986
  }, t(data.display).split("\\n").map((text, index) => /*#__PURE__*/React.createElement("p", {
21897
21987
  key: index,
21898
- className: "text-align-center"
21988
+ style: {
21989
+ textAlign: "center"
21990
+ }
21899
21991
  }, text))) : !isLoading && data !== "" ? /*#__PURE__*/React.createElement(Table, {
21900
21992
  t: t,
21901
21993
  data: data,
@@ -22071,7 +22163,11 @@ const EmployeeApp = ({
22071
22163
  return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
22072
22164
  className: "ground-container"
22073
22165
  }, !isRes ? /*#__PURE__*/React.createElement("div", {
22074
- className: `${isNewRegistration ? 'ads-registration-row--new' : 'ads-registration-row--existing'}`
22166
+ style: isNewRegistration ? {
22167
+ marginLeft: "12px"
22168
+ } : {
22169
+ marginLeft: "-4px"
22170
+ }
22075
22171
  }, /*#__PURE__*/React.createElement(PETBreadCrumbs, {
22076
22172
  location: location
22077
22173
  })) : null, /*#__PURE__*/React.createElement(PrivateRoute, {
@@ -22670,7 +22766,7 @@ const NewApplication = () => {
22670
22766
  };
22671
22767
 
22672
22768
  const ApplicationDetails = () => {
22673
- var _tenantInfo$city, _tenantInfo$city2, _pet_details$addition, _user$info, _reciept_data$Payment7, _reciept_data$Payment8, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$owner5, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6, _pet_details$petDetai8, _pet_details$petDetai9, _pet_details$petDetai0;
22769
+ var _pet_details$addition, _reciept_data$Payment2, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$owner5, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6, _pet_details$petDetai8, _pet_details$petDetai9, _pet_details$petDetai0;
22674
22770
  const {
22675
22771
  t
22676
22772
  } = useTranslation();
@@ -22682,7 +22778,6 @@ const ApplicationDetails = () => {
22682
22778
  const [showOptions, setShowOptions] = useState(false);
22683
22779
  const [popup, setpopup] = useState(false);
22684
22780
  const [showToast, setShowToast] = useState(null);
22685
- const [approver, setApprover] = useState(null);
22686
22781
  const tenantId = window.localStorage.getItem("Employee.tenant-id");
22687
22782
  const {
22688
22783
  data: storeData
@@ -22705,31 +22800,13 @@ const ApplicationDetails = () => {
22705
22800
  refetchOnMount: "always"
22706
22801
  }
22707
22802
  });
22708
- const tenantInfo = tenants === null || tenants === void 0 ? void 0 : tenants.find(tenant => (tenant === null || tenant === void 0 ? void 0 : tenant.code) === tenantId);
22709
22803
  const [billData, setBillData] = useState(null);
22710
22804
  const PetRegistrationApplications = get_1(data, "PetRegistrationApplications", []);
22711
22805
  const petId = get_1(data, "PetRegistrationApplications[0].applicationNumber", []);
22712
- const ulb = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city = tenantInfo.city) === null || _tenantInfo$city === void 0 ? void 0 : _tenantInfo$city.name;
22713
- const ulbType = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city2 = tenantInfo.city) === null || _tenantInfo$city2 === void 0 ? void 0 : _tenantInfo$city2.ulbType;
22714
22806
  let pet_details = PetRegistrationApplications && PetRegistrationApplications.length > 0 && PetRegistrationApplications[0] || {};
22715
22807
  const application = pet_details;
22716
22808
  sessionStorage.setItem("ptr-pet", JSON.stringify(application));
22717
22809
  const [loading, setLoading] = useState(false);
22718
- const {
22719
- data: approverData,
22720
- isLoading: approverDataLoading
22721
- } = Digit.Hooks.useWorkflowDetails({
22722
- tenantId,
22723
- id: id,
22724
- moduleCode: "ptr"
22725
- });
22726
- useEffect(() => {
22727
- if (!approverDataLoading && approverData) {
22728
- var _approverData$process, _approverData$process2, _approverData$process3;
22729
- const name = approverData === null || approverData === void 0 ? void 0 : (_approverData$process = approverData.processInstances) === null || _approverData$process === void 0 ? void 0 : (_approverData$process2 = _approverData$process[1]) === null || _approverData$process2 === void 0 ? void 0 : (_approverData$process3 = _approverData$process2.assigner) === null || _approverData$process3 === void 0 ? void 0 : _approverData$process3.name;
22730
- setApprover(name);
22731
- }
22732
- }, [approverDataLoading, approverData]);
22733
22810
  const fetchBillData = async () => {
22734
22811
  setLoading(true);
22735
22812
  const result = await Digit.PaymentService.fetchBill(tenantId, {
@@ -22784,580 +22861,13 @@ const ApplicationDetails = () => {
22784
22861
  if (isLoading || auditDataLoading) {
22785
22862
  return /*#__PURE__*/React.createElement(Loader$1, null);
22786
22863
  }
22787
- const printCertificate = async () => {
22788
- const qrDataURL = await browser.toDataURL(window.location.href);
22789
- try {
22790
- var _data$PetRegistration;
22791
- if (!(data !== null && data !== void 0 && (_data$PetRegistration = data.PetRegistrationApplications) !== null && _data$PetRegistration !== void 0 && _data$PetRegistration[0])) {
22792
- throw new Error("Pet registration data is missing");
22793
- }
22794
- const createCertificateHTML = () => {
22795
- var _petData$documents, _petData$petDetails, _petData$owner, _petData$address, _petData$address2, _petData$owner2, _petData$petDetails2, _petData$petDetails3, _petData$petDetails4, _petData$petDetails5, _petData$petDetails6, _petData$petDetails7, _petData$auditDetails, _petData$auditDetails2, _reciept_data$Payment, _reciept_data$Payment2, _reciept_data$Payment3, _reciept_data$Payment4, _reciept_data$Payment5, _reciept_data$Payment6, _petData$owner3, _petData$owner4, _petData$address3, _petData$address4;
22796
- const petData = data.PetRegistrationApplications[0];
22797
- const currentDate = new Date().toLocaleDateString("en-IN", {
22798
- day: "2-digit",
22799
- month: "2-digit",
22800
- year: "numeric"
22801
- });
22802
- const petImage = petData === null || petData === void 0 ? void 0 : (_petData$documents = petData.documents) === null || _petData$documents === void 0 ? void 0 : _petData$documents.find(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === "PET.PETPHOTO");
22803
- const petImageUrl = petImage !== null && petImage !== void 0 && petImage.filestoreId ? `${window.location.origin}/filestore/v1/files/id?tenantId=pb&fileStoreId=${petImage.filestoreId}` : `${window.location.origin}/adorable-golden-retriever.png`;
22804
- const content = `
22805
- <html>
22806
- <head>
22807
- <title>Pet Registration Certificate</title>
22808
- <style>
22809
- @page { margin: 0.5in; }
22810
- body {
22811
- font-family: 'Times New Roman', serif;
22812
- margin: 0;
22813
- font-size: 11px;
22814
- }
22815
- .certificate-container {
22816
- max-width: 800px;
22817
- margin: 0 auto;
22818
- border: 3px solid #000;
22819
- background: white;
22820
- }
22821
- .header {
22822
- display: flex;
22823
- justify-content: space-between;
22824
- align-items: center;
22825
- text-align: center;
22826
- margin-bottom: 5px;
22827
- position: relative;
22828
- }
22829
- .header-value{
22830
- border: none;
22831
- display: flex;
22832
- text-align: center;
22833
- }
22834
- .header-center {
22835
- text-align: center;
22836
- flex: 1;
22837
- padding-right: 80px
22838
- }
22839
- .header-disclaimer {
22840
- text-align: center;
22841
- flex: 1;
22842
- }
22843
- .header-right {
22844
- flex: 0 0 auto;
22845
- }
22846
- .title {
22847
- font-size: 13px;
22848
- font-weight: bold;
22849
- margin: 10px 0;
22850
- }
22851
- .subtitle {
22852
- font-size: 10px;
22853
- color: #666;
22854
- }
22855
- .main-content {
22856
- display: flex;
22857
- gap: 10px;
22858
- margin: 10px 0;
22859
- align-items:flex-start;
22860
- margin-bottom: -13px;
22861
- }
22862
- .details-section {
22863
- }
22864
- .pet-image-section {
22865
- flex-shrink: 0;
22866
- text-align: center;
22867
- order: 2;
22868
- }
22869
- .pet-image {
22870
- width: 100px;
22871
- max-width: 100%;
22872
- aspect-ratio : 1 / 1;
22873
- height: auto;
22874
- border: 2px solid #000;
22875
- object-fit: cover;
22876
- margin-bottom: 10px;
22877
- border-right-width: 2px;
22878
- margin-right: 50px;
22879
- margin-top: 20px;
22880
- display: block;
22881
- }
22882
- .image-label {
22883
- font-size: 12px;
22884
- font-weight: bold;
22885
- text-align: center;
22886
- border-right-width: 30px;
22887
- margin-right: 50px;
22888
- }
22889
- .details-grid {
22890
- display: grid;
22891
- grid-template-columns: 290px 280px;
22892
- overflow: hidden;
22893
- margin: 10px 0;
22894
- margin-left : 40px;
22895
- }
22896
- .detail-row {
22897
- display: grid;
22898
- grid-template-columns: 140px 180px;
22899
- overflow:hidden;
22900
- border: 1px solid black;
22901
- }
22902
- .detail-label {
22903
- font-weight: bold;
22904
- white-space: normal;
22905
- word-break: break-word;
22906
- margin-left: 10px;
22907
- flex-shrink: 1;
22908
- }
22909
- .detail-value {
22910
- padding-bottom: 2px;
22911
- margin-right: 10px;
22912
- }
22913
- .owner-section {
22914
- margin: 5px 40px;
22915
- margin-bottom: 0px;
22916
- display: grid;
22917
- grid-template-columns: 50%;
22918
- }
22919
- .footer-section {
22920
- margin: 0px 40px;
22921
- display: flex;
22922
- justify-content: space-between;
22923
- align-items: anchor-center;
22924
- }
22925
- .signature-area {
22926
- text-align: center;
22927
- min-width: 200px;
22928
- }
22929
- .signature-line {
22930
- border-top: 1px solid #000;
22931
- margin: 10px 0 5px 0;
22932
- }
22933
- .pet-sub {
22934
- font-size: 10px;
22935
- margin: 5px 0;
22936
- color: #666;
22937
- font-weight: bold;
22938
- }
22939
- .terms-section {
22940
- border-top: 2px solid #000;
22941
- padding-top: 5px;
22942
- font-size: 11px;
22943
- margin: 0px 10px;
22944
- }
22945
- .terms-title {
22946
- font-weight: bold;
22947
- margin-bottom: 10px;
22948
- }
22949
- .terms-list {
22950
- margin: 0;
22951
- padding-left: 20px;
22952
- }
22953
- .terms-list li {
22954
- margin-bottom: 2px;
22955
- text-align: left;
22956
- }
22957
- @media print {
22958
- body { background: white !important; }
22959
- }
22960
- @media (max-width: 700px) {
22961
- .main-content {
22962
- flex-wrap: wrap;
22963
- }
22964
- .pet-image {
22965
- width: 100px;
22966
- max-width: 100%;
22967
- height: auto;
22968
- aspect-ratio: 1/1;
22969
- }
22970
- .dis-section{
22971
- font-size: 12px;
22972
- margin: 0px 10px;
22973
- }
22974
- }
22975
- </style>
22976
- </head>
22977
- <body>
22978
- <div class="certificate-container">
22979
- <div class="header">
22980
- <div>
22981
- <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
22982
- style="width: 80px; height: 80px; padding-left: 20px; padding-top: 5px;" />
22983
- </div>
22984
- <div class="header-center">
22985
- <div class="title">${t(ulbType)} ${t(ulb)}</div>
22986
- <div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
22987
- <div class="pet-sub">Pet Registration Certificate</div>
22988
- <div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
22989
- </div>
22990
- <div class="header-right">
22991
- </div>
22992
- </div>
22993
- <span class="header-value">This is to certify that the ${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails = petData.petDetails) === null || _petData$petDetails === void 0 ? void 0 : _petData$petDetails.petType) || "Dog"} kept by Mr./Mrs./Ms. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner = petData.owner) === null || _petData$owner === void 0 ? void 0 : _petData$owner.name) || "Not Specified"} at ${(petData === null || petData === void 0 ? void 0 : (_petData$address = petData.address) === null || _petData$address === void 0 ? void 0 : _petData$address.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address2 = petData.address) === null || _petData$address2 === void 0 ? void 0 : _petData$address2.pincode) || ""} mobile no. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner2 = petData.owner) === null || _petData$owner2 === void 0 ? void 0 : _petData$owner2.mobileNumber) || "Not Specified"} is registered with ${ulbType} ${ulb} as per following details:</span>
22994
- <div class="main-content">
22995
- <div class="details-section">
22996
- <span class="detail-label">Pet Information</span> <br>
22997
- <span class="detail-label">Registration No:</span> <span class="detail-label">${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""}</span>
22998
- <div class="details-grid">
22999
- <div class="detail-row">
23000
- <span class="detail-label">Category</span>
23001
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails2 = petData.petDetails) === null || _petData$petDetails2 === void 0 ? void 0 : _petData$petDetails2.petType) || "Dog"}</span>
23002
- </div>
23003
- <div class="detail-row">
23004
- <span class="detail-label">Breed</span>
23005
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails3 = petData.petDetails) === null || _petData$petDetails3 === void 0 ? void 0 : _petData$petDetails3.breedType) || "Not Specified"}</span>
23006
- </div>
23007
- <div class="detail-row">
23008
- <span class="detail-label">Name of Animal</span>
23009
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails4 = petData.petDetails) === null || _petData$petDetails4 === void 0 ? void 0 : _petData$petDetails4.petName) || "Not Specified"}</span>
23010
- </div>
23011
- <div class="detail-row">
23012
- <span class="detail-label">Gender</span>
23013
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails5 = petData.petDetails) === null || _petData$petDetails5 === void 0 ? void 0 : _petData$petDetails5.petGender) || "Not Specified"}</span>
23014
- </div>
23015
- <div class="detail-row">
23016
- <span class="detail-label">Pet Age</span>
23017
- <span class="detail-value">${formatPetAge(petData === null || petData === void 0 ? void 0 : (_petData$petDetails6 = petData.petDetails) === null || _petData$petDetails6 === void 0 ? void 0 : _petData$petDetails6.petAge, t) || t("CS_NA")}</span>
23018
- </div>
23019
- <div class="detail-row">
23020
- <span class="detail-label">Colour</span>
23021
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails7 = petData.petDetails) === null || _petData$petDetails7 === void 0 ? void 0 : _petData$petDetails7.petColor) || "Not Specified"}</span>
23022
- </div>
23023
- <div class="detail-row">
23024
- <span class="detail-label">Application Number</span>
23025
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Specified"}</span>
23026
- </div>
23027
- <div class="detail-row">
23028
- <span class="detail-label">Token No</span>
23029
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.petToken) || "Not Specified"}</span>
23030
- </div>
23031
- <div class="detail-row">
23032
- <span class="detail-label">Issue Date</span>
23033
- <span class="detail-value">
23034
- ${petData !== null && petData !== void 0 && (_petData$auditDetails = petData.auditDetails) !== null && _petData$auditDetails !== void 0 && _petData$auditDetails.lastModifiedTime ? new Date((_petData$auditDetails2 = petData.auditDetails) === null || _petData$auditDetails2 === void 0 ? void 0 : _petData$auditDetails2.lastModifiedTime).toLocaleDateString("en-GB") : "N/A"}
23035
- </span>
23036
- </div>
23037
-
23038
- <div class="detail-row">
23039
- <span class="detail-label">License Valid Upto</span>
23040
- <span class="detail-value">
23041
- ${petData !== null && petData !== void 0 && petData.validityDate ? new Date(petData.validityDate * 1000).toLocaleDateString("en-GB") : "N/A"}
23042
-
23043
- </span>
23044
- </div>
23045
- <div class="detail-row">
23046
- <span class="detail-label">Amount</span>
23047
- <span class="detail-value">Rs. ${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments) === null || _reciept_data$Payment === void 0 ? void 0 : (_reciept_data$Payment2 = _reciept_data$Payment[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.totalAmountPaid) || "Not Specified"}/-</span>
23048
- </div>
23049
- <div class="detail-row">
23050
- <span class="detail-label">G8/Receipt No</span>
23051
- <span class="detail-value">${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment3 = reciept_data.Payments) === null || _reciept_data$Payment3 === void 0 ? void 0 : (_reciept_data$Payment4 = _reciept_data$Payment3[0]) === null || _reciept_data$Payment4 === void 0 ? void 0 : (_reciept_data$Payment5 = _reciept_data$Payment4.paymentDetails) === null || _reciept_data$Payment5 === void 0 ? void 0 : (_reciept_data$Payment6 = _reciept_data$Payment5[0]) === null || _reciept_data$Payment6 === void 0 ? void 0 : _reciept_data$Payment6.receiptNumber) || "Not Specified"}</span>
23052
- </div>
23053
- </div>
23054
- </div>
23055
-
23056
- <div class="pet-image-section">
23057
- <img
23058
- src="${petImageUrl}"
23059
- alt="Pet Photo"
23060
- class="pet-image"
23061
- onload="console.log('Pet image loaded successfully:', this.src);"
23062
- onerror="console.log('Pet image failed to load:', this.src); console.log('Trying fallback image...'); this.src='/adorable-golden-retriever.png';"
23063
- />
23064
- <div class="image-label">Pet Photo</div>
23065
- <script>
23066
- console.log('Image URL being used:', '${petImageUrl}');
23067
- console.log('Pet image data:', ${JSON.stringify(petImage)});
23068
- </script>
23069
- </div>
23070
- </div>
23071
-
23072
- <span class="detail-label">Owner Information</span>
23073
- <div class="owner-section">
23074
- <div class="detail-row">
23075
- <span class="detail-label">Owner Name</span>
23076
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$owner3 = petData.owner) === null || _petData$owner3 === void 0 ? void 0 : _petData$owner3.name) || "Not Specified"}</span>
23077
- </div>
23078
- <div class="detail-row">
23079
- <span class="detail-label">Father/Spouse Name</span>
23080
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.fatherName) || (petData === null || petData === void 0 ? void 0 : (_petData$owner4 = petData.owner) === null || _petData$owner4 === void 0 ? void 0 : _petData$owner4.fatherOrHusbandName) || "Not Specified"}</span>
23081
- </div>
23082
- <div class="detail-row">
23083
- <span class="detail-label">Address</span>
23084
- <span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$address3 = petData.address) === null || _petData$address3 === void 0 ? void 0 : _petData$address3.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address4 = petData.address) === null || _petData$address4 === void 0 ? void 0 : _petData$address4.pincode) || ""}</span>
23085
- </div>
23086
- </div>
23087
-
23088
- <div class="header">
23089
- <div class="header-left"> </div>
23090
- <div class="header-disclaimer">
23091
- <div class="title">DISCLAIMER</div>
23092
- <div class="dis-section">${t("PET_DISCLAIMER")}</div>
23093
- <div class="header-right"></div>
23094
- </div>
23095
- </div>
23096
-
23097
- <div class="footer-section">
23098
- <div>
23099
- <div>Date:........................</div>
23100
- <div>Place:.......................</div>
23101
- </div>
23102
- <div class="signature-area">
23103
- <div class="detail-label">Approved by</div>
23104
- <span class="detail-value">${approver || "Not Specified"}</span>
23105
- <div class="signature-line"></div>
23106
- <div>Licensing Authority</div>
23107
- <div>${t(ulbType)}</div>
23108
-
23109
- </div>
23110
- </div>
23111
-
23112
- <div class="terms-section">
23113
- <div class="terms-title">${t("TERMS AND CONDITIONS")}</div>
23114
- <div class="terms-title">${t("PET_TERMS_HEADER")}</div>
23115
- <ol class="terms-list">
23116
- <li>${t("PET_TERM1A")} <strong> ${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""} </strong> ${t("PET_TERM1B")} <strong>'https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home'</strong></li>
23117
- <li>${t("PET_NEW_TERM_2")}</li>
23118
- <li>${t("PET_NEW_TERM_3")}</li>
23119
- <li>${t("PET_NEW_TERM_4")}</li>
23120
- <li>${t("PET_NEW_TERM_5")}</li>
23121
- <li>${t("PET_NEW_TERM_6")}</li>
23122
- <li>${t("PET_NEW_TERM_7")}</li>
23123
- <li>${t("PET_NEW_TERM_8")}</li>
23124
- <li>${t("PET_NEW_TERM_9")}</li>
23125
- <li>${t("PET_NEW_TERM_10")}</li>
23126
- <li>${t("PET_NEW_TERM_11")}</li>
23127
- <li>${t("PET_NEW_TERM_12")}</li>
23128
- <li>${t("PET_NEW_TERM_13")}</li>
23129
- <li>${t("PET_NEW_TERM_14")}</li>
23130
- <li>${t("PET_NEW_TERM_15")}</li>
23131
- <li>${t("PET_NEW_TERM_16")}</li>
23132
- </ol>
23133
-
23134
- <div style="text-align: center;">
23135
- <img src="${qrDataURL}" style="width: 100px; height: 100px;" />
23136
- </div>
23137
- </div>
23138
- </div>
23139
- </body>
23140
- </html>
23141
- `;
23142
- const printWindow = window.open("", "_blank");
23143
- printWindow.document.write(content);
23144
- printWindow.document.close();
23145
- printWindow.onload = () => {
23146
- setTimeout(() => {
23147
- printWindow.print();
23148
- printWindow.onafterprint = () => {
23149
- printWindow.close();
23150
- };
23151
- }, 500);
23152
- };
23153
- };
23154
- createCertificateHTML();
23155
- setShowToast({
23156
- key: false,
23157
- label: "PTR_CERTIFICATE_DOWNLOADED_SUCCESSFULLY"
23158
- });
23159
- } catch (error) {
23160
- setShowToast({
23161
- key: true,
23162
- label: `PTR_CERTIFICATE_DOWNLOAD_ERROR: ${error.message}`
23163
- });
23164
- }
23165
- };
23166
- const downloadAcknowledgement = async () => {
23167
- try {
23168
- var _data$PetRegistration2;
23169
- if (!(data !== null && data !== void 0 && (_data$PetRegistration2 = data.PetRegistrationApplications) !== null && _data$PetRegistration2 !== void 0 && _data$PetRegistration2[0])) {
23170
- throw new Error("Pet registration data is missing");
23171
- }
23172
- const createAcknowledgementHTML = () => {
23173
- var _petData$petDetails8, _petData$petDetails9, _petData$petDetails0, _petData$owner5, _petData$owner6, _petData$owner7;
23174
- const petData = data.PetRegistrationApplications[0];
23175
- const ulb = petData === null || petData === void 0 ? void 0 : petData.tenantId.split(".")[1];
23176
- const currentDate = new Date().toLocaleDateString("en-IN", {
23177
- day: "2-digit",
23178
- month: "long",
23179
- year: "numeric"
23180
- });
23181
- const content = `
23182
- <html>
23183
- <head>
23184
- <title>Pet Registration Acknowledgement</title>
23185
- <style>
23186
- @page { margin: 0.5in; }
23187
- body {
23188
- font-family: 'Arial', sans-serif;
23189
- margin: 0;
23190
- padding: 20px;
23191
- font-size: 14px;
23192
- line-height: 1.6;
23193
- }
23194
- .acknowledgement-container {
23195
- max-width: 800px;
23196
- margin: 0 auto;
23197
- border: 2px solid #333;
23198
- padding: 30px;
23199
- background: white;
23200
- }
23201
- .header {
23202
- text-align: center;
23203
- border-bottom: 2px solid #333;
23204
- display: flex;
23205
- justify-content: space-between;
23206
- align-items: center;
23207
- position: relative;
23208
- }
23209
- .header-center {
23210
- text-align: center;
23211
- flex: 1;
23212
- padding-right: 80px
23213
- }
23214
- .header-right {
23215
- flex: 0 0 auto;
23216
- }
23217
- .title {
23218
- font-size: 20px;
23219
- font-weight: bold;
23220
- margin: 10px 0;
23221
- color: #333;
23222
- }
23223
- .subtitle {
23224
- font-size: 16px;
23225
- margin: 5px 0;
23226
- color: #666;
23227
- }
23228
- .pet-sub {
23229
- font-size: 16px;
23230
- margin: 5px 0;
23231
- color: #666;
23232
- font-weight: bold;
23233
- }
23234
- .acknowledgement-text {
23235
- text-align: justify;
23236
- font-size: 15px;
23237
- }
23238
- .details-table {
23239
- width: 100%;
23240
- border-collapse: collapse;
23241
- }
23242
- .details-table th,
23243
- .details-table td {
23244
- padding: 12px;
23245
- text-align: left;
23246
- border: 1px solid #ddd;
23247
- }
23248
- .details-table th {
23249
- background: #f5f5f5;
23250
- font-weight: bold;
23251
- width: 40%;
23252
- }
23253
- .footer {
23254
- text-align: center;
23255
- font-size: 12px;
23256
- color: #666;
23257
- }
23258
- @media print {
23259
- body { background: white !important; }
23260
- }
23261
- </style>
23262
- </head>
23263
- <body>
23264
- <div class="acknowledgement-container">
23265
- <div class="header">
23266
- <div>
23267
- <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
23268
- style="width: 110px; height: 110px; padding-left: 20px; padding-bottom: 20px;" />
23269
- </div>
23270
- <div class="header-center">
23271
- <div class="title">${t(ulbType)} ${t(ulb)}</div>
23272
- <div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
23273
- <div class="pet-sub">Pet Registration Acknowledgment</div>
23274
- <div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
23275
- </div>
23276
- <div class="header-right">
23277
- </div>
23278
- </div>
23279
-
23280
- <div class="acknowledgement-text">
23281
- ${t("PTR_ACKN_TERM_1")}
23282
- </div>
23283
-
23284
- <table class="details-table">
23285
- <tr>
23286
- <th>Application Number</th>
23287
- <td>${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Available"}</td>
23288
- </tr>
23289
- <tr>
23290
- <th>Application Date</th>
23291
- <td>${currentDate}</td>
23292
- </tr>
23293
- <tr>
23294
- <th>Pet Name</th>
23295
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails8 = petData.petDetails) === null || _petData$petDetails8 === void 0 ? void 0 : _petData$petDetails8.petName) || "Not Specified"}</td>
23296
- </tr>
23297
- <tr>
23298
- <th>Pet Type</th>
23299
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails9 = petData.petDetails) === null || _petData$petDetails9 === void 0 ? void 0 : _petData$petDetails9.petType) || "Not Specified"}</td>
23300
- </tr>
23301
- <tr>
23302
- <th>Breed</th>
23303
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails0 = petData.petDetails) === null || _petData$petDetails0 === void 0 ? void 0 : _petData$petDetails0.breedType) || "Not Specified"}</td>
23304
- </tr>
23305
- <tr>
23306
- <th>Owner Name</th>
23307
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner5 = petData.owner) === null || _petData$owner5 === void 0 ? void 0 : _petData$owner5.name) || "Not Specified"}</td>
23308
- </tr>
23309
- <tr>
23310
- <th>Contact Number</th>
23311
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner6 = petData.owner) === null || _petData$owner6 === void 0 ? void 0 : _petData$owner6.mobileNumber) || "Not Specified"}</td>
23312
- </tr>
23313
- <tr>
23314
- <th>Email</th>
23315
- <td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner7 = petData.owner) === null || _petData$owner7 === void 0 ? void 0 : _petData$owner7.emailId) || "Not Specified"}</td>
23316
- </tr>
23317
- <tr>
23318
- <th>Application Status</th>
23319
- <td style="color: #28a745; font-weight: bold;">${t(petData === null || petData === void 0 ? void 0 : petData.status) || "SUBMITTED"}</td>
23320
- </tr>
23321
- </table>
23322
-
23323
- <div class="acknowledgement-text">
23324
- ${t("PTR_ACKN_TERM_2")}
23325
- </div>
23326
-
23327
-
23328
- <div class="footer">
23329
- <p>Generated on: ${currentDate}</p>
23330
- <p>${t(ulbType)}</p>
23331
- <p>This is a computer-generated document and does not require a signature.</p>
23332
- <p>https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home</p>
23333
- </div>
23334
- </div>
23335
- </body>
23336
- </html>
23337
- `;
23338
- const printWindow = window.open("", "_blank");
23339
- printWindow.document.write(content);
23340
- printWindow.document.close();
23341
- printWindow.onload = () => {
23342
- setTimeout(() => {
23343
- printWindow.print();
23344
- printWindow.onafterprint = () => {
23345
- printWindow.close();
23346
- };
23347
- }, 500);
23348
- };
23349
- };
23350
- createAcknowledgementHTML();
23351
- setShowToast({
23352
- key: false,
23353
- label: "PTR_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"
23354
- });
23355
- } catch (error) {
23356
- setShowToast({
23357
- key: true,
23358
- label: `PTR_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: ${error.message}`
23359
- });
23360
- }
22864
+ const getAcknowledgementData = async () => {
22865
+ const applications = application || {};
22866
+ const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
22867
+ const acknowldgementDataAPI = await getPetAcknowledgementData({
22868
+ ...applications
22869
+ }, tenantInfo, t);
22870
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
23361
22871
  };
23362
22872
  let documentDate = t("CS_NA");
23363
22873
  if (pet_details !== null && pet_details !== void 0 && (_pet_details$addition = pet_details.additionalDetails) !== null && _pet_details$addition !== void 0 && _pet_details$addition.documentDate) {
@@ -23385,36 +22895,35 @@ const ApplicationDetails = () => {
23385
22895
  });
23386
22896
  window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
23387
22897
  }
22898
+ const printCertificate = async () => {
22899
+ var _data$PetRegistration;
22900
+ let response = await Digit.PaymentService.generatePdf(tenantId, {
22901
+ PetRegistrationApplications: [data === null || data === void 0 ? void 0 : (_data$PetRegistration = data.PetRegistrationApplications) === null || _data$PetRegistration === void 0 ? void 0 : _data$PetRegistration[0]]
22902
+ }, "petservicecertificate");
22903
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
22904
+ fileStoreIds: response.filestoreIds[0]
22905
+ });
22906
+ window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
22907
+ };
23388
22908
  let dowloadOptions = [];
23389
- let user = Digit.UserService.getUser();
23390
- const isCemp = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.roles.filter(role => role.code === "CEMP");
23391
22909
  dowloadOptions.push({
23392
22910
  label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
23393
- onClick: () => downloadAcknowledgement()
22911
+ onClick: () => getAcknowledgementData()
22912
+ });
22913
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && recieptDataLoading == false) dowloadOptions.push({
22914
+ label: t("PTR_FEE_RECIEPT"),
22915
+ onClick: () => {
22916
+ var _reciept_data$Payment;
22917
+ return getRecieptSearch({
22918
+ 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,
22919
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
22920
+ });
22921
+ }
22922
+ });
22923
+ if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment2 = reciept_data.Payments[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.paymentStatus) === "DEPOSITED") dowloadOptions.push({
22924
+ label: t("PTR_CERTIFICATE"),
22925
+ onClick: () => printCertificate()
23394
22926
  });
23395
- if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment7 = reciept_data.Payments[0]) === null || _reciept_data$Payment7 === void 0 ? void 0 : _reciept_data$Payment7.paymentStatus) === "NEW" || (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment8 = reciept_data.Payments[0]) === null || _reciept_data$Payment8 === void 0 ? void 0 : _reciept_data$Payment8.paymentStatus) === "DEPOSITED") {
23396
- dowloadOptions.push({
23397
- label: t("PTR_CERTIFICATE"),
23398
- onClick: () => {
23399
- printCertificate();
23400
- }
23401
- });
23402
- } else {
23403
- var _reciept_data$Payment9;
23404
- console.log("Certificate not available. Payment status:", reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment9 = reciept_data.Payments[0]) === null || _reciept_data$Payment9 === void 0 ? void 0 : _reciept_data$Payment9.paymentStatus);
23405
- }
23406
- if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
23407
- dowloadOptions.push({
23408
- label: t("PTR_FEE_RECIEPT"),
23409
- onClick: () => {
23410
- var _reciept_data$Payment0;
23411
- return getRecieptSearch({
23412
- tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment0 = reciept_data.Payments[0]) === null || _reciept_data$Payment0 === void 0 ? void 0 : _reciept_data$Payment0.tenantId,
23413
- payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23414
- });
23415
- }
23416
- });
23417
- }
23418
22927
  const formatPetAge = (ageValue, t) => {
23419
22928
  if (ageValue === null || ageValue === undefined || ageValue === "") return t("CS_NA");
23420
22929
  const ageStr = String(ageValue).trim();
@@ -23442,16 +22951,7 @@ const ApplicationDetails = () => {
23442
22951
  marginRight: "auto",
23443
22952
  maxWidth: "960px"
23444
22953
  }
23445
- }, /*#__PURE__*/React.createElement(Header, {
23446
- styles: {
23447
- fontSize: "32px"
23448
- }
23449
- }, t("CS_APPLICATION_DETAILS")), isCemp && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
23450
- className: "multilinkWrapper",
23451
- onHeadClick: () => setShowOptions(!showOptions),
23452
- displayOptions: showOptions,
23453
- options: dowloadOptions
23454
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
22954
+ }), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
23455
22955
  style: {
23456
22956
  fontSize: "24px"
23457
22957
  }
@@ -24958,14 +24458,67 @@ function PTRSummary({
24958
24458
  console.log("pet", pet);
24959
24459
  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) || [];
24960
24460
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
24461
+ const sectionStyle = {
24462
+ backgroundColor: "#ffffff",
24463
+ padding: "1rem 0",
24464
+ borderRadius: "8px",
24465
+ marginBottom: "1.5rem",
24466
+ boxShadow: "0 2px 6px rgba(18,38,63,0.04)"
24467
+ };
24468
+ const headerRow = {
24469
+ display: "flex",
24470
+ justifyContent: "space-between",
24471
+ alignItems: "center",
24472
+ marginBottom: "0.75rem",
24473
+ padding: "0 1.5rem"
24474
+ };
24475
+ const headingStyle = {
24476
+ fontSize: "1.25rem",
24477
+ color: "#2e4a66",
24478
+ margin: 0
24479
+ };
24480
+ const labelFieldPairStyle = {
24481
+ display: "flex",
24482
+ justifyContent: "space-between",
24483
+ borderBottom: "1px dashed #e9eef2",
24484
+ padding: "0.6rem 1.5rem",
24485
+ alignItems: "center"
24486
+ };
24487
+ const documentsContainerStyle = {
24488
+ display: "flex",
24489
+ flexWrap: "wrap",
24490
+ gap: "1rem",
24491
+ marginTop: "0.5rem"
24492
+ };
24493
+ const documentCardStyle = {
24494
+ flex: "1 1 220px",
24495
+ minWidth: "180px",
24496
+ maxWidth: "260px",
24497
+ backgroundColor: "#fbfcfe",
24498
+ padding: "0.6rem",
24499
+ border: "1px solid #eef3f7",
24500
+ borderRadius: "6px"
24501
+ };
24502
+ const boldLabelStyle = {
24503
+ fontWeight: "600",
24504
+ color: "#333",
24505
+ marginBottom: "0px"
24506
+ };
24961
24507
  const renderRow = (label, value) => /*#__PURE__*/React.createElement("div", {
24962
- className: "bpa-summary-label-field-pair"
24508
+ style: labelFieldPairStyle
24963
24509
  }, /*#__PURE__*/React.createElement("div", {
24964
- className: "ads-summary-row-label"
24510
+ style: {
24511
+ display: "flex",
24512
+ gap: "0.5rem",
24513
+ alignItems: "center"
24514
+ }
24965
24515
  }, /*#__PURE__*/React.createElement(CardLabel, {
24966
- className: "bpa-summary-bold-label"
24516
+ style: boldLabelStyle
24967
24517
  }, label)), /*#__PURE__*/React.createElement("div", {
24968
- className: "ads-summary-row-value"
24518
+ style: {
24519
+ textAlign: "right",
24520
+ minWidth: "120px"
24521
+ }
24969
24522
  }, value || "NA"));
24970
24523
  const formatPetAge = (ageValue, t) => {
24971
24524
  if (ageValue === null || ageValue === undefined || ageValue === "") return t("CS_NA");
@@ -24989,41 +24542,41 @@ function PTRSummary({
24989
24542
  return `${years} year${years > 1 ? "s" : ""} and ${months} month${months > 1 ? "s" : ""}`;
24990
24543
  };
24991
24544
  return /*#__PURE__*/React.createElement("div", {
24992
- className: "bpa-summary-page"
24545
+ className: "application-summary"
24993
24546
  }, /*#__PURE__*/React.createElement("div", {
24994
24547
  className: "summary-section",
24995
24548
  style: {
24996
24549
  padding: "2px"
24997
24550
  }
24998
24551
  }, /*#__PURE__*/React.createElement("div", {
24999
- className: "bpa-summary-section"
24552
+ style: sectionStyle
25000
24553
  }, /*#__PURE__*/React.createElement("div", {
25001
- className: "ads-summary-row"
24554
+ style: headerRow
25002
24555
  }, /*#__PURE__*/React.createElement("h3", {
25003
- className: "bpa-summary-heading"
24556
+ style: headingStyle
25004
24557
  }, t("ES_TITILE_OWNER_DETAILS"))), renderRow(t("NOC_COMMON_TABLE_COL_OWN_NAME_LABEL"), owner === null || owner === void 0 ? void 0 : owner.name), renderRow(t("PT_ACK_LOCALIZATION_FATHERS_NAME"), owner === null || owner === void 0 ? void 0 : owner.fatherOrHusbandName), renderRow(t("CORE_COMMON_MOBILE_NUMBER"), owner === null || owner === void 0 ? void 0 : owner.mobileNumber), renderRow(t("CORE_COMMON_EMAIL_ID"), owner === null || owner === void 0 ? void 0 : owner.emailId), renderRow(t("ADDRESS"), owner === null || owner === void 0 ? void 0 : owner.address))), /*#__PURE__*/React.createElement("div", {
25005
24558
  className: "summary-section"
25006
24559
  }, /*#__PURE__*/React.createElement("div", {
25007
- className: "bpa-summary-section"
24560
+ style: sectionStyle
25008
24561
  }, /*#__PURE__*/React.createElement("div", {
25009
- className: "ads-summary-row"
24562
+ style: headerRow
25010
24563
  }, /*#__PURE__*/React.createElement("h3", {
25011
- className: "bpa-summary-heading"
24564
+ style: headingStyle
25012
24565
  }, t("ES_TITILE_PET_DETAILS"))), renderRow(t("PTR_PET_NAME"), pet === null || pet === void 0 ? void 0 : pet.petName), renderRow(t("PTR_PET_TYPE"), (pet === null || pet === void 0 ? void 0 : (_pet$petType = pet.petType) === null || _pet$petType === void 0 ? void 0 : _pet$petType.name) || (pet === null || pet === void 0 ? void 0 : (_pet$petType2 = pet.petType) === null || _pet$petType2 === void 0 ? void 0 : _pet$petType2.code)), renderRow(t("PTR_BREED_TYPE"), (pet === null || pet === void 0 ? void 0 : (_pet$breedType = pet.breedType) === null || _pet$breedType === void 0 ? void 0 : _pet$breedType.name) || (pet === null || pet === void 0 ? void 0 : (_pet$breedType2 = pet.breedType) === null || _pet$breedType2 === void 0 ? void 0 : _pet$breedType2.code)), renderRow(t("PTR_PET_GENDER"), (pet === null || pet === void 0 ? void 0 : (_pet$petGender = pet.petGender) === null || _pet$petGender === void 0 ? void 0 : _pet$petGender.name) || (pet === null || pet === void 0 ? void 0 : (_pet$petGender2 = pet.petGender) === null || _pet$petGender2 === void 0 ? void 0 : _pet$petGender2.code)), renderRow(t("PTR_PET_AGE"), formatPetAge(pet === null || pet === void 0 ? void 0 : pet.petAge, t)), renderRow(t("PTR_COLOR"), pet === null || pet === void 0 ? void 0 : pet.petColor), renderRow(t("PTR_VACCINATION_NUMBER"), pet === null || pet === void 0 ? void 0 : pet.vaccinationNumber), renderRow(t("PTR_VACCINATION_DATE"), pet === null || pet === void 0 ? void 0 : pet.lastVaccineDate), renderRow(t("PTR_CLINIC_NAME"), pet === null || pet === void 0 ? void 0 : pet.clinicName), renderRow(t("PTR_DOCTOR_NAME"), pet === null || pet === void 0 ? void 0 : pet.doctorName))), /*#__PURE__*/React.createElement("div", {
25013
24566
  className: "summary-section"
25014
24567
  }, /*#__PURE__*/React.createElement("div", {
25015
- className: "bpa-summary-section"
24568
+ style: sectionStyle
25016
24569
  }, /*#__PURE__*/React.createElement("div", {
25017
- className: "ads-summary-row"
24570
+ style: headerRow
25018
24571
  }, /*#__PURE__*/React.createElement("h3", {
25019
- className: "bpa-summary-heading"
24572
+ style: headingStyle
25020
24573
  }, t("ES_TITLE_DOCS"))), /*#__PURE__*/React.createElement("div", null, Array.isArray(docs) && docs.length > 0 ? /*#__PURE__*/React.createElement("div", {
25021
- className: "ads-summary-docs"
24574
+ style: documentsContainerStyle
25022
24575
  }, docs.map((doc, index) => {
25023
24576
  var _formData$CreatedResp;
25024
24577
  return /*#__PURE__*/React.createElement("div", {
25025
24578
  key: index,
25026
- className: "ads-summary-doc-card"
24579
+ style: documentCardStyle
25027
24580
  }, /*#__PURE__*/React.createElement(PTRDocument, {
25028
24581
  petdetail: {
25029
24582
  documents: [doc],