@argusoft/medplat-form-engine 1.0.9 → 1.0.11

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 (121) hide show
  1. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.js +1238 -0
  2. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.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-CkTu7sOI-DQFBCBim.js +212 -0
  7. package/dist/AddFeatures-CkTu7sOI-DQFBCBim.js.map +1 -0
  8. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.js +734 -0
  9. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.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-xMb2iVGk.js +453 -0
  14. package/dist/AddRoleDrawer-ZK1eejxI-xMb2iVGk.js.map +1 -0
  15. package/dist/AppModal-BgZyfrd--CZPgx1UG.js +428 -0
  16. package/dist/AppModal-BgZyfrd--CZPgx1UG.js.map +1 -0
  17. package/dist/ChangePasswordModal-MV7g8tkA-Duk536Oa.js +176 -0
  18. package/dist/ChangePasswordModal-MV7g8tkA-Duk536Oa.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-9p5IIVx2.js +249 -0
  32. package/dist/FeatureMenu-BYSRoNm0-9p5IIVx2.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-CdG02LFN.js +5162 -0
  38. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-CdG02LFN.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-BaAI1s2W.js +394 -0
  45. package/dist/LanguagesModal-rk6IGQwY-BaAI1s2W.js.map +1 -0
  46. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js +4189 -0
  47. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js.map +1 -0
  48. package/dist/ManageEventConfiguration-BJxS2Su0-CLP6VZyB.js +1017 -0
  49. package/dist/ManageEventConfiguration-BJxS2Su0-CLP6VZyB.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-CuXmWQyp-ELNs9emF.js +728 -0
  54. package/dist/ManageRole-CuXmWQyp-ELNs9emF.js.map +1 -0
  55. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js +616 -0
  56. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js.map +1 -0
  57. package/dist/ManageTranslation-BTxvSYKb.css +1 -0
  58. package/dist/ManageUser-PHiTNyF8-D63df1GG.js +2160 -0
  59. package/dist/ManageUser-PHiTNyF8-D63df1GG.js.map +1 -0
  60. package/dist/ManageUser-PHiTNyF8.css +1 -0
  61. package/dist/{MedplatFormWrapper-CFiFeztb.js → MedplatFormWrapper-BNTRYrFO.js} +10677 -10272
  62. package/dist/MedplatFormWrapper-BNTRYrFO.js.map +1 -0
  63. package/dist/MedplatFormWrapper.css +1 -0
  64. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js +108 -0
  65. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js.map +1 -0
  66. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Wd3d3SEP.js +782 -0
  67. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Wd3d3SEP.js.map +1 -0
  68. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js +1002 -0
  69. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js.map +1 -0
  70. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js +244 -0
  71. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js.map +1 -0
  72. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js +400 -0
  73. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js.map +1 -0
  74. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-tpC-SI0P.js +1952 -0
  75. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-tpC-SI0P.js.map +1 -0
  76. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js +378 -0
  77. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js.map +1 -0
  78. package/dist/QueryBuilder-Cus_mRwZ.css +1 -0
  79. package/dist/QueryManagement-DXA73N2j-s7-8jQY4.js +671 -0
  80. package/dist/QueryManagement-DXA73N2j-s7-8jQY4.js.map +1 -0
  81. package/dist/QueryManagement-DXA73N2j.css +1 -0
  82. package/dist/RoleManagement-C0feJCuq-CsxaM0rI.js +410 -0
  83. package/dist/RoleManagement-C0feJCuq-CsxaM0rI.js.map +1 -0
  84. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js +869 -0
  85. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js.map +1 -0
  86. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js +130 -0
  87. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js.map +1 -0
  88. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js +259 -0
  89. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js.map +1 -0
  90. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js +190 -0
  91. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js.map +1 -0
  92. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js +187 -0
  93. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js.map +1 -0
  94. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js +1508 -0
  95. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js.map +1 -0
  96. package/dist/TableList-B9hr05Hs-BIsMbnIV.js +428 -0
  97. package/dist/TableList-B9hr05Hs-BIsMbnIV.js.map +1 -0
  98. package/dist/TypeConfiguration-C-lk8Szs-DKu6I5Im.js +116 -0
  99. package/dist/TypeConfiguration-C-lk8Szs-DKu6I5Im.js.map +1 -0
  100. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js +13039 -0
  101. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js.map +1 -0
  102. package/dist/UserList-BxB1tCwM.css +1 -0
  103. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js +184 -0
  104. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js.map +1 -0
  105. package/dist/WidgetList-BSApErov-D05f9srr.js +188 -0
  106. package/dist/WidgetList-BSApErov-D05f9srr.js.map +1 -0
  107. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js +29 -0
  108. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js.map +1 -0
  109. package/dist/i18next-CTOWN_jH-BKKbdDel.js +1389 -0
  110. package/dist/i18next-CTOWN_jH-BKKbdDel.js.map +1 -0
  111. package/dist/index-B4r0wjBD.js +563 -0
  112. package/dist/index-B4r0wjBD.js.map +1 -0
  113. package/dist/{index-ohCbNSTD.js → index-BQKWCEEG.js} +107 -107
  114. package/dist/{index-ohCbNSTD.js.map → index-BQKWCEEG.js.map} +1 -1
  115. package/dist/index.css +1 -1
  116. package/dist/index.js +1 -1
  117. package/dist/manageImmunization-B4swS745-JldexHrO.js +1204 -0
  118. package/dist/manageImmunization-B4swS745-JldexHrO.js.map +1 -0
  119. package/dist/manageImmunization-B4swS745.css +1 -0
  120. package/package.json +3 -3
  121. package/dist/MedplatFormWrapper-CFiFeztb.js.map +0 -1
