@argusoft/medplat-core 1.0.0

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 (113) hide show
  1. package/dist/AccessRights-sgIhYR30.js +1238 -0
  2. package/dist/AccessRights-sgIhYR30.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-BaZxS2Cm.js +289 -0
  4. package/dist/AddEditQueryBuilder-BaZxS2Cm.js.map +1 -0
  5. package/dist/AddEditQueryBuilder.css +1 -0
  6. package/dist/AddFeatures-BxXCC6ex.js +212 -0
  7. package/dist/AddFeatures-BxXCC6ex.js.map +1 -0
  8. package/dist/AddLabelModal-DE3ploGD.js +734 -0
  9. package/dist/AddLabelModal-DE3ploGD.js.map +1 -0
  10. package/dist/AddMenuConfiguration-QWfpcnuP.js +2237 -0
  11. package/dist/AddMenuConfiguration-QWfpcnuP.js.map +1 -0
  12. package/dist/AddMenuConfiguration.css +1 -0
  13. package/dist/AddRoleDrawer-ZK1eejxI.js +453 -0
  14. package/dist/AddRoleDrawer-ZK1eejxI.js.map +1 -0
  15. package/dist/AppModal-BgZyfrd-.js +428 -0
  16. package/dist/AppModal-BgZyfrd-.js.map +1 -0
  17. package/dist/ChangePasswordModal-MV7g8tkA.js +176 -0
  18. package/dist/ChangePasswordModal-MV7g8tkA.js.map +1 -0
  19. package/dist/ConditionConfig-BqWe0NKO.js +395 -0
  20. package/dist/ConditionConfig-BqWe0NKO.js.map +1 -0
  21. package/dist/ConditionConfig.css +1 -0
  22. package/dist/EntityManagement-D-x6Qzal.js +50 -0
  23. package/dist/EntityManagement-D-x6Qzal.js.map +1 -0
  24. package/dist/EventConfigurations-jGCJ4LqP.js +384 -0
  25. package/dist/EventConfigurations-jGCJ4LqP.js.map +1 -0
  26. package/dist/EventConfigurations.css +1 -0
  27. package/dist/EventsExceptionModal-BF6E1Np7.js +200 -0
  28. package/dist/EventsExceptionModal-BF6E1Np7.js.map +1 -0
  29. package/dist/EventsSkeleton-BN7_0IGs.js +74 -0
  30. package/dist/EventsSkeleton-BN7_0IGs.js.map +1 -0
  31. package/dist/FeatureMenu-BYSRoNm0.js +249 -0
  32. package/dist/FeatureMenu-BYSRoNm0.js.map +1 -0
  33. package/dist/Features-CKMmuqcs.js +11 -0
  34. package/dist/Features-CKMmuqcs.js.map +1 -0
  35. package/dist/FlywayQuery-Cx2sly6g.js +169 -0
  36. package/dist/FlywayQuery-Cx2sly6g.js.map +1 -0
  37. package/dist/ImmunizationConfigurationBase-CdCgDaAl.js +5299 -0
  38. package/dist/ImmunizationConfigurationBase-CdCgDaAl.js.map +1 -0
  39. package/dist/ImmunizationConfigurationBase.css +1 -0
  40. package/dist/ImmunizationConfigurationsList-CQnxWa09.js +335 -0
  41. package/dist/ImmunizationConfigurationsList-CQnxWa09.js.map +1 -0
  42. package/dist/ImmunizationSkeleton-D2tdv5k-.js +186 -0
  43. package/dist/ImmunizationSkeleton-D2tdv5k-.js.map +1 -0
  44. package/dist/LanguagesModal-rk6IGQwY.js +394 -0
  45. package/dist/LanguagesModal-rk6IGQwY.js.map +1 -0
  46. package/dist/ManageDynamicFeature-CeeqiS3K.js +4189 -0
  47. package/dist/ManageDynamicFeature-CeeqiS3K.js.map +1 -0
  48. package/dist/ManageEventConfiguration-BRXh51fc.js +1017 -0
  49. package/dist/ManageEventConfiguration-BRXh51fc.js.map +1 -0
  50. package/dist/ManageEventConfiguration.css +1 -0
  51. package/dist/ManageNotification-B4prX-9Z.js +6819 -0
  52. package/dist/ManageNotification-B4prX-9Z.js.map +1 -0
  53. package/dist/ManageRole-ByqBmjuc.js +699 -0
  54. package/dist/ManageRole-ByqBmjuc.js.map +1 -0
  55. package/dist/ManageTranslation-BTxvSYKb.js +616 -0
  56. package/dist/ManageTranslation-BTxvSYKb.js.map +1 -0
  57. package/dist/ManageTranslation.css +1 -0
  58. package/dist/ManageUser-PHiTNyF8.js +2160 -0
  59. package/dist/ManageUser-PHiTNyF8.js.map +1 -0
  60. package/dist/ManageUser.css +1 -0
  61. package/dist/MobileMenuManagement-DmQU5TTo.js +108 -0
  62. package/dist/MobileMenuManagement-DmQU5TTo.js.map +1 -0
  63. package/dist/MobileTypeEventConfigModal-BCp-SF4-.js +783 -0
  64. package/dist/MobileTypeEventConfigModal-BCp-SF4-.js.map +1 -0
  65. package/dist/NewServerManagement-5YcAtF-g.js +1002 -0
  66. package/dist/NewServerManagement-5YcAtF-g.js.map +1 -0
  67. package/dist/NotificationFlywayQuery-BY8Zzml_.js +244 -0
  68. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +1 -0
  69. package/dist/NotificationList-BkpOrCpM.js +400 -0
  70. package/dist/NotificationList-BkpOrCpM.js.map +1 -0
  71. package/dist/OtherTypeEventConfigModal-DPB8IYzj.js +2001 -0
  72. package/dist/OtherTypeEventConfigModal-DPB8IYzj.js.map +1 -0
  73. package/dist/QueryBuilder-Cus_mRwZ.js +378 -0
  74. package/dist/QueryBuilder-Cus_mRwZ.js.map +1 -0
  75. package/dist/QueryBuilder.css +1 -0
  76. package/dist/QueryManagement-DXA73N2j.js +671 -0
  77. package/dist/QueryManagement-DXA73N2j.js.map +1 -0
  78. package/dist/QueryManagement.css +1 -0
  79. package/dist/RoleManagement-CLaEJ90J.js +410 -0
  80. package/dist/RoleManagement-CLaEJ90J.js.map +1 -0
  81. package/dist/ServerSyncModal-uNjGCQJz.js +869 -0
  82. package/dist/ServerSyncModal-uNjGCQJz.js.map +1 -0
  83. package/dist/ShowFlywayQuery-DMsAbtOW.js +130 -0
  84. package/dist/ShowFlywayQuery-DMsAbtOW.js.map +1 -0
  85. package/dist/ShowFlywayQuery-DVRCd384.js +259 -0
  86. package/dist/ShowFlywayQuery-DVRCd384.js.map +1 -0
  87. package/dist/ShowQueryHistory-BDN0tzHg.js +190 -0
  88. package/dist/ShowQueryHistory-BDN0tzHg.js.map +1 -0
  89. package/dist/SubMenu-BHcSNSUF.js +187 -0
  90. package/dist/SubMenu-BHcSNSUF.js.map +1 -0
  91. package/dist/TableDetails-DzREeJkm.js +1508 -0
  92. package/dist/TableDetails-DzREeJkm.js.map +1 -0
  93. package/dist/TableList-B9hr05Hs.js +428 -0
  94. package/dist/TableList-B9hr05Hs.js.map +1 -0
  95. package/dist/TypeConfiguration-BYM8PjV9.js +117 -0
  96. package/dist/TypeConfiguration-BYM8PjV9.js.map +1 -0
  97. package/dist/UserList-BxB1tCwM.js +13042 -0
  98. package/dist/UserList-BxB1tCwM.js.map +1 -0
  99. package/dist/UserList.css +1 -0
  100. package/dist/UserListSkeleton-cglK2SaU.js +184 -0
  101. package/dist/UserListSkeleton-cglK2SaU.js.map +1 -0
  102. package/dist/WidgetList-BSApErov.js +188 -0
  103. package/dist/WidgetList-BSApErov.js.map +1 -0
  104. package/dist/_commonjsHelpers-BItOPCY9.js +29 -0
  105. package/dist/_commonjsHelpers-BItOPCY9.js.map +1 -0
  106. package/dist/i18next-CTOWN_jH.js +1394 -0
  107. package/dist/i18next-CTOWN_jH.js.map +1 -0
  108. package/dist/index.js +481 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/manageImmunization-B4swS745.js +1204 -0
  111. package/dist/manageImmunization-B4swS745.js.map +1 -0
  112. package/dist/manageImmunization.css +1 -0
  113. package/package.json +79 -0
