mario-core 2.0.126-release → 2.0.127-release

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 (35) hide show
  1. package/dist/Dashboard-BtSsn3Vo.mjs +206 -0
  2. package/dist/Dashboard-uzWPTPcg.js +1 -0
  3. package/dist/EmailTemplateDetail-CrW66rV6.js +1 -0
  4. package/dist/EmailTemplateDetail-siQwIfEp.mjs +443 -0
  5. package/dist/EmailTemplateList-DJUKGiSG.js +1 -0
  6. package/dist/EmailTemplateList-DYa5U3BY.mjs +170 -0
  7. package/dist/GalleryList-Bd9QQfIE.mjs +329 -0
  8. package/dist/GalleryList-pp4RkxC5.js +1 -0
  9. package/dist/Login-DvOFdAym.mjs +1699 -0
  10. package/dist/Login-h9gmLFZK.js +1 -0
  11. package/dist/NotificationList-DGtOVsRX.js +2 -0
  12. package/dist/NotificationList-XQ66giFX.mjs +3658 -0
  13. package/dist/SkillList-CDUc-Zc4.mjs +386 -0
  14. package/dist/SkillList-CLlJoF6w.js +1 -0
  15. package/dist/TeacherSelector-D56z1NkG.mjs +30 -0
  16. package/dist/TeacherSelector-UxolyB8k.js +1 -0
  17. package/dist/TheContent-CoA7bs3f.js +1 -0
  18. package/dist/TheContent-DZUdjJzj.mjs +38 -0
  19. package/dist/UserContainer-BToGqWO5.mjs +2696 -0
  20. package/dist/UserContainer-Bs9uVUtT.js +5 -0
  21. package/dist/UserDetail-BMuvkpEQ.js +1 -0
  22. package/dist/UserDetail-BgE9xLhy.mjs +912 -0
  23. package/dist/UserList-BuV21Pjg.js +7 -0
  24. package/dist/UserList-DdXF-Zcw.mjs +1512 -0
  25. package/dist/constants-DC5ON0TF.mjs +241 -0
  26. package/dist/constants-DoUJBhKz.js +1 -0
  27. package/dist/index-B9R5BJ7_.mjs +19607 -0
  28. package/dist/index-DenbcZA6.js +15 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.modern.js +15 -15
  31. package/dist/mailCategoryService-BJjQgqsM.mjs +11 -0
  32. package/dist/mailCategoryService-Dwo0Q0wk.js +1 -0
  33. package/dist/userService-CNkSvMtf.js +1 -0
  34. package/dist/userService-DsXLHOjx.mjs +47 -0
  35. package/package.json +1 -1