@@ -0,0 +1,616 @@
1
+ import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
+ import { useRef as ye, useState as r, useEffect as be, useCallback as fa, useMemo as q, Suspense as M, createElement as va, lazy as U } from "react";
3
+ import { api as m } from "@/common/interceptors/AxiosInterceptor";
4
+ import { execute as ya, executeQuery as j } from "@/common/services/GlobalApis";
5
+ import { showToast as v } from "@/common/toaster/toaster";
6
+ import c from "@mui/material/Grid2";
7
+ import { getAssignedFeatures as ba } from "@/utils/feature";
8
+ import { FormControl as H, Typography as C, Select as xa, MenuItem as wa, Autocomplete as ka, TextField as xe, Chip as Na, Box as we, Button as A, FormGroup as Ca, FormControlLabel as Aa, Checkbox as Sa } from "@mui/material";
9
+ import Ta from "@/hooks/usePagination";
10
+ import La from "@/views/custom-components/CustomConfirmationModal";
11
+ import { useTranslateProvider as _a } from "@/common/languageTranslator/TranslationContext";
12
+ import g from "prop-types";
13
+ import { useSelector as F } from "react-redux";
14
+ import { getUseSkeleton as E } from "@/store/reducers/SkeletonReducer";
15
+ import Ia from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
16
+ import { faPen as za, faBars as Ma } from "@fortawesome/free-solid-svg-icons";
17
+ import { FontAwesomeIcon as ke } from "@fortawesome/react-fontawesome";
18
+ import './ManageTranslation-BTxvSYKb.css';const rl = (n) => m.post("/translation/languages", n), sl = (n) => m.put("/translation/languages", n), ja = () => m.get("/translation/languages"), ol = (n) => m.post("/translation/apps", n), dl = (n) => m.post("/translation/apps", n), Fa = () => m.get("/translation/apps"), cl = (n) => m.post("/translation/labels", n), ul = (n) => m.post("/translation/map", n), pl = (n) => m.post("/translation/mapUpdate", n), Ea = (n, o, h) => {
19
+ const O = new URLSearchParams({
20
+ key: n,
21
+ isActive: o,
22
+ app: h
23
+ }).toString();
24
+ return m.put(`/translation/toggleActive?${O}`, { key: n, isActive: o, app: h });
25
+ }, ml = (n, o) => m.get("/translation/translate", { params: { targetLangs: n, englishText: o } }), Ne = ({ children: n, isLoading: o }) => !F(E) || !o ? n : /* @__PURE__ */ u("div", { className: "flex flex-col mt-6 gap-2 w-full", children: [
26
+ /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between space-x-2", children: [
27
+ /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
28
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
29
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
30
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-60 h-10" })
31
+ ] }),
32
+ /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
33
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-40 h-10" }),
34
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
35
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
36
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" })
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-full h-100" })
40
+ ] });
41
+ Ne.propTypes = {
42
+ children: g.any,
43
+ isLoading: g.any
44
+ };
45
+ const Oa = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ u("div", { className: "flex flex-col absolute top-10 left-1/2 -translate-x-1/2 w-[95%] sm:w-[600px] md:w-[700px] lg:w-[800px] bg-white shadow-2xl border border-gray-300 rounded-sm h-[60vh]", children: [
46
+ /* @__PURE__ */ a("div", { className: "h-15 w-full bg-gray-200 rounded mb-6" }),
47
+ /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
48
+ /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
49
+ /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4 " }),
50
+ /* @__PURE__ */ a("div", { className: "h-9 w-1/3 bg-gray-200 rounded mt-auto ml-auto mb-2 mr-3" })
51
+ ] });
52
+ Oa.propTypes = {
53
+ children: g.any,
54
+ isLoading: g.any
55
+ };
56
+ const Pa = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ a("div", { className: "w-full flex justify-end pb-[10px]", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[100px]" }) });
57
+ Pa.propTypes = {
58
+ children: g.any,
59
+ isLoading: g.any
60
+ };
61
+ const Va = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ a("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[120px]" }) });
62
+ Va.propTypes = {
63
+ children: g.any,
64
+ isLoading: g.any
65
+ };
66
+ g.any, g.any;
67
+ const Wa = U(() => import("./AppModal-BgZyfrd--CZPgx1UG.js")), Ba = U(() => import("./LanguagesModal-rk6IGQwY-BaAI1s2W.js")), Ra = U(() => import("./AddLabelModal-DE3ploGD-BV_K8Q7c.js"));
68
+ function $a() {
69
+ const { translate: n } = _a(), o = ye(null), [h, O] = r([]), S = ye(!1), [Ce, G] = r([]), [Ae, J] = r(!1), [Se, P] = r(null), [Te, V] = r(!1), [X, Le] = r([]), [Y, Z] = r(!1), [ee, ae] = r(!1), [le, _e] = r(!0), [f, W] = r(""), [T, Ie] = r([]), [te, k] = r(!1), [ze, B] = r(null), [N, ne] = r(""), [y, ie] = r(""), [x, re] = r(!1), [L, Me] = r({}), [je, R] = r(!1), [Fe, Ee] = r(""), [Oe, Pe] = r(""), [d, Ve] = r({}), [We, se] = r(!1), [Be, oe] = r(null), [de, $] = r(!1), [Re, ce] = r(!1), [_, $e] = r(!1), [De, D] = r(!1), [ue, Ke] = r([]), [b, pe] = r([]), Qe = async () => {
70
+ var e;
71
+ try {
72
+ const l = await ya({
73
+ code: "get_distinct_namespce",
74
+ parameters: {}
75
+ });
76
+ Ke((e = l == null ? void 0 : l.data) == null ? void 0 : e.result);
77
+ } catch (l) {
78
+ console.error(l);
79
+ }
80
+ };
81
+ be(() => {
82
+ qe(), Qe();
83
+ }, []);
84
+ const qe = async () => {
85
+ try {
86
+ await K();
87
+ const { data: e } = await ba(
88
+ "techo.manage.manageTranslation"
89
+ );
90
+ Me(JSON.parse(e));
91
+ } catch (e) {
92
+ console.error(e), v({ message: "Error in manage Translation", type: "error" });
93
+ }
94
+ }, K = async () => {
95
+ var e, l;
96
+ try {
97
+ let t = await Fa();
98
+ const s = (e = t == null ? void 0 : t.data) == null ? void 0 : e.filter((p) => p.isActive === !0);
99
+ O(s), t = await ja();
100
+ const i = (l = t == null ? void 0 : t.data) == null ? void 0 : l.filter((p) => p.active === !0);
101
+ Ie(i);
102
+ } catch (t) {
103
+ console.error(t), v({ message: "Error in manage Translation", type: "error" });
104
+ }
105
+ }, He = (e) => {
106
+ var l;
107
+ W((l = e == null ? void 0 : e.target) == null ? void 0 : l.value);
108
+ }, me = fa((e) => {
109
+ const l = (e.match(/{/g) || []).length, t = (e.match(/}/g) || []).length;
110
+ l > t || ne(e);
111
+ }, []), Ue = (e, l) => {
112
+ let t;
113
+ return (...s) => {
114
+ t && clearTimeout(t), t = setTimeout(() => {
115
+ e(...s);
116
+ }, l);
117
+ };
118
+ }, Ge = q(
119
+ () => Ue(me, 300),
120
+ [me]
121
+ ), Je = (e) => {
122
+ const { value: l } = e.target;
123
+ Ge(l);
124
+ }, ge = (e) => {
125
+ ie(e);
126
+ }, he = [
127
+ { field: "Sr. No.", label: "Sr.No", align: "left" },
128
+ { field: "Actions", label: "Actions" },
129
+ { field: "app", label: "App", align: "left" },
130
+ { field: "state", label: "State", align: "left" },
131
+ { field: "key", label: "Key", align: "left" }
132
+ ];
133
+ T == null || T.map(
134
+ (e) => {
135
+ var l;
136
+ return he.push({
137
+ field: (l = e == null ? void 0 : e.languageValue) == null ? void 0 : l.toLowerCase(),
138
+ label: e == null ? void 0 : e.languageValue,
139
+ align: "left"
140
+ });
141
+ }
142
+ );
143
+ const Xe = (e) => {
144
+ Ee(
145
+ (e == null ? void 0 : e.state) === "Active" ? "Mark as Inactive" : "Mark as Active"
146
+ ), Pe(
147
+ (e == null ? void 0 : e.state) === "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?"
148
+ ), Ve(e);
149
+ }, Ye = () => {
150
+ R((e) => !e);
151
+ }, Ze = async () => {
152
+ try {
153
+ P({ key: d == null ? void 0 : d.key }), ce(!0), k((e) => !e);
154
+ } catch (e) {
155
+ console.error(e), v({ message: "Error in opening Add App Modal", type: "error" });
156
+ }
157
+ }, ea = async () => {
158
+ var e, l, t;
159
+ try {
160
+ let s = {
161
+ code: "labels_selected_apps_for_editing",
162
+ parameters: { key: d == null ? void 0 : d.key.replace(/'/g, "''") }
163
+ };
164
+ const i = await j(s);
165
+ let p = (e = i == null ? void 0 : i.data) == null ? void 0 : e.result;
166
+ B((l = i == null ? void 0 : i.data) == null ? void 0 : l.result);
167
+ let ma = {
168
+ code: "labels_app_data_for_prepopulating",
169
+ parameters: {
170
+ key: d == null ? void 0 : d.key,
171
+ appValue: d == null ? void 0 : d.app
172
+ }
173
+ }, ga = p.map((w) => w.app), ve = h.filter((w) => ga.indexOf(w.id) === -1);
174
+ if (ve.length > 0) {
175
+ const w = await j(ma);
176
+ P((t = w == null ? void 0 : w.data) == null ? void 0 : t.result), G(ve), J(!0), k((ha) => !ha);
177
+ } else
178
+ v({
179
+ message: "Label already present in all apps",
180
+ type: "info"
181
+ });
182
+ } catch (s) {
183
+ console.error(s), v({ message: "Error in opening Add App Modal", type: "error" });
184
+ }
185
+ }, aa = async () => {
186
+ try {
187
+ let e = (d == null ? void 0 : d.state) === "Active";
188
+ await Ea(d == null ? void 0 : d.key, !e, d == null ? void 0 : d.appId), z(), R((l) => !l);
189
+ } catch (e) {
190
+ console.error(e), v({ message: "Error in Toggle State", type: "error" });
191
+ }
192
+ }, la = async (e) => {
193
+ var l;
194
+ try {
195
+ V(!0), k((i) => !i), se((i) => !i);
196
+ let t = e == null ? void 0 : e.key.replace(/'/g, "''");
197
+ oe(t);
198
+ const s = await j({
199
+ code: "labels_selected_apps_for_editing",
200
+ parameters: { key: t }
201
+ });
202
+ B((l = s == null ? void 0 : s.data) == null ? void 0 : l.result), V(!1);
203
+ } catch (t) {
204
+ console.error(t), v({ message: "Error in Editing label", type: "error" }), V(!1);
205
+ }
206
+ }, ta = [
207
+ { label: n(Fe), onClick: Ye },
208
+ { label: n("Add app"), onClick: ea },
209
+ { label: n("Add Namespace"), onClick: Ze }
210
+ ], na = [
211
+ {
212
+ label: "",
213
+ icon: /* @__PURE__ */ a(ke, { icon: za }),
214
+ onClick: la,
215
+ condition: (e) => (e == null ? void 0 : e.state) !== "Inactive",
216
+ dataTestId: "manage-translation-edit-icon"
217
+ },
218
+ {
219
+ label: "",
220
+ icon: /* @__PURE__ */ a(ke, { icon: Ma }),
221
+ menuClick: Xe,
222
+ dataTestId: "manage-translation-menu-icon",
223
+ menuItems: ta
224
+ }
225
+ ], ia = () => {
226
+ Z((e) => !e);
227
+ }, ra = () => {
228
+ ae((e) => !e);
229
+ }, sa = () => {
230
+ k((e) => !e), G(h);
231
+ }, Q = (e) => e == null ? e : e.replace(/'/g, "''"), oa = async (e, l) => {
232
+ var t;
233
+ try {
234
+ l && !_ ? (S.current = !0, $(!0)) : l && _ && D(!0);
235
+ let s = {
236
+ code: "fetch_labels_translation_translation_master",
237
+ parameters: {
238
+ appId: f || null,
239
+ searchString: Q(N || ""),
240
+ startsWith: Q(y || ""),
241
+ namespaceArray: b.length > 0 ? b.map((p) => Q(p)).join(",") : "",
242
+ showInactive: x || !1,
243
+ limit: (e == null ? void 0 : e.limit) || 100,
244
+ offset: (e == null ? void 0 : e.offset) || 0
245
+ }
246
+ };
247
+ const i = await j(s);
248
+ return (t = i == null ? void 0 : i.data) == null ? void 0 : t.result;
249
+ } catch (s) {
250
+ S.current = !1, console.error(s), D(!1), $(!1), v({ message: "Error in loading data", type: "error" });
251
+ }
252
+ }, fe = q(() => N === "" && y === "" && x === !1 && f === "" && b.length === 0, [N, y, x, f, b]), da = q(
253
+ () => [
254
+ "translation",
255
+ f,
256
+ N,
257
+ y,
258
+ x,
259
+ b
260
+ ],
261
+ [f, N, y, x, b]
262
+ ), {
263
+ data: I,
264
+ fetchNextPage: ca,
265
+ hasNextPage: ua,
266
+ refetch: z
267
+ } = Ta({
268
+ key: da,
269
+ queryFn: ({ pageParam: e }) => {
270
+ const l = !_, t = (!(e != null && e.offset) || (e == null ? void 0 : e.offset) === 0) && l;
271
+ return oa(e, t);
272
+ },
273
+ limit: 100
274
+ });
275
+ be(() => {
276
+ var e;
277
+ if (I) {
278
+ let l = ((e = I == null ? void 0 : I.pages) == null ? void 0 : e.flat()) || [];
279
+ const t = Object.values(
280
+ l == null ? void 0 : l.reduce((s, i) => {
281
+ const p = (i == null ? void 0 : i.key) + "-" + (i == null ? void 0 : i.app);
282
+ return s[p] || (s[p] = {
283
+ appId: i == null ? void 0 : i.appid,
284
+ key: i == null ? void 0 : i.key,
285
+ app: i == null ? void 0 : i.app,
286
+ state: i != null && i.is_active ? "Active" : "Inactive"
287
+ }), s[p][i == null ? void 0 : i.language.toLowerCase()] = i == null ? void 0 : i.value, i != null && i.is_active && (s[p].state = "Active"), s;
288
+ }, {})
289
+ );
290
+ _e(ua), Le(t), S.current && (_ ? D(!1) : ($(!1), $e(!0)), S.current = !1);
291
+ }
292
+ }, [I]);
293
+ const pa = () => {
294
+ ne(""), ie(""), re(!1), W(""), pe([]), o.current.value = "";
295
+ };
296
+ return /* @__PURE__ */ u(c, { container: !0, mt: 3, spacing: 2, children: [
297
+ /* @__PURE__ */ a(M, { children: Y && /* @__PURE__ */ a(
298
+ Wa,
299
+ {
300
+ open: Y,
301
+ handleClose: () => Z((e) => !e),
302
+ languages: T,
303
+ refresh: K,
304
+ refetch: z,
305
+ selectedApp: f,
306
+ setSelectedApp: W
307
+ }
308
+ ) }),
309
+ /* @__PURE__ */ a(M, { children: ee && /* @__PURE__ */ a(
310
+ Ba,
311
+ {
312
+ open: ee,
313
+ handleClose: () => {
314
+ ae((e) => !e);
315
+ },
316
+ refresh: K,
317
+ refetch: z
318
+ }
319
+ ) }),
320
+ /* @__PURE__ */ a(M, { children: te && /* @__PURE__ */ a(
321
+ Ra,
322
+ {
323
+ open: te,
324
+ handleClose: () => {
325
+ k((e) => !e), J(!1), ce(!1), B(null), P(null), se(!1), oe(null);
326
+ },
327
+ apps: Ce,
328
+ addAppFlag: Ae,
329
+ addNameSpaceFlag: Re,
330
+ languageList: T,
331
+ editLabel: ze,
332
+ fieldsData: Se,
333
+ editLabelFlag: We,
334
+ labelKey: Be,
335
+ refetch: z,
336
+ isLoading: Te
337
+ }
338
+ ) }),
339
+ /* @__PURE__ */ a(M, {}),
340
+ /* @__PURE__ */ a(
341
+ La,
342
+ {
343
+ description: Oe,
344
+ title: "CONFIRM ACTION",
345
+ handleClick: aa,
346
+ open: je,
347
+ handleClose: () => {
348
+ R((e) => !e);
349
+ },
350
+ "data-testid": "manageTranslation-modal-customconfirmation"
351
+ }
352
+ ),
353
+ /* @__PURE__ */ a(c, { container: !0, spacing: 1, className: "grow", children: /* @__PURE__ */ u(Ne, { isLoading: de, children: [
354
+ /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
355
+ /* @__PURE__ */ a(C, { className: "pl-2", children: /* @__PURE__ */ a("span", { children: n("App") }) }),
356
+ /* @__PURE__ */ a(
357
+ xa,
358
+ {
359
+ value: f,
360
+ onChange: He,
361
+ size: "small",
362
+ displayEmpty: !0,
363
+ sx: {
364
+ bgcolor: "background.paper",
365
+ color: f ? "text.primary" : "text.disabled"
366
+ // gray when empty
367
+ },
368
+ renderValue: (e) => {
369
+ var l;
370
+ return e ? (l = h.find((t) => t.id === e)) == null ? void 0 : l.appValue : "Select App";
371
+ },
372
+ children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ a(wa, { value: e == null ? void 0 : e.id, children: e == null ? void 0 : e.appValue }, e == null ? void 0 : e.id))
373
+ }
374
+ )
375
+ ] }) }),
376
+ /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
377
+ /* @__PURE__ */ a(C, { className: "", children: /* @__PURE__ */ a("span", { children: n("Name Spaces") }) }),
378
+ /* @__PURE__ */ a(
379
+ ka,
380
+ {
381
+ multiple: !0,
382
+ options: ue ?? [],
383
+ getOptionLabel: (e) => (e == null ? void 0 : e.label) ?? "",
384
+ value: ue.filter(
385
+ (e) => b.includes(e.value)
386
+ ),
387
+ onChange: (e, l) => {
388
+ pe(l.map((t) => t.value));
389
+ },
390
+ filterSelectedOptions: !0,
391
+ disableCloseOnSelect: !0,
392
+ size: "small",
393
+ renderTags: (e, l) => e.map((t, s) => /* @__PURE__ */ va(
394
+ Na,
395
+ {
396
+ variant: "outlined",
397
+ size: "small",
398
+ label: t.label,
399
+ ...l({ index: s }),
400
+ key: t.label,
401
+ sx: {
402
+ bgcolor: "action.hover"
403
+ }
404
+ }
405
+ )),
406
+ renderInput: (e) => /* @__PURE__ */ a(
407
+ xe,
408
+ {
409
+ ...e,
410
+ placeholder: "Select Name Space",
411
+ sx: { bgcolor: "background.paper" },
412
+ "data-testid": "autocomplete-namespace"
413
+ }
414
+ )
415
+ }
416
+ )
417
+ ] }) }),
418
+ /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
419
+ /* @__PURE__ */ a(C, { sx: { pl: 1 }, children: /* @__PURE__ */ u("span", { children: [
420
+ n("Search For"),
421
+ ":"
422
+ ] }) }),
423
+ /* @__PURE__ */ a(
424
+ xe,
425
+ {
426
+ inputRef: o,
427
+ name: "searchQuery",
428
+ id: "searchQuery",
429
+ placeholder: "Enter Search Value",
430
+ size: "small",
431
+ onChange: Je,
432
+ sx: { bgcolor: "background.paper" },
433
+ "data-testid": "managetranslation-search-textfield"
434
+ }
435
+ )
436
+ ] }) }),
437
+ /* @__PURE__ */ a(
438
+ c,
439
+ {
440
+ size: { xs: 12, sm: 12, md: 2 },
441
+ sx: {
442
+ display: "flex",
443
+ mt: 3,
444
+ justifyContent: "end",
445
+ alignItems: "center"
446
+ },
447
+ children: /* @__PURE__ */ a(we, { children: /* @__PURE__ */ a(
448
+ A,
449
+ {
450
+ variant: "contained",
451
+ disabled: fe,
452
+ sx: {
453
+ lineHeight: "35px",
454
+ ml: 1,
455
+ mt: 1,
456
+ display: "inline-block",
457
+ ...fe ? {} : {
458
+ bgcolor: "error.main",
459
+ color: "error.contrastText",
460
+ "&:hover": { bgcolor: "error.dark" }
461
+ }
462
+ },
463
+ onClick: pa,
464
+ children: "Clear All Filters"
465
+ }
466
+ ) })
467
+ }
468
+ ),
469
+ /* @__PURE__ */ a(
470
+ c,
471
+ {
472
+ size: { xs: 12, sm: 12, md: 6.5 },
473
+ sx: {
474
+ pl: 1,
475
+ display: "flex",
476
+ justifyContent: "start",
477
+ alignItems: "center"
478
+ },
479
+ children: /* @__PURE__ */ u(we, { className: "overflow-x-auto whitespace-nowrap", children: [
480
+ /* @__PURE__ */ a(C, { className: "pb-[7px]", children: /* @__PURE__ */ u("span", { children: [
481
+ n("Starts With"),
482
+ ":"
483
+ ] }) }),
484
+ Array.from({ length: 26 }, (e, l) => {
485
+ const t = String.fromCharCode(65 + l);
486
+ return /* @__PURE__ */ a(
487
+ C,
488
+ {
489
+ component: "span",
490
+ className: `${y === t ? "selected-letter" : "letter-style"} inline-block cursor-pointer`,
491
+ onClick: () => ge(t),
492
+ children: t
493
+ },
494
+ t
495
+ );
496
+ }),
497
+ /* @__PURE__ */ a(
498
+ A,
499
+ {
500
+ variant: "contained",
501
+ color: "secondary",
502
+ disabled: y.length === 0,
503
+ className: "x-button ml-2 inline-block",
504
+ onClick: () => ge(""),
505
+ children: "×"
506
+ }
507
+ )
508
+ ] })
509
+ }
510
+ ),
511
+ /* @__PURE__ */ a(
512
+ c,
513
+ {
514
+ size: { xs: 12, sm: 12, md: 5.5 },
515
+ display: "flex",
516
+ alignItems: "center",
517
+ children: /* @__PURE__ */ u(
518
+ c,
519
+ {
520
+ container: !0,
521
+ justifyContent: "flex-end",
522
+ alignItems: "center",
523
+ spacing: 1,
524
+ children: [
525
+ /* @__PURE__ */ a(c, { item: "true", children: /* @__PURE__ */ a(Ca, { children: /* @__PURE__ */ a(
526
+ Aa,
527
+ {
528
+ control: /* @__PURE__ */ a(
529
+ Sa,
530
+ {
531
+ checked: x,
532
+ onChange: (e) => re(e.target.checked)
533
+ }
534
+ ),
535
+ label: `${n("Show Inactive")}`,
536
+ labelPlacement: "end",
537
+ className: "translation-inactive"
538
+ }
539
+ ) }) }),
540
+ /* @__PURE__ */ a(c, { item: "true", children: (L == null ? void 0 : L.canManage) && /* @__PURE__ */ a(
541
+ A,
542
+ {
543
+ size: "small",
544
+ variant: "contained",
545
+ "data-testid": "manageTranslation-manage-apps-button",
546
+ color: "primary",
547
+ onClick: ia,
548
+ children: n("Manage Apps")
549
+ }
550
+ ) }),
551
+ /* @__PURE__ */ a(c, { item: "true", children: (L == null ? void 0 : L.canManage) && /* @__PURE__ */ a(
552
+ A,
553
+ {
554
+ size: "small",
555
+ variant: "contained",
556
+ "data-testid": "managetranslation-manage-language-button",
557
+ onClick: ra,
558
+ children: n("Manage Language")
559
+ }
560
+ ) }),
561
+ /* @__PURE__ */ a(c, { item: "true", children: /* @__PURE__ */ a(
562
+ A,
563
+ {
564
+ size: "small",
565
+ variant: "contained",
566
+ "data-testid": "manageTranalation-add-label-button",
567
+ onClick: sa,
568
+ children: n("Add Label")
569
+ }
570
+ ) })
571
+ ]
572
+ }
573
+ )
574
+ }
575
+ ),
576
+ /* @__PURE__ */ a(c, { className: "mt-2", size: { xs: 12 }, children: /* @__PURE__ */ a(
577
+ Ia,
578
+ {
579
+ columns: he,
580
+ tableData: X,
581
+ actions: na,
582
+ paginationConfig: {
583
+ pagination: !0,
584
+ paginationType: "infinite-scroll",
585
+ loadMore: () => le && ca({ cancelRefetch: !1 }),
586
+ hasMore: le
587
+ },
588
+ dataTestId: "manageTranslation-table",
589
+ isLoading: X ? de || De : !1,
590
+ styleConfig: { tableStyle: { maxHeight: 120 } }
591
+ }
592
+ ) })
593
+ ] }) })
594
+ ] });
595
+ }
596
+ const gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
597
+ __proto__: null,
598
+ default: $a
599
+ }, Symbol.toStringTag, { value: "Module" }));
600
+ export {
601
+ Pa as A,
602
+ Va as L,
603
+ gl as M,
604
+ ja as a,
605
+ sl as b,
606
+ ol as c,
607
+ rl as d,
608
+ Oa as e,
609
+ cl as f,
610
+ Fa as g,
611
+ ul as h,
612
+ pl as i,
613
+ ml as t,
614
+ dl as u
615
+ };
616
+ //# sourceMappingURL=ManageTranslation-BTxvSYKb-C2CZwkRN.js.map