@@ -0,0 +1,2237 @@
1
+ import { jsxs as p, jsx as e, Fragment as Ze } from "react/jsx-runtime";
2
+ import { execute as ve } from "@/common/services/QueryBuilder";
3
+ import { showToast as ie } from "@/common/toaster/toaster";
4
+ import { useDroppable as nt, DndContext as Nt, useDraggable as Mt, DragOverlay as an, rectIntersection as At, closestCenter as sn } from "@dnd-kit/core";
5
+ import { SortableContext as De, verticalListSortingStrategy as Ue, arrayMove as Pe, useSortable as rt } from "@dnd-kit/sortable";
6
+ import { Box as U, Typography as S, FormControl as Ve, InputLabel as ln, Select as cn, MenuItem as Tt, Tooltip as dn, Paper as xe, IconButton as un, Divider as ot, Button as Ge, Switch as Ot, TextField as Qe, InputAdornment as pn, Accordion as Ye, AccordionSummary as Je, AccordionDetails as Xe, Grid2 as fn, Autocomplete as mn } from "@mui/material";
7
+ import v from "@mui/material/Grid2";
8
+ import { Grid as ye, Box as N } from "@mui/system";
9
+ import K, { createContext as hn, useState as k, useCallback as Re, useMemo as Fe, useEffect as Ke } from "react";
10
+ import { useForm as gn } from "react-hook-form";
11
+ import { useSelector as xn } from "react-redux";
12
+ import { useLocation as yn, useNavigate as bn } from "react-router";
13
+ import Sn from "@/views/custom-components/CustomDropdown";
14
+ import m from "prop-types";
15
+ import { FontAwesomeIcon as W } from "@fortawesome/react-fontawesome";
16
+ import { faWifi as Cn, faSignal as In, faBatteryFull as vn, faLocationDot as Rn, faRotate as wn, faBell as En, faCircleUser as An, faChevronDown as _t, faMagnifyingGlass as kt, faTimes as Tn, faTrashCan as On } from "@fortawesome/free-solid-svg-icons";
17
+ import Nn from "@/assets/img/home.svg";
18
+ import Mn from "@/assets/img/programs.svg";
19
+ import _n from "@/assets/img/analytics.svg";
20
+ import kn from "@/assets/img/family-management.svg";
21
+ import { CSS as Fn } from "@dnd-kit/utilities";
22
+ import X from "@/common/fontAwesomeIcons/FontAwesomeIcons";
23
+ import { generateUUID as ge } from "@/utils/UUIDgenerator";
24
+ import Pn from "@/views/custom-components/CustomConfirmationModal";
25
+ import './AddMenuConfiguration.css';const Gn = hn(), Dn = ({ id: o, children: c, componentType: d }) => {
26
+ const { attributes: b, listeners: E, setNodeRef: u, isDragging: y } = rt({
27
+ id: o,
28
+ data: { sortable: !0, type: d }
29
+ }), R = {
30
+ opacity: y ? 0.3 : 1
31
+ };
32
+ return K.cloneElement(c, {
33
+ ref: u,
34
+ style: { ...c.props.style, ...R },
35
+ dnd: { listeners: E, attributes: b }
36
+ });
37
+ }, Un = ({ id: o, children: c, componentType: d }) => {
38
+ const { attributes: b, listeners: E, setNodeRef: u, isDragging: y } = Mt({
39
+ id: o,
40
+ data: {
41
+ type: d,
42
+ deletable: !0
43
+ }
44
+ }), R = {
45
+ opacity: y ? 0.3 : 1
46
+ };
47
+ return K.cloneElement(c, {
48
+ ref: u,
49
+ style: { ...c.props.style, ...R },
50
+ ...E,
51
+ ...b
52
+ });
53
+ }, Ft = ({ id: o, children: c, sectionId: d, featureName: b }) => {
54
+ const { attributes: E, listeners: u, setNodeRef: y, isDragging: R } = rt({
55
+ id: o,
56
+ data: {
57
+ sortable: !0,
58
+ type: "FEATURE_TILE",
59
+ sectionId: d,
60
+ name: b
61
+ }
62
+ }), F = {
63
+ opacity: R ? 0.3 : 1
64
+ };
65
+ return K.cloneElement(c, {
66
+ ref: y,
67
+ style: { ...c.props.style, ...F },
68
+ ...E,
69
+ ...u
70
+ });
71
+ }, it = K.forwardRef(({ id: o, style: c, handleSectionClick: d, ...b }, E) => /* @__PURE__ */ p(
72
+ U,
73
+ {
74
+ id: o,
75
+ ref: E,
76
+ onContextMenu: (y) => {
77
+ y.preventDefault(), d(o);
78
+ },
79
+ sx: {
80
+ ...c,
81
+ width: "100%",
82
+ minHeight: "50px",
83
+ p: 1.5,
84
+ border: "1px solid #ccc",
85
+ borderRadius: "8px",
86
+ backgroundColor: "#fff",
87
+ display: "flex",
88
+ alignItems: "center",
89
+ mt: 1,
90
+ boxShadow: "0 1px 3px rgba(0,0,0,0.05)",
91
+ mb: 3
92
+ },
93
+ ...b,
94
+ children: [
95
+ /* @__PURE__ */ e(W, { icon: kt, style: { marginRight: "8px", color: "#888" } }),
96
+ /* @__PURE__ */ e(S, { variant: "body2", color: "textSecondary", sx: { flexGrow: 1 }, children: "Search..." })
97
+ ]
98
+ }
99
+ ));
100
+ it.displayName = "MobileSearchBar";
101
+ it.propTypes = {
102
+ id: m.any,
103
+ style: m.any,
104
+ handleSectionClick: m.any
105
+ };
106
+ const at = K.forwardRef(
107
+ ({
108
+ id: o,
109
+ arrayIndex: c,
110
+ sectionTitle: d,
111
+ handleSectionClick: b,
112
+ dnd: E,
113
+ sectionFeatures: u,
114
+ SvgIconBox: y,
115
+ onGroupClick: R,
116
+ activeGroupId: F,
117
+ ...Q
118
+ }, ee) => {
119
+ const { listeners: de, attributes: T } = E || {}, te = (A) => {
120
+ A.preventDefault(), b(o);
121
+ }, M = (A) => {
122
+ A.stopPropagation();
123
+ }, ne = (A, j) => {
124
+ A.preventDefault(), A.stopPropagation(), R && R(A, j);
125
+ }, { setNodeRef: ae, isOver: ue } = nt({
126
+ id: `section-drop-zone-${o}`,
127
+ data: {
128
+ type: "SECTION_DROP_ZONE",
129
+ sectionId: o
130
+ }
131
+ });
132
+ return /* @__PURE__ */ p(
133
+ U,
134
+ {
135
+ id: o,
136
+ ref: ee,
137
+ ...de,
138
+ ...T,
139
+ onContextMenu: te,
140
+ sx: {
141
+ display: "flex",
142
+ flexDirection: "column",
143
+ alignItems: "flex-start",
144
+ justifyContent: "flex-start",
145
+ p: 1,
146
+ border: ue ? "1px dashed #073149" : "0.1px solid #A9BCCD",
147
+ cursor: "pointer",
148
+ backgroundColor: "#e6f0ff",
149
+ borderRadius: "14px",
150
+ mt: 1
151
+ },
152
+ ...Q,
153
+ children: [
154
+ /* @__PURE__ */ e(
155
+ U,
156
+ {
157
+ sx: {
158
+ display: "flex",
159
+ justifyContent: "space-between",
160
+ alignItems: "center",
161
+ width: "100%",
162
+ mb: 0.5
163
+ },
164
+ children: /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "bold", color: "#073149", flexGrow: 1 }, children: d || `Section ${c + 1}` })
165
+ }
166
+ ),
167
+ /* @__PURE__ */ e(
168
+ U,
169
+ {
170
+ ref: ae,
171
+ sx: {
172
+ width: "100%",
173
+ minHeight: "40px",
174
+ border: `${ue ? "1px dashed #073149" : ""}`,
175
+ borderRadius: "4px",
176
+ textAlign: "center",
177
+ display: "flex",
178
+ flexDirection: "column",
179
+ alignItems: "center",
180
+ justifyContent: (u == null ? void 0 : u.length) > 0 ? "flex-start" : "center",
181
+ transition: "background-color 0.1s"
182
+ },
183
+ children: (u == null ? void 0 : u.length) > 0 ? /* @__PURE__ */ e(De, { items: u.map((A) => A.instanceId), strategy: Ue, children: /* @__PURE__ */ e(ye, { container: !0, spacing: 1, sx: { width: "100%", m: 0 }, children: u.map((A) => {
184
+ const j = A.type === "GROUP", be = j && F === A.instanceId;
185
+ return /* @__PURE__ */ e(
186
+ Ft,
187
+ {
188
+ id: A.instanceId,
189
+ sectionId: o,
190
+ featureName: A.name,
191
+ children: /* @__PURE__ */ e(
192
+ ye,
193
+ {
194
+ item: !0,
195
+ xs: 3,
196
+ sm: 3,
197
+ sx: {
198
+ flexBasis: "calc(25% - 8px)",
199
+ maxWidth: "calc(25% - 8px)",
200
+ flexGrow: 0,
201
+ flexShrink: 0,
202
+ minWidth: 0
203
+ },
204
+ children: /* @__PURE__ */ p(
205
+ U,
206
+ {
207
+ onClick: (P) => A.type === "FEATURE" && M(P),
208
+ onContextMenu: (P) => A.type === "GROUP" && ne(P, A),
209
+ sx: {
210
+ display: "flex",
211
+ flexDirection: "column",
212
+ alignItems: "center",
213
+ justifyContent: "flex-start",
214
+ p: 0.5,
215
+ height: "100%",
216
+ backgroundColor: "transparent",
217
+ cursor: j ? "pointer" : "grab",
218
+ minWidth: 0,
219
+ overflow: "hidden",
220
+ "&:hover": {
221
+ backgroundColor: "#f5f5f5"
222
+ }
223
+ },
224
+ children: [
225
+ Ut(
226
+ Object.prototype.hasOwnProperty.call(A, "icon") ? A.icon : null,
227
+ y
228
+ ),
229
+ /* @__PURE__ */ e(
230
+ S,
231
+ {
232
+ variant: "body2",
233
+ sx: {
234
+ mt: 0.5,
235
+ textAlign: "center",
236
+ lineHeight: 1.2,
237
+ width: "100%",
238
+ fontSize: "0.7rem",
239
+ color: "#073149",
240
+ fontWeight: "bold",
241
+ letterSpacing: 0.2,
242
+ whiteSpace: "normal",
243
+ wordBreak: "break-word",
244
+ overflowWrap: "break-word"
245
+ },
246
+ children: Dt(A.name)
247
+ }
248
+ ),
249
+ j && /* @__PURE__ */ e(U, { sx: { ml: 0.5, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e(
250
+ W,
251
+ {
252
+ icon: _t,
253
+ sx: {
254
+ fontSize: "0.7rem",
255
+ color: "#073149",
256
+ transition: "transform 0.2s",
257
+ transform: be ? "rotate(180deg)" : "rotate(0deg)"
258
+ }
259
+ }
260
+ ) })
261
+ ]
262
+ }
263
+ )
264
+ }
265
+ )
266
+ },
267
+ A.instanceId
268
+ );
269
+ }) }) }) : /* @__PURE__ */ e(S, { variant: "caption", color: "textSecondary", children: ue ? "Drop Feature Here" : "Drag features here later." })
270
+ }
271
+ )
272
+ ]
273
+ }
274
+ );
275
+ }
276
+ );
277
+ at.displayName = "MobileSection";
278
+ at.propTypes = {
279
+ id: m.any,
280
+ arrayIndex: m.any,
281
+ sectionTitle: m.any,
282
+ handleSectionClick: m.any,
283
+ dnd: m.any,
284
+ sectionFeatures: m.any,
285
+ SvgIconBox: m.any,
286
+ onGroupClick: m.any,
287
+ activeGroupId: m.any
288
+ };
289
+ const Pt = ({ feature: o, SvgIconBox: c, handleFeatureClick: d }) => {
290
+ const { attributes: b, listeners: E, setNodeRef: u, transform: y, transition: R, isDragging: F } = rt({
291
+ id: o.uuid || o.id
292
+ }), Q = {
293
+ transform: Fn.Transform.toString(y),
294
+ transition: R,
295
+ zIndex: F ? 2e3 : 1,
296
+ opacity: F ? 0.8 : 1,
297
+ boxShadow: F ? "0px 4px 10px rgba(0,0,0,0.1)" : "none"
298
+ };
299
+ return /* @__PURE__ */ e(
300
+ ye,
301
+ {
302
+ item: !0,
303
+ xs: 4,
304
+ ref: u,
305
+ style: Q,
306
+ sx: {
307
+ flexBasis: "calc(33.3333% - 8px)",
308
+ maxWidth: "calc(33.3333% - 8px)",
309
+ flexGrow: 0,
310
+ flexShrink: 0,
311
+ minWidth: 0,
312
+ p: 0.5
313
+ },
314
+ children: /* @__PURE__ */ p(
315
+ U,
316
+ {
317
+ onClick: (T) => {
318
+ T.stopPropagation(), d && d();
319
+ },
320
+ ...E,
321
+ ...b,
322
+ sx: {
323
+ display: "flex",
324
+ flexDirection: "column",
325
+ alignItems: "center",
326
+ justifyContent: "flex-start",
327
+ p: 0.5,
328
+ height: "100%",
329
+ backgroundColor: "transparent",
330
+ cursor: "grab",
331
+ minWidth: 0,
332
+ overflow: "hidden",
333
+ borderRadius: "8px",
334
+ "&:hover": {
335
+ backgroundColor: "#f5f5f5"
336
+ }
337
+ },
338
+ children: [
339
+ /* @__PURE__ */ e(U, { sx: { mt: 0.5, mb: 0.5, display: "flex", alignItems: "center" }, children: ((T, te) => {
340
+ let M = null;
341
+ if (typeof T == "object" && T !== null ? T.type === "svg" && typeof T.content == "string" ? M = T.content : typeof T.svg == "string" && (M = T.svg) : typeof T == "string" ? M = T : typeof o.icon == "object" && o.icon !== null && (M = o.icon.content || o.icon.svg), typeof M == "string" && M.includes("<svg")) {
342
+ const ne = M.match(/<svg[\s\S]*<\/svg>/i);
343
+ ne && (M = ne[0]);
344
+ }
345
+ return M ? /* @__PURE__ */ e(U, { sx: { height: "24px", width: "24px", display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(te, { svg: M }) }) : /* @__PURE__ */ e(
346
+ U,
347
+ {
348
+ sx: {
349
+ height: "24px",
350
+ width: "24px",
351
+ display: "flex",
352
+ justifyContent: "center",
353
+ alignItems: "center",
354
+ color: "#b0bec5",
355
+ border: "1px solid",
356
+ borderRadius: "4px",
357
+ fontSize: "0.8rem"
358
+ },
359
+ children: "?"
360
+ }
361
+ );
362
+ })(o.icon, c) }),
363
+ /* @__PURE__ */ e(
364
+ S,
365
+ {
366
+ variant: "body2",
367
+ sx: {
368
+ mt: 0.5,
369
+ textAlign: "center",
370
+ lineHeight: 1.2,
371
+ width: "100%",
372
+ fontSize: "0.7rem",
373
+ color: "#073149",
374
+ fontWeight: "bold",
375
+ letterSpacing: 0.2,
376
+ whiteSpace: "normal",
377
+ wordBreak: "break-word",
378
+ overflowWrap: "break-word",
379
+ p: "0 4px"
380
+ },
381
+ children: o.name
382
+ }
383
+ )
384
+ ]
385
+ }
386
+ )
387
+ }
388
+ );
389
+ };
390
+ Pt.propTypes = {
391
+ feature: m.any,
392
+ SvgIconBox: m.any,
393
+ handleFeatureClick: m.any
394
+ };
395
+ function Gt({
396
+ tabStatus: o,
397
+ layoutComponents: c,
398
+ componentTypes: d,
399
+ handleSectionClick: b,
400
+ activeElementId: E,
401
+ activeTabId: u,
402
+ handleTabSwitch: y,
403
+ formList: R,
404
+ selectedForm: F,
405
+ onFormSelect: Q,
406
+ SvgIconBox: ee,
407
+ setCurrentLayoutComponents: de,
408
+ programFeatures: T
409
+ }) {
410
+ const te = "mobile-content", M = u === "programs" ? "PROGRAMS_ROOT_DROP_ZONE" : "LAYOUT_ROOT_DROP_ZONE", { setNodeRef: ne, isOver: ae } = nt({
411
+ id: te,
412
+ data: {
413
+ type: M,
414
+ sectionId: te
415
+ }
416
+ }), A = [
417
+ { id: "home", label: "Home", icon: Nn, alt: "Home" },
418
+ { id: "programs", label: "Programs", icon: Mn, alt: "Programs" },
419
+ { id: "analytics", label: "Analytics", icon: _n, alt: "Analytics" },
420
+ { id: "familyManagement", label: "Family Management", icon: kn, alt: "Family Management" }
421
+ ].filter((f) => o[f.id]), j = c.find((f) => f.type === d.SEARCH_BAR), be = c.filter((f) => f.type === d.SECTION), [P, se] = k({
422
+ anchorEl: null,
423
+ groupData: null
424
+ }), $ = Re(
425
+ (f, G) => {
426
+ var H;
427
+ const q = f.currentTarget;
428
+ ((H = P.groupData) == null ? void 0 : H.instanceId) === G.instanceId ? Se() : se({
429
+ anchorEl: q,
430
+ groupData: G
431
+ });
432
+ },
433
+ [P.groupData]
434
+ ), Se = Re(() => {
435
+ se({ anchorEl: null, groupData: null });
436
+ }, []), Be = (f) => {
437
+ var H;
438
+ const G = f.type === "GROUP", q = G && ((H = P.groupData) == null ? void 0 : H.instanceId) === f.instanceId;
439
+ return /* @__PURE__ */ e(
440
+ Ft,
441
+ {
442
+ id: f.instanceId,
443
+ sectionId: null,
444
+ featureName: f.name,
445
+ children: /* @__PURE__ */ e(
446
+ ye,
447
+ {
448
+ item: !0,
449
+ xs: 4,
450
+ sm: 4,
451
+ sx: {
452
+ flexBasis: "calc(33.3333% - 8px)",
453
+ maxWidth: "calc(33.3333% - 8px)",
454
+ flexGrow: 0,
455
+ flexShrink: 0,
456
+ minWidth: 0
457
+ },
458
+ children: /* @__PURE__ */ p(
459
+ U,
460
+ {
461
+ onClick: (L) => f.type === "FEATURE" && L.stopPropagation(),
462
+ onContextMenu: (L) => f.type === "GROUP" && $(L, f),
463
+ sx: {
464
+ display: "flex",
465
+ flexDirection: "column",
466
+ alignItems: "center",
467
+ justifyContent: "flex-start",
468
+ p: 0.5,
469
+ height: "100%",
470
+ backgroundColor: "transparent",
471
+ cursor: G ? "pointer" : "grab",
472
+ minWidth: 0,
473
+ overflow: "hidden",
474
+ "&:hover": {
475
+ backgroundColor: "#f5f5f5"
476
+ }
477
+ },
478
+ children: [
479
+ Ut(Object.prototype.hasOwnProperty.call(f, "icon") ? f.icon : null, ee),
480
+ /* @__PURE__ */ e(
481
+ S,
482
+ {
483
+ variant: "body2",
484
+ sx: {
485
+ mt: 0.5,
486
+ textAlign: "center",
487
+ lineHeight: 1.2,
488
+ width: "100%",
489
+ fontSize: "0.7rem",
490
+ color: "#073149",
491
+ fontWeight: "bold",
492
+ letterSpacing: 0.2,
493
+ whiteSpace: "normal",
494
+ wordBreak: "break-word",
495
+ overflowWrap: "break-word"
496
+ },
497
+ children: Dt(f.name)
498
+ }
499
+ ),
500
+ G && /* @__PURE__ */ e(U, { sx: { ml: 0.5, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e(
501
+ W,
502
+ {
503
+ icon: _t,
504
+ sx: {
505
+ fontSize: "0.7rem",
506
+ color: "#073149",
507
+ transition: "transform 0.2s",
508
+ transform: q ? "rotate(180deg)" : "rotate(0deg)"
509
+ }
510
+ }
511
+ ) })
512
+ ]
513
+ }
514
+ )
515
+ }
516
+ )
517
+ },
518
+ f.instanceId
519
+ );
520
+ }, ze = (f) => {
521
+ const { active: G, over: q } = f;
522
+ if (!q || G.id === q.id || !P.groupData)
523
+ return;
524
+ const H = P.groupData.instanceId;
525
+ let L = null;
526
+ de((Ce) => Ce.map((pe) => pe.features ? {
527
+ ...pe,
528
+ features: pe.features.map((B) => {
529
+ if (B.instanceId === H && B.type === "GROUP" && B.menus) {
530
+ const fe = B.menus.findIndex((Y) => (Y.uuid || Y.instanceId) === G.id), Ie = B.menus.findIndex((Y) => (Y.uuid || Y.instanceId) === q.id);
531
+ if (fe !== -1 && Ie !== -1) {
532
+ const Y = Pe(B.menus, fe, Ie);
533
+ return L = { ...B, menus: Y }, L;
534
+ }
535
+ }
536
+ return B;
537
+ })
538
+ } : pe)), L && se((Ce) => ({
539
+ ...Ce,
540
+ groupData: L
541
+ }));
542
+ }, Ae = () => {
543
+ Se();
544
+ }, Te = (f, G) => {
545
+ var H;
546
+ const q = f.id === E;
547
+ return /* @__PURE__ */ e(Dn, { id: f.id, componentType: d.SECTION, isSortable: !0, children: /* @__PURE__ */ e(
548
+ at,
549
+ {
550
+ id: f.id,
551
+ arrayIndex: G,
552
+ sectionTitle: f.title,
553
+ handleSectionClick: b,
554
+ sectionFeatures: f.features,
555
+ isActive: q,
556
+ SvgIconBox: ee,
557
+ onGroupClick: $,
558
+ activeGroupId: (H = P.groupData) == null ? void 0 : H.instanceId
559
+ }
560
+ ) }, f.id);
561
+ };
562
+ return /* @__PURE__ */ p("div", { className: "mobile-screen-v2", id: "mobile-screen", children: [
563
+ /* @__PURE__ */ p("div", { className: "status-bar-v2", children: [
564
+ /* @__PURE__ */ e("span", { className: "time-v2", children: "12:16" }),
565
+ /* @__PURE__ */ e("div", { className: "notch-v2" }),
566
+ /* @__PURE__ */ p("div", { className: "right-status-icons-v2", children: [
567
+ /* @__PURE__ */ e("span", { "aria-label": "wifi", children: /* @__PURE__ */ e(W, { icon: Cn }) }),
568
+ /* @__PURE__ */ e("span", { "aria-label": "signal", children: /* @__PURE__ */ e(W, { icon: In }) }),
569
+ /* @__PURE__ */ e("span", { "aria-label": "battery", className: "battery-icon", children: /* @__PURE__ */ e(W, { icon: vn }) })
570
+ ] })
571
+ ] }),
572
+ /* @__PURE__ */ p("div", { className: "header-v2", children: [
573
+ /* @__PURE__ */ p("div", { className: "location-v2", children: [
574
+ /* @__PURE__ */ e(W, { icon: Rn }),
575
+ /* @__PURE__ */ e("span", { className: "location-text-v2", children: "પાલડી-કાંકજ" })
576
+ ] }),
577
+ /* @__PURE__ */ p("div", { className: "header-actions-v2", children: [
578
+ /* @__PURE__ */ e("span", { className: "action-icon-v2 rotate-icon", role: "button", "aria-label": "refresh", children: /* @__PURE__ */ e(W, { icon: wn }) }),
579
+ /* @__PURE__ */ e("span", { className: "action-icon-v2 notification-outline", role: "button", "aria-label": "notifications", children: /* @__PURE__ */ e(W, { icon: En }) }),
580
+ /* @__PURE__ */ e("span", { className: "action-icon-v2 profile-icon", role: "button", "aria-label": "profile", children: /* @__PURE__ */ e(W, { icon: An }) })
581
+ ] })
582
+ ] }),
583
+ /* @__PURE__ */ e(
584
+ "div",
585
+ {
586
+ className: "content-v2",
587
+ id: "mobile-content",
588
+ ref: u !== "familyManagement" ? ne : null,
589
+ style: {
590
+ border: u !== "familyManagement" && ae ? "2px dashed #073149" : "none",
591
+ backgroundColor: u !== "familyManagement" && ae ? "#f0f4f8" : "transparent",
592
+ minHeight: "300px",
593
+ maxHeight: "calc(100% - 110px)",
594
+ overflowY: "auto",
595
+ padding: "8px",
596
+ marginTop: u === "programs" ? 20 : 0,
597
+ marginLeft: u === "programs" ? 3 : 0
598
+ },
599
+ children: u === "familyManagement" ? /* @__PURE__ */ p(
600
+ U,
601
+ {
602
+ sx: {
603
+ p: 2,
604
+ width: "100%",
605
+ display: "flex",
606
+ flexDirection: "column",
607
+ alignItems: "center",
608
+ justifyContent: "center",
609
+ height: "100%"
610
+ },
611
+ children: [
612
+ /* @__PURE__ */ e(S, { variant: "body1", sx: { mb: 2, fontWeight: "bold" }, children: "Select Form for Family Management" }),
613
+ /* @__PURE__ */ p(Ve, { fullWidth: !0, sx: { maxWidth: "90%", mb: 2 }, children: [
614
+ /* @__PURE__ */ e(ln, { id: "form-selector-label", children: "Form Name" }),
615
+ /* @__PURE__ */ p(
616
+ cn,
617
+ {
618
+ labelId: "form-selector-label",
619
+ id: "form-selector",
620
+ value: (F == null ? void 0 : F.code) || "",
621
+ label: "Form Name",
622
+ onChange: Q,
623
+ MenuProps: {
624
+ PaperProps: {
625
+ style: {
626
+ maxHeight: 240
627
+ }
628
+ }
629
+ },
630
+ children: [
631
+ R == null ? void 0 : R.map((f) => /* @__PURE__ */ e(Tt, { value: f.code, children: f.name }, f.code)),
632
+ (R == null ? void 0 : R.length) === 0 && /* @__PURE__ */ e(Tt, { disabled: !0, children: "No Forms Available" })
633
+ ]
634
+ }
635
+ )
636
+ ] })
637
+ ]
638
+ }
639
+ ) : u === "programs" ? /* @__PURE__ */ e(Ze, { children: T && T.length > 0 ? /* @__PURE__ */ e(De, { items: T.map((f) => f.instanceId), strategy: Ue, children: /* @__PURE__ */ e(ye, { container: !0, spacing: 1, sx: { width: "100%", m: 0 }, children: T.map((f) => Be(f)) }) }) : /* @__PURE__ */ e(S, { variant: "body2", color: "textSecondary", sx: { mt: 5, textAlign: "center" }, children: ae ? "Drop features here (Groups are not allowed)." : "Drag features directly onto the screen." }) }) : /* @__PURE__ */ p(Ze, { children: [
640
+ j && /* @__PURE__ */ e(Un, { id: j.id, componentType: d.SEARCH_BAR, children: /* @__PURE__ */ e(
641
+ it,
642
+ {
643
+ id: j.id,
644
+ style: { marginBottom: "8px" },
645
+ handleSectionClick: b
646
+ }
647
+ ) }),
648
+ be.map((f, G) => Te(f, G)),
649
+ c.length === 0 && /* @__PURE__ */ e(S, { variant: "body2", color: "textSecondary", sx: { mt: 5, textAlign: "center" }, children: "Drag components here to build the layout." })
650
+ ] })
651
+ }
652
+ ),
653
+ P.groupData && P.anchorEl && /* @__PURE__ */ e("div", { onPointerDown: (f) => f.stopPropagation(), children: /* @__PURE__ */ e(Nt, { onDragEnd: ze, children: /* @__PURE__ */ e(
654
+ Bt,
655
+ {
656
+ groupData: P.groupData,
657
+ anchorEl: P.anchorEl,
658
+ onClose: Se,
659
+ SvgIconBox: ee,
660
+ handleFeatureClick: Ae
661
+ }
662
+ ) }) }),
663
+ /* @__PURE__ */ p("div", { className: "bottom-nav-v2", children: [
664
+ /* @__PURE__ */ e("div", { className: "nav-bar-v2", children: A.map((f) => /* @__PURE__ */ e(dn, { title: f.label, placement: "bottom", arrow: !0, children: /* @__PURE__ */ e(
665
+ "div",
666
+ {
667
+ className: `nav-item-v2 ${u === f.id ? "active-v2" : ""}`,
668
+ role: "button",
669
+ "aria-label": f.label,
670
+ onClick: () => y(f.id),
671
+ children: /* @__PURE__ */ e("img", { src: f.icon, alt: f.alt })
672
+ },
673
+ f.id
674
+ ) }, f.id)) }),
675
+ /* @__PURE__ */ e("div", { className: "home-indicator-v2" })
676
+ ] })
677
+ ] });
678
+ }
679
+ Gt.propTypes = {
680
+ tabStatus: m.any.isRequired,
681
+ layoutComponents: m.any,
682
+ componentTypes: m.any,
683
+ handleSectionClick: m.any,
684
+ activeElementId: m.any,
685
+ activeTabId: m.any,
686
+ handleTabSwitch: m.any,
687
+ formList: m.any,
688
+ selectedForm: m.any,
689
+ onFormSelect: m.any,
690
+ SvgIconBox: m.any,
691
+ setCurrentLayoutComponents: m.any,
692
+ programFeatures: m.any
693
+ };
694
+ const Dt = (o) => {
695
+ const c = o.split(" ");
696
+ return c.map((d, b) => /* @__PURE__ */ p(K.Fragment, { children: [
697
+ d,
698
+ b < c.length - 1 && /* @__PURE__ */ e("br", {})
699
+ ] }, b));
700
+ }, Ut = (o, c) => {
701
+ let d = null;
702
+ if (typeof o == "object" && o !== null ? o.type === "svg" && typeof o.content == "string" ? d = o.content : typeof o.svg == "string" && (d = o.svg) : typeof o == "string" && (d = o), typeof d == "string" && d.includes("<svg")) {
703
+ const b = d.match(/<svg[\s\S]*<\/svg>/i);
704
+ b && (d = b[0]);
705
+ }
706
+ return d ? /* @__PURE__ */ e(
707
+ U,
708
+ {
709
+ sx: {
710
+ height: "36px",
711
+ width: "36px",
712
+ display: "flex",
713
+ justifyContent: "center",
714
+ alignItems: "center"
715
+ },
716
+ children: /* @__PURE__ */ e(c, { svg: d })
717
+ }
718
+ ) : /* @__PURE__ */ e(
719
+ U,
720
+ {
721
+ sx: {
722
+ fontSize: "1.2rem",
723
+ color: "#b0bec5",
724
+ border: "1px solid",
725
+ borderRadius: "50%",
726
+ height: "36px",
727
+ width: "36px",
728
+ display: "flex",
729
+ alignItems: "center",
730
+ justifyContent: "center",
731
+ marginBottom: "4px"
732
+ },
733
+ children: "?"
734
+ }
735
+ );
736
+ }, Bt = ({ groupData: o, anchorEl: c, onClose: d, SvgIconBox: b, handleFeatureClick: E }) => {
737
+ if (!o || !c) return null;
738
+ const u = o.menus || [], y = c.getBoundingClientRect();
739
+ return /* @__PURE__ */ p(
740
+ xe,
741
+ {
742
+ elevation: 8,
743
+ sx: {
744
+ position: "fixed",
745
+ top: y.bottom,
746
+ left: y.left + y.width + 65,
747
+ minWidth: "320px",
748
+ maxWidth: "100%",
749
+ p: 2,
750
+ borderRadius: "12px",
751
+ boxShadow: "0 8px 30px rgba(0,0,0,0.25)",
752
+ backgroundColor: "#f9f9f9",
753
+ zIndex: 1500,
754
+ maxHeight: "400px",
755
+ overflowY: "auto",
756
+ transform: "translateX(-50%)"
757
+ },
758
+ children: [
759
+ /* @__PURE__ */ p(U, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
760
+ /* @__PURE__ */ e(S, { variant: "h6", sx: { color: "#073149", fontWeight: "bold", fontSize: "1rem" }, children: o.name }),
761
+ /* @__PURE__ */ e(un, { onClick: d, size: "small", sx: { color: "#073149", p: 0.5 }, children: /* @__PURE__ */ e(W, { icon: Tn }) })
762
+ ] }),
763
+ /* @__PURE__ */ e(ot, {}),
764
+ u.length > 0 ? /* @__PURE__ */ e(De, { items: u.map((R) => R.uuid || R.instanceId), strategy: Ue, children: /* @__PURE__ */ e(ye, { container: !0, spacing: 1, children: u.map((R) => /* @__PURE__ */ e(
765
+ Pt,
766
+ {
767
+ feature: R,
768
+ SvgIconBox: b,
769
+ handleFeatureClick: E
770
+ },
771
+ R.uuid || R.instanceId
772
+ )) }) }) : /* @__PURE__ */ e(S, { variant: "body2", color: "textSecondary", sx: { fontStyle: "italic", p: 1 }, children: "This menu is empty." })
773
+ ]
774
+ }
775
+ );
776
+ };
777
+ Bt.propTypes = {
778
+ groupData: m.any,
779
+ anchorEl: m.any,
780
+ onClose: m.any,
781
+ SvgIconBox: m.any,
782
+ handleFeatureClick: m.any
783
+ };
784
+ function cr() {
785
+ var ht, gt;
786
+ const o = yn(), c = o.state, d = Fe(() => new URLSearchParams(o.search), [o.search]), b = bn(), [E, u] = k([]), [y, R] = k(!1), [F, Q] = k([]), [ee, de] = k([]), [T, te] = k({}), [M, ne] = k([]), [ae, ue] = k(!0), [A, j] = k(!0), [be, P] = k(!1), { user: se } = xn((t) => t.Authenticate), $ = gn({
787
+ defaultValues: {
788
+ role: "",
789
+ isAttendanceRequired: !1
790
+ },
791
+ mode: "onChange"
792
+ });
793
+ Ke(() => {
794
+ (async () => (await ze(), await Se(), await Be(), d.get("id") && (c != null && c.mobileMenuList) ? (R(!0), $.setValue("role", c.roleId), await Ae(c.roleId)) : R(!1)))();
795
+ }, []), Ke(() => {
796
+ var t;
797
+ if (Object.keys(T).length > 0 && d.get("id") && (c != null && c.mobileMenuList)) {
798
+ const { appConfiguration: n, tabStatus: r, selectedForm: a, isAttendanceRequired: i } = q(
799
+ (t = c == null ? void 0 : c.mobileMenuList) == null ? void 0 : t.configJson
800
+ );
801
+ J(n), Ie(r), ct(a), $.setValue("isAttendanceRequired", i);
802
+ }
803
+ }, [T]);
804
+ const Se = async () => {
805
+ const r = (await ve({
806
+ code: "medplat_form_get_all_form_details",
807
+ parameters: {}
808
+ })).data.result.map((a, i) => ({
809
+ id: a.form_code,
810
+ name: a.form_name,
811
+ code: a.form_code,
812
+ uuid: a.uuid || `temp-uuid-${i}`
813
+ }));
814
+ Q(r);
815
+ }, Be = async () => {
816
+ const n = (await ve({
817
+ code: "get_all_mobile_query",
818
+ parameters: {}
819
+ })).data.result;
820
+ de(n);
821
+ }, ze = async () => {
822
+ try {
823
+ const t = (await ve({
824
+ code: "RETRIEVE_MENU_CONFIG_ROLE_V2"
825
+ })).data;
826
+ t.result && u(t.result);
827
+ } catch (t) {
828
+ ie({
829
+ message: t,
830
+ type: "error"
831
+ });
832
+ }
833
+ }, Ae = async (t) => {
834
+ if (t)
835
+ try {
836
+ const n = (await ve({
837
+ code: "fetch_linked_menus_by_role_id",
838
+ parameters: {
839
+ id: t
840
+ }
841
+ })).data;
842
+ n.result && H(n.result);
843
+ } catch (n) {
844
+ ie({
845
+ message: n,
846
+ type: "error"
847
+ });
848
+ }
849
+ }, Te = (t, n, r) => {
850
+ const a = n[t];
851
+ if (a) return a;
852
+ const i = r.find((s) => s.type === "GROUP" && s.id === t);
853
+ return i || null;
854
+ }, f = (t, n, r, a) => {
855
+ const i = Te(t.id, r, a);
856
+ if (!i) return null;
857
+ const s = ge();
858
+ if (i.type === "GROUP") {
859
+ const l = t.menus.map((C) => {
860
+ const Z = Te(C.id, r, a);
861
+ return Z ? {
862
+ ...Z,
863
+ uuid: ge(),
864
+ isGroupMember: !0,
865
+ groupId: t.id
866
+ } : null;
867
+ }).filter((C) => C !== null);
868
+ return l.length === 0 ? null : {
869
+ ...i,
870
+ id: s,
871
+ instanceId: `${n}_GROUP_${s}`,
872
+ menus: l
873
+ };
874
+ } else if (i.type === "FEATURE") {
875
+ const l = n === "PROGRAMS_ROOT" ? n : `${n}_${i.id}`;
876
+ return {
877
+ ...i,
878
+ id: i.id,
879
+ uuid: s,
880
+ instanceId: `${l}_${s}`
881
+ };
882
+ }
883
+ return null;
884
+ }, G = (t, n, r, a) => {
885
+ if (!t || !Array.isArray(t)) return [];
886
+ if (t.every((i) => i.id && !i.type && !i.features)) {
887
+ const i = n === "programs" ? "PROGRAMS_ROOT" : n;
888
+ return t.map((s) => f(s, i, r, a)).filter((s) => s !== null);
889
+ }
890
+ return t.map((i) => {
891
+ const s = ge();
892
+ if (i.type === "SEARCH_BAR")
893
+ return { ...i, id: s };
894
+ if (i.type === "SECTION") {
895
+ const l = `comp-${s}`, C = i.features.map((Z) => f(Z, l, r, a)).filter((Z) => Z !== null);
896
+ return { type: i.type, title: i.title, id: l, features: C };
897
+ }
898
+ return null;
899
+ }).filter((i) => i !== null);
900
+ }, q = (t) => {
901
+ var s;
902
+ const n = {}, r = {};
903
+ let a = null;
904
+ const i = ((s = t == null ? void 0 : t.isAttendanceRequired) == null ? void 0 : s.value) || !1;
905
+ for (const l in t) {
906
+ const C = t[l];
907
+ if (r[l] = C.active, C.active)
908
+ if (l === "home" && C.layout)
909
+ n[l] = G(C.layout, l, T, M);
910
+ else if (l === "programs" && (C != null && C.features)) {
911
+ const Z = G(C.features, l, T, M);
912
+ n[l] = {
913
+ features: Z
914
+ };
915
+ } else C != null && C.features ? n[l] = G(C == null ? void 0 : C.features, l, T, M) : l === "familyManagement" && C.formCode && (a = {
916
+ formName: `Form for ${C.formCode}`,
917
+ code: C.formCode,
918
+ formUuid: ge()
919
+ });
920
+ else
921
+ l === "programs" ? n[l] = { features: [] } : n[l] = [];
922
+ }
923
+ return {
924
+ appConfiguration: n,
925
+ tabStatus: r,
926
+ selectedForm: a,
927
+ isAttendanceRequired: i
928
+ };
929
+ }, H = (t) => {
930
+ const n = [], r = {};
931
+ t.forEach((a) => {
932
+ const s = JSON.parse(a.menus || "[]").map((l) => {
933
+ const C = {
934
+ uuid: ge(),
935
+ id: l.id ? parseInt(l.id) : null,
936
+ name: l.name || "",
937
+ icon: l.icon || "",
938
+ type: "FEATURE",
939
+ isGroupMember: a.id != null,
940
+ groupId: a.id || null
941
+ };
942
+ return r[C.id] = C, C;
943
+ });
944
+ a.id != null ? n.push({
945
+ uuid: ge(),
946
+ id: a.id,
947
+ name: a.name,
948
+ icon: a.icon || "",
949
+ type: "GROUP",
950
+ menus: s
951
+ }) : n.push(...s);
952
+ }), te(r), ne(n);
953
+ }, L = (t) => {
954
+ var n, r;
955
+ if (t.type === "GROUP") {
956
+ const a = (r = (n = t.menus) == null ? void 0 : n[0]) == null ? void 0 : r.groupId;
957
+ return a ? {
958
+ id: a,
959
+ menus: t.menus.map((i) => ({
960
+ id: i.id
961
+ }))
962
+ } : null;
963
+ } else if (t.type === "FEATURE")
964
+ return {
965
+ id: t.id
966
+ };
967
+ return null;
968
+ }, Ce = (t) => !t || !Array.isArray(t) ? [] : t.map((n) => {
969
+ if (n.type === "SEARCH_BAR")
970
+ return {
971
+ type: n.type,
972
+ queryName: n.queryName
973
+ };
974
+ if (n.type === "SECTION") {
975
+ const r = n == null ? void 0 : n.features.map(L).filter((a) => a !== null);
976
+ return {
977
+ type: n.type,
978
+ title: n.title,
979
+ features: r
980
+ };
981
+ }
982
+ return null;
983
+ }).filter((n) => n !== null), lt = () => {
984
+ const t = {
985
+ isAttendanceRequired: { value: $.getValues("isAttendanceRequired") }
986
+ };
987
+ return B.forEach((n) => {
988
+ var s;
989
+ const r = n.id, a = fe[r], i = {
990
+ active: a
991
+ };
992
+ if (a) {
993
+ if (r === "familyManagement" && We)
994
+ i.formCode = We.code;
995
+ else if (r === "home") {
996
+ const l = he[r] || [];
997
+ i.layout = Ce(l);
998
+ } else if (r === "programs") {
999
+ const l = ((s = he[r]) == null ? void 0 : s.features) || [];
1000
+ l.length > 0 && (i.features = l.map(L).filter((C) => C !== null));
1001
+ } else if (r !== "analytics") {
1002
+ const l = he[r] || [];
1003
+ Array.isArray(l) && (i.features = l.map(L).filter((C) => C !== null));
1004
+ }
1005
+ }
1006
+ t[r] = i;
1007
+ }), t;
1008
+ }, pe = async (t) => {
1009
+ const n = lt(), r = JSON.stringify(n), a = {
1010
+ roleId: t.role,
1011
+ userId: se == null ? void 0 : se.id,
1012
+ config_json: r
1013
+ };
1014
+ try {
1015
+ (await ve({
1016
+ code: "save_mobile_menu_role_relation",
1017
+ parameters: a
1018
+ })).data.result && (ie({
1019
+ message: "Menu configuration saved successfully",
1020
+ type: "success"
1021
+ }), b("/ui/medplat/admin/mobileMenuManagement"));
1022
+ } catch (i) {
1023
+ ie({
1024
+ message: i,
1025
+ type: "error"
1026
+ });
1027
+ }
1028
+ }, B = [
1029
+ { id: "home", name: "Home" },
1030
+ { id: "programs", name: "Programs" },
1031
+ { id: "analytics", name: "Analytics" },
1032
+ { id: "familyManagement", name: "Family Management" }
1033
+ ], [fe, Ie] = k({
1034
+ home: !0,
1035
+ programs: !0,
1036
+ analytics: !0,
1037
+ familyManagement: !0
1038
+ }), Y = (t) => {
1039
+ Ie((n) => {
1040
+ const r = {
1041
+ ...n,
1042
+ [t]: !n[t]
1043
+ };
1044
+ if (t === z && !r[t]) {
1045
+ const i = B.find((s) => s.id !== t && r[s.id] === !0);
1046
+ i ? Oe(i.id) : r.home ? Oe("home") : Oe(B[0].id);
1047
+ }
1048
+ return r;
1049
+ });
1050
+ }, w = {
1051
+ SEARCH_BAR: "SEARCH_BAR",
1052
+ SECTION: "SECTION",
1053
+ FEATURE: "FEATURE",
1054
+ SECTION_DROP_ZONE: "SECTION_DROP_ZONE",
1055
+ GROUP: "GROUP"
1056
+ }, [We, ct] = k(null), Ht = (t) => {
1057
+ const n = t.target.value, r = F.find((a) => a.code === n);
1058
+ ct(r);
1059
+ }, [me, He] = k(null), [dt, ut] = k(null), [z, Oe] = k("home"), [he, J] = k(() => {
1060
+ const t = {};
1061
+ return B.forEach((n) => {
1062
+ t[n.id] = [];
1063
+ }), t;
1064
+ }), [Le, Lt] = k(""), [jt, $t] = k(null), le = ((ht = he.programs) == null ? void 0 : ht.features) || [], qt = (t) => {
1065
+ $t((n) => n === t ? null : t);
1066
+ }, pt = he[z], re = Array.isArray(pt) ? pt : [], je = Fe(() => {
1067
+ const t = Le.toLowerCase();
1068
+ return M.map((n) => {
1069
+ if (n.type === "GROUP") {
1070
+ const r = n.menus.filter((a) => a.name.toLowerCase().includes(t));
1071
+ return n.name.toLowerCase().includes(t) || r.length > 0 ? { ...n, menus: r } : null;
1072
+ }
1073
+ return n.name.toLowerCase().includes(t) ? n : null;
1074
+ }).filter(Boolean);
1075
+ }, [M, Le]), { separatedGroups: Ne, separatedFeatures: Me } = Fe(() => {
1076
+ const t = je.filter((r) => r.type === "GROUP"), n = je.filter((r) => r.type !== "GROUP");
1077
+ return { separatedGroups: t, separatedFeatures: n };
1078
+ }, [je]), oe = Re(
1079
+ (t) => {
1080
+ J((n) => ({
1081
+ ...n,
1082
+ [z]: typeof t == "function" ? t(n[z] || []) : t
1083
+ }));
1084
+ },
1085
+ [z]
1086
+ ), Zt = Re((t) => {
1087
+ Oe(t);
1088
+ }, []), Vt = (t, n, r) => {
1089
+ oe((a) => a.map((i) => i.id === t ? { ...i, [n]: r } : i));
1090
+ }, Qt = (t) => {
1091
+ He(t.active.id);
1092
+ }, Yt = Re(
1093
+ (t) => {
1094
+ var C, Z, xt, yt, bt, St, Ct, It, vt, Rt, wt, Et;
1095
+ const { active: n, over: r } = t;
1096
+ if (!n || !n.data.current) {
1097
+ He(null);
1098
+ return;
1099
+ }
1100
+ const a = (C = r == null ? void 0 : r.data.current) == null ? void 0 : C.type, i = (Z = r == null ? void 0 : r.data.current) == null ? void 0 : Z.sectionId, s = (xt = n.data.current) == null ? void 0 : xt.sectionId, l = (yt = n.data.current) == null ? void 0 : yt.type;
1101
+ if (He(null), !r && z === "programs" && l === w.FEATURE) {
1102
+ const g = n.data.current.data;
1103
+ if (!g) return;
1104
+ J((h) => {
1105
+ const x = h.programs || {}, I = (x == null ? void 0 : x.features) || [], O = {
1106
+ id: g.id,
1107
+ name: g.name,
1108
+ instanceId: `PROGRAMS_ROOT_${g.id}_${crypto.randomUUID()}`,
1109
+ type: "FEATURE",
1110
+ icon: {
1111
+ id: `svg-icon-${g.id}`,
1112
+ content: g.icon,
1113
+ type: "svg"
1114
+ }
1115
+ };
1116
+ return {
1117
+ ...h,
1118
+ programs: {
1119
+ ...x,
1120
+ features: [...I, O]
1121
+ }
1122
+ };
1123
+ });
1124
+ return;
1125
+ }
1126
+ if ((r == null ? void 0 : r.id) === "trash-zone") {
1127
+ const g = n.id, h = n.data.current.sectionId;
1128
+ l === "FEATURE_TILE" ? h ? oe(
1129
+ (x) => x.map((I) => {
1130
+ if (I.id === h && (I != null && I.features)) {
1131
+ const O = I == null ? void 0 : I.features.filter((_) => _.instanceId !== g);
1132
+ return { ...I, features: O };
1133
+ }
1134
+ return I;
1135
+ })
1136
+ ) : z === "programs" && J((x) => {
1137
+ const I = x.programs || {}, _ = ((I == null ? void 0 : I.features) || []).filter((D) => D.instanceId !== g);
1138
+ return {
1139
+ ...x,
1140
+ programs: {
1141
+ ...I,
1142
+ features: _
1143
+ }
1144
+ };
1145
+ }) : (l === w.SECTION || l === w.SEARCH_BAR) && oe((x) => x.filter((I) => I.id !== n.id));
1146
+ return;
1147
+ }
1148
+ if (l === "FEATURE_TILE" && a === "FEATURE_TILE") {
1149
+ if (!s && z === "programs") {
1150
+ J((g) => {
1151
+ const h = g.programs || {}, x = (h == null ? void 0 : h.features) || [], I = x.findIndex((D) => D.instanceId === n.id), O = x.findIndex((D) => D.instanceId === r.id);
1152
+ if (I === -1 || O === -1)
1153
+ return g;
1154
+ const _ = Pe(x, I, O);
1155
+ return {
1156
+ ...g,
1157
+ programs: {
1158
+ ...h,
1159
+ features: _
1160
+ }
1161
+ };
1162
+ });
1163
+ return;
1164
+ }
1165
+ s === i && n.id !== r.id && oe(
1166
+ (g) => g.map((h) => {
1167
+ if (h.id === s) {
1168
+ const x = h == null ? void 0 : h.features, I = x.findIndex((D) => D.instanceId === n.id), O = x.findIndex((D) => D.instanceId === r.id);
1169
+ if (I === -1 || O === -1) return h;
1170
+ const _ = Pe(x, I, O);
1171
+ return { ...h, features: _ };
1172
+ }
1173
+ return h;
1174
+ })
1175
+ );
1176
+ return;
1177
+ }
1178
+ if (l === w.GROUP && a === w.SECTION_DROP_ZONE) {
1179
+ const g = n.data.current.data, h = (bt = r == null ? void 0 : r.data.current) == null ? void 0 : bt.sectionId;
1180
+ g && h && J((x) => {
1181
+ const I = x[z] || [], O = I.findIndex((ke) => ke.id === h);
1182
+ if (O === -1) return x;
1183
+ const _ = I[O], D = String(g.uuid);
1184
+ if (_ == null ? void 0 : _.features.some((ke) => ke.type === "GROUP" && String(ke.uuid) === D))
1185
+ return ie({
1186
+ type: "warn",
1187
+ message: `Group ${g.name} is already in this section.`
1188
+ }), x;
1189
+ const qe = {
1190
+ id: g.uuid,
1191
+ name: g.name,
1192
+ instanceId: `${h}_GROUP_${g.uuid}_${crypto.randomUUID()}`,
1193
+ type: "GROUP",
1194
+ menus: g.menus || [],
1195
+ icon: g.icon
1196
+ }, _e = {
1197
+ ..._,
1198
+ features: [..._.features, qe]
1199
+ }, ce = [...I];
1200
+ return ce[O] = _e, { ...x, [z]: ce };
1201
+ });
1202
+ return;
1203
+ }
1204
+ if (l === w.FEATURE && a === w.SECTION_DROP_ZONE) {
1205
+ const g = n.data.current.data, h = (St = r == null ? void 0 : r.data.current) == null ? void 0 : St.sectionId;
1206
+ g && h && J((x) => {
1207
+ const I = x[z] || [], O = I.findIndex((ce) => ce.id === h);
1208
+ if (O === -1) return x;
1209
+ const _ = I[O];
1210
+ if (_ == null ? void 0 : _.features.some((ce) => ce.id === g.id && ce.type === "FEATURE"))
1211
+ return ie({
1212
+ type: "warn",
1213
+ message: `Feature ${g.name} is already in this section.`
1214
+ }), x;
1215
+ const V = {
1216
+ id: g.id,
1217
+ name: g.name,
1218
+ instanceId: `${h}_${g.id}_${crypto.randomUUID()}`,
1219
+ type: "FEATURE",
1220
+ icon: {
1221
+ id: `svg-icon-${g.id}`,
1222
+ content: g.icon,
1223
+ type: "svg"
1224
+ }
1225
+ }, qe = {
1226
+ ..._,
1227
+ features: [..._.features, V]
1228
+ }, _e = [...I];
1229
+ return _e[O] = qe, { ...x, [z]: _e };
1230
+ });
1231
+ return;
1232
+ }
1233
+ if (!((Ct = n.data.current) != null && Ct.sortable && !((It = r == null ? void 0 : r.data.current) != null && It.sortable) && (r == null ? void 0 : r.id) === "mobile-content")) {
1234
+ if ((vt = r == null ? void 0 : r.data.current) != null && vt.sortable && ((Rt = n.data.current) == null ? void 0 : Rt.type) === w.SECTION && n.id !== r.id) {
1235
+ oe((g) => {
1236
+ const h = g.find((V) => V.type === w.SEARCH_BAR), x = g.filter((V) => V.type !== w.SEARCH_BAR), I = x.findIndex((V) => V.id === n.id), O = x.findIndex((V) => V.id === r.id);
1237
+ if (I === -1 || O === -1)
1238
+ return g;
1239
+ let D = Pe(x, I, O);
1240
+ return h && (D = [h, ...D]), D;
1241
+ });
1242
+ return;
1243
+ }
1244
+ if ((r == null ? void 0 : r.id) === "mobile-content" && l) {
1245
+ const g = (wt = r.data.current) == null ? void 0 : wt.type;
1246
+ if (g === "PROGRAMS_ROOT_DROP_ZONE") {
1247
+ if (l === w.GROUP) {
1248
+ ie({
1249
+ type: "warn",
1250
+ message: "Groups cannot be dropped directly onto the Programs tab."
1251
+ });
1252
+ return;
1253
+ }
1254
+ if (l === w.FEATURE) {
1255
+ const h = n.data.current.data;
1256
+ if (!h) return;
1257
+ J((x) => ({
1258
+ ...x,
1259
+ programs: {
1260
+ ...x.programs,
1261
+ features: [
1262
+ ...x.programs.features,
1263
+ {
1264
+ id: h.id,
1265
+ name: h.name,
1266
+ instanceId: `PROGRAMS_ROOT_${h.id}_${crypto.randomUUID()}`,
1267
+ type: "FEATURE",
1268
+ icon: {
1269
+ id: `svg-icon-${h.id}`,
1270
+ content: h.icon,
1271
+ type: "svg"
1272
+ }
1273
+ }
1274
+ ]
1275
+ }
1276
+ }));
1277
+ return;
1278
+ }
1279
+ }
1280
+ if ((Et = n.data.current) != null && Et.sortable && g === "LAYOUT_ROOT_DROP_ZONE")
1281
+ return;
1282
+ if (g === "LAYOUT_ROOT_DROP_ZONE") {
1283
+ oe((h) => {
1284
+ if (l === w.SEARCH_BAR)
1285
+ return h.some((O) => O.type === w.SEARCH_BAR) ? (ie({
1286
+ type: "info",
1287
+ message: "Only one Search Bar is allowed."
1288
+ }), h) : [{
1289
+ id: `comp-${Date.now()}`,
1290
+ type: w.SEARCH_BAR,
1291
+ queryName: "Query Name"
1292
+ }, ...h];
1293
+ if (l === w.SECTION) {
1294
+ const x = {
1295
+ id: `comp-${Date.now()}`,
1296
+ type: l,
1297
+ title: "Section",
1298
+ features: []
1299
+ };
1300
+ return [...h, x];
1301
+ }
1302
+ return h;
1303
+ });
1304
+ return;
1305
+ }
1306
+ }
1307
+ }
1308
+ },
1309
+ [oe, J, z, w]
1310
+ ), ft = "350px", Jt = () => /* @__PURE__ */ p(
1311
+ N,
1312
+ {
1313
+ sx: {
1314
+ width: ft,
1315
+ p: 1.5,
1316
+ border: "1px solid #ccc",
1317
+ borderRadius: "8px",
1318
+ backgroundColor: "#fff",
1319
+ display: "flex",
1320
+ alignItems: "center",
1321
+ boxShadow: "0 1px 10px rgba(0,0,0,0.3)"
1322
+ },
1323
+ children: [
1324
+ /* @__PURE__ */ e(W, { icon: kt, style: { marginRight: "8px", color: "#888" } }),
1325
+ /* @__PURE__ */ e(S, { variant: "body2", color: "textSecondary", sx: { flexGrow: 1 }, children: "Search..." })
1326
+ ]
1327
+ }
1328
+ ), Xt = () => /* @__PURE__ */ e(
1329
+ N,
1330
+ {
1331
+ sx: {
1332
+ width: ft,
1333
+ minHeight: "100px",
1334
+ backgroundColor: "#e6f0ff",
1335
+ border: "1px dashed #073149",
1336
+ borderRadius: "4px",
1337
+ display: "flex",
1338
+ alignItems: "center",
1339
+ justifyContent: "center",
1340
+ boxShadow: "0 1px 10px rgba(0,0,0,0.3)",
1341
+ color: "#073149"
1342
+ },
1343
+ children: /* @__PURE__ */ e(S, { variant: "caption", sx: { fontWeight: "bold" }, children: "Section Dragging" })
1344
+ }
1345
+ ), $e = ({ feature: t }) => /* @__PURE__ */ e(v, { item: !0, xs: 4, sm: 4, children: /* @__PURE__ */ p(
1346
+ N,
1347
+ {
1348
+ sx: {
1349
+ display: "flex",
1350
+ flexDirection: "column",
1351
+ alignItems: "center",
1352
+ justifyContent: "center",
1353
+ p: 0.5,
1354
+ height: "100%",
1355
+ backgroundColor: "transparent",
1356
+ cursor: "grab"
1357
+ },
1358
+ children: [
1359
+ Ee(t.icon),
1360
+ /* @__PURE__ */ e(
1361
+ S,
1362
+ {
1363
+ variant: "caption",
1364
+ sx: {
1365
+ mt: 1,
1366
+ textAlign: "center",
1367
+ lineHeight: 1.2,
1368
+ width: "100%",
1369
+ fontSize: "0.65rem"
1370
+ },
1371
+ children: t.name
1372
+ }
1373
+ )
1374
+ ]
1375
+ }
1376
+ ) });
1377
+ $e.propTypes = {
1378
+ feature: m.any
1379
+ };
1380
+ const mt = ({ feature: t }) => /* @__PURE__ */ p(
1381
+ N,
1382
+ {
1383
+ sx: {
1384
+ width: "fit-content",
1385
+ p: "10px",
1386
+ pl: "10px",
1387
+ backgroundColor: "#fff",
1388
+ border: "1px solid #e0e0e0",
1389
+ borderRadius: "4px",
1390
+ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)",
1391
+ cursor: "grab",
1392
+ display: "flex",
1393
+ alignItems: "center",
1394
+ transition: "all 0.1s",
1395
+ mt: "4px",
1396
+ "&:hover": {
1397
+ backgroundColor: "#f5f5f5",
1398
+ borderColor: "#b0bec5"
1399
+ }
1400
+ },
1401
+ children: [
1402
+ ((r, a) => {
1403
+ const i = Ee(t.icon, "18px");
1404
+ return i && i.type === N ? K.cloneElement(i, {
1405
+ sx: {
1406
+ ...i.props.sx,
1407
+ height: "18px",
1408
+ width: "18px",
1409
+ marginRight: "8px"
1410
+ }
1411
+ }) : /* @__PURE__ */ e(N, { sx: { mr: "8px", display: "flex", alignItems: "center" }, children: Ee(r, a) });
1412
+ })(t.icon, "18px"),
1413
+ /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "normal", color: "#333" }, children: t == null ? void 0 : t.name })
1414
+ ]
1415
+ }
1416
+ );
1417
+ mt.propTypes = {
1418
+ feature: m.any
1419
+ };
1420
+ const Kt = (t) => {
1421
+ const r = M.flatMap((s) => s.type === w.GROUP ? [s, ...s.menus] : [s]).find((s) => (s.uuid || s.id) === t);
1422
+ if (r) {
1423
+ let s;
1424
+ return r.type ? s = r.type : r.menus ? s = w.GROUP : s = w.FEATURE, {
1425
+ type: s,
1426
+ data: r
1427
+ };
1428
+ }
1429
+ const a = le == null ? void 0 : le.find((s) => s.instanceId === t);
1430
+ if (a)
1431
+ return { type: "FEATURE_TILE", data: a };
1432
+ const i = re.find((s) => s.id === t);
1433
+ if (i) return { type: i.type, data: i };
1434
+ for (const s of re)
1435
+ if (s != null && s.features) {
1436
+ const l = s == null ? void 0 : s.features.find((C) => C.instanceId === t);
1437
+ if (l)
1438
+ return { type: "FEATURE_TILE", data: l };
1439
+ }
1440
+ return null;
1441
+ }, en = re.find((t) => t.id === dt), tn = (t) => {
1442
+ const n = Kt(t);
1443
+ return n ? n.type === w.SEARCH_BAR ? /* @__PURE__ */ e(Jt, {}) : n.type === w.SECTION ? /* @__PURE__ */ e(Xt, {}) : n.type === w.FEATURE ? /* @__PURE__ */ e(mt, { feature: n.data }) : n.type === w.GROUP ? /* @__PURE__ */ e($e, { feature: n.data }) : n.type === "FEATURE_TILE" ? /* @__PURE__ */ e($e, { feature: n.data }) : null : null;
1444
+ }, nn = Fe(() => {
1445
+ if (!me) return !1;
1446
+ const t = re.some((a) => a.id === me), n = re.some((a) => {
1447
+ var i;
1448
+ return (i = a == null ? void 0 : a.features) == null ? void 0 : i.some((s) => s.instanceId === me);
1449
+ }), r = le == null ? void 0 : le.some((a) => a.instanceId === me);
1450
+ return t || n || r;
1451
+ }, [me, re, le]), rn = re.filter((t) => t.type === w.SECTION).map((t) => t.id), on = (t) => {
1452
+ var r, a;
1453
+ const n = (a = (r = t.active) == null ? void 0 : r.data.current) == null ? void 0 : a.type;
1454
+ if (n === w.FEATURE) {
1455
+ const i = t.droppableContainers.filter(
1456
+ (s) => {
1457
+ var l;
1458
+ return ((l = s.data.current) == null ? void 0 : l.type) === "SECTION_DROP_ZONE";
1459
+ }
1460
+ );
1461
+ return At({
1462
+ ...t,
1463
+ droppableContainers: i
1464
+ });
1465
+ }
1466
+ if (n === w.SECTION) {
1467
+ const i = t.droppableContainers.filter((s) => {
1468
+ var l;
1469
+ return !(s.id === t.active.id || ((l = s.data.current) == null ? void 0 : l.type) === "SECTION_DROP_ZONE");
1470
+ });
1471
+ return At({
1472
+ ...t,
1473
+ droppableContainers: i
1474
+ });
1475
+ }
1476
+ return sn(t);
1477
+ };
1478
+ return /* @__PURE__ */ p(Ze, { children: [
1479
+ /* @__PURE__ */ e(Gn.Provider, { children: /* @__PURE__ */ e("form", { noValidate: !0, onSubmit: $.handleSubmit(pe), children: /* @__PURE__ */ p(
1480
+ Nt,
1481
+ {
1482
+ onDragStart: Qt,
1483
+ onDragEnd: Yt,
1484
+ collisionDetection: on,
1485
+ children: [
1486
+ /* @__PURE__ */ p(v, { container: !0, spacing: 1, children: [
1487
+ /* @__PURE__ */ e(v, { size: 1 }),
1488
+ /* @__PURE__ */ e(v, { size: 6, children: /* @__PURE__ */ p(
1489
+ v,
1490
+ {
1491
+ sx: {
1492
+ padding: "2px",
1493
+ margin: "6px 0px"
1494
+ },
1495
+ children: [
1496
+ /* @__PURE__ */ p(v, { container: !0, sx: { justifyContent: "space-between" }, children: [
1497
+ /* @__PURE__ */ e(v, { size: 2 }),
1498
+ /* @__PURE__ */ e(S, { variant: "subtitle1", sx: { fontWeight: "bold", marginLeft: "5px", mb: 1 }, children: "Mobile View" }),
1499
+ /* @__PURE__ */ p(v, { container: !0, spacing: 1, children: [
1500
+ /* @__PURE__ */ e(
1501
+ Ge,
1502
+ {
1503
+ variant: "contained",
1504
+ color: "gray",
1505
+ sx: { fontSize: "0.8rem", height: "30px" },
1506
+ type: "submit",
1507
+ onClick: () => {
1508
+ P(!0);
1509
+ },
1510
+ children: "Back"
1511
+ }
1512
+ ),
1513
+ /* @__PURE__ */ e(
1514
+ Ge,
1515
+ {
1516
+ variant: "contained",
1517
+ color: "primary",
1518
+ sx: { fontSize: "0.8rem", height: "30px" },
1519
+ type: "submit",
1520
+ children: "Save"
1521
+ }
1522
+ )
1523
+ ] })
1524
+ ] }),
1525
+ /* @__PURE__ */ e(v, { sx: { height: "100%", maxHeight: "100%", overflowY: "auto" }, children: /* @__PURE__ */ e(De, { items: rn, strategy: Ue, children: /* @__PURE__ */ e(
1526
+ Gt,
1527
+ {
1528
+ tabStatus: fe,
1529
+ layoutComponents: re,
1530
+ componentTypes: w,
1531
+ handleSectionClick: ut,
1532
+ activeElementId: dt,
1533
+ activeTabId: z,
1534
+ handleTabSwitch: Zt,
1535
+ formList: F,
1536
+ selectedForm: We,
1537
+ onFormSelect: Ht,
1538
+ SvgIconBox: st,
1539
+ setCurrentLayoutComponents: oe,
1540
+ programFeatures: ((gt = he.programs) == null ? void 0 : gt.features) || []
1541
+ }
1542
+ ) }) }),
1543
+ /* @__PURE__ */ e(v, { container: !0, spacing: 2, justifyContent: "space-around", sx: { my: "1.25rem" }, children: B.map((t) => /* @__PURE__ */ e(v, { item: !0, xs: 12, sm: 6, md: 3, children: /* @__PURE__ */ p(v, { container: !0, alignItems: "center", justifyContent: "space-between", children: [
1544
+ /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "bolder" }, children: t.name }),
1545
+ /* @__PURE__ */ e(
1546
+ Ot,
1547
+ {
1548
+ checked: fe[t.id],
1549
+ onChange: () => Y(t.id),
1550
+ name: t.name,
1551
+ sx: {
1552
+ "& .MuiSwitch-switchBase.Mui-checked": {
1553
+ color: "#073149",
1554
+ "&:hover": {
1555
+ backgroundColor: "rgba(7, 49, 73, 0.08)"
1556
+ }
1557
+ },
1558
+ "& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track": {
1559
+ backgroundColor: "#073149",
1560
+ opacity: 0.7
1561
+ }
1562
+ }
1563
+ }
1564
+ )
1565
+ ] }) }, t.id)) })
1566
+ ]
1567
+ }
1568
+ ) }),
1569
+ /* @__PURE__ */ e(v, { size: 1 }),
1570
+ /* @__PURE__ */ p(v, { size: 4, children: [
1571
+ /* @__PURE__ */ e(v, { size: 12, children: /* @__PURE__ */ p(xe, { sx: { padding: "2px", margin: "6px 0px" }, children: [
1572
+ /* @__PURE__ */ e(v, { className: "justify-between items-center", container: !0, children: /* @__PURE__ */ e(S, { variant: "subtitle1", sx: { fontWeight: "bold", marginLeft: "5px" }, children: "Menu Relation" }) }),
1573
+ /* @__PURE__ */ p(v, { container: !0, children: [
1574
+ /* @__PURE__ */ e(v, { size: 12, children: /* @__PURE__ */ p(
1575
+ Ve,
1576
+ {
1577
+ variant: "outlined",
1578
+ className: "ml-3 mb-1 flex flex-row items-center align-items w-[90%]",
1579
+ children: [
1580
+ /* @__PURE__ */ p(S, { variant: "body2", children: [
1581
+ "Select Role",
1582
+ /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" }),
1583
+ " :"
1584
+ ] }),
1585
+ /* @__PURE__ */ e(N, { className: "w-[60%] ms-3", children: /* @__PURE__ */ e(
1586
+ Sn,
1587
+ {
1588
+ control: $.control,
1589
+ size: "small",
1590
+ id: "role",
1591
+ name: "role",
1592
+ options: E || [],
1593
+ disabled: y,
1594
+ displayName: "name",
1595
+ optionValue: "id",
1596
+ errors: $.formState.errors,
1597
+ sx: { height: "50px", mt: 2 },
1598
+ disableClearable: !!y,
1599
+ placeholder: "Select role",
1600
+ onChange: (t) => Ae(t.target.value)
1601
+ }
1602
+ ) })
1603
+ ]
1604
+ }
1605
+ ) }),
1606
+ /* @__PURE__ */ e(v, { size: 12, children: /* @__PURE__ */ p(
1607
+ Ve,
1608
+ {
1609
+ variant: "standard",
1610
+ className: "ml-3 mb-3 flex flex-row items-center align-items w-[90%]",
1611
+ children: [
1612
+ /* @__PURE__ */ e(S, { variant: "body2", children: "Attendance Required? :" }),
1613
+ /* @__PURE__ */ e(N, { className: "w-[60%] ms-3", children: /* @__PURE__ */ e(
1614
+ Ot,
1615
+ {
1616
+ checked: $.watch("isAttendanceRequired"),
1617
+ onChange: (t) => $.setValue("isAttendanceRequired", t.target.checked),
1618
+ sx: {
1619
+ "& .MuiSwitch-switchBase.Mui-checked": {
1620
+ color: "#073149",
1621
+ "&:hover": {
1622
+ backgroundColor: "rgba(7, 49, 73, 0.08)"
1623
+ }
1624
+ },
1625
+ "& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track": {
1626
+ backgroundColor: "#073149",
1627
+ opacity: 0.7
1628
+ }
1629
+ }
1630
+ }
1631
+ ) })
1632
+ ]
1633
+ }
1634
+ ) })
1635
+ ] })
1636
+ ] }) }),
1637
+ /* @__PURE__ */ e(v, { size: 12, children: /* @__PURE__ */ p(
1638
+ xe,
1639
+ {
1640
+ sx: {
1641
+ padding: "5px",
1642
+ margin: "2px 0px",
1643
+ height: "595px",
1644
+ transition: "height 0.3s ease-in-out"
1645
+ },
1646
+ children: [
1647
+ /* @__PURE__ */ e(S, { variant: "subtitle1", sx: { fontWeight: "bold", marginLeft: "5px", mb: 1 }, children: "Draggable Components" }),
1648
+ /* @__PURE__ */ p(v, { container: !0, spacing: 2, justifyContent: "space-around", sx: { p: 1 }, children: [
1649
+ /* @__PURE__ */ e(we, { id: "draggable-search", componentType: w.SEARCH_BAR, children: /* @__PURE__ */ e(v, { item: !0, xs: 6, sm: 4, size: 6, children: /* @__PURE__ */ p(
1650
+ N,
1651
+ {
1652
+ sx: {
1653
+ width: "100%",
1654
+ height: "50px",
1655
+ p: "8px 10px",
1656
+ backgroundColor: "#f0f4f8",
1657
+ border: "1px solid #e0e0e0",
1658
+ borderRadius: "8px",
1659
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
1660
+ cursor: "grab",
1661
+ display: "flex",
1662
+ alignItems: "center",
1663
+ justifyContent: "flex-start",
1664
+ color: "#073149",
1665
+ transition: "all 0.2s ease-in-out",
1666
+ "&:hover": {
1667
+ backgroundColor: "#e0eaf1",
1668
+ borderColor: "#b0bec5",
1669
+ boxShadow: "0 2px 5px rgba(0, 0, 0, 0.15)"
1670
+ }
1671
+ },
1672
+ children: [
1673
+ /* @__PURE__ */ e(
1674
+ X,
1675
+ {
1676
+ iconName: "faMagnifyingGlass",
1677
+ style: { fontSize: "1.2rem", marginRight: "8px" }
1678
+ }
1679
+ ),
1680
+ /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "bold", lineHeight: 1 }, children: "Search Bar" })
1681
+ ]
1682
+ }
1683
+ ) }) }),
1684
+ /* @__PURE__ */ e(we, { id: "draggable-section", componentType: w.SECTION, children: /* @__PURE__ */ e(v, { item: !0, xs: 6, sm: 4, size: 6, children: /* @__PURE__ */ p(
1685
+ N,
1686
+ {
1687
+ sx: {
1688
+ width: "100%",
1689
+ height: "50px",
1690
+ p: "8px 10px",
1691
+ backgroundColor: "#f0f4f8",
1692
+ border: "1px solid #e0e0e0",
1693
+ borderRadius: "8px",
1694
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
1695
+ cursor: "grab",
1696
+ display: "flex",
1697
+ alignItems: "center",
1698
+ justifyContent: "flex-start",
1699
+ color: "#073149",
1700
+ transition: "all 0.2s ease-in-out",
1701
+ "&:hover": {
1702
+ backgroundColor: "#c5e1ff",
1703
+ borderColor: "#073149",
1704
+ boxShadow: "0 2px 5px rgba(0, 0, 0, 0.15)"
1705
+ }
1706
+ },
1707
+ children: [
1708
+ /* @__PURE__ */ e(X, { iconName: "faBox", style: { fontSize: "1.2rem", marginRight: "8px" } }),
1709
+ /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "bold", lineHeight: 1 }, children: "Section" })
1710
+ ]
1711
+ }
1712
+ ) }) })
1713
+ ] }),
1714
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(zt, { isDraggingSortable: nn }) }),
1715
+ /* @__PURE__ */ e(ot, { sx: { mt: 2 } }),
1716
+ /* @__PURE__ */ e(v, { size: 12, children: /* @__PURE__ */ p(
1717
+ N,
1718
+ {
1719
+ sx: {
1720
+ padding: "0px",
1721
+ margin: "10px 0px",
1722
+ height: "450px",
1723
+ overflowY: "auto",
1724
+ transition: "height 0.3s ease-in-out"
1725
+ },
1726
+ children: [
1727
+ /* @__PURE__ */ e(S, { variant: "subtitle1", sx: { fontWeight: "bold", marginLeft: "5px", mb: 1 }, children: "Available Features" }),
1728
+ /* @__PURE__ */ e(
1729
+ Qe,
1730
+ {
1731
+ fullWidth: !0,
1732
+ size: "small",
1733
+ placeholder: "Search Feature...",
1734
+ variant: "outlined",
1735
+ sx: { mb: 2, px: 1 },
1736
+ value: Le,
1737
+ onChange: (t) => Lt(t.target.value),
1738
+ InputProps: {
1739
+ startAdornment: /* @__PURE__ */ e(pn, { position: "start", children: /* @__PURE__ */ e(X, { iconName: "faMagnifyingGlass" }) })
1740
+ }
1741
+ }
1742
+ ),
1743
+ /* @__PURE__ */ e(
1744
+ N,
1745
+ {
1746
+ sx: {
1747
+ flexGrow: 1,
1748
+ overflowY: "auto",
1749
+ padding: "0 8px"
1750
+ },
1751
+ children: /* @__PURE__ */ p(v, { container: !0, direction: "column", spacing: 0, sx: { px: 1 }, children: [
1752
+ Ne.length > 0 && /* @__PURE__ */ e(
1753
+ v,
1754
+ {
1755
+ item: !0,
1756
+ xs: 12,
1757
+ sx: {
1758
+ mb: 1
1759
+ },
1760
+ children: /* @__PURE__ */ p(
1761
+ Ye,
1762
+ {
1763
+ sx: {
1764
+ "&:before": { display: "none" },
1765
+ boxShadow: "0 2px 4px rgba(0,0,0,0.05)",
1766
+ border: "1px solid #c5e1ff",
1767
+ borderRadius: "4px!important",
1768
+ backgroundColor: "#fff"
1769
+ },
1770
+ expanded: ae,
1771
+ onChange: () => ue((t) => !t),
1772
+ disableGutters: !0,
1773
+ children: [
1774
+ /* @__PURE__ */ e(
1775
+ Je,
1776
+ {
1777
+ expandIcon: /* @__PURE__ */ e(X, { iconName: "faChevronDown", style: { color: "#3f51b5" } }),
1778
+ sx: {
1779
+ minHeight: "40px",
1780
+ backgroundColor: "#e3f2fd",
1781
+ "&:hover": { backgroundColor: "#c5e3f8" },
1782
+ "& .MuiAccordionSummary-content": { margin: "0" },
1783
+ p: "0 10px"
1784
+ },
1785
+ children: /* @__PURE__ */ p(S, { variant: "subtitle2", sx: { fontWeight: "bold", color: "#3f51b5" }, children: [
1786
+ /* @__PURE__ */ e(X, { iconName: "faLayerGroup", style: { marginRight: "6px" } }),
1787
+ "Menu Groups (",
1788
+ Ne.length,
1789
+ ")"
1790
+ ] })
1791
+ }
1792
+ ),
1793
+ /* @__PURE__ */ e(Xe, { sx: { p: "8px", pt: 1, backgroundColor: "#f9f9f9" }, children: /* @__PURE__ */ e(v, { container: !0, spacing: 0.5, direction: "column", children: Ne.map((t) => /* @__PURE__ */ e(
1794
+ tt,
1795
+ {
1796
+ item: t,
1797
+ COMPONENT_TYPES: w,
1798
+ activeGroupId: jt,
1799
+ onGroupToggle: qt
1800
+ },
1801
+ t.uuid
1802
+ )) }) })
1803
+ ]
1804
+ }
1805
+ )
1806
+ }
1807
+ ),
1808
+ Me.length > 0 && /* @__PURE__ */ e(v, { item: !0, xs: 12, children: /* @__PURE__ */ p(
1809
+ Ye,
1810
+ {
1811
+ sx: {
1812
+ mt: 0.5,
1813
+ "&:before": { display: "none" },
1814
+ boxShadow: "0 2px 4px rgba(0,0,0,0.05)",
1815
+ border: "1px solid #c8e6c9",
1816
+ mb: 1,
1817
+ borderRadius: "4px!important",
1818
+ backgroundColor: "#fff"
1819
+ },
1820
+ expanded: A,
1821
+ onChange: () => j((t) => !t),
1822
+ disableGutters: !0,
1823
+ children: [
1824
+ /* @__PURE__ */ e(
1825
+ Je,
1826
+ {
1827
+ expandIcon: /* @__PURE__ */ e(X, { iconName: "faChevronDown", style: { color: "#009688" } }),
1828
+ sx: {
1829
+ minHeight: "40px",
1830
+ backgroundColor: "#e8f5e9",
1831
+ "&:hover": { backgroundColor: "#cbe6cc" },
1832
+ "& .MuiAccordionSummary-content": { margin: "0" },
1833
+ p: "0 10px"
1834
+ },
1835
+ children: /* @__PURE__ */ p(S, { variant: "subtitle2", sx: { fontWeight: "bold", color: "#009688" }, children: [
1836
+ /* @__PURE__ */ e(X, { iconName: "faPuzzlePiece", style: { marginRight: "6px" } }),
1837
+ "Standalone Features (",
1838
+ Me.length,
1839
+ ")"
1840
+ ] })
1841
+ }
1842
+ ),
1843
+ /* @__PURE__ */ e(Xe, { sx: { p: "8px", pt: 1, backgroundColor: "#ffffff" }, children: /* @__PURE__ */ e(v, { container: !0, spacing: 0.5, direction: "column", children: Me.map((t) => /* @__PURE__ */ e(
1844
+ tt,
1845
+ {
1846
+ item: t,
1847
+ COMPONENT_TYPES: w
1848
+ },
1849
+ t.uuid
1850
+ )) }) })
1851
+ ]
1852
+ }
1853
+ ) }),
1854
+ Ne.length === 0 && Me.length === 0 && /* @__PURE__ */ e(S, { variant: "body2", sx: { p: 2, color: "#9e9e9e", textAlign: "center" }, children: "No groups or features match your search criteria." })
1855
+ ] })
1856
+ }
1857
+ )
1858
+ ]
1859
+ }
1860
+ ) })
1861
+ ]
1862
+ }
1863
+ ) }),
1864
+ /* @__PURE__ */ e(v, { size: 12, sx: { mt: 1 }, children: /* @__PURE__ */ e(
1865
+ Wt,
1866
+ {
1867
+ activeComponent: en,
1868
+ onUpdate: Vt,
1869
+ onDeselect: () => ut(null),
1870
+ mobileQueries: ee
1871
+ }
1872
+ ) })
1873
+ ] })
1874
+ ] }),
1875
+ /* @__PURE__ */ e(an, { children: tn(me) })
1876
+ ]
1877
+ }
1878
+ ) }) }),
1879
+ /* @__PURE__ */ e(
1880
+ Pn,
1881
+ {
1882
+ open: be,
1883
+ handleClose: () => {
1884
+ P(!1);
1885
+ },
1886
+ handleClick: () => {
1887
+ b("/ui/medplat/admin/mobileMenuManagement");
1888
+ },
1889
+ title: "Leave Page",
1890
+ description: "Changes you made will be discarded. Do you want to continue?",
1891
+ dataTestId: "delete-auth-confirmation"
1892
+ }
1893
+ )
1894
+ ] });
1895
+ }
1896
+ function we({ id: o, children: c, componentType: d, dragData: b = null }) {
1897
+ const { attributes: E, listeners: u, setNodeRef: y, transform: R } = Mt({
1898
+ id: o,
1899
+ data: { type: d, ...b && { data: b } }
1900
+ }), F = R ? {
1901
+ transform: `translate3d(${R.x}px, ${R.y}px, 0)`,
1902
+ zIndex: 1e3,
1903
+ opacity: 0.9
1904
+ } : void 0;
1905
+ return K.cloneElement(c, {
1906
+ ref: y,
1907
+ style: { ...c.props.style, ...F },
1908
+ ...u,
1909
+ ...E
1910
+ });
1911
+ }
1912
+ m.node, m.number.isRequired, m.number.isRequired;
1913
+ const zt = ({ isDraggingSortable: o }) => {
1914
+ const { setNodeRef: c, isOver: d } = nt({
1915
+ id: "trash-zone"
1916
+ });
1917
+ return o ? /* @__PURE__ */ p(
1918
+ N,
1919
+ {
1920
+ ref: c,
1921
+ sx: {
1922
+ position: "fixed",
1923
+ bottom: 20,
1924
+ left: "50%",
1925
+ transform: "translateX(-50%)",
1926
+ width: 250,
1927
+ height: 50,
1928
+ p: 2,
1929
+ borderRadius: "8px",
1930
+ display: "flex",
1931
+ alignItems: "center",
1932
+ justifyContent: "center",
1933
+ backgroundColor: d ? "#d32f2f" : "#ef5350",
1934
+ color: "white",
1935
+ zIndex: 3e3,
1936
+ transition: "background-color 0.2s"
1937
+ },
1938
+ children: [
1939
+ /* @__PURE__ */ e(W, { icon: On, style: { marginRight: "10px" } }),
1940
+ /* @__PURE__ */ e(S, { variant: "body1", children: d ? "Release to Delete" : "Drag Here to Delete" })
1941
+ ]
1942
+ }
1943
+ ) : null;
1944
+ };
1945
+ zt.propTypes = {
1946
+ isDraggingSortable: m.any
1947
+ };
1948
+ const Wt = ({ activeComponent: o, onUpdate: c, onDeselect: d, mobileQueries: b }) => {
1949
+ if (!o)
1950
+ return /* @__PURE__ */ p(
1951
+ xe,
1952
+ {
1953
+ sx: {
1954
+ p: 1,
1955
+ backgroundColor: "#f5f5f5",
1956
+ textAlign: "center"
1957
+ },
1958
+ children: [
1959
+ /* @__PURE__ */ e(S, { variant: "subtitle1", sx: { fontWeight: "bold", mb: 1, color: "#073149" }, children: "Component Configuration" }),
1960
+ /* @__PURE__ */ e(ot, { sx: { mb: 1 } }),
1961
+ /* @__PURE__ */ p(S, { variant: "body1", children: [
1962
+ "To add or edit ",
1963
+ /* @__PURE__ */ e("b", { children: "Section Title" }),
1964
+ " or ",
1965
+ /* @__PURE__ */ e("b", { children: "Search Bar Query Name" }),
1966
+ ":"
1967
+ ] }),
1968
+ /* @__PURE__ */ p(N, { sx: { display: "flex", alignItems: "center", justifyContent: "center", mb: 1 }, children: [
1969
+ /* @__PURE__ */ e(S, { variant: "body1", color: "primary", children: "Right-Click" }),
1970
+ /* @__PURE__ */ e(S, { variant: "body1", sx: { ml: 1 }, children: "on the selected component card" })
1971
+ ] }),
1972
+ /* @__PURE__ */ e(S, { variant: "caption", color: "textSecondary", children: "This will open the menu to access the **Configuration Panel**." })
1973
+ ]
1974
+ }
1975
+ );
1976
+ if (o.type === "SEARCH_BAR") {
1977
+ const E = b.map((u) => u.code);
1978
+ if (o.type === "SEARCH_BAR")
1979
+ return /* @__PURE__ */ p(xe, { sx: { p: 2, height: "100%" }, children: [
1980
+ /* @__PURE__ */ e(S, { variant: "h6", sx: { mb: 2 }, children: "Search Bar Configuration" }),
1981
+ /* @__PURE__ */ e(
1982
+ mn,
1983
+ {
1984
+ disablePortal: !0,
1985
+ id: "query-name-autocomplete",
1986
+ options: E,
1987
+ size: "small",
1988
+ fullWidth: !0,
1989
+ sx: { mb: 2 },
1990
+ value: o.queryName || null,
1991
+ onChange: (u, y) => {
1992
+ c(o.id, "queryName", y || "");
1993
+ },
1994
+ renderInput: (u) => /* @__PURE__ */ e(Qe, { ...u, label: "Query Code", variant: "outlined", placeholder: "Select or search query code" })
1995
+ }
1996
+ ),
1997
+ /* @__PURE__ */ e(Ge, { onClick: d, variant: "outlined", color: "gray", children: "Close" })
1998
+ ] });
1999
+ }
2000
+ return o.type === "SECTION" ? /* @__PURE__ */ p(xe, { sx: { p: 2, height: "100%" }, children: [
2001
+ /* @__PURE__ */ e(S, { variant: "h6", sx: { mb: 2 }, children: "Section Configuration" }),
2002
+ /* @__PURE__ */ e(
2003
+ Qe,
2004
+ {
2005
+ label: "Section Title",
2006
+ variant: "outlined",
2007
+ fullWidth: !0,
2008
+ value: o.title || "",
2009
+ onChange: (E) => c(o.id, "title", E.target.value),
2010
+ sx: { mb: 2 }
2011
+ }
2012
+ ),
2013
+ /* @__PURE__ */ e(Ge, { onClick: d, variant: "outlined", color: "gray", children: "Close" })
2014
+ ] }) : null;
2015
+ };
2016
+ Wt.propTypes = {
2017
+ activeComponent: m.any,
2018
+ onUpdate: m.any,
2019
+ onDeselect: m.any,
2020
+ mobileQueries: m.any
2021
+ };
2022
+ function st({ svg: o }) {
2023
+ const [c, d] = k("");
2024
+ return Ke(() => {
2025
+ if (o) {
2026
+ const u = new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
2027
+ if (!u.getAttribute("viewBox")) {
2028
+ const F = u.getAttribute("width") || "512", Q = u.getAttribute("height") || "512";
2029
+ u.setAttribute("viewBox", `0 0 ${F} ${Q}`);
2030
+ }
2031
+ u.removeAttribute("width"), u.removeAttribute("height"), u.setAttribute("style", "width: 100%; height: 100%;");
2032
+ const R = new XMLSerializer().serializeToString(u);
2033
+ d(R);
2034
+ }
2035
+ }, [o]), /* @__PURE__ */ e(
2036
+ fn,
2037
+ {
2038
+ size: 2,
2039
+ sx: {
2040
+ alignItems: "center",
2041
+ alignSelf: "center",
2042
+ height: "40px",
2043
+ width: "40px",
2044
+ display: "flex",
2045
+ justifyContent: "center",
2046
+ textAlign: "center",
2047
+ backgroundColor: "",
2048
+ borderRadius: "3%",
2049
+ transition: "background-color 0.3s ease",
2050
+ "&:hover": {
2051
+ backgroundColor: "#e0e0e0",
2052
+ cursor: "pointer"
2053
+ },
2054
+ overflow: "hidden"
2055
+ },
2056
+ children: /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: c } })
2057
+ }
2058
+ );
2059
+ }
2060
+ st.propTypes = {
2061
+ svg: m.string.isRequired
2062
+ };
2063
+ const Ee = (o, c = "36px") => {
2064
+ let d = null;
2065
+ if (typeof o == "object" && o !== null ? o.type === "svg" && typeof o.content == "string" ? d = o.content : typeof o.svg == "string" && (d = o.svg) : typeof o == "string" && (d = o), typeof d == "string" && d.includes("<svg")) {
2066
+ const b = d.match(/<svg[\s\S]*<\/svg>/i);
2067
+ b && (d = b[0]);
2068
+ }
2069
+ return d ? /* @__PURE__ */ e(
2070
+ N,
2071
+ {
2072
+ sx: {
2073
+ height: c,
2074
+ width: c,
2075
+ display: "flex",
2076
+ justifyContent: "center",
2077
+ alignItems: "center"
2078
+ },
2079
+ children: /* @__PURE__ */ e(st, { svg: d })
2080
+ }
2081
+ ) : /* @__PURE__ */ e(
2082
+ N,
2083
+ {
2084
+ sx: {
2085
+ fontSize: "1.2rem",
2086
+ color: "#b0bec5",
2087
+ border: "1px solid",
2088
+ borderRadius: "50%",
2089
+ height: "36px",
2090
+ width: "36px",
2091
+ display: "flex",
2092
+ alignItems: "center",
2093
+ justifyContent: "center",
2094
+ marginBottom: "4px"
2095
+ },
2096
+ children: "?"
2097
+ }
2098
+ );
2099
+ }, et = ({ feature: o, isGroupMember: c = !1 }) => /* @__PURE__ */ p(
2100
+ N,
2101
+ {
2102
+ sx: {
2103
+ width: "fit-content",
2104
+ p: "10px",
2105
+ pl: c ? "20px" : "10px",
2106
+ backgroundColor: "#fff",
2107
+ border: "1px solid #e0e0e0",
2108
+ borderRadius: "4px",
2109
+ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)",
2110
+ cursor: "grab",
2111
+ display: "flex",
2112
+ alignItems: "center",
2113
+ transition: "all 0.1s",
2114
+ mt: "4px",
2115
+ "&:hover": {
2116
+ backgroundColor: "#f5f5f5",
2117
+ borderColor: "#b0bec5"
2118
+ }
2119
+ },
2120
+ children: [
2121
+ ((b, E) => {
2122
+ const u = Ee(o.icon, "18px");
2123
+ return u && u.type === N ? K.cloneElement(u, {
2124
+ sx: {
2125
+ ...u.props.sx,
2126
+ height: "18px",
2127
+ width: "18px",
2128
+ marginRight: "8px"
2129
+ }
2130
+ }) : /* @__PURE__ */ e(N, { sx: { mr: "8px", display: "flex", alignItems: "center" }, children: Ee(b, E) });
2131
+ })(o.icon, "18px"),
2132
+ /* @__PURE__ */ e(S, { variant: "body2", sx: { fontWeight: "normal", color: "#333" }, children: o == null ? void 0 : o.name })
2133
+ ]
2134
+ }
2135
+ );
2136
+ et.propTypes = {
2137
+ feature: m.any,
2138
+ isGroupMember: m.any
2139
+ };
2140
+ const tt = ({ item: o, COMPONENT_TYPES: c, activeGroupId: d, onGroupToggle: b }) => {
2141
+ const E = d === o.uuid, u = (y) => {
2142
+ y.stopPropagation();
2143
+ };
2144
+ return o.type !== "GROUP" ? /* @__PURE__ */ e(we, { id: o.uuid, componentType: c.FEATURE, dragData: o, children: /* @__PURE__ */ e(v, { item: !0, xs: 12, children: /* @__PURE__ */ e(et, { feature: o }) }, o.id) }, o.uuid) : /* @__PURE__ */ p(
2145
+ Ye,
2146
+ {
2147
+ sx: {
2148
+ m: 0,
2149
+ "&:before": { display: "none" },
2150
+ boxShadow: "none",
2151
+ border: "1px solid #e0e0e0",
2152
+ mb: 1,
2153
+ borderRadius: "4px!important"
2154
+ },
2155
+ expanded: E,
2156
+ onChange: () => b(o.uuid),
2157
+ disableGutters: !0,
2158
+ children: [
2159
+ /* @__PURE__ */ e(
2160
+ Je,
2161
+ {
2162
+ expandIcon: /* @__PURE__ */ e(N, { sx: { p: 1 }, onMouseDown: u, onTouchStart: u, children: /* @__PURE__ */ e(
2163
+ X,
2164
+ {
2165
+ iconName: "faChevronDown",
2166
+ style: {
2167
+ fontSize: "1rem",
2168
+ color: "#073149",
2169
+ transform: E ? "rotate(360deg)" : "rotate(0deg)",
2170
+ transition: "transform 0.2s"
2171
+ }
2172
+ }
2173
+ ) }),
2174
+ sx: {
2175
+ minHeight: "15px",
2176
+ backgroundColor: "#e3f2fd",
2177
+ borderBottom: "1px solid #bbdefb",
2178
+ cursor: "grab",
2179
+ "&:hover": { backgroundColor: "#c5e3f8" },
2180
+ "& .MuiAccordionSummary-content": { margin: "0" },
2181
+ p: "0 10px"
2182
+ },
2183
+ children: /* @__PURE__ */ p(N, { sx: { display: "flex", alignItems: "center", width: "100%" }, children: [
2184
+ /* @__PURE__ */ e(
2185
+ we,
2186
+ {
2187
+ id: o.uuid,
2188
+ componentType: c.GROUP,
2189
+ dragData: o,
2190
+ children: /* @__PURE__ */ e(
2191
+ N,
2192
+ {
2193
+ component: "span",
2194
+ sx: { cursor: "grab", mr: 1, px: 0.5, "&:hover": { color: "#007bff" } },
2195
+ onClick: (y) => y.stopPropagation(),
2196
+ onMouseDown: (y) => y.stopPropagation(),
2197
+ onTouchStart: (y) => y.stopPropagation(),
2198
+ children: /* @__PURE__ */ e(X, { iconName: "faBars", style: { fontSize: "0.8rem", color: "#073149" } })
2199
+ }
2200
+ )
2201
+ },
2202
+ `drag-handle-${o.uuid}`
2203
+ ),
2204
+ /* @__PURE__ */ p(S, { variant: "subtitle2", sx: { fontWeight: "bold", color: "#073149", flexGrow: 1 }, children: [
2205
+ o.name,
2206
+ " (",
2207
+ o.menus.length,
2208
+ ")"
2209
+ ] })
2210
+ ] })
2211
+ }
2212
+ ),
2213
+ /* @__PURE__ */ e(Xe, { sx: { p: "8px", pt: 1, backgroundColor: "#f9f9f9" }, children: /* @__PURE__ */ e(v, { container: !0, spacing: 0.5, children: o.menus.map((y) => /* @__PURE__ */ e(
2214
+ we,
2215
+ {
2216
+ id: y.uuid,
2217
+ componentType: c.FEATURE,
2218
+ dragData: y,
2219
+ children: /* @__PURE__ */ e(v, { item: !0, xs: 12, children: /* @__PURE__ */ e(et, { feature: y, isGroupMember: !0 }) }, y.id)
2220
+ },
2221
+ y.uuid
2222
+ )) }) })
2223
+ ]
2224
+ },
2225
+ o.uuid
2226
+ );
2227
+ };
2228
+ tt.propTypes = {
2229
+ item: m.any,
2230
+ COMPONENT_TYPES: m.any,
2231
+ activeGroupId: m.any,
2232
+ onGroupToggle: m.any
2233
+ };
2234
+ export {
2235
+ cr as default
2236
+ };
2237
+ //# sourceMappingURL=AddMenuConfiguration-QWfpcnuP.js.map