@@ -0,0 +1,912 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as v, useEffect as ee, useCallback as _ } from "react";
3
+ import { useNavigate as we, useParams as Ee } from "react-router-dom";
4
+ import { Row as A, Col as u, FormGroup as b, Input as I, Label as ne, Button as G, Modal as Se, ModalHeader as ye, ModalBody as Te, ModalFooter as Ne } from "reactstrap";
5
+ import { Formik as le } from "formik";
6
+ import Re from "react-datepicker";
7
+ import { format as me } from "date-fns";
8
+ import { ap as De, b as N, c as R, af as g, aq as ue, ar as Ce, a2 as he, u as be, s as V, _ as ve, $ as F, E as M, as as Ue, at as Pe, au as Ae, a1 as Ie, an as _e, t as xe, al as He } from "./index-B9R5BJ7_.mjs";
9
+ import { useDispatch as pe, useSelector as Oe } from "react-redux";
10
+ import { useTranslation as Be } from "react-i18next";
11
+ import { o as Le, q as ie, v as Fe, w as ke, x as Me, y as qe, z as $e, A as je, B as ze, C as Ge, D as Ve } from "./userService-DsXLHOjx.mjs";
12
+ import * as x from "yup";
13
+ import { T as Je } from "./TeacherSelector-D56z1NkG.mjs";
14
+ import { h as ce } from "./constants-DC5ON0TF.mjs";
15
+ function Ye(o, r) {
16
+ if (r.length < o)
17
+ throw new TypeError(o + " argument required, but only " + r.length + " present");
18
+ }
19
+ function We(o) {
20
+ Ye(1, arguments);
21
+ var r = Object.prototype.toString.call(o);
22
+ return o instanceof Date || De(o) === "object" && r === "[object Date]" ? new Date(o.getTime()) : typeof o == "number" || r === "[object Number]" ? new Date(o) : ((typeof o == "string" || r === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
23
+ }
24
+ const Ke = {
25
+ id: "",
26
+ firstName: "",
27
+ lastName: "",
28
+ email: "",
29
+ dateOfBirth: "",
30
+ roles: [],
31
+ isActive: !0,
32
+ profileImageFileName: "",
33
+ teacherUserId: [],
34
+ msRoles: [],
35
+ hsRoles: [],
36
+ esRoles: []
37
+ }, de = "/admin/users/user-list", Qe = "User detail", Xe = (o) => {
38
+ const r = pe(), U = we(), [P, n] = v(Ke), [D, y] = v(!1), [q, J] = v([]), [C, Y] = v(null), [W, p] = v(!1), [K, $] = v({
39
+ isHasAssistantData: !1,
40
+ isHasCounselorData: !1,
41
+ isHasEduTeacherData: !1,
42
+ isHasSecondaryTeacherData: !1,
43
+ isHasTeacherData: !1
44
+ }), B = async () => {
45
+ localStorage.setItem(window.location.href, "true"), p(!0);
46
+ }, [Q, f] = v([]), m = () => {
47
+ y(!D);
48
+ };
49
+ ee(() => {
50
+ document.title = Qe, p(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
51
+ }, []), ee(() => {
52
+ o && (H(), L()), !o && S();
53
+ }, [o]);
54
+ const H = _(async () => {
55
+ r(N(!0));
56
+ try {
57
+ const s = await Le(o);
58
+ $(s.data);
59
+ } catch (s) {
60
+ r(
61
+ R({
62
+ type: "danger",
63
+ message: s.response?.data?.title || s.message
64
+ })
65
+ );
66
+ }
67
+ r(N(!1));
68
+ }, [o]), L = _(async () => {
69
+ r(N(!0));
70
+ try {
71
+ const s = await ie(o), a = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), c = (s.data?.msRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER), l = (s.data?.hsRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER), h = (s.data?.esRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER);
72
+ let T = s.data?.roles?.map((d) => d != "EduTeacher" ? d : g.EDUTEACHER) || [];
73
+ a === "HS" && l.length > 0 ? T = l : a === "MS" && c.length > 0 ? T = c : a === "ES" && h.length > 0 && (T = h), n({
74
+ ...s.data,
75
+ dateOfBirth: me(new Date(s.data.dateOfBirth), ue),
76
+ roles: T,
77
+ msRoles: c,
78
+ hsRoles: l,
79
+ esRoles: h
80
+ }), f(T), document.title = s.data?.fullName;
81
+ } catch (s) {
82
+ r(
83
+ R({
84
+ type: "danger",
85
+ message: s.response?.data?.title || s.message
86
+ })
87
+ );
88
+ }
89
+ r(N(!1));
90
+ }, [o]), S = async () => {
91
+ try {
92
+ const s = await Fe({
93
+ sortBy: "Email"
94
+ });
95
+ s.data && J(s.data.map?.((a) => ({
96
+ label: a.email,
97
+ value: a.id
98
+ })) || []);
99
+ } catch (s) {
100
+ r(
101
+ R({
102
+ type: "danger",
103
+ message: s.response?.data?.title || s.message
104
+ })
105
+ );
106
+ }
107
+ }, k = _((s) => {
108
+ U(s && typeof s == "string" ? de + `?query=${s}` : de);
109
+ }, []), j = _(
110
+ async (s) => {
111
+ r(N(!0));
112
+ try {
113
+ if (C) {
114
+ const l = new FormData(), { name: h } = C;
115
+ l.append("file", C, h);
116
+ const d = (await Ce(l))?.data?.key;
117
+ s.profileImageFileName = d;
118
+ }
119
+ const a = o ? ke : Me;
120
+ !o && delete s.id, s.dateOfBirth === "" && delete s.dateOfBirth;
121
+ const c = await a(s);
122
+ c && ie(c.data.id).then((l) => {
123
+ k(l.data.fullName);
124
+ }), o || alert("Password of " + c.data.email + ` is "${c.data.password}"`), c.data.id && await qe(c.data.id, s.gradeLevel), r(
125
+ R({
126
+ type: "success",
127
+ message: `${o ? "Update" : "Create"} user successfully`
128
+ })
129
+ );
130
+ } catch (a) {
131
+ r(
132
+ R({
133
+ type: "danger",
134
+ message: a.response?.data?.title || a.message
135
+ })
136
+ );
137
+ }
138
+ r(N(!1));
139
+ },
140
+ [o, C]
141
+ ), O = (s) => ["Student", "Parent", "EduTeacher"].includes(s), ae = async (s) => {
142
+ r(N(!0));
143
+ try {
144
+ await ze(s), r(
145
+ R({
146
+ type: "success",
147
+ message: "Change password successfully"
148
+ })
149
+ );
150
+ } catch (a) {
151
+ r(
152
+ R({
153
+ type: "danger",
154
+ message: a.response?.data?.title || a.message
155
+ })
156
+ );
157
+ }
158
+ r(N(!1));
159
+ }, te = _(async (s) => {
160
+ r(N(!0));
161
+ try {
162
+ await $e(s), r(
163
+ R({
164
+ type: "success",
165
+ message: "Send forgot password link successfully"
166
+ })
167
+ );
168
+ } catch (a) {
169
+ r(
170
+ R({
171
+ type: "danger",
172
+ message: a.response?.data?.title || a.message || "Error occured"
173
+ })
174
+ );
175
+ }
176
+ r(N(!1));
177
+ }, []), re = _(
178
+ async (s) => {
179
+ r(N(!0));
180
+ try {
181
+ const c = await je({
182
+ userId: s
183
+ });
184
+ if (c.data) {
185
+ const l = `${P.firstName} ${P.lastName}`;
186
+ alert(`Password of ${l} is ${c.data}`), r(
187
+ R({
188
+ type: "success",
189
+ message: "Update user password successfully"
190
+ })
191
+ );
192
+ }
193
+ } catch (a) {
194
+ r(
195
+ R({
196
+ type: "danger",
197
+ message: a.response?.data?.title || a.message
198
+ })
199
+ );
200
+ }
201
+ r(N(!1));
202
+ },
203
+ [P]
204
+ );
205
+ return {
206
+ userDetail: P,
207
+ backToList: k,
208
+ confirmData: j,
209
+ file: C,
210
+ setFile: Y,
211
+ edited: W,
212
+ setEdited: p,
213
+ setEditedTrue: B,
214
+ confirmChangePassword: ae,
215
+ forgotPasswordRequest: te,
216
+ currentRoles: Q,
217
+ handleDisableRoles: O,
218
+ handleResetPassword: re,
219
+ teacherOptions: q,
220
+ openModel: D,
221
+ handleToggleModel: m,
222
+ userHasData: K
223
+ };
224
+ }, Ze = x.object({
225
+ firstName: x.string().required("First name is required"),
226
+ lastName: x.string().required("Last name is required"),
227
+ email: x.string().email("Email is invalid").required("Email is required"),
228
+ roles: x.array().of(x.string()).min(1, "Role is required")
229
+ }), es = x.object({
230
+ oldPassword: x.string().required("Current password is required"),
231
+ newPassword: x.string().required("New password is required"),
232
+ confirmedNewPassword: x.string().required("Confirm password is required")
233
+ }), ss = {
234
+ currentPage: 1,
235
+ pageSize: 100
236
+ }, as = (o, r) => {
237
+ const [U, P] = v([]), [n, D] = v(!1), [y, q] = v(ss), [J, C] = v(), Y = pe(), W = _(async () => {
238
+ D(!0);
239
+ try {
240
+ const m = (await Ge(y)).data?.items || [];
241
+ P(K(m));
242
+ } catch {
243
+ Y(R({
244
+ type: "error",
245
+ message: "Cannot get roster users"
246
+ }));
247
+ }
248
+ D(!1);
249
+ }, [JSON.stringify(y)]), p = _(async () => {
250
+ if (!r) return;
251
+ const f = U.find((m) => m.value === r);
252
+ if (f) {
253
+ C(f);
254
+ return;
255
+ }
256
+ D(!0);
257
+ try {
258
+ const H = (await Ve(r)).data;
259
+ C({
260
+ label: $(H),
261
+ value: H.sourcedId
262
+ });
263
+ } catch (m) {
264
+ console.log("err:", m);
265
+ }
266
+ D(!1);
267
+ }, [r]), K = (f) => f.map((m) => ({
268
+ label: $(m),
269
+ value: m.sourcedId
270
+ })), $ = (f) => {
271
+ const m = [], { givenName: H, middleName: L, familyName: S, email: k, role: j } = f, O = [];
272
+ return H && O.push(H), L && O.push(L), S && O.push(S), O.length && m.push(O.join(" ")), k && m.push(k), `${m.join(" - ")}${j ? ` (${j})` : ""}`;
273
+ }, B = (f) => {
274
+ q((m) => ({ ...m, searchString: f }));
275
+ }, Q = _((f) => {
276
+ q({
277
+ ...y,
278
+ ...f
279
+ });
280
+ }, [JSON.stringify(y)]);
281
+ return ee(() => {
282
+ y.roles?.length && W();
283
+ }, [JSON.stringify(y)]), ee(() => {
284
+ Q({
285
+ roles: o
286
+ });
287
+ }, [JSON.stringify(o)]), ee(() => {
288
+ p();
289
+ }, [r]), {
290
+ users: U,
291
+ isLoading: n,
292
+ user: J,
293
+ handleInputChange: B
294
+ };
295
+ }, ts = ({ value: o, roles: r, onChange: U }) => {
296
+ const {
297
+ users: P,
298
+ isLoading: n,
299
+ user: D,
300
+ handleInputChange: y
301
+ } = as(r, o);
302
+ return /* @__PURE__ */ e(
303
+ he,
304
+ {
305
+ options: P,
306
+ value: D,
307
+ placeholder: "Select user",
308
+ onChange: U,
309
+ isLoading: n,
310
+ onInputChange: y
311
+ }
312
+ );
313
+ }, rs = "create_user", os = "edit_user", ns = "change_password", ys = () => {
314
+ const { id: o } = Ee(), { getLabel: r, system: U } = be(), P = Oe((s) => s.common.user), { t: n } = Be(), {
315
+ userDetail: D,
316
+ backToList: y,
317
+ confirmData: q,
318
+ file: J,
319
+ setFile: C,
320
+ edited: Y,
321
+ setEdited: W,
322
+ setEditedTrue: p,
323
+ confirmChangePassword: K,
324
+ forgotPasswordRequest: $,
325
+ currentRoles: B,
326
+ handleDisableRoles: Q,
327
+ handleResetPassword: f,
328
+ teacherOptions: m,
329
+ openModel: H,
330
+ handleToggleModel: L,
331
+ userHasData: S
332
+ } = Xe(o), k = {
333
+ oldPassword: "",
334
+ newPassword: "",
335
+ confirmedNewPassword: ""
336
+ }, j = n(o ? `${os}` : `${rs}`), O = n(o ? "update" : "create"), ae = () => {
337
+ var s = window.location.origin + "/api/ExportDataUser/" + o;
338
+ window.open(s);
339
+ }, te = async (s) => {
340
+ var a = {
341
+ email: s
342
+ };
343
+ $(a);
344
+ }, re = () => {
345
+ if (!o) return;
346
+ confirm("You want to reset this user's password") == !0 && f(o);
347
+ };
348
+ return /* @__PURE__ */ e(
349
+ le,
350
+ {
351
+ initialValues: D,
352
+ enableReinitialize: !0,
353
+ validationSchema: Ze,
354
+ onSubmit: (s) => {
355
+ const a = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), c = s.roles.map(
356
+ (w) => w != g.EDUTEACHER ? w : "EduTeacher"
357
+ );
358
+ let l = a;
359
+ c.includes(g.STUDENT) && s.gradeLevel && (xe.includes(s.gradeLevel) ? l = "ES" : He.includes(s.gradeLevel) ? l = "HS" : l = "MS");
360
+ const h = (l === "MS" ? c : s.msRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher"), T = (l === "HS" ? c : s.hsRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher"), d = (l === "ES" ? c : s.esRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher");
361
+ q({
362
+ ...s,
363
+ roles: c,
364
+ msRoles: h,
365
+ hsRoles: T,
366
+ esRoles: d
367
+ }), W(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
368
+ },
369
+ children: (s) => {
370
+ const {
371
+ values: a,
372
+ touched: c,
373
+ errors: l,
374
+ setFieldValue: h,
375
+ handleChange: T,
376
+ handleBlur: d,
377
+ handleSubmit: w
378
+ } = s, se = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), fe = _(
379
+ (t) => {
380
+ let E;
381
+ a.roles.includes(t) ? E = a.roles.filter((X) => X !== t) : [g.STUDENT, g.PARENT].includes(t) ? E = [t] : a.roles.includes(g.STUDENT) && g.STUDENT !== t ? E = [t] : E = [...a.roles, t], h("roles", E), se === "HS" ? h("hsRoles", E) : se === "MS" ? h("msRoles", E) : se === "ES" && h("esRoles", E);
382
+ },
383
+ [a.roles, se]
384
+ );
385
+ return /* @__PURE__ */ i(
386
+ "div",
387
+ {
388
+ className: `animated fadeIn detail-buttons-padding ${_e <= 767 ? V["p-0-12"] : ""}`,
389
+ children: [
390
+ /* @__PURE__ */ e(ve, { when: Y }),
391
+ /* @__PURE__ */ e("h5", { className: "mb-2", children: j }),
392
+ /* @__PURE__ */ i(A, { className: "pt-2", children: [
393
+ /* @__PURE__ */ i(u, { md: 8, children: [
394
+ /* @__PURE__ */ i(A, { children: [
395
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
396
+ /* @__PURE__ */ e(
397
+ F,
398
+ {
399
+ text: n("first_name"),
400
+ className: "text-capitalize"
401
+ }
402
+ ),
403
+ /* @__PURE__ */ e(
404
+ I,
405
+ {
406
+ name: "firstName",
407
+ value: a.firstName,
408
+ onChange: (t) => {
409
+ T(t), p();
410
+ },
411
+ onBlur: d("subject"),
412
+ placeholder: n("first_name"),
413
+ className: V["input-name"]
414
+ }
415
+ ),
416
+ c.firstName && l.firstName && /* @__PURE__ */ e(
417
+ M,
418
+ {
419
+ text: l.firstName
420
+ }
421
+ )
422
+ ] }) }),
423
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
424
+ /* @__PURE__ */ e(ne, { children: n("date_of_birth") }),
425
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
426
+ Re,
427
+ {
428
+ value: a.dateOfBirth,
429
+ todayButton: "Today",
430
+ peekNextMonth: !0,
431
+ showMonthDropdown: !0,
432
+ showYearDropdown: !0,
433
+ dropdownMode: "select",
434
+ selected: a.dateOfBirth ? We(
435
+ new Date(
436
+ a.dateOfBirth
437
+ )
438
+ ) : null,
439
+ onChange: (t) => {
440
+ s.setFieldValue(
441
+ "dateOfBirth",
442
+ me(
443
+ t,
444
+ ue
445
+ )
446
+ ), p();
447
+ },
448
+ placeholderText: n(
449
+ "date_of_birth"
450
+ ),
451
+ customInput: /* @__PURE__ */ e(
452
+ I,
453
+ {
454
+ type: "text",
455
+ style: {
456
+ width: "maxContent"
457
+ },
458
+ placeholder: n(
459
+ "date_of_birth"
460
+ )
461
+ }
462
+ )
463
+ }
464
+ ) })
465
+ ] }) })
466
+ ] }),
467
+ /* @__PURE__ */ i(A, { children: [
468
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
469
+ /* @__PURE__ */ e(
470
+ F,
471
+ {
472
+ text: n("last_name"),
473
+ className: "text-capitalize"
474
+ }
475
+ ),
476
+ /* @__PURE__ */ e(
477
+ I,
478
+ {
479
+ name: "lastName",
480
+ value: a.lastName,
481
+ onChange: (t) => {
482
+ T(t), p();
483
+ },
484
+ onBlur: d("lastName"),
485
+ placeholder: n("last_name"),
486
+ className: V["input-name"]
487
+ }
488
+ ),
489
+ c.lastName && l.lastName && /* @__PURE__ */ e(
490
+ M,
491
+ {
492
+ text: l.lastName
493
+ }
494
+ )
495
+ ] }) }),
496
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
497
+ /* @__PURE__ */ e(F, { text: n("roles") }),
498
+ /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
499
+ u,
500
+ {
501
+ md: 12,
502
+ className: "d-flex flex-wrap align-items-center",
503
+ children: Ue.map(
504
+ (t) => /* @__PURE__ */ e(
505
+ "div",
506
+ {
507
+ className: "mr-3",
508
+ children: /* @__PURE__ */ e(
509
+ I,
510
+ {
511
+ type: "checkbox",
512
+ id: `role-checkbox-${t}`,
513
+ label: t === "SecondaryTeacher" ? "SupportTeacher" : `${t}`,
514
+ checked: a.roles.includes(
515
+ t
516
+ ),
517
+ onChange: () => {
518
+ o && (S.isHasTeacherData && t === "Teacher" || S.isHasAssistantData && t === "Assistant" || S.isHasCounselorData && t === "Counselor" || S.isHasSecondaryTeacherData && t === "SecondaryTeacher" || t == "Student" && (S.isHasAssistantData || S.isHasCounselorData || S.isHasSecondaryTeacherData || S.isHasTeacherData)) ? alert(
519
+ "Please switch data before removing the role"
520
+ ) : (fe(
521
+ t
522
+ ), p());
523
+ },
524
+ disabled: B.includes(
525
+ "Parent"
526
+ ) || B.includes(
527
+ "Student"
528
+ ) && o ? B.concat(
529
+ [
530
+ "Student",
531
+ "Parent"
532
+ ]
533
+ ).includes(
534
+ t
535
+ ) || B.every(
536
+ Q
537
+ ) : [
538
+ "Parent"
539
+ ].includes(
540
+ t
541
+ )
542
+ }
543
+ )
544
+ },
545
+ t
546
+ )
547
+ )
548
+ }
549
+ ) }),
550
+ c.roles && l.roles && /* @__PURE__ */ e(
551
+ M,
552
+ {
553
+ text: l.roles
554
+ }
555
+ )
556
+ ] }) })
557
+ ] }),
558
+ /* @__PURE__ */ i(A, { children: [
559
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
560
+ /* @__PURE__ */ e(F, { text: n("email") }),
561
+ /* @__PURE__ */ e(
562
+ I,
563
+ {
564
+ name: "email",
565
+ value: a.email,
566
+ onChange: (t) => {
567
+ T(t), p();
568
+ },
569
+ onBlur: d("email"),
570
+ placeholder: n("email")
571
+ }
572
+ ),
573
+ c.email && l.email && /* @__PURE__ */ e(
574
+ M,
575
+ {
576
+ text: l.email
577
+ }
578
+ )
579
+ ] }) }),
580
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
581
+ /* @__PURE__ */ e(F, { text: n("status") }),
582
+ /* @__PURE__ */ i(A, { children: [
583
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
584
+ I,
585
+ {
586
+ id: "role-checkbox-active",
587
+ type: "radio",
588
+ name: "active",
589
+ label: n("active"),
590
+ checked: !!a && !!a.isActive,
591
+ onChange: () => {
592
+ h(
593
+ "isActive",
594
+ !0
595
+ ), p();
596
+ }
597
+ }
598
+ ) }),
599
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
600
+ I,
601
+ {
602
+ id: "role-checkbox-inActive",
603
+ type: "radio",
604
+ name: "active",
605
+ label: n("inactive"),
606
+ checked: !!a && !a.isActive,
607
+ onChange: () => h(
608
+ "isActive",
609
+ !1
610
+ )
611
+ }
612
+ ) })
613
+ ] })
614
+ ] }) })
615
+ ] }),
616
+ a.roles.includes(g.STUDENT) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(b, { children: [
617
+ /* @__PURE__ */ e(ne, { children: U === "UK" ? "Year" : "Grade Level" }),
618
+ /* @__PURE__ */ e(
619
+ he,
620
+ {
621
+ options: ce.map((t) => ({ ...t, label: r(t.value) })),
622
+ value: ce.map((t) => ({ ...t, label: r(t.value) })).find(
623
+ (t) => t.value == a.gradeLevel
624
+ ),
625
+ placeholder: U === "UK" ? "Year" : "Grade Level",
626
+ onChange: (t) => {
627
+ h(
628
+ "gradeLevel",
629
+ t.value
630
+ );
631
+ }
632
+ }
633
+ )
634
+ ] }) }) }),
635
+ !!o && /* @__PURE__ */ i(A, { children: [
636
+ /* @__PURE__ */ e(u, { md: 6, children: (!a.roles.includes("Admin") || a.roles.length > 1) && !!a.roles.length && /* @__PURE__ */ i(b, { children: [
637
+ /* @__PURE__ */ e(ne, { children: "Map from Roster" }),
638
+ /* @__PURE__ */ e(
639
+ ts,
640
+ {
641
+ roles: a.roles,
642
+ value: a.sourcedId,
643
+ onChange: (t) => h(
644
+ "sourcedId",
645
+ t.value
646
+ )
647
+ }
648
+ )
649
+ ] }) }),
650
+ /* @__PURE__ */ i(u, { md: 6, children: [
651
+ /* @__PURE__ */ e(
652
+ G,
653
+ {
654
+ color: "primary",
655
+ className: "w-100",
656
+ onClick: () => {
657
+ te(
658
+ a.email || ""
659
+ );
660
+ },
661
+ children: n("send_forgot_password_link")
662
+ }
663
+ ),
664
+ /* @__PURE__ */ e(
665
+ G,
666
+ {
667
+ color: "primary",
668
+ className: "w-100 mt-3",
669
+ onClick: () => re(),
670
+ children: n("reset_password")
671
+ }
672
+ ),
673
+ /* @__PURE__ */ e(
674
+ G,
675
+ {
676
+ color: "success",
677
+ className: "w-100 mt-3",
678
+ onClick: () => {
679
+ ae();
680
+ },
681
+ children: n("download_user_data")
682
+ }
683
+ )
684
+ ] })
685
+ ] })
686
+ ] }),
687
+ /* @__PURE__ */ e(u, { md: 4, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ i(u, { md: 8, children: [
688
+ /* @__PURE__ */ e(
689
+ Pe,
690
+ {
691
+ setFile: C,
692
+ fileName: a.profileImageFileName,
693
+ onAddImage: p,
694
+ canDelete: !0,
695
+ onDelete: () => {
696
+ C(null), h(
697
+ "profileImageFileName",
698
+ ""
699
+ ), p();
700
+ }
701
+ }
702
+ ),
703
+ !J && !a.profileImageFileName && /* @__PURE__ */ e(
704
+ "img",
705
+ {
706
+ src: Ae,
707
+ style: { maxWidth: "100%" }
708
+ }
709
+ )
710
+ ] }) }) })
711
+ ] }),
712
+ P.id === o ? /* @__PURE__ */ i("div", { children: [
713
+ /* @__PURE__ */ e("h5", { className: "mt-3", children: n(`${ns}`) }),
714
+ /* @__PURE__ */ e(
715
+ le,
716
+ {
717
+ initialValues: k,
718
+ enableReinitialize: !0,
719
+ validationSchema: es,
720
+ onSubmit: (t) => {
721
+ K(t);
722
+ },
723
+ children: (t) => {
724
+ const {
725
+ values: E,
726
+ touched: X,
727
+ errors: z,
728
+ handleChange: oe,
729
+ handleSubmit: ge
730
+ } = t;
731
+ return /* @__PURE__ */ i(A, { className: "pt-2 pb-5", children: [
732
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(b, { children: [
733
+ /* @__PURE__ */ e(
734
+ F,
735
+ {
736
+ text: n(
737
+ "current_password"
738
+ ),
739
+ className: "text-capitalize"
740
+ }
741
+ ),
742
+ /* @__PURE__ */ e(
743
+ I,
744
+ {
745
+ name: "oldPassword",
746
+ type: "password",
747
+ value: E.oldPassword,
748
+ onChange: (Z) => {
749
+ oe(Z), p();
750
+ },
751
+ onBlur: d(
752
+ "subject"
753
+ ),
754
+ placeholder: n(
755
+ "current_password"
756
+ ),
757
+ className: V["input-name"]
758
+ }
759
+ ),
760
+ X.oldPassword && z.oldPassword && /* @__PURE__ */ e(
761
+ M,
762
+ {
763
+ text: z.oldPassword
764
+ }
765
+ )
766
+ ] }) }),
767
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(b, { children: [
768
+ /* @__PURE__ */ e(
769
+ F,
770
+ {
771
+ text: n(
772
+ "new_password"
773
+ ),
774
+ className: "text-capitalize"
775
+ }
776
+ ),
777
+ /* @__PURE__ */ e(
778
+ I,
779
+ {
780
+ name: "newPassword",
781
+ type: "password",
782
+ value: E.newPassword,
783
+ onChange: (Z) => {
784
+ oe(Z), p();
785
+ },
786
+ onBlur: d(
787
+ "subject"
788
+ ),
789
+ placeholder: n(
790
+ "new_password"
791
+ ),
792
+ className: V["input-name"]
793
+ }
794
+ ),
795
+ X.newPassword && z.newPassword && /* @__PURE__ */ e(
796
+ M,
797
+ {
798
+ text: z.newPassword
799
+ }
800
+ )
801
+ ] }) }),
802
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(b, { children: [
803
+ /* @__PURE__ */ e(
804
+ F,
805
+ {
806
+ text: n(
807
+ "confirm_password"
808
+ ),
809
+ className: "text-capitalize"
810
+ }
811
+ ),
812
+ /* @__PURE__ */ e(
813
+ I,
814
+ {
815
+ name: "confirmedNewPassword",
816
+ type: "password",
817
+ value: E.confirmedNewPassword,
818
+ onChange: (Z) => {
819
+ oe(Z), p();
820
+ },
821
+ onBlur: d(
822
+ "subject"
823
+ ),
824
+ placeholder: n(
825
+ "confirm_password"
826
+ ),
827
+ className: V["input-name"]
828
+ }
829
+ ),
830
+ X.confirmedNewPassword && z.confirmedNewPassword && /* @__PURE__ */ e(
831
+ M,
832
+ {
833
+ text: z.confirmedNewPassword
834
+ }
835
+ )
836
+ ] }) }),
837
+ /* @__PURE__ */ e(u, { md: 12, children: /* @__PURE__ */ e(
838
+ G,
839
+ {
840
+ color: "primary",
841
+ size: "sm",
842
+ className: "px-4 pl-1 mr-2 ml-3",
843
+ onClick: () => ge(),
844
+ children: n("save")
845
+ }
846
+ ) })
847
+ ] });
848
+ }
849
+ }
850
+ )
851
+ ] }) : null,
852
+ /* @__PURE__ */ e(
853
+ Ie,
854
+ {
855
+ confirmText: O,
856
+ onConfirm: a.roles.includes(g.STUDENT) && !o ? L : w,
857
+ onCancel: y
858
+ }
859
+ ),
860
+ /* @__PURE__ */ i(
861
+ Se,
862
+ {
863
+ centered: !0,
864
+ isOpen: H,
865
+ toggle: () => L(),
866
+ children: [
867
+ /* @__PURE__ */ e(ye, { children: "Assign Teacher" }),
868
+ /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
869
+ Je,
870
+ {
871
+ isMulti: !0,
872
+ value: m.filter(
873
+ (t) => a.teacherUserId?.includes(
874
+ t.value
875
+ )
876
+ ) || null,
877
+ options: m,
878
+ onChange: (t) => h(
879
+ "teacherUserId",
880
+ t.map((E) => E.value)
881
+ ),
882
+ placeholder: n("select_teacher"),
883
+ className: "flex-grow-1 mb-3"
884
+ }
885
+ ) }),
886
+ /* @__PURE__ */ i(Ne, { className: "text-right", children: [
887
+ /* @__PURE__ */ e(G, { onClick: () => L(), children: "Cancel" }),
888
+ /* @__PURE__ */ e(
889
+ G,
890
+ {
891
+ disabled: !a.teacherUserId,
892
+ color: "primary",
893
+ onClick: () => {
894
+ w();
895
+ },
896
+ children: "Assign"
897
+ }
898
+ )
899
+ ] })
900
+ ]
901
+ }
902
+ )
903
+ ]
904
+ }
905
+ );
906
+ }
907
+ }
908
+ );
909
+ };
910
+ export {
911
+ ys as default
912
+ };