@argusoft/medplat-form-engine 1.0.8 → 1.0.10

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.
Files changed (119) hide show
  1. package/dist/AccessRights-sgIhYR30-DWNCTLI6.js +1238 -0
  2. package/dist/AccessRights-sgIhYR30-DWNCTLI6.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js +289 -0
  4. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js.map +1 -0
  5. package/dist/AddEditQueryBuilder-BaZxS2Cm.css +1 -0
  6. package/dist/AddFeatures-BxXCC6ex-1VYoA24R.js +212 -0
  7. package/dist/AddFeatures-BxXCC6ex-1VYoA24R.js.map +1 -0
  8. package/dist/AddLabelModal-DE3ploGD-DWF1SOUp.js +734 -0
  9. package/dist/AddLabelModal-DE3ploGD-DWF1SOUp.js.map +1 -0
  10. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js +5389 -0
  11. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js.map +1 -0
  12. package/dist/AddMenuConfiguration-QWfpcnuP.css +1 -0
  13. package/dist/AddRoleDrawer-ZK1eejxI-ldfhQqA_.js +453 -0
  14. package/dist/AddRoleDrawer-ZK1eejxI-ldfhQqA_.js.map +1 -0
  15. package/dist/AppModal-BgZyfrd--CNvWjWhL.js +428 -0
  16. package/dist/AppModal-BgZyfrd--CNvWjWhL.js.map +1 -0
  17. package/dist/ChangePasswordModal-MV7g8tkA-BDA1Pw0i.js +176 -0
  18. package/dist/ChangePasswordModal-MV7g8tkA-BDA1Pw0i.js.map +1 -0
  19. package/dist/ConditionConfig-GDCXIg3C-XbR1fp6h.js +395 -0
  20. package/dist/ConditionConfig-GDCXIg3C-XbR1fp6h.js.map +1 -0
  21. package/dist/ConditionConfig-GDCXIg3C.css +1 -0
  22. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js +50 -0
  23. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js.map +1 -0
  24. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js +384 -0
  25. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js.map +1 -0
  26. package/dist/EventConfigurations-jGCJ4LqP.css +1 -0
  27. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js +200 -0
  28. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js.map +1 -0
  29. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js +74 -0
  30. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js.map +1 -0
  31. package/dist/FeatureMenu-BYSRoNm0-D2Ak-EDd.js +249 -0
  32. package/dist/FeatureMenu-BYSRoNm0-D2Ak-EDd.js.map +1 -0
  33. package/dist/Features-CKMmuqcs-ClXAzWGV.js +11 -0
  34. package/dist/Features-CKMmuqcs-ClXAzWGV.js.map +1 -0
  35. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js +169 -0
  36. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js.map +1 -0
  37. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-CSPs9x_q.js +5162 -0
  38. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-CSPs9x_q.js.map +1 -0
  39. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.css +1 -0
  40. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js +335 -0
  41. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js.map +1 -0
  42. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js +186 -0
  43. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js.map +1 -0
  44. package/dist/LanguagesModal-rk6IGQwY-Cxw9xctN.js +394 -0
  45. package/dist/LanguagesModal-rk6IGQwY-Cxw9xctN.js.map +1 -0
  46. package/dist/ManageDynamicFeature-CeeqiS3K-D2Se68tC.js +4189 -0
  47. package/dist/ManageDynamicFeature-CeeqiS3K-D2Se68tC.js.map +1 -0
  48. package/dist/ManageEventConfiguration-BJxS2Su0-yd2dUxgz.js +1017 -0
  49. package/dist/ManageEventConfiguration-BJxS2Su0-yd2dUxgz.js.map +1 -0
  50. package/dist/ManageEventConfiguration-BJxS2Su0.css +1 -0
  51. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js +6819 -0
  52. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js.map +1 -0
  53. package/dist/ManageRole-ByqBmjuc-CApL3DJy.js +699 -0
  54. package/dist/ManageRole-ByqBmjuc-CApL3DJy.js.map +1 -0
  55. package/dist/ManageTranslation-BTxvSYKb-CwT975cy.js +616 -0
  56. package/dist/ManageTranslation-BTxvSYKb-CwT975cy.js.map +1 -0
  57. package/dist/ManageTranslation-BTxvSYKb.css +1 -0
  58. package/dist/ManageUser-PHiTNyF8-Bddmh2CC.js +2160 -0
  59. package/dist/ManageUser-PHiTNyF8-Bddmh2CC.js.map +1 -0
  60. package/dist/ManageUser-PHiTNyF8.css +1 -0
  61. package/dist/{MedplatFormWrapper-YzMB3zpp.js → MedplatFormWrapper-DbdQUpEu.js} +13624 -13168
  62. package/dist/MedplatFormWrapper-DbdQUpEu.js.map +1 -0
  63. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js +108 -0
  64. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js.map +1 -0
  65. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Wd3d3SEP.js +782 -0
  66. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Wd3d3SEP.js.map +1 -0
  67. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js +1002 -0
  68. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js.map +1 -0
  69. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js +244 -0
  70. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js.map +1 -0
  71. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js +400 -0
  72. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js.map +1 -0
  73. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-tpC-SI0P.js +1952 -0
  74. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-tpC-SI0P.js.map +1 -0
  75. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js +378 -0
  76. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js.map +1 -0
  77. package/dist/QueryBuilder-Cus_mRwZ.css +1 -0
  78. package/dist/QueryManagement-DXA73N2j-Wlk7hKP3.js +671 -0
  79. package/dist/QueryManagement-DXA73N2j-Wlk7hKP3.js.map +1 -0
  80. package/dist/QueryManagement-DXA73N2j.css +1 -0
  81. package/dist/RoleManagement-CLaEJ90J-BW0tG5t9.js +410 -0
  82. package/dist/RoleManagement-CLaEJ90J-BW0tG5t9.js.map +1 -0
  83. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js +869 -0
  84. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js.map +1 -0
  85. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js +130 -0
  86. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js.map +1 -0
  87. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js +259 -0
  88. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js.map +1 -0
  89. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js +190 -0
  90. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js.map +1 -0
  91. package/dist/SubMenu-BHcSNSUF-d-_yEXeN.js +187 -0
  92. package/dist/SubMenu-BHcSNSUF-d-_yEXeN.js.map +1 -0
  93. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js +1508 -0
  94. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js.map +1 -0
  95. package/dist/TableList-B9hr05Hs-BIsMbnIV.js +428 -0
  96. package/dist/TableList-B9hr05Hs-BIsMbnIV.js.map +1 -0
  97. package/dist/TypeConfiguration-C-lk8Szs-DKu6I5Im.js +116 -0
  98. package/dist/TypeConfiguration-C-lk8Szs-DKu6I5Im.js.map +1 -0
  99. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js +13039 -0
  100. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js.map +1 -0
  101. package/dist/UserList-BxB1tCwM.css +1 -0
  102. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js +184 -0
  103. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js.map +1 -0
  104. package/dist/WidgetList-BSApErov-CBYLh0Oh.js +188 -0
  105. package/dist/WidgetList-BSApErov-CBYLh0Oh.js.map +1 -0
  106. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js +29 -0
  107. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js.map +1 -0
  108. package/dist/i18next-CTOWN_jH-BKKbdDel.js +1389 -0
  109. package/dist/i18next-CTOWN_jH-BKKbdDel.js.map +1 -0
  110. package/dist/index-B4r0wjBD.js +563 -0
  111. package/dist/index-B4r0wjBD.js.map +1 -0
  112. package/dist/{index-CBsXn92s.js → index-CdFr9tGu.js} +107 -107
  113. package/dist/{index-CBsXn92s.js.map → index-CdFr9tGu.js.map} +1 -1
  114. package/dist/index.js +1 -1
  115. package/dist/manageImmunization-B4swS745-JldexHrO.js +1204 -0
  116. package/dist/manageImmunization-B4swS745-JldexHrO.js.map +1 -0
  117. package/dist/manageImmunization-B4swS745.css +1 -0
  118. package/package.json +1 -1
  119. package/dist/MedplatFormWrapper-YzMB3zpp.js.map +0 -1
