@argusoft/medplat-core 1.0.14 → 1.0.16

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