@@ -0,0 +1,428 @@
1
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { useRef as de, useState as r, useEffect as _ } from "react";
3
+ import n from "prop-types";
4
+ import { useForm as pe } from "react-hook-form";
5
+ import { yupResolver as ce } from "@hookform/resolvers/yup";
6
+ import t from "@mui/material/Grid2";
7
+ import * as b from "yup";
8
+ import { Modal as me, Typography as ue, IconButton as fe, Button as v, FormControl as z, Box as s } from "@mui/material";
9
+ import K from "@/views/custom-components/CustomTextField";
10
+ import { showToast as p } from "@/common/toaster/toaster";
11
+ import { g as he, A as ye, u as W, c as ge } from "./ManageTranslation-BTxvSYKb-CwT975cy.js";
12
+ import be from "@/views/custom-components/CustomConfirmationModal";
13
+ import ve from "@/hooks/useTrackEvent";
14
+ import { useTranslateProvider as xe } from "@/common/languageTranslator/TranslationContext";
15
+ import { faXmark as Ae, faPen as we, faBars as Ce } from "@fortawesome/free-solid-svg-icons";
16
+ import { FontAwesomeIcon as x } from "@fortawesome/react-fontawesome";
17
+ import ke from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
18
+ const Ne = ({
19
+ open: D,
20
+ handleClose: F,
21
+ languages: A,
22
+ refresh: w,
23
+ refetch: C,
24
+ selectedApp: P,
25
+ setSelectedApp: R
26
+ }) => {
27
+ const k = de(null), h = ve(), [X, q] = r([]), [c, H] = r([]), [N, m] = r(!1), [O, S] = r(!1), { translate: i } = xe(), [$, y] = r(!1), [G, L] = r(""), [U, Y] = r(""), [d, J] = r({}), [V, I] = r(!1), Q = b.object().shape({
28
+ appValue: b.string().required("Select App Value"),
29
+ appKey: b.string().required("Enter App key")
30
+ }), {
31
+ control: j,
32
+ handleSubmit: Z,
33
+ reset: M,
34
+ setValue: u,
35
+ formState: { errors: T }
36
+ } = pe({
37
+ defaultValues: {},
38
+ resolver: ce(Q),
39
+ mode: "onChange"
40
+ }), ee = [
41
+ { field: "Sr. No.", label: "Sr.No", align: "left" },
42
+ { field: "appValue", label: "App", align: "left" },
43
+ { field: "stateValue", label: "State", align: "left" },
44
+ { field: "Actions", label: "Actions" }
45
+ ], ae = (e) => {
46
+ u("appKey", e == null ? void 0 : e.appKey), u("appValue", e == null ? void 0 : e.appValue), u("id", e == null ? void 0 : e.id), u("isActive", e == null ? void 0 : e.isActive), S(!0), m(!0);
47
+ }, te = (e) => {
48
+ L(
49
+ (e == null ? void 0 : e.stateValue) === "Active" ? "Mark as Inactive" : "Mark as Active"
50
+ ), Y(
51
+ (e == null ? void 0 : e.stateValue) === "Active" ? "Are you sure you want to change the state from active to inactive?" : "Are you sure you want to change the state from inactive to active?"
52
+ ), J(e);
53
+ }, le = () => {
54
+ y((e) => !e);
55
+ }, oe = async () => {
56
+ try {
57
+ d.isActive = !d.isActive, await W(d), g(), P === (d == null ? void 0 : d.id) && R(null), await w(), C(), y((e) => !e);
58
+ } catch (e) {
59
+ console.error(e), p({ message: "Error in Toggle State", type: "error" });
60
+ }
61
+ }, ie = [
62
+ { label: i(G), onClick: le }
63
+ ], re = [
64
+ {
65
+ label: "",
66
+ icon: /* @__PURE__ */ a(x, { icon: we }),
67
+ onClick: ae,
68
+ dataTestId: "app-modal-edit-icon"
69
+ },
70
+ {
71
+ label: "",
72
+ icon: /* @__PURE__ */ a(x, { icon: Ce }),
73
+ menuClick: te,
74
+ menuItems: ie,
75
+ dataTestId: "app-modal-menu-icon"
76
+ }
77
+ ], ne = () => {
78
+ M(), S(!1), m(!0);
79
+ };
80
+ _(() => {
81
+ if (c) {
82
+ const e = [];
83
+ c == null || c.forEach((l) => {
84
+ let f = { ...l };
85
+ l != null && l.isActive ? f.stateValue = "Active" : f.stateValue = "Inactive", A == null || A.forEach((E) => {
86
+ l.language === E.id && (f.languagevalue = E.languageValue);
87
+ }), e.push(f);
88
+ }), q(e);
89
+ }
90
+ }, [c]), _(() => {
91
+ g();
92
+ }, []);
93
+ const g = async () => {
94
+ I((e) => !e);
95
+ try {
96
+ const e = await he();
97
+ H(e == null ? void 0 : e.data);
98
+ } catch (e) {
99
+ console.error(e), p({ message: "Error in loading apps", type: "error" });
100
+ } finally {
101
+ I((e) => !e);
102
+ }
103
+ }, B = () => {
104
+ F();
105
+ }, se = async (e) => {
106
+ try {
107
+ h("button_click", {
108
+ button_name: "add-app-add-button",
109
+ button_type: "submit",
110
+ button_id: "add-app-submit-button"
111
+ });
112
+ let l = { ...e };
113
+ O ? (await W(l), p({ message: "App Updated Succesfully", type: "success" })) : (l.isActive = !0, await ge(l), p({ message: "App added Succesfully", type: "success" })), h("conversion_event", {
114
+ form: k.current,
115
+ form_name: "Add app Configuration",
116
+ submit: !0
117
+ }), g(), await w(), C(), m(!1);
118
+ } catch (l) {
119
+ console.error(l), p({ message: "Error in Adding App", type: "error" });
120
+ }
121
+ };
122
+ return /* @__PURE__ */ a(
123
+ me,
124
+ {
125
+ "data-testid": "appModal-modal",
126
+ open: D,
127
+ onClose: () => {
128
+ B(), M();
129
+ },
130
+ className: "translation-modal",
131
+ children: /* @__PURE__ */ o(
132
+ t,
133
+ {
134
+ container: !0,
135
+ sx: {
136
+ display: "flex",
137
+ flexDirection: "column",
138
+ position: "absolute",
139
+ top: 20,
140
+ left: "50%",
141
+ transform: "translateX(-50%)",
142
+ width: "95%",
143
+ maxW: "100%",
144
+ maxWidth: { sm: 600, md: 700, lg: 800 },
145
+ bgcolor: "background.paper",
146
+ boxShadow: 24,
147
+ border: 1,
148
+ borderColor: "divider",
149
+ borderRadius: 0.5
150
+ },
151
+ children: [
152
+ /* @__PURE__ */ a(
153
+ be,
154
+ {
155
+ description: U,
156
+ title: "CONFIRM ACTION",
157
+ handleClick: oe,
158
+ open: $,
159
+ handleClose: () => {
160
+ y((e) => !e);
161
+ },
162
+ "data-testid": "app-modal-customconfirmation"
163
+ }
164
+ ),
165
+ /* @__PURE__ */ o(
166
+ t,
167
+ {
168
+ sx: {
169
+ p: 1.25,
170
+ px: 3,
171
+ display: "flex",
172
+ justifyContent: "space-between",
173
+ alignItems: "center",
174
+ borderBottom: 1,
175
+ borderColor: "divider",
176
+ flexWrap: "wrap",
177
+ gap: 1
178
+ },
179
+ "data-testid": "appModal-header",
180
+ children: [
181
+ /* @__PURE__ */ a(
182
+ ue,
183
+ {
184
+ variant: "body1",
185
+ className: "text-customBlue",
186
+ sx: { fontWeight: "medium", fontSize: "1.125rem" },
187
+ children: i("Manage Apps")
188
+ }
189
+ ),
190
+ /* @__PURE__ */ a(
191
+ fe,
192
+ {
193
+ size: "small",
194
+ onClick: () => {
195
+ B();
196
+ },
197
+ "data-testid": "appModal-close-button",
198
+ children: /* @__PURE__ */ a(x, { icon: Ae })
199
+ }
200
+ )
201
+ ]
202
+ }
203
+ ),
204
+ /* @__PURE__ */ a(
205
+ t,
206
+ {
207
+ item: !0,
208
+ sx: {
209
+ overflowY: "auto",
210
+ maxHeight: "80vh",
211
+ width: "100%",
212
+ overflowX: "auto"
213
+ },
214
+ children: /* @__PURE__ */ a(
215
+ t,
216
+ {
217
+ sx: {
218
+ p: 1.25,
219
+ px: 3,
220
+ display: "flex",
221
+ justifyContent: "space-between",
222
+ alignItems: "center",
223
+ borderBottom: 1,
224
+ borderColor: "divider",
225
+ flexWrap: "wrap",
226
+ gap: 1
227
+ },
228
+ children: /* @__PURE__ */ o(t, { item: !0, className: "w-full", children: [
229
+ !N && /* @__PURE__ */ a(t, { container: !0, justifyContent: "flex-end", className: "pb-[10px]", children: /* @__PURE__ */ a(ye, { isLoading: V, children: /* @__PURE__ */ a(t, { item: !0, children: /* @__PURE__ */ o(
230
+ v,
231
+ {
232
+ size: "small",
233
+ variant: "contained",
234
+ "data-testid": "add-app-button",
235
+ color: "primary",
236
+ onClick: ne,
237
+ children: [
238
+ i("Add"),
239
+ " ",
240
+ i("App")
241
+ ]
242
+ }
243
+ ) }) }) }),
244
+ N && /* @__PURE__ */ a(t, { container: !0, justifyContent: "flex-start", sx: { pb: 1.25 }, children: /* @__PURE__ */ o("form", { onSubmit: Z(se), className: "w-full", children: [
245
+ /* @__PURE__ */ a(t, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ a(
246
+ z,
247
+ {
248
+ variant: "outlined",
249
+ className: "w-full",
250
+ "data-testid": "app-value-field",
251
+ children: /* @__PURE__ */ o(
252
+ s,
253
+ {
254
+ sx: {
255
+ display: "flex",
256
+ alignItems: "center",
257
+ gap: 2,
258
+ mb: 1,
259
+ width: "100%"
260
+ },
261
+ children: [
262
+ /* @__PURE__ */ o(s, { sx: { width: "100%" }, children: [
263
+ i("App"),
264
+ /* @__PURE__ */ a(
265
+ s,
266
+ {
267
+ component: "span",
268
+ sx: { color: "error.main", ml: 0.5 },
269
+ children: "*"
270
+ }
271
+ )
272
+ ] }),
273
+ /* @__PURE__ */ a(
274
+ K,
275
+ {
276
+ control: j,
277
+ id: "appValue",
278
+ name: "appValue",
279
+ errors: T,
280
+ label: "",
281
+ size: "small",
282
+ className: "w-full",
283
+ "data-testid": "app-value-input"
284
+ }
285
+ )
286
+ ]
287
+ }
288
+ )
289
+ }
290
+ ) }),
291
+ /* @__PURE__ */ a(t, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ a(
292
+ z,
293
+ {
294
+ variant: "outlined",
295
+ className: "w-full",
296
+ "data-testid": "app-key-field",
297
+ children: /* @__PURE__ */ o(
298
+ s,
299
+ {
300
+ sx: {
301
+ display: "flex",
302
+ alignItems: "center",
303
+ gap: 2,
304
+ mb: 1,
305
+ width: "100%"
306
+ },
307
+ children: [
308
+ /* @__PURE__ */ o(s, { sx: { width: "100%" }, children: [
309
+ i("App"),
310
+ " ",
311
+ i("Key"),
312
+ /* @__PURE__ */ a(
313
+ s,
314
+ {
315
+ component: "span",
316
+ sx: { color: "error.main", ml: 0.5 },
317
+ children: "*"
318
+ }
319
+ )
320
+ ] }),
321
+ /* @__PURE__ */ a(
322
+ K,
323
+ {
324
+ control: j,
325
+ id: "appKey",
326
+ name: "appKey",
327
+ errors: T,
328
+ label: "",
329
+ size: "small",
330
+ className: "w-full",
331
+ "data-testid": "app-key-input"
332
+ }
333
+ )
334
+ ]
335
+ }
336
+ )
337
+ }
338
+ ) }),
339
+ /* @__PURE__ */ a(
340
+ t,
341
+ {
342
+ item: !0,
343
+ sx: {
344
+ pb: 0.625,
345
+ display: "flex",
346
+ justifyContent: "flex-end",
347
+ width: "100%"
348
+ },
349
+ children: /* @__PURE__ */ o(
350
+ s,
351
+ {
352
+ sx: {
353
+ display: "flex",
354
+ flexDirection: { xs: "column", sm: "row" },
355
+ gap: 1,
356
+ width: { xs: "100%", sm: "auto" },
357
+ justifyContent: "flex-end"
358
+ },
359
+ children: [
360
+ /* @__PURE__ */ a(
361
+ v,
362
+ {
363
+ size: "small",
364
+ variant: "contained",
365
+ "data-testid": "add-app-cancel",
366
+ color: "secondary",
367
+ onClick: () => {
368
+ m(!1), h("conversion_event", {
369
+ form: k.current,
370
+ form_name: "Add App Configuration",
371
+ submit: !1
372
+ });
373
+ },
374
+ children: i("Cancel")
375
+ }
376
+ ),
377
+ /* @__PURE__ */ a(
378
+ v,
379
+ {
380
+ type: "submit",
381
+ size: "small",
382
+ variant: "contained",
383
+ "data-testid": "add-app-save",
384
+ color: "primary",
385
+ children: i("Save")
386
+ }
387
+ )
388
+ ]
389
+ }
390
+ )
391
+ }
392
+ )
393
+ ] }) }),
394
+ /* @__PURE__ */ a(t, { className: "w-full block", children: /* @__PURE__ */ a(
395
+ ke,
396
+ {
397
+ columns: ee,
398
+ tableData: X,
399
+ actions: re,
400
+ paginationConfig: { pagination: !1 },
401
+ styleConfig: { tableStyle: { maxHeight: 120 } },
402
+ isLoading: V
403
+ }
404
+ ) })
405
+ ] })
406
+ }
407
+ )
408
+ }
409
+ )
410
+ ]
411
+ }
412
+ )
413
+ }
414
+ );
415
+ };
416
+ Ne.propTypes = {
417
+ open: n.any,
418
+ handleClose: n.any,
419
+ languages: n.any,
420
+ refresh: n.any,
421
+ refetch: n.any,
422
+ selectedApp: n.any,
423
+ setSelectedApp: n.any
424
+ };
425
+ export {
426
+ Ne as default
427
+ };
428
+ //# sourceMappingURL=AppModal-BgZyfrd--CNvWjWhL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppModal-BgZyfrd--CNvWjWhL.js","sources":["../../core/dist/AppModal-BgZyfrd-.js"],"sourcesContent":["import { jsx as t, jsxs as i } from \"react/jsx-runtime\";\nimport { useRef as ce, useState as l, useEffect as _ } from \"react\";\nimport n from \"prop-types\";\nimport { useForm as pe } from \"react-hook-form\";\nimport { yupResolver as de } from \"@hookform/resolvers/yup\";\nimport a from \"@mui/material/Grid2\";\nimport * as v from \"yup\";\nimport { Modal as me, Typography as ue, IconButton as fe, Button as x, FormControl as B, Box as r } from \"@mui/material\";\nimport D from \"@/views/custom-components/CustomTextField\";\nimport { showToast as d } from \"@/common/toaster/toaster\";\nimport { g as he, A as ye, u as F, c as ge } from \"./ManageTranslation-BTxvSYKb.js\";\nimport be from \"@/views/custom-components/CustomConfirmationModal\";\nimport ve from \"@/hooks/useTrackEvent\";\nimport { useTranslateProvider as xe } from \"@/common/languageTranslator/TranslationContext\";\nimport { faXmark as Ae, faPen as Ce, faBars as Se } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon as A } from \"@fortawesome/react-fontawesome\";\nimport ke from \"@/views/custom-components/CustomizedTable/CustomizedTableV2\";\nconst we = ({\n open: K,\n handleClose: L,\n languages: h,\n refresh: C,\n refetch: S,\n selectedApp: O,\n setSelectedApp: R\n}) => {\n const k = ce(null), y = ve(), [W, P] = l([]), [p, X] = l([]), [w, m] = l(!1), [q, T] = l(!1), { translate: s } = xe(), [H, g] = l(!1), [G, U] = l(\"\"), [Y, J] = l(\"\"), [c, Q] = l({}), [I, N] = l(!1), Z = v.object().shape({\n appValue: v.string().required(\"Select App Value\"),\n appKey: v.string().required(\"Enter App key\")\n }), {\n control: V,\n handleSubmit: $,\n reset: E,\n setValue: u,\n formState: { errors: M }\n } = pe({\n defaultValues: {},\n resolver: de(Z),\n mode: \"onChange\"\n }), ee = [\n { field: \"Sr. No.\", label: \"Sr.No\", align: \"left\" },\n { field: \"appValue\", label: \"App\", align: \"left\" },\n { field: \"stateValue\", label: \"State\", align: \"left\" },\n { field: \"Actions\", label: \"Actions\" }\n ], te = (e) => {\n u(\"appKey\", e == null ? void 0 : e.appKey), u(\"appValue\", e == null ? void 0 : e.appValue), u(\"id\", e == null ? void 0 : e.id), u(\"isActive\", e == null ? void 0 : e.isActive), T(!0), m(!0);\n }, ae = (e) => {\n U(\n (e == null ? void 0 : e.stateValue) === \"Active\" ? \"Mark as Inactive\" : \"Mark as Active\"\n ), J(\n (e == null ? void 0 : e.stateValue) === \"Active\" ? \"Are you sure you want to change the state from active to inactive?\" : \"Are you sure you want to change the state from inactive to active?\"\n ), Q(e);\n }, oe = () => {\n g((e) => !e);\n }, ie = async () => {\n try {\n c.isActive = !c.isActive, await F(c), b(), O === (c == null ? void 0 : c.id) && R(null), await C(), S(), g((e) => !e);\n } catch (e) {\n console.error(e), d({ message: \"Error in Toggle State\", type: \"error\" });\n }\n }, se = [\n { label: s(G), onClick: oe }\n ], le = [\n {\n label: \"\",\n icon: /* @__PURE__ */ t(A, { icon: Ce }),\n onClick: te,\n dataTestId: \"app-modal-edit-icon\"\n },\n {\n label: \"\",\n icon: /* @__PURE__ */ t(A, { icon: Se }),\n menuClick: ae,\n menuItems: se,\n dataTestId: \"app-modal-menu-icon\"\n }\n ], ne = () => {\n E(), T(!1), m(!0);\n };\n _(() => {\n if (p) {\n const e = [];\n p == null || p.forEach((o) => {\n let f = { ...o };\n o != null && o.isActive ? f.stateValue = \"Active\" : f.stateValue = \"Inactive\", h == null || h.forEach((z) => {\n o.language === z.id && (f.languagevalue = z.languageValue);\n }), e.push(f);\n }), P(e);\n }\n }, [p]), _(() => {\n b();\n }, []);\n const b = async () => {\n N((e) => !e);\n try {\n const e = await he();\n X(e == null ? void 0 : e.data);\n } catch (e) {\n console.error(e), d({ message: \"Error in loading apps\", type: \"error\" });\n } finally {\n N((e) => !e);\n }\n }, j = () => {\n L();\n }, re = async (e) => {\n try {\n y(\"button_click\", {\n button_name: \"add-app-add-button\",\n button_type: \"submit\",\n button_id: \"add-app-submit-button\"\n });\n let o = { ...e };\n q ? (await F(o), d({ message: \"App Updated Succesfully\", type: \"success\" })) : (o.isActive = !0, await ge(o), d({ message: \"App added Succesfully\", type: \"success\" })), y(\"conversion_event\", {\n form: k.current,\n form_name: \"Add app Configuration\",\n submit: !0\n }), b(), await C(), S(), m(!1);\n } catch (o) {\n console.error(o), d({ message: \"Error in Adding App\", type: \"error\" });\n }\n };\n return /* @__PURE__ */ t(\n me,\n {\n \"data-testid\": \"appModal-modal\",\n open: K,\n onClose: () => {\n j(), E();\n },\n className: \"translation-modal\",\n children: /* @__PURE__ */ i(\n a,\n {\n container: !0,\n sx: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"absolute\",\n top: 20,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: \"95%\",\n maxW: \"100%\",\n maxWidth: { sm: 600, md: 700, lg: 800 },\n bgcolor: \"background.paper\",\n boxShadow: 24,\n border: 1,\n borderColor: \"divider\",\n borderRadius: 0.5\n },\n children: [\n /* @__PURE__ */ t(\n be,\n {\n description: Y,\n title: \"CONFIRM ACTION\",\n handleClick: ie,\n open: H,\n handleClose: () => {\n g((e) => !e);\n },\n \"data-testid\": \"app-modal-customconfirmation\"\n }\n ),\n /* @__PURE__ */ i(\n a,\n {\n sx: {\n p: 1.25,\n px: 3,\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n borderBottom: 1,\n borderColor: \"divider\",\n flexWrap: \"wrap\",\n gap: 1\n },\n \"data-testid\": \"appModal-header\",\n children: [\n /* @__PURE__ */ t(\n ue,\n {\n variant: \"body1\",\n className: \"text-customBlue\",\n sx: { fontWeight: \"medium\", fontSize: \"1.125rem\" },\n children: s(\"Manage Apps\")\n }\n ),\n /* @__PURE__ */ t(\n fe,\n {\n size: \"small\",\n onClick: () => {\n j();\n },\n \"data-testid\": \"appModal-close-button\",\n children: /* @__PURE__ */ t(A, { icon: Ae })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ t(\n a,\n {\n item: !0,\n sx: {\n overflowY: \"auto\",\n maxHeight: \"80vh\",\n width: \"100%\",\n overflowX: \"auto\"\n },\n children: /* @__PURE__ */ t(\n a,\n {\n sx: {\n p: 1.25,\n px: 3,\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n borderBottom: 1,\n borderColor: \"divider\",\n flexWrap: \"wrap\",\n gap: 1\n },\n children: /* @__PURE__ */ i(a, { item: !0, className: \"w-full\", children: [\n !w && /* @__PURE__ */ t(a, { container: !0, justifyContent: \"flex-end\", className: \"pb-[10px]\", children: /* @__PURE__ */ t(ye, { isLoading: I, children: /* @__PURE__ */ t(a, { item: !0, children: /* @__PURE__ */ i(\n x,\n {\n size: \"small\",\n variant: \"contained\",\n \"data-testid\": \"add-app-button\",\n color: \"primary\",\n onClick: ne,\n children: [\n s(\"Add\"),\n \" \",\n s(\"App\")\n ]\n }\n ) }) }) }),\n w && /* @__PURE__ */ t(a, { container: !0, justifyContent: \"flex-start\", sx: { pb: 1.25 }, children: /* @__PURE__ */ i(\"form\", { onSubmit: $(re), className: \"w-full\", children: [\n /* @__PURE__ */ t(a, { item: !0, className: \"pb-[5px]\", children: /* @__PURE__ */ t(\n B,\n {\n variant: \"outlined\",\n className: \"w-full\",\n \"data-testid\": \"app-value-field\",\n children: /* @__PURE__ */ i(\n r,\n {\n sx: {\n display: \"flex\",\n alignItems: \"center\",\n gap: 2,\n mb: 1,\n width: \"100%\"\n },\n children: [\n /* @__PURE__ */ i(r, { sx: { width: \"100%\" }, children: [\n s(\"App\"),\n /* @__PURE__ */ t(\n r,\n {\n component: \"span\",\n sx: { color: \"error.main\", ml: 0.5 },\n children: \"*\"\n }\n )\n ] }),\n /* @__PURE__ */ t(\n D,\n {\n control: V,\n id: \"appValue\",\n name: \"appValue\",\n errors: M,\n label: \"\",\n size: \"small\",\n className: \"w-full\",\n \"data-testid\": \"app-value-input\"\n }\n )\n ]\n }\n )\n }\n ) }),\n /* @__PURE__ */ t(a, { item: !0, className: \"pb-[5px]\", children: /* @__PURE__ */ t(\n B,\n {\n variant: \"outlined\",\n className: \"w-full\",\n \"data-testid\": \"app-key-field\",\n children: /* @__PURE__ */ i(\n r,\n {\n sx: {\n display: \"flex\",\n alignItems: \"center\",\n gap: 2,\n mb: 1,\n width: \"100%\"\n },\n children: [\n /* @__PURE__ */ i(r, { sx: { width: \"100%\" }, children: [\n s(\"App\"),\n \" \",\n s(\"Key\"),\n /* @__PURE__ */ t(\n r,\n {\n component: \"span\",\n sx: { color: \"error.main\", ml: 0.5 },\n children: \"*\"\n }\n )\n ] }),\n /* @__PURE__ */ t(\n D,\n {\n control: V,\n id: \"appKey\",\n name: \"appKey\",\n errors: M,\n label: \"\",\n size: \"small\",\n className: \"w-full\",\n \"data-testid\": \"app-key-input\"\n }\n )\n ]\n }\n )\n }\n ) }),\n /* @__PURE__ */ t(\n a,\n {\n item: !0,\n sx: {\n pb: 0.625,\n display: \"flex\",\n justifyContent: \"flex-end\",\n width: \"100%\"\n },\n children: /* @__PURE__ */ i(\n r,\n {\n sx: {\n display: \"flex\",\n flexDirection: { xs: \"column\", sm: \"row\" },\n gap: 1,\n width: { xs: \"100%\", sm: \"auto\" },\n justifyContent: \"flex-end\"\n },\n children: [\n /* @__PURE__ */ t(\n x,\n {\n size: \"small\",\n variant: \"contained\",\n \"data-testid\": \"add-app-cancel\",\n color: \"secondary\",\n onClick: () => {\n m(!1), y(\"conversion_event\", {\n form: k.current,\n form_name: \"Add App Configuration\",\n submit: !1\n });\n },\n children: s(\"Cancel\")\n }\n ),\n /* @__PURE__ */ t(\n x,\n {\n type: \"submit\",\n size: \"small\",\n variant: \"contained\",\n \"data-testid\": \"add-app-save\",\n color: \"primary\",\n children: s(\"Save\")\n }\n )\n ]\n }\n )\n }\n )\n ] }) }),\n /* @__PURE__ */ t(a, { className: \"w-full block\", children: /* @__PURE__ */ t(\n ke,\n {\n columns: ee,\n tableData: W,\n actions: le,\n paginationConfig: { pagination: !1 },\n styleConfig: { tableStyle: { maxHeight: 120 } },\n isLoading: I\n }\n ) })\n ] })\n }\n )\n }\n )\n ]\n }\n )\n }\n );\n};\nwe.propTypes = {\n open: n.any,\n handleClose: n.any,\n languages: n.any,\n refresh: n.any,\n refetch: n.any,\n selectedApp: n.any,\n setSelectedApp: n.any\n};\nexport {\n we as default\n};\n//# sourceMappingURL=AppModal-BgZyfrd-.js.map\n"],"names":["we","K","L","h","C","S","O","ce","y","ve","W","P","l","p","X","w","q","T","s","xe","H","g","U","Y","J","c","Q","I","N","Z","v","V","$","E","M","pe","de","te","ae","oe","ie","F","b","d","se","le","t","A","Ce","Se","_","o","z","he","j","re","ge","me","i","a","be","ue","fe","Ae","ye","x","B","r","D","ke","n"],"mappings":";;;;;;;;;;;;;;;;;AAiBK,MAACA,KAAK,CAAC;AAAA,EACV,MAAMC;AAAA,EACN,aAAaC;AAAA,EACb,WAAWC;AAAA,EACX,SAASC;AAAA,EACT,SAASC;AAAA,EACT,aAAaC;AAAA,EACb,gBAAgB;AAClB,MAAM;AACJ,QAAM,IAAIC,GAAG,IAAI,GAAGC,IAAIC,GAAE,GAAI,CAACC,GAAGC,CAAC,IAAIC,EAAE,CAAA,CAAE,GAAG,CAACC,GAAGC,CAAC,IAAIF,EAAE,CAAA,CAAE,GAAG,CAACG,GAAG,CAAC,IAAIH,EAAE,EAAE,GAAG,CAACI,GAAGC,CAAC,IAAIL,EAAE,EAAE,GAAG,EAAE,WAAWM,MAAMC,GAAE,GAAI,CAACC,GAAGC,CAAC,IAAIT,EAAE,EAAE,GAAG,CAAC,GAAGU,CAAC,IAAIV,EAAE,EAAE,GAAG,CAACW,GAAGC,CAAC,IAAIZ,EAAE,EAAE,GAAG,CAACa,GAAGC,CAAC,IAAId,EAAE,CAAA,CAAE,GAAG,CAACe,GAAGC,CAAC,IAAIhB,EAAE,EAAE,GAAGiB,IAAIC,EAAE,OAAM,EAAG,MAAM;AAAA,IAC1N,UAAUA,EAAE,SAAS,SAAS,kBAAkB;AAAA,IAChD,QAAQA,EAAE,OAAM,EAAG,SAAS,eAAe;AAAA,EAC/C,CAAG,GAAG;AAAA,IACF,SAASC;AAAA,IACT,cAAcC;AAAA,IACd,OAAOC;AAAA,IACP,UAAU;AAAA,IACV,WAAW,EAAE,QAAQC,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oBAAoB;AAAA,0CAC3B,MAAM,EAAE;AAAA,0CACR,WAAW;AAAA,0CACX,QAAQ;AAAA,wCAClD,CAAyC;AAAA,sCACH;AAAA,sCACA,UAAUU,EAAE,QAAQ;AAAA,oCAC1D;AAAA,kCACA;AAAA,kCACkD4B,gBAAAA;AAAAA,oCACdmB;AAAAA,oCACA;AAAA,sCACE,MAAM;AAAA,sCACN,MAAM;AAAA,sCACN,SAAS;AAAA,sCACT,eAAe;AAAA,sCACf,OAAO;AAAA,sCACP,UAAU/C,EAAE,MAAM;AAAA,oCACxD;AAAA,kCACA;AAAA,gCACA;AAAA,8BACA;AAAA,4BACA;AAAA,0BACA;AAAA,wBACA;AAAA,sBACA,EAAuB,CAAE,EAAC,CAAE;AAAA,sBACU4B,gBAAAA,EAAEa,GAAG,EAAE,WAAW,gBAAgB,UAA0Bb,gBAAAA;AAAAA,wBAC1EuB;AAAAA,wBACA;AAAA,0BACE,SAAS;AAAA,0BACT,WAAW3D;AAAA,0BACX,SAASmC;AAAA,0BACT,kBAAkB,EAAE,YAAY,GAAE;AAAA,0BAClC,aAAa,EAAE,YAAY,EAAE,WAAW,IAAG,EAAE;AAAA,0BAC7C,WAAWlB;AAAAA,wBACrC;AAAA,sBACA,EAAuB,CAAE;AAAA,oBACzB,EAAqB,CAAE;AAAA,kBACvB;AAAA,gBACA;AAAA,cACA;AAAA,YACA;AAAA,UACA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;AACA3B,GAAG,YAAY;AAAA,EACb,MAAMsE,EAAE;AAAA,EACR,aAAaA,EAAE;AAAA,EACf,WAAWA,EAAE;AAAA,EACb,SAASA,EAAE;AAAA,EACX,SAASA,EAAE;AAAA,EACX,aAAaA,EAAE;AAAA,EACf,gBAAgBA,EAAE;AACpB;"}
@@ -0,0 +1,176 @@
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { yupResolver as j } from "@hookform/resolvers/yup";
3
+ import c from "prop-types";
4
+ import { Modal as q, Paper as W, Card as B, CardHeader as E, Typography as m, CardContent as F, Button as g } from "@mui/material";
5
+ import s from "@mui/material/Grid2";
6
+ import * as t from "yup";
7
+ import { useRef as y, useEffect as H } from "react";
8
+ import { useForm as M } from "react-hook-form";
9
+ import { P as b, a as O } from "./ManageUser-PHiTNyF8-Bddmh2CC.js";
10
+ import R from "@/hooks/useAESEncryption.js";
11
+ import { F as _ } from "./UserListSkeleton-cglK2SaU-B_Tj5gUp.js";
12
+ import { showToast as C } from "@/common/toaster/toaster.jsx";
13
+ import $ from "@/hooks/useTrackEvent";
14
+ import { useTranslateProvider as k } from "@/common/languageTranslator/TranslationContext";
15
+ const A = t.object().shape({
16
+ password: t.string().required("Password is required").matches(
17
+ /^(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&#]).{8,}$/,
18
+ "Password must be at least 8 characters long with one uppercase letter and one special character"
19
+ ),
20
+ confirmPassword: t.string().required("Confirm Password is required").oneOf([t.ref("password"), null], "Passwords do not match")
21
+ }), G = ({ open: P, onClose: n, userId: x, ...v }) => {
22
+ const {
23
+ control: p,
24
+ formState: { errors: h },
25
+ handleSubmit: N,
26
+ watch: z
27
+ } = M({ resolver: j(A), mode: "onChange" }), d = y(null), u = y(!1), S = $(), T = R(), { translate: a } = k(), I = async ({ password: o }) => {
28
+ var f, w;
29
+ try {
30
+ const i = await T.encrypt(o);
31
+ try {
32
+ await _({
33
+ oldPassword: i,
34
+ userId: x
35
+ }), n(), C({
36
+ message: "Password Changed Successfully",
37
+ type: "success"
38
+ }), u.current = !0;
39
+ } catch (l) {
40
+ console.error(l), C({
41
+ message: ((w = (f = l == null ? void 0 : l.response) == null ? void 0 : f.data) == null ? void 0 : w.message) || "Something Went Wrong",
42
+ type: "error"
43
+ });
44
+ }
45
+ } catch (i) {
46
+ console.error(i);
47
+ }
48
+ };
49
+ return H(() => {
50
+ let o = d.current;
51
+ return () => {
52
+ o && S("conversion_event", {
53
+ form: o,
54
+ form_name: "Change Password",
55
+ submit: u.current
56
+ });
57
+ };
58
+ }, [d.current]), /* @__PURE__ */ e(q, { open: P, onClose: n, ...v, children: /* @__PURE__ */ e(W, { className: "absolute mt-[12rem] top-[10%] left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90%] md:w-[60%]", children: /* @__PURE__ */ r(
59
+ B,
60
+ {
61
+ className: "m-0",
62
+ elevation: 5,
63
+ component: "form",
64
+ ref: d,
65
+ onSubmit: N(I),
66
+ noValidate: !0,
67
+ children: [
68
+ /* @__PURE__ */ e(
69
+ E,
70
+ {
71
+ className: "manage-user-type-header",
72
+ subheader: /* @__PURE__ */ r(m, { className: "subheader-style text-customBlue text-lg", children: [
73
+ a("Change Password"),
74
+ " "
75
+ ] }),
76
+ "data-testid": "changepasswordmodal-cardheader-subheader"
77
+ }
78
+ ),
79
+ /* @__PURE__ */ r(F, { children: [
80
+ /* @__PURE__ */ r(s, { container: !0, spacing: 2, alignItems: "space-between", children: [
81
+ /* @__PURE__ */ e(s, { size: { xs: 10 }, children: /* @__PURE__ */ r(m, { variant: "body1", className: "flex items-center", children: [
82
+ a("New Password"),
83
+ " ",
84
+ /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
85
+ ] }) }),
86
+ /* @__PURE__ */ e(
87
+ s,
88
+ {
89
+ size: { xs: 12 },
90
+ "data-testid": "changepasswordmodal-grid-newpasswordfield",
91
+ children: /* @__PURE__ */ e(
92
+ b,
93
+ {
94
+ control: p,
95
+ name: "password",
96
+ errors: h
97
+ }
98
+ )
99
+ }
100
+ ),
101
+ /* @__PURE__ */ e(
102
+ s,
103
+ {
104
+ size: { xs: 12 },
105
+ "data-testid": "changepasswordmodal-grid-passwordstrengthbar",
106
+ children: /* @__PURE__ */ e(O, { password: z("password") })
107
+ }
108
+ ),
109
+ /* @__PURE__ */ e(
110
+ s,
111
+ {
112
+ size: { xs: 12 },
113
+ "data-testid": "changepasswordmodal-grid-confirmpasswordlabel",
114
+ children: /* @__PURE__ */ r(m, { variant: "body1", className: "flex items-center", children: [
115
+ a("Confirm Password"),
116
+ " ",
117
+ /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
118
+ ] })
119
+ }
120
+ ),
121
+ /* @__PURE__ */ e(
122
+ s,
123
+ {
124
+ size: { xs: 12 },
125
+ "data-testid": "changepaConfirm Passwordsswordmodal-grid-confirmpasswordfield",
126
+ children: /* @__PURE__ */ e(
127
+ b,
128
+ {
129
+ control: p,
130
+ name: "confirmPassword",
131
+ errors: h
132
+ }
133
+ )
134
+ }
135
+ )
136
+ ] }),
137
+ /* @__PURE__ */ r(s, { container: !0, wrap: "nowrap", gap: 1, justifyContent: "flex-end", children: [
138
+ /* @__PURE__ */ e(
139
+ g,
140
+ {
141
+ type: "submit",
142
+ variant: "contained",
143
+ size: "small",
144
+ color: "primary",
145
+ className: "mt-[1rem]",
146
+ "data-testid": "changepasswordmodal-button-submit",
147
+ children: a("Change Password")
148
+ }
149
+ ),
150
+ /* @__PURE__ */ e(
151
+ g,
152
+ {
153
+ variant: "contained",
154
+ onClick: n,
155
+ className: "mt-[1rem]",
156
+ color: "secondary",
157
+ size: "small",
158
+ "data-testid": "changepasswordmodal-button-cancel",
159
+ children: a("Cancel")
160
+ }
161
+ )
162
+ ] })
163
+ ] })
164
+ ]
165
+ }
166
+ ) }) });
167
+ };
168
+ G.propTypes = {
169
+ open: c.any,
170
+ onClose: c.any,
171
+ userId: c.any
172
+ };
173
+ export {
174
+ G as default
175
+ };
176
+ //# sourceMappingURL=ChangePasswordModal-MV7g8tkA-BDA1Pw0i.js.map