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,1699 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { memo as Ye, useState as N, useCallback as T, Fragment as ve, useEffect as Z } from "react";
3
+ import { Input as ie, Modal as Ke, ModalBody as Je, ModalFooter as fs, Button as ws, Form as Ss, FormGroup as me, Row as be, Col as ee } from "reactstrap";
4
+ import { Link as Ze, useLocation as ys, useNavigate as xe } from "react-router-dom";
5
+ import { u as Ns, s as t, M as Qe, E as oe, a as Xe, A as vs, g as Ie, b as g, f as Is, c as P, d as M, e as bs, r as Ts, h as ge, i as es, B as ks, j as ye, k as Cs, l as Ls, m as Es, I as Pe, N as Ps, n as xs, o as Rs, p as _s, q as $s, t as As, v as Ms, w as Fe, x as Gs, y as Os, z as Le, C as Ve, D as Us, F as Bs, G as zs, H as Fs, J as Vs } from "./index-B9R5BJ7_.mjs";
6
+ import { useDispatch as Te, useSelector as Ee } from "react-redux";
7
+ import { Formik as ke } from "formik";
8
+ import * as V from "yup";
9
+ import { useGoogleReCaptcha as Re, GoogleReCaptcha as Hs, GoogleReCaptchaProvider as Ds } from "react-google-recaptcha-v3";
10
+ import { GoogleOAuthProvider as qs, useGoogleLogin as Ws } from "@react-oauth/google";
11
+ import { L as Ne, T as ss } from "./types-BvnbDeJF.mjs";
12
+ import { G as He } from "./constants-DC5ON0TF.mjs";
13
+ import { LogLevel as Se, PublicClientApplication as js } from "@azure/msal-browser";
14
+ import * as de from "@amplitude/analytics-browser";
15
+ const Ys = {
16
+ backgroundColor: "#f7f9fc",
17
+ borderRadius: "4px",
18
+ marginBottom: "5px",
19
+ position: "relative"
20
+ }, Ks = {
21
+ backgroundColor: "#ffffff",
22
+ paddingRight: "50px",
23
+ color: "#333333",
24
+ caretColor: "#333333"
25
+ }, Js = {
26
+ fontSize: "20px",
27
+ position: "absolute",
28
+ right: "10px",
29
+ color: "#316CD9"
30
+ }, Zs = (s) => s.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (o, i) => i.toUpperCase()), he = ({
31
+ isShowPassword: s,
32
+ togglePasswordVisible: o,
33
+ onChange: i,
34
+ placeholder: d
35
+ }) => /* @__PURE__ */ r("div", { className: "d-flex align-items-center w-100", style: Ys, children: [
36
+ /* @__PURE__ */ e(
37
+ ie,
38
+ {
39
+ className: "border password-input",
40
+ style: Ks,
41
+ type: s ? "text" : "password",
42
+ name: "password",
43
+ onChange: i,
44
+ placeholder: d || "Password",
45
+ autocomplete: d ? Zs(d) : "password",
46
+ required: !0
47
+ }
48
+ ),
49
+ /* @__PURE__ */ e(
50
+ "i",
51
+ {
52
+ className: `far ${s ? "fa-eye-slash" : "fa-eye"} mx-2 cursor-pointer`,
53
+ style: Js,
54
+ onClick: () => o(),
55
+ title: s ? "Hide" : "Show"
56
+ }
57
+ )
58
+ ] }), Qs = ({ open: s, onConfirm: o, onClose: i, clickHandler: d }) => {
59
+ const { getLabel: m, system: u } = Ns(), [p, v] = N(He[0].value);
60
+ return /* @__PURE__ */ r(
61
+ Ke,
62
+ {
63
+ isOpen: s,
64
+ className: `${t["teacher-code"]}`,
65
+ style: { zIndex: 1201 },
66
+ centered: !0,
67
+ autoFocus: !1,
68
+ returnFocusAfterClose: !1,
69
+ children: [
70
+ /* @__PURE__ */ r("div", { className: `${t["header-teacher-code"]}`, children: [
71
+ /* @__PURE__ */ e("div", { style: { padding: "16px 24px", margin: 0, fontWeight: 500, fontSize: "1.25rem" }, children: u === "UK" ? "Select Year" : "Select Grade" }),
72
+ /* @__PURE__ */ e("div", { hidden: !i, children: /* @__PURE__ */ e(Qe, { onClick: () => i?.(), className: `${t["close-icon"]}`, size: 24, style: { color: "rgba(0, 0, 0, 0.54)" } }) })
73
+ ] }),
74
+ /* @__PURE__ */ r(Je, { style: { padding: "20px 24px" }, children: [
75
+ /* @__PURE__ */ e("p", { className: `${t["teacher-code-label"]}`, style: { margin: 0, marginBottom: "16px", color: "rgba(0, 0, 0, 0.6)" }, children: u === "UK" ? "You are logging in as a student, please select your year" : "You are logging in as a student, please select your grade" }),
76
+ /* @__PURE__ */ r("div", { className: "form-floating", style: { marginTop: "16px", marginBottom: "8px" }, children: [
77
+ /* @__PURE__ */ e(
78
+ ie,
79
+ {
80
+ type: "select",
81
+ id: "floatingSelectGrade",
82
+ value: p,
83
+ onChange: (w) => v(w.target.value),
84
+ children: He.map((w) => /* @__PURE__ */ e("option", { value: w.value, children: m(w.value) || w.label }, w.value))
85
+ }
86
+ ),
87
+ /* @__PURE__ */ e("label", { htmlFor: "floatingSelectGrade", children: u === "UK" ? "Select year" : "Select grade" })
88
+ ] })
89
+ ] }),
90
+ /* @__PURE__ */ e(fs, { style: { borderTop: "none", padding: "8px 24px" }, children: /* @__PURE__ */ e(ws, { disabled: !p, style: { borderRadius: 20, background: "#316cd9", border: "none", opacity: p ? 1 : 0.65 }, color: "primary", onClick: () => o(p, d), children: "Confirm" }) })
91
+ ]
92
+ }
93
+ );
94
+ };
95
+ function Xs(s, o) {
96
+ return JSON.stringify(s) === JSON.stringify(o);
97
+ }
98
+ const ea = Ye(Qs, Xs), sa = V.object({
99
+ email: V.string().email("Email is invalid").required("Email is required"),
100
+ password: V.string().required("Password is required"),
101
+ rememberMe: V.boolean()
102
+ }), aa = ({ onSuccess: s, onError: o }) => {
103
+ const i = Ws({
104
+ onSuccess: async (d) => {
105
+ try {
106
+ const m = await fetch("https://www.googleapis.com/oauth2/v3/userinfo", {
107
+ headers: { Authorization: `Bearer ${d.access_token}` }
108
+ }).then((p) => p.json()), u = {
109
+ accessToken: d.access_token,
110
+ googleId: m.sub,
111
+ profileObj: {
112
+ email: m.email,
113
+ familyName: m.family_name,
114
+ givenName: m.given_name,
115
+ imageUrl: m.picture,
116
+ name: m.name
117
+ }
118
+ };
119
+ s(u);
120
+ } catch (m) {
121
+ o(m);
122
+ }
123
+ },
124
+ onError: (d) => o(d)
125
+ });
126
+ return /* @__PURE__ */ r("div", { className: t["btn-login-with-sso"], onClick: () => i(), children: [
127
+ /* @__PURE__ */ r("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", width: "24px", height: "24px", style: { marginRight: "8px" }, children: [
128
+ /* @__PURE__ */ e("path", { fill: "#EA4335", d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" }),
129
+ /* @__PURE__ */ e("path", { fill: "#4285F4", d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" }),
130
+ /* @__PURE__ */ e("path", { fill: "#FBBC05", d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" }),
131
+ /* @__PURE__ */ e("path", { fill: "#34A853", d: "M24 48c6.48 0 12.38-2.12 16.66-5.73l-7.73-6c-2.15 1.45-4.92 2.3-8.93 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" }),
132
+ /* @__PURE__ */ e("path", { fill: "none", d: "M0 0h48v48H0z" })
133
+ ] }),
134
+ /* @__PURE__ */ e("p", { children: "GOOGLE" })
135
+ ] });
136
+ }, ta = ({
137
+ defaultInfo: s,
138
+ userLogin: o,
139
+ school: i,
140
+ isShowPassword: d,
141
+ setIsShowPassword: m,
142
+ fnIsCheckLogin: u,
143
+ // isLoginGoogle,
144
+ // submitLogin,
145
+ // infoUser,
146
+ googleClientId: p,
147
+ fnLoginSSO: v,
148
+ extensionEmail: w,
149
+ onLoginWidthClever: k,
150
+ openModalSelectGrade: x,
151
+ handleRegisterUser: S,
152
+ onToggleModelGrade: R
153
+ }) => {
154
+ const I = () => m(!d), j = Te(), { executeRecaptcha: G } = Re(), C = T(async () => {
155
+ if (!G) {
156
+ console.log("execute recaptcha undefined");
157
+ return;
158
+ }
159
+ return await G("login");
160
+ }, [G]), A = async (L) => {
161
+ try {
162
+ await vs(L);
163
+ } catch (E) {
164
+ console.error(E);
165
+ }
166
+ }, Y = async (L) => {
167
+ if (L?.accessToken) {
168
+ let {
169
+ email: E,
170
+ familyName: K,
171
+ givenName: b,
172
+ imageUrl: _,
173
+ name: O
174
+ // fullName
175
+ } = L.profileObj, D = L.accessToken, se = L.googleId;
176
+ const ae = window.location.hostname.split(".marioforme.com")?.[0], Q = E.split("@")?.[1], Ce = w?.split(",")?.map((H) => H.trim())?.filter((H) => H).some((H) => Q.includes(H));
177
+ if (!Q.includes(ae) && !Ce) {
178
+ alert(
179
+ "The email address you used does not match the login information in the database. Please check that you are using your school assigned email address to log into MARIO for Me. If you have further trouble please notify your school site administrator"
180
+ ), await A([`${Q} is incorrect`]);
181
+ return;
182
+ }
183
+ const ue = {
184
+ firstName: b,
185
+ lastName: K,
186
+ imageUrl: _,
187
+ fullName: O,
188
+ email: E,
189
+ accessToken: D,
190
+ googleId: se
191
+ };
192
+ j(Xe(ue)), u(
193
+ ss.Google,
194
+ ue,
195
+ D,
196
+ C
197
+ );
198
+ }
199
+ };
200
+ return /* @__PURE__ */ r(ve, { children: [
201
+ /* @__PURE__ */ e(
202
+ ke,
203
+ {
204
+ initialValues: s,
205
+ validationSchema: sa,
206
+ onSubmit: async (L) => {
207
+ try {
208
+ const E = await C();
209
+ if (!E) return;
210
+ L.captcha = E, L.loginType = Ne.Default, o(L);
211
+ } catch (E) {
212
+ console.error(E);
213
+ }
214
+ },
215
+ children: (L) => {
216
+ const {
217
+ handleBlur: E,
218
+ handleSubmit: K,
219
+ values: b,
220
+ touched: _,
221
+ errors: O,
222
+ setFieldValue: D
223
+ } = L, se = _.email && O.email, le = _.password && O.password;
224
+ return /* @__PURE__ */ e("div", { className: `${t["box-login"]} w-100`, children: /* @__PURE__ */ e(
225
+ Ss,
226
+ {
227
+ className: `${t["block-login"]}`,
228
+ onSubmit: K,
229
+ children: /* @__PURE__ */ r("div", { className: `${t["block-form"]}`, children: [
230
+ /* @__PURE__ */ r("div", { className: "d-flex align-items-center mb-4", children: [
231
+ /* @__PURE__ */ e(
232
+ "img",
233
+ {
234
+ hidden: !i?.schoolLogo,
235
+ src: i?.schoolLogo,
236
+ className: `${t["school-icon"]} mr-3`
237
+ }
238
+ ),
239
+ /* @__PURE__ */ e(
240
+ "p",
241
+ {
242
+ className: `${t["school-name"]} mb-0`,
243
+ children: i.schoolName
244
+ }
245
+ )
246
+ ] }),
247
+ /* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "Welcome Back!" }),
248
+ /* @__PURE__ */ e(
249
+ "p",
250
+ {
251
+ className: `${t["login-description"]} mb-5`,
252
+ children: "Please enter your MARIO Education account details"
253
+ }
254
+ ),
255
+ /* @__PURE__ */ r(
256
+ me,
257
+ {
258
+ className: `${t["form-user-name"]}`,
259
+ children: [
260
+ /* @__PURE__ */ e(
261
+ ie,
262
+ {
263
+ type: "text",
264
+ name: "email",
265
+ placeholder: "Email",
266
+ value: b.email,
267
+ onChange: (ae) => D(
268
+ "email",
269
+ ae.target?.value?.trim() || ""
270
+ ),
271
+ autocomplete: "email",
272
+ onBlur: E("email"),
273
+ required: !0
274
+ }
275
+ ),
276
+ se && /* @__PURE__ */ e(
277
+ oe,
278
+ {
279
+ text: O.email
280
+ }
281
+ )
282
+ ]
283
+ }
284
+ ),
285
+ /* @__PURE__ */ r(me, { children: [
286
+ /* @__PURE__ */ e(
287
+ he,
288
+ {
289
+ isShowPassword: d,
290
+ togglePasswordVisible: I,
291
+ onChange: (ae) => D(
292
+ "password",
293
+ ae.target?.value?.trim() || ""
294
+ )
295
+ }
296
+ ),
297
+ le && /* @__PURE__ */ e(
298
+ oe,
299
+ {
300
+ text: O.password
301
+ }
302
+ )
303
+ ] }),
304
+ /* @__PURE__ */ e(me, {}),
305
+ /* @__PURE__ */ r("div", { className: "d-flex justify-content-between", children: [
306
+ /* @__PURE__ */ r("div", { className: "d-flex align-items-center", style: { gap: "8px" }, children: [
307
+ /* @__PURE__ */ e(
308
+ "input",
309
+ {
310
+ type: "checkbox",
311
+ checked: !b.isSessionUserBrowser,
312
+ className: `${t["checkbox-keep-login"]}`,
313
+ onChange: () => D(
314
+ "isSessionUserBrowser",
315
+ !b.isSessionUserBrowser
316
+ )
317
+ }
318
+ ),
319
+ /* @__PURE__ */ e(
320
+ "p",
321
+ {
322
+ className: `${t["label-keep-login"]} mb-0 ml-2`,
323
+ children: "Keep me logged in"
324
+ }
325
+ )
326
+ ] }),
327
+ /* @__PURE__ */ e(
328
+ Ze,
329
+ {
330
+ to: "/forgot-password",
331
+ className: `${t["link-to-login"]}`,
332
+ children: "Forgot password?"
333
+ }
334
+ )
335
+ ] }),
336
+ /* @__PURE__ */ e(
337
+ "button",
338
+ {
339
+ className: `${t["btn-login"]} mt-5`,
340
+ type: "submit",
341
+ children: "LOG IN"
342
+ }
343
+ ),
344
+ /* @__PURE__ */ e(
345
+ "p",
346
+ {
347
+ className: `${t["option-text"]} my-3 text-center`,
348
+ children: "OR"
349
+ }
350
+ ),
351
+ /* @__PURE__ */ r(be, { className: "mb-4", children: [
352
+ /* @__PURE__ */ e(
353
+ ee,
354
+ {
355
+ lg: 6,
356
+ md: 6,
357
+ xs: 12,
358
+ className: "pr-md-3",
359
+ children: !!p && /* @__PURE__ */ e(
360
+ qs,
361
+ {
362
+ clientId: p,
363
+ children: /* @__PURE__ */ e(
364
+ aa,
365
+ {
366
+ onSuccess: Y,
367
+ onError: () => console.log("Google login failed")
368
+ }
369
+ )
370
+ }
371
+ )
372
+ }
373
+ ),
374
+ i.schoolId && /* @__PURE__ */ e(
375
+ ee,
376
+ {
377
+ lg: 6,
378
+ md: 6,
379
+ xs: 12,
380
+ className: `${t["btn-login-sso"]} pl-md-2`,
381
+ hidden: !i?.schoolId,
382
+ children: /* @__PURE__ */ r(
383
+ "div",
384
+ {
385
+ className: t["btn-login-with-sso"],
386
+ onClick: () => v(C),
387
+ children: [
388
+ /* @__PURE__ */ e("img", { src: "images/microsoft-logo.png" }),
389
+ /* @__PURE__ */ e("p", { children: "MICROSOFT" })
390
+ ]
391
+ }
392
+ )
393
+ }
394
+ )
395
+ ] }),
396
+ /* @__PURE__ */ e(
397
+ "div",
398
+ {
399
+ className: `${t["btn-login-sso"]}`,
400
+ children: /* @__PURE__ */ r(
401
+ "div",
402
+ {
403
+ className: t["btn-login-with-sso"],
404
+ onClick: () => window.open(
405
+ "https://launchpad.classlink.com/login"
406
+ ),
407
+ children: [
408
+ /* @__PURE__ */ e("img", { src: "images/class-link-icon.png" }),
409
+ /* @__PURE__ */ e("p", { children: "SIGN IN WITH CLASSLINK" })
410
+ ]
411
+ }
412
+ )
413
+ }
414
+ ),
415
+ /* @__PURE__ */ e(
416
+ "div",
417
+ {
418
+ className: `${t["btn-login-sso"]} mt-4`,
419
+ children: /* @__PURE__ */ r(
420
+ "div",
421
+ {
422
+ className: t["btn-login-with-sso"],
423
+ onClick: () => k(),
424
+ children: [
425
+ /* @__PURE__ */ e("img", { src: "images/clever-icon.png" }),
426
+ /* @__PURE__ */ e("p", { children: "SIGN IN WITH CLEVER" })
427
+ ]
428
+ }
429
+ )
430
+ }
431
+ )
432
+ ] })
433
+ }
434
+ ) });
435
+ }
436
+ }
437
+ ),
438
+ /* @__PURE__ */ e(ea, { open: x, onConfirm: S, clickHandler: C, onClose: R })
439
+ ] });
440
+ }, oa = {
441
+ email: "",
442
+ captcha: ""
443
+ }, ra = "/", De = "/login", na = "Log in", as = () => {
444
+ const s = new URLSearchParams(ys().search), o = s.get("token"), i = s.get("key") ?? "", d = Te(), m = xe(), [u, p] = N(!1), v = T(() => {
445
+ p(!u);
446
+ }, [u]), [w, k] = N(!1), [x, S] = N(!1), [R, I] = N({
447
+ token: "",
448
+ password: "",
449
+ reEnterPassword: "",
450
+ email: "",
451
+ userId: ""
452
+ }), [j, G] = N(!0), { executeRecaptcha: C } = Re();
453
+ Z(() => {
454
+ document.title = na, Ie() && m(ra);
455
+ }, []);
456
+ const A = T(async (b) => {
457
+ d(g(!0));
458
+ try {
459
+ await Is(b), m(De), d(
460
+ P({
461
+ type: "success",
462
+ message: "A mail to reset password was sent"
463
+ })
464
+ );
465
+ } catch (_) {
466
+ d(
467
+ P({
468
+ type: "danger",
469
+ message: _.response?.data?.title || _.message || "Error occured"
470
+ })
471
+ ), localStorage.removeItem(M), sessionStorage.removeItem(M);
472
+ }
473
+ d(g(!1));
474
+ }, []), Y = T(
475
+ async (b, _) => {
476
+ d(g(!0));
477
+ try {
478
+ const O = await bs(b, _);
479
+ O.data ? I({
480
+ ...R,
481
+ token: b,
482
+ email: O.data
483
+ }) : G(!1);
484
+ } catch {
485
+ G(!1);
486
+ }
487
+ d(g(!1));
488
+ },
489
+ []
490
+ ), L = T(async (b) => {
491
+ d(g(!0));
492
+ try {
493
+ await Ts({ ...b, key: i }), m(De), d(
494
+ P({
495
+ type: "success",
496
+ message: "Reset password sucessfully"
497
+ })
498
+ );
499
+ } catch (_) {
500
+ d(
501
+ P({
502
+ type: "danger",
503
+ message: _.response?.data?.title || _.message || "Error occured"
504
+ })
505
+ ), localStorage.removeItem(M), sessionStorage.removeItem(M);
506
+ }
507
+ d(g(!1));
508
+ }, []), E = T(async () => {
509
+ if (!C) {
510
+ console.log("execute recaptcha undefined");
511
+ return;
512
+ }
513
+ return await C("forgetPass");
514
+ }, [C]), K = T(() => {
515
+ }, []);
516
+ return Z(() => {
517
+ o && i && Y(o, i);
518
+ }, [o, i]), {
519
+ defaultInfo: oa,
520
+ forgotPasswordRequest: A,
521
+ checkResetTokenRequest: Y,
522
+ validLink: j,
523
+ resetPasswordRequest: L,
524
+ openLogin: u,
525
+ toggle: v,
526
+ isShowNewPassword: w,
527
+ setIsShowNewPassword: k,
528
+ isShowReTypePassword: x,
529
+ setIsShowReTypePassword: S,
530
+ clickHandler: E,
531
+ handleVerify: K,
532
+ initialValues: R
533
+ };
534
+ }, ia = {
535
+ email: "",
536
+ captcha: ""
537
+ }, la = V.object({
538
+ email: V.string().email("Email is invalid").required("Email is required")
539
+ }), ca = ({ school: s }) => {
540
+ const {
541
+ forgotPasswordRequest: o,
542
+ clickHandler: i,
543
+ handleVerify: d
544
+ } = as();
545
+ return /* @__PURE__ */ e(
546
+ ke,
547
+ {
548
+ initialValues: ia,
549
+ enableReinitialize: !0,
550
+ validationSchema: la,
551
+ onSubmit: async (m) => {
552
+ const u = await i();
553
+ u && (m.captcha = u, o(m));
554
+ },
555
+ children: (m) => {
556
+ const {
557
+ handleChange: u,
558
+ handleSubmit: p,
559
+ values: v,
560
+ touched: w,
561
+ errors: k
562
+ } = m;
563
+ return /* @__PURE__ */ e("div", { className: `${t["box-login"]}`, children: /* @__PURE__ */ e("div", { className: `${t["block-login"]}`, children: /* @__PURE__ */ r("div", { className: `${t["block-form"]}`, children: [
564
+ /* @__PURE__ */ r("div", { className: "d-flex align-items-center mb-4", children: [
565
+ /* @__PURE__ */ e(
566
+ "img",
567
+ {
568
+ src: s.schoolLogo,
569
+ className: `${t["school-icon"]} mr-3`
570
+ }
571
+ ),
572
+ /* @__PURE__ */ e(
573
+ "p",
574
+ {
575
+ className: `${t["school-name"]} mb-0`,
576
+ children: s.schoolName
577
+ }
578
+ )
579
+ ] }),
580
+ /* @__PURE__ */ e("p", { className: `${t["title-login"]} `, children: "Forgot password" }),
581
+ /* @__PURE__ */ e(
582
+ "p",
583
+ {
584
+ className: `${t["recover-account"]} mb-5`,
585
+ children: "Enter email to recover your account"
586
+ }
587
+ ),
588
+ /* @__PURE__ */ r("div", { className: "w-100", children: [
589
+ /* @__PURE__ */ e(
590
+ ie,
591
+ {
592
+ type: "text",
593
+ name: "email",
594
+ id: "email",
595
+ placeholder: "Input email",
596
+ onChange: u,
597
+ value: v.email
598
+ }
599
+ ),
600
+ w.email && k.email && /* @__PURE__ */ e(oe, { text: k.email })
601
+ ] }),
602
+ /* @__PURE__ */ e(
603
+ Ze,
604
+ {
605
+ to: "/login",
606
+ className: `${t["link-to-login"]} mt-2`,
607
+ children: "Return to login"
608
+ }
609
+ ),
610
+ /* @__PURE__ */ e(
611
+ Hs,
612
+ {
613
+ action: "forgetPass",
614
+ onVerify: d
615
+ }
616
+ ),
617
+ /* @__PURE__ */ e(ee, { className: "p-0", children: /* @__PURE__ */ e(
618
+ "button",
619
+ {
620
+ className: `${t["btn-login"]} mt-5`,
621
+ onClick: () => p(),
622
+ children: "Continue"
623
+ }
624
+ ) })
625
+ ] }) }) });
626
+ }
627
+ }
628
+ );
629
+ }, da = V.object({
630
+ password: V.string().required("New password is required"),
631
+ reEnterPassword: V.string().required("Please re-enter new password").test("matching", "Passwords do not match", function() {
632
+ return this.parent.password === this.parent.reEnterPassword;
633
+ })
634
+ }), ma = () => {
635
+ const {
636
+ validLink: s,
637
+ resetPasswordRequest: o,
638
+ isShowNewPassword: i,
639
+ setIsShowNewPassword: d,
640
+ isShowReTypePassword: m,
641
+ setIsShowReTypePassword: u,
642
+ initialValues: p
643
+ } = as();
644
+ return /* @__PURE__ */ e(
645
+ ke,
646
+ {
647
+ initialValues: p,
648
+ enableReinitialize: !0,
649
+ validationSchema: da,
650
+ onSubmit: (v) => {
651
+ o(v);
652
+ },
653
+ children: (v) => {
654
+ const { setFieldValue: w, handleSubmit: k, touched: x, errors: S, values: R } = v;
655
+ return /* @__PURE__ */ e(be, { className: `${t["box-login"]}`, children: /* @__PURE__ */ e(ee, { className: "p-0", children: /* @__PURE__ */ e("div", { className: `${t["block-login"]}`, children: /* @__PURE__ */ r("div", { className: `${t["block-form"]}`, children: [
656
+ /* @__PURE__ */ e(
657
+ "img",
658
+ {
659
+ src: `${ge(
660
+ "/images/horizontal-logo-blue.svg"
661
+ )}`,
662
+ className: `${t["img-login-rectangle"]}`
663
+ }
664
+ ),
665
+ /* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "Reset Password" }),
666
+ /* @__PURE__ */ e("div", { className: "w-100", children: s ? /* @__PURE__ */ r(ve, { children: [
667
+ /* @__PURE__ */ e(
668
+ me,
669
+ {
670
+ className: `${t["form-user-name"]}`,
671
+ children: /* @__PURE__ */ e(
672
+ ie,
673
+ {
674
+ disabled: !0,
675
+ type: "text",
676
+ name: "email",
677
+ placeholder: "Email",
678
+ value: R.email,
679
+ autocomplete: "email",
680
+ required: !0,
681
+ className: `${t.input}`
682
+ }
683
+ )
684
+ }
685
+ ),
686
+ /* @__PURE__ */ r(
687
+ "div",
688
+ {
689
+ className: `${t["form-user-name"]}`,
690
+ children: [
691
+ /* @__PURE__ */ e(
692
+ he,
693
+ {
694
+ isShowPassword: i,
695
+ togglePasswordVisible: () => d(
696
+ !i
697
+ ),
698
+ onChange: (I) => w(
699
+ "password",
700
+ I.target.value
701
+ )
702
+ }
703
+ ),
704
+ x.password && S.password && /* @__PURE__ */ e(
705
+ oe,
706
+ {
707
+ text: S.password
708
+ }
709
+ )
710
+ ]
711
+ }
712
+ ),
713
+ /* @__PURE__ */ r(
714
+ "div",
715
+ {
716
+ className: `${t["form-user-name"]}`,
717
+ children: [
718
+ /* @__PURE__ */ e(
719
+ he,
720
+ {
721
+ placeholder: "Confirm Password",
722
+ isShowPassword: m,
723
+ togglePasswordVisible: () => u(
724
+ !m
725
+ ),
726
+ onChange: (I) => w(
727
+ "reEnterPassword",
728
+ I.target.value
729
+ )
730
+ }
731
+ ),
732
+ x.reEnterPassword && S.reEnterPassword && /* @__PURE__ */ e(
733
+ oe,
734
+ {
735
+ text: S.reEnterPassword
736
+ }
737
+ )
738
+ ]
739
+ }
740
+ )
741
+ ] }) : /* @__PURE__ */ r(ve, { children: [
742
+ /* @__PURE__ */ e(
743
+ "p",
744
+ {
745
+ className: `${t["recover-account"]} mb-5`,
746
+ children: "Invalid reset password link"
747
+ }
748
+ ),
749
+ /* @__PURE__ */ e("p", { className: "w-100", children: "It may have been accessed before or expired or you have just tried to reset another account's password" })
750
+ ] }) }),
751
+ s && /* @__PURE__ */ e(ee, { className: "p-0", children: /* @__PURE__ */ e(
752
+ "button",
753
+ {
754
+ className: `${t["btn-login"]} ${t["btn-rounder"]} mt-4`,
755
+ onClick: () => k(),
756
+ children: "SET A NEW PASSWORD"
757
+ }
758
+ ) })
759
+ ] }) }) }) });
760
+ }
761
+ }
762
+ );
763
+ }, ts = `${ks}/api/school`, ga = () => es.get(`${ts}/settings`), ha = () => es.get(`${ts}/info`), ua = {
764
+ auth: {
765
+ clientId: ye ? "a27f8ac9-e039-4bbd-a9e1-3096e52a77bb" : "90c6897c-f17b-475e-a7a8-9a19651e0060",
766
+ authority: "https://login.microsoftonline.com/common",
767
+ redirectUri: "https://sso.marioforme.com/microsoft-login.html"
768
+ },
769
+ cache: {
770
+ cacheLocation: "sessionStorage",
771
+ // This configures where your cache will be stored
772
+ storeAuthStateInCookie: !1
773
+ // Set this to "true" if you are having issues on IE11 or Edge
774
+ },
775
+ system: {
776
+ loggerOptions: {
777
+ loggerCallback: (s, o, i) => {
778
+ if (!i)
779
+ switch (s) {
780
+ case Se.Error:
781
+ console.error(o);
782
+ return;
783
+ case Se.Info:
784
+ console.info(o);
785
+ return;
786
+ case Se.Verbose:
787
+ console.debug(o);
788
+ return;
789
+ case Se.Warning:
790
+ console.warn(o);
791
+ return;
792
+ default:
793
+ return;
794
+ }
795
+ }
796
+ }
797
+ }
798
+ }, pa = {
799
+ email: "",
800
+ password: "",
801
+ captcha: "",
802
+ rememberMe: !1,
803
+ isSessionUserBrowser: !!sessionStorage.getItem(Pe)
804
+ }, fa = "/home", qe = "/home", wa = "/admin/home", Sa = "/parent", ya = "/admin/schools", Na = "/list-student", va = "Log in", Ia = () => {
805
+ const s = Te(), o = xe(), [i, d] = N(!1), m = Ee(
806
+ (a) => a.common.isLoginGoogle
807
+ ), [u, p] = N(""), [v, w] = N(""), [k, x] = N(""), [S, R] = N(!1), I = Ee((a) => a.common.inforUserGoogle), j = Ee((a) => a.common.environment), G = new URLSearchParams(location.search), C = G.get("type") === "classlink", A = G.get("token"), Y = G.get("isAdminUser"), [
808
+ L
809
+ /*, setOpenModelAssign*/
810
+ ] = N(!1), [E, K] = N({
811
+ schoolName: "",
812
+ schoolLogo: "",
813
+ schoolId: 0
814
+ }), [b, _] = N(null), O = T(() => {
815
+ d(!i);
816
+ }, [i]), [D, se] = N(!1), [le, ae] = N(!1), [Q, Ce] = N({
817
+ firstName: "",
818
+ lastName: "",
819
+ fullName: "",
820
+ imageUrl: "",
821
+ email: "",
822
+ accessToken: "",
823
+ googleId: ""
824
+ });
825
+ Z(() => {
826
+ document.title = va;
827
+ const a = Cs("auth-token");
828
+ if (a) {
829
+ const l = window.location.hostname;
830
+ if (localStorage.setItem(M, a), document.cookie = `auth-token=;domain=${l.includes("localhost") ? l : ".marioforme.com"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`, document.cookie = "redirect-uri=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/", Y)
831
+ return o("/admin/home");
832
+ Me(a);
833
+ return;
834
+ }
835
+ Ie() && o("/"), cs();
836
+ }, [Y, Me, o]);
837
+ const ue = () => {
838
+ localStorage.removeItem(M), sessionStorage.removeItem(M), localStorage.removeItem("USER_EMAIL");
839
+ };
840
+ Z(() => {
841
+ C && A != "" && rs();
842
+ }, []);
843
+ const H = () => {
844
+ ae(!le);
845
+ }, os = () => {
846
+ if (ye) {
847
+ const a = "https://clever.com/oauth/instant-login?client_id=44f4bbf55cd873d3f7e5&district_id=6620cba31f1ddde7bd689dc5";
848
+ window.location.href = a;
849
+ } else {
850
+ const a = `https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;
851
+ window.location.href = a;
852
+ }
853
+ }, rs = async () => {
854
+ s(g(!0));
855
+ try {
856
+ const n = await Ls({
857
+ tokenClassLink: A
858
+ }), { email: l, token: f } = n.data;
859
+ await te({
860
+ email: l,
861
+ rememberMe: !1,
862
+ password: "default",
863
+ accessToken: f
864
+ });
865
+ } catch (a) {
866
+ s(
867
+ P({
868
+ type: "danger",
869
+ message: a.response?.data?.title || a.message
870
+ })
871
+ );
872
+ }
873
+ s(g(!1));
874
+ }, _e = window.location.host.includes("-district"), ns = T(async () => {
875
+ s(g(!0));
876
+ try {
877
+ const a = await ha(), n = a.data.schoolLogo ?? "";
878
+ a.data && K({
879
+ schoolName: a.data.schoolName,
880
+ schoolLogo: n ? Es(n) : ge("/images/logo_header_blue.png"),
881
+ schoolId: a.data.schoolId
882
+ });
883
+ } catch (a) {
884
+ s(
885
+ P({
886
+ type: "danger",
887
+ message: a.response?.data?.title || a.message
888
+ })
889
+ );
890
+ }
891
+ s(g(!1));
892
+ }, []), [is, pe] = N(!1), [re, $e] = N(null), ce = T((a, n, l, f, c, q, B, W, J, $) => {
893
+ const z = $?.isSessionUserBrowser ?? !1;
894
+ z ? (sessionStorage.setItem(M, a), sessionStorage.setItem(
895
+ Pe,
896
+ String(z)
897
+ )) : (sessionStorage.removeItem(Pe), localStorage.setItem(M, a)), localStorage.removeItem(Ps), sessionStorage.removeItem("ACTIVE_ROLE"), s(
898
+ xs({
899
+ id: n,
900
+ firstName: l,
901
+ lastName: f,
902
+ roles: c,
903
+ email: q,
904
+ profileImageFileName: B
905
+ })
906
+ );
907
+ let y = localStorage.getItem("ROLES") || "";
908
+ if (!y) {
909
+ if (c.includes("Admin"))
910
+ y = "Admin";
911
+ else {
912
+ const U = ((n ? localStorage.getItem(`PREFERRED_ROLE_${n}`) : null) || "").split(",").map((we) => we.trim()).filter(Boolean);
913
+ U.length > 0 && U.every((we) => c.includes(we)) ? U.length > 1 ? y = U.every(
914
+ (ze) => ze === "Teacher" || ze === "Assistant"
915
+ ) ? "Teacher,Assistant" : U[0] : y = U[0] : c.includes("Teacher") ? y = c.includes("Assistant") ? "Teacher,Assistant" : "Teacher" : c.includes("Assistant") ? y = "Assistant" : c.includes("Counselor") ? y = "Counselor" : c.includes("SecondaryTeacher") ? y = "SecondaryTeacher" : c.includes("EduTeacher") ? y = "EduTeacher" : c.includes("Student") ? y = "Student" : c.includes("Parent") ? y = "Parent" : c.length > 0 && (y = c[0]);
916
+ }
917
+ y && (localStorage.setItem("ROLES", y), sessionStorage.setItem("ACTIVE_ROLE", y));
918
+ }
919
+ if ($?.email && !c.includes("Admin")) {
920
+ de.init(
921
+ ye ? _s : Rs,
922
+ $.email,
923
+ {
924
+ defaultTracking: !1
925
+ }
926
+ );
927
+ const X = window.location.hostname, U = new de.Identify();
928
+ U.set("domain", X), de.identify(U), de.track("general: session start", {
929
+ user_id: $.email,
930
+ domain: X,
931
+ roles: c?.toString()
932
+ }), localStorage.setItem("USER_EMAIL", $.email), W && de.track("general: first login", {
933
+ user_id: $.email,
934
+ domain: X,
935
+ roles: c?.toString()
936
+ });
937
+ }
938
+ const us = (String($?.preferredAppType || "").split(",").map((X) => X.trim().toUpperCase()).filter(Boolean)[0] || "") === "HS" ? "HS" : "MS";
939
+ $s() || localStorage.setItem("ACTIVE_TIER", us);
940
+ const ne = (X) => {
941
+ const U = Us(X, J);
942
+ window.location.pathname.startsWith("/es") ? J === "es" ? o(U) : window.location.href = U : J === "es" ? window.location.href = U : o(U);
943
+ }, F = y.split(",")[0] || "";
944
+ _e ? ne(ya) : c.includes("Admin") || F === "Admin" ? ne(wa) : F === "Teacher" || F === "Assistant" || F === "Counselor" || F === "SecondaryTeacher" || !F && (c.includes("Teacher") || c.includes("Assistant") || c.includes("Counselor") || c.includes("SecondaryTeacher")) ? ne(fa) : F === "Student" || !F && c.includes("Student") ? ne(qe) : F === "Parent" || !F && c.includes("Parent") ? ne(Sa) : (F === "EduTeacher" || !F && c.includes("EduTeacher")) && ne(Na), s(g(!1));
945
+ }, [s, o, _e]), fe = T((a, n, l) => S && a?.includes("Student") && (n === "es" || l === "ES") ? (s(
946
+ P({
947
+ type: "danger",
948
+ message: "Unable to sign in with SSO. Please contact your admin or teacher."
949
+ })
950
+ ), localStorage.removeItem(M), sessionStorage.removeItem(M), s(g(!1)), !0) : !1, [S, s]), Ae = T((a) => S && a && As.includes(a.trim()) ? (s(
951
+ P({
952
+ type: "danger",
953
+ message: "Unable to sign in with SSO. Please contact your admin or teacher."
954
+ })
955
+ ), s(g(!1)), !0) : !1, [S, s]);
956
+ async function Me(a) {
957
+ s(g(!0));
958
+ try {
959
+ const n = await Ms();
960
+ let {
961
+ id: l,
962
+ firstName: f,
963
+ lastName: c,
964
+ roles: q,
965
+ email: B,
966
+ profileImageFileName: W,
967
+ isLoginFirst: J,
968
+ schoolLevel: $,
969
+ appType: z,
970
+ preferredAppType: y,
971
+ needsAppTypeChoice: Be
972
+ } = n.data;
973
+ if (Be) {
974
+ $e({ email: B }), pe(!0), s(g(!1));
975
+ return;
976
+ }
977
+ $ || (z === "ES" || z === "ES, MS" && y === "ES") && ($ = "es"), ce(
978
+ a,
979
+ l,
980
+ f,
981
+ c,
982
+ q,
983
+ B,
984
+ W,
985
+ J,
986
+ $,
987
+ { email: B, ...n.data }
988
+ );
989
+ } catch (n) {
990
+ s(
991
+ P({
992
+ type: "danger",
993
+ message: n.response?.data?.title || n.message || "Login failed"
994
+ })
995
+ ), s(g(!1));
996
+ }
997
+ }
998
+ const ls = T(async (a) => {
999
+ if (pe(!1), !re) return;
1000
+ s(g(!0));
1001
+ const n = a === "es" ? "ES" : a === "ms" ? "MS" : "ES, MS";
1002
+ try {
1003
+ const l = await Fe({
1004
+ ...re,
1005
+ email: re?.email?.trim(),
1006
+ password: re?.password?.trim(),
1007
+ preferredAppType: n
1008
+ });
1009
+ let {
1010
+ token: f,
1011
+ id: c,
1012
+ firstName: q,
1013
+ lastName: B,
1014
+ roles: W,
1015
+ email: J,
1016
+ profileImageFileName: $,
1017
+ isLoginFirst: z,
1018
+ schoolLevel: y
1019
+ } = l.data;
1020
+ if (!y && a === "es" && (y = "es"), fe(W, y, l.data.appType)) return;
1021
+ ce(
1022
+ f,
1023
+ c,
1024
+ q,
1025
+ B,
1026
+ W,
1027
+ J,
1028
+ $,
1029
+ z,
1030
+ y,
1031
+ { ...re, ...l.data }
1032
+ );
1033
+ } catch (l) {
1034
+ s(
1035
+ P({
1036
+ type: "danger",
1037
+ message: l.response?.data?.title || l.message || "Login failed"
1038
+ })
1039
+ ), s(g(!1));
1040
+ }
1041
+ }, [re, ce, fe, s]), te = T(async (a) => {
1042
+ s(g(!0));
1043
+ try {
1044
+ const n = await Fe({
1045
+ ...a,
1046
+ email: a?.email?.trim(),
1047
+ password: a?.password?.trim()
1048
+ });
1049
+ let {
1050
+ token: l,
1051
+ id: f,
1052
+ firstName: c,
1053
+ lastName: q,
1054
+ roles: B,
1055
+ email: W,
1056
+ profileImageFileName: J,
1057
+ isLoginFirst: $,
1058
+ schoolLevel: z
1059
+ } = n.data;
1060
+ if (n.data.needsAppTypeChoice) {
1061
+ $e(a), pe(!0), s(g(!1));
1062
+ return;
1063
+ }
1064
+ if (z || (n.data.appType === "ES" || n.data.appType === "ES, MS" && n.data.preferredAppType === "ES") && (z = "es"), fe(B, z, n.data.appType)) return;
1065
+ ce(
1066
+ l,
1067
+ f,
1068
+ c,
1069
+ q,
1070
+ B,
1071
+ W,
1072
+ J,
1073
+ $,
1074
+ z,
1075
+ { ...a, ...n.data }
1076
+ );
1077
+ } catch (n) {
1078
+ s(
1079
+ P({
1080
+ type: "danger",
1081
+ message: n.response?.data?.title || n.message || "Login failed"
1082
+ })
1083
+ ), localStorage.removeItem(M), sessionStorage.removeItem(M), s(g(!1));
1084
+ }
1085
+ }, [ce, fe, s]), cs = async () => {
1086
+ try {
1087
+ const a = await Gs();
1088
+ p(a.data.googleClientId), w(a.data.googleCaptchaId), x(a.data.extensionEmail), R(a.data.isRestrictedLogin);
1089
+ } catch (a) {
1090
+ s(
1091
+ P({
1092
+ type: "danger",
1093
+ message: a.response?.data?.title || a.message || "Login failed"
1094
+ })
1095
+ );
1096
+ }
1097
+ }, Ge = T(
1098
+ async (a, n, l, f) => {
1099
+ s(g(!0));
1100
+ try {
1101
+ if ((await Os(a, n)).data) {
1102
+ const B = {
1103
+ email: n.email,
1104
+ isLoginGoogle: !0,
1105
+ rememberMe: !1,
1106
+ password: "default",
1107
+ accessToken: l,
1108
+ captcha: "",
1109
+ loginType: Ne.Google
1110
+ };
1111
+ if (f != null) {
1112
+ const W = await f();
1113
+ B.captcha = W;
1114
+ }
1115
+ await te(B), s(Le(!1));
1116
+ } else
1117
+ Ce({ ...n, token: l }), H();
1118
+ } catch (c) {
1119
+ s(
1120
+ P({
1121
+ type: "danger",
1122
+ message: c.response?.data?.title || c.message || "Login failed"
1123
+ })
1124
+ );
1125
+ }
1126
+ s(g(!1));
1127
+ },
1128
+ [te, s, H]
1129
+ ), ds = T(async (a, n) => {
1130
+ s(g(!0));
1131
+ try {
1132
+ if (Ae(a)) return;
1133
+ if ((await Ve({ ...Q, gradeLevel: a }))?.data) {
1134
+ const f = {
1135
+ email: Q.email,
1136
+ isLoginGoogle: !0,
1137
+ rememberMe: !1,
1138
+ password: "default",
1139
+ accessToken: Q.accessToken,
1140
+ captcha: "",
1141
+ loginType: Ne.Google
1142
+ };
1143
+ if (n != null) {
1144
+ const c = await n();
1145
+ f.captcha = c;
1146
+ }
1147
+ await te(f), H();
1148
+ }
1149
+ } catch (l) {
1150
+ s(
1151
+ P({
1152
+ type: "danger",
1153
+ message: l.response?.data?.title || l.message || "Login failed"
1154
+ })
1155
+ );
1156
+ }
1157
+ s(g(!1));
1158
+ }, [Ae, Q, te, H, s]), ms = async (a, n) => {
1159
+ s(g(!0));
1160
+ try {
1161
+ const l = {
1162
+ firstName: I.firstName,
1163
+ lastName: I.lastName,
1164
+ imageUrl: I.imageUrl,
1165
+ fullName: I.fullName,
1166
+ email: I.email,
1167
+ accessToken: I.accessToken,
1168
+ teacherId: a
1169
+ };
1170
+ if ((await Ve(l)).data) {
1171
+ const c = await n(), q = {
1172
+ email: I.email,
1173
+ captcha: c,
1174
+ isLoginGoogle: !0,
1175
+ rememberMe: !1,
1176
+ password: "default",
1177
+ accessToken: I.accessToken,
1178
+ loginType: Ne.Google
1179
+ };
1180
+ s(Le(!1)), await te(q), o(qe);
1181
+ }
1182
+ } catch (l) {
1183
+ s(
1184
+ P({
1185
+ type: "danger",
1186
+ message: l.response?.data?.title || l.message || "Login failed"
1187
+ })
1188
+ );
1189
+ }
1190
+ s(Le(!1)), s(g(!1));
1191
+ }, gs = async () => {
1192
+ try {
1193
+ const a = await ga();
1194
+ s(Bs(a.data.isSandboxMode)), zs(!!a.data.isCombineMsHs);
1195
+ } catch (a) {
1196
+ console.error(a);
1197
+ }
1198
+ }, Oe = async (a) => {
1199
+ b.handleRedirectPromise().then(async (n) => {
1200
+ if (E?.schoolId)
1201
+ if (n) {
1202
+ let l = n.account;
1203
+ await Ue(l, a);
1204
+ } else {
1205
+ const l = b.getAllAccounts();
1206
+ if (l.length === 0) {
1207
+ const f = j === "PreProduction" ? "https://mario1.marioforme.com" : ye ? "https://brightsoft.marioforme.com" : "https://sso.marioforme.com";
1208
+ window.location.href = (window.location.hostname === "localhost" ? window.location.origin : f) + `/microsoft-login.html?redirect-uri=${window.location.origin}&schoolId=${E.schoolId}`;
1209
+ } else {
1210
+ let f = l[0];
1211
+ await Ue(f, a);
1212
+ }
1213
+ }
1214
+ }).catch((n) => {
1215
+ console.error(n);
1216
+ });
1217
+ }, Ue = async (a, n) => {
1218
+ let l = a.name, f = {
1219
+ firstName: l.split(" ").slice(0, -1).join(" "),
1220
+ lastName: l.split(" ").slice(-1).join(" "),
1221
+ fullName: l,
1222
+ imageUrl: "",
1223
+ email: a.username,
1224
+ accessToken: a.idTokenClaims.aio,
1225
+ googleId: a.tenantId
1226
+ };
1227
+ s(Xe(f)), await Ge(
1228
+ ss.MicrosoftSSO,
1229
+ f,
1230
+ a.idTokenClaims.aio,
1231
+ n
1232
+ );
1233
+ }, hs = async () => {
1234
+ const a = new js(ua);
1235
+ await a.initialize(), _(a);
1236
+ };
1237
+ return Z(() => {
1238
+ let a = window.location.href;
1239
+ b && a.includes("code") && a.includes("client_info") && Oe();
1240
+ }, [JSON.stringify(b)]), Z(() => {
1241
+ gs(), hs(), ns();
1242
+ }, []), {
1243
+ defaultInfo: pa,
1244
+ userLogin: te,
1245
+ openLogin: i,
1246
+ toggle: O,
1247
+ isShowPassword: D,
1248
+ setIsShowPassword: se,
1249
+ fnIsCheckLogin: Ge,
1250
+ isLoginGoogle: m,
1251
+ infoUser: I,
1252
+ submitLogin: ms,
1253
+ googleClientId: u,
1254
+ googleRecaptchaId: v,
1255
+ handleCancelModelAssign: ue,
1256
+ openModelAssign: L,
1257
+ // handleAssignTeacherByCode,
1258
+ fnLoginSSO: Oe,
1259
+ school: E,
1260
+ extensionEmail: k,
1261
+ handleLoginWidthClever: os,
1262
+ openModalSelectGrade: le,
1263
+ handleRegisterUser: ds,
1264
+ handleToggleModelGrade: H,
1265
+ openModalSelectTier: is,
1266
+ handleSelectTier: ls,
1267
+ setOpenModalSelectTier: pe
1268
+ };
1269
+ }, We = "/", ba = "/login", je = "Log in", Ta = () => {
1270
+ const s = Te(), o = xe(), i = location.search, m = new URLSearchParams(i).get("userId"), [u, p] = N(!1), [v, w] = N(
1271
+ !1
1272
+ ), [k, x] = N({
1273
+ password: "",
1274
+ reEnterPassword: "",
1275
+ email: "",
1276
+ userId: m ?? "",
1277
+ token: ""
1278
+ }), { executeRecaptcha: S } = Re(), R = T(async (C) => {
1279
+ s(g(!0));
1280
+ try {
1281
+ const A = await Fs(C);
1282
+ x({ ...k, email: A.data });
1283
+ } catch (A) {
1284
+ s(
1285
+ P({
1286
+ type: "danger",
1287
+ message: A.message
1288
+ })
1289
+ );
1290
+ }
1291
+ s(g(!1));
1292
+ }, []), I = T(async (C) => {
1293
+ s(g(!0));
1294
+ try {
1295
+ await Vs(C), o(ba), s(
1296
+ P({
1297
+ type: "success",
1298
+ message: "Create password sucessfully"
1299
+ })
1300
+ );
1301
+ } catch (A) {
1302
+ s(
1303
+ P({
1304
+ type: "danger",
1305
+ message: A.response?.data?.title || A.message || "Error occured"
1306
+ })
1307
+ ), localStorage.removeItem(M), sessionStorage.removeItem(M);
1308
+ }
1309
+ s(g(!1));
1310
+ }, []), j = T(async () => {
1311
+ if (!S) {
1312
+ console.log("execute recaptcha undefined");
1313
+ return;
1314
+ }
1315
+ return await S("forgetPass");
1316
+ }, [S]), G = T(() => {
1317
+ }, []);
1318
+ return Z(() => {
1319
+ document.title = je, Ie() && o(We), m && R(m);
1320
+ }, [m]), Z(() => {
1321
+ document.title = je, Ie() && o(We);
1322
+ }, []), {
1323
+ createPasswordRequest: I,
1324
+ isShowNewPassword: u,
1325
+ setIsShowNewPassword: p,
1326
+ isShowReTypePassword: v,
1327
+ setIsShowReTypePassword: w,
1328
+ clickHandler: j,
1329
+ handleVerify: G,
1330
+ initialValues: k
1331
+ };
1332
+ }, ka = V.object({
1333
+ password: V.string().required("Password is required"),
1334
+ reEnterPassword: V.string().required("Please re-enter Password").test("matching", "Passwords do not match", function() {
1335
+ return this.parent.password === this.parent.reEnterPassword;
1336
+ })
1337
+ }), Ca = () => {
1338
+ const {
1339
+ createPasswordRequest: s,
1340
+ isShowNewPassword: o,
1341
+ setIsShowNewPassword: i,
1342
+ isShowReTypePassword: d,
1343
+ setIsShowReTypePassword: m,
1344
+ initialValues: u
1345
+ } = Ta();
1346
+ return /* @__PURE__ */ e(
1347
+ ke,
1348
+ {
1349
+ initialValues: u,
1350
+ enableReinitialize: !0,
1351
+ validationSchema: ka,
1352
+ onSubmit: (p) => {
1353
+ s(p);
1354
+ },
1355
+ children: (p) => {
1356
+ const {
1357
+ setFieldValue: v,
1358
+ handleSubmit: w,
1359
+ touched: k,
1360
+ errors: x,
1361
+ values: S
1362
+ } = p;
1363
+ return /* @__PURE__ */ e(be, { className: `${t["box-login"]}`, children: /* @__PURE__ */ r(ee, { className: "p-0", children: [
1364
+ /* @__PURE__ */ e(
1365
+ "div",
1366
+ {
1367
+ hidden: !S.email,
1368
+ className: `${t["block-login"]}`,
1369
+ children: /* @__PURE__ */ r("div", { className: `${t["block-form"]}`, children: [
1370
+ /* @__PURE__ */ e(
1371
+ "img",
1372
+ {
1373
+ src: `${ge(
1374
+ "/images/horizontal-logo-blue.svg"
1375
+ )}`,
1376
+ className: `${t["img-login-rectangle"]}`
1377
+ }
1378
+ ),
1379
+ /* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "Create Your Password" }),
1380
+ /* @__PURE__ */ e("div", { className: "w-100", children: /* @__PURE__ */ r(ve, { children: [
1381
+ /* @__PURE__ */ e(
1382
+ me,
1383
+ {
1384
+ className: `${t["form-user-name"]}`,
1385
+ children: /* @__PURE__ */ e(
1386
+ ie,
1387
+ {
1388
+ disabled: !0,
1389
+ type: "text",
1390
+ name: "email",
1391
+ placeholder: "Email",
1392
+ value: S.email,
1393
+ autocomplete: "email",
1394
+ required: !0,
1395
+ className: `${t.input}`
1396
+ }
1397
+ )
1398
+ }
1399
+ ),
1400
+ /* @__PURE__ */ r(
1401
+ "div",
1402
+ {
1403
+ className: `${t["form-user-name"]}`,
1404
+ children: [
1405
+ /* @__PURE__ */ e(
1406
+ he,
1407
+ {
1408
+ isShowPassword: o,
1409
+ togglePasswordVisible: () => i(
1410
+ !o
1411
+ ),
1412
+ onChange: (R) => v(
1413
+ "password",
1414
+ R.target.value
1415
+ )
1416
+ }
1417
+ ),
1418
+ k.password && x.password && /* @__PURE__ */ e(
1419
+ oe,
1420
+ {
1421
+ text: x.password
1422
+ }
1423
+ )
1424
+ ]
1425
+ }
1426
+ ),
1427
+ /* @__PURE__ */ r(
1428
+ "div",
1429
+ {
1430
+ className: `${t["form-user-name"]}`,
1431
+ children: [
1432
+ /* @__PURE__ */ e(
1433
+ he,
1434
+ {
1435
+ placeholder: "Confirm Password",
1436
+ isShowPassword: d,
1437
+ togglePasswordVisible: () => m(
1438
+ !d
1439
+ ),
1440
+ onChange: (R) => v(
1441
+ "reEnterPassword",
1442
+ R.target.value
1443
+ )
1444
+ }
1445
+ ),
1446
+ k.reEnterPassword && x.reEnterPassword && /* @__PURE__ */ e(
1447
+ oe,
1448
+ {
1449
+ text: x.reEnterPassword
1450
+ }
1451
+ )
1452
+ ]
1453
+ }
1454
+ )
1455
+ ] }) }),
1456
+ /* @__PURE__ */ e(
1457
+ "button",
1458
+ {
1459
+ className: `${t["btn-login"]} ${t["btn-rounder"]} mt-4`,
1460
+ onClick: () => w(),
1461
+ children: "CREATE YOUR PASSWORD"
1462
+ }
1463
+ )
1464
+ ] })
1465
+ }
1466
+ ),
1467
+ /* @__PURE__ */ e(
1468
+ "div",
1469
+ {
1470
+ hidden: !!S.email,
1471
+ className: `${t["block-login"]}`,
1472
+ children: /* @__PURE__ */ r("div", { className: `${t["block-form"]}`, children: [
1473
+ /* @__PURE__ */ e(
1474
+ "img",
1475
+ {
1476
+ src: `${ge(
1477
+ "/images/horizontal-logo-blue.svg"
1478
+ )}`,
1479
+ className: `${t["img-login-rectangle"]}`
1480
+ }
1481
+ ),
1482
+ /* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "You cannot regenerate the password" })
1483
+ ] })
1484
+ }
1485
+ )
1486
+ ] }) });
1487
+ }
1488
+ }
1489
+ );
1490
+ }, La = "_modalContent_1pxxz_1", Ea = "_closeButton_1pxxz_6", Pa = "_modalBody_1pxxz_17", xa = "_iconWrapper_1pxxz_22", Ra = "_title_1pxxz_38", _a = "_subtitle_1pxxz_45", $a = "_tierCard_1pxxz_51", Aa = "_es_1pxxz_60", Ma = "_tierTitle_1pxxz_71", Ga = "_tierDesc_1pxxz_76", Oa = "_arrow_1pxxz_81", Ua = "_ms_1pxxz_85", Ba = "_both_1pxxz_110", za = "_cardLeft_1pxxz_134", Fa = "_cardText_1pxxz_138", h = {
1491
+ modalContent: La,
1492
+ closeButton: Ea,
1493
+ modalBody: Pa,
1494
+ iconWrapper: xa,
1495
+ title: Ra,
1496
+ subtitle: _a,
1497
+ tierCard: $a,
1498
+ es: Aa,
1499
+ tierTitle: Ma,
1500
+ tierDesc: Ga,
1501
+ arrow: Oa,
1502
+ ms: Ua,
1503
+ both: Ba,
1504
+ cardLeft: za,
1505
+ cardText: Fa
1506
+ }, Va = ({ open: s, onSelectTier: o, onClose: i }) => /* @__PURE__ */ r(
1507
+ Ke,
1508
+ {
1509
+ isOpen: s,
1510
+ style: { zIndex: 1201, maxWidth: 450 },
1511
+ centered: !0,
1512
+ autoFocus: !1,
1513
+ returnFocusAfterClose: !1,
1514
+ contentClassName: h.modalContent,
1515
+ children: [
1516
+ /* @__PURE__ */ e("div", { className: h.closeButton, children: i && /* @__PURE__ */ e(Qe, { onClick: () => i(), size: 24 }) }),
1517
+ /* @__PURE__ */ r(Je, { className: h.modalBody, children: [
1518
+ /* @__PURE__ */ e("div", { className: h.iconWrapper, children: /* @__PURE__ */ e("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }) }),
1519
+ /* @__PURE__ */ e("h4", { className: h.title, children: "Select Grade Level" }),
1520
+ /* @__PURE__ */ e("p", { className: h.subtitle, children: "Select the grade levels you support" }),
1521
+ /* @__PURE__ */ r(
1522
+ "div",
1523
+ {
1524
+ onClick: () => o("es"),
1525
+ className: `${h.tierCard} ${h.es}`,
1526
+ children: [
1527
+ /* @__PURE__ */ r("div", { className: h.cardLeft, children: [
1528
+ /* @__PURE__ */ e("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" }) }),
1529
+ /* @__PURE__ */ r("div", { className: h.cardText, children: [
1530
+ /* @__PURE__ */ e("div", { className: h.tierTitle, children: "Elementary / Primary" }),
1531
+ /* @__PURE__ */ e("div", { className: h.tierDesc, children: "Grades 2-5 / Years 3-6" })
1532
+ ] })
1533
+ ] }),
1534
+ /* @__PURE__ */ e("div", { className: h.arrow, children: ">" })
1535
+ ]
1536
+ }
1537
+ ),
1538
+ /* @__PURE__ */ r(
1539
+ "div",
1540
+ {
1541
+ onClick: () => o("ms"),
1542
+ className: `${h.tierCard} ${h.ms}`,
1543
+ children: [
1544
+ /* @__PURE__ */ r("div", { className: h.cardLeft, children: [
1545
+ /* @__PURE__ */ e("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" }) }),
1546
+ /* @__PURE__ */ r("div", { className: h.cardText, children: [
1547
+ /* @__PURE__ */ e("div", { className: h.tierTitle, children: "Middle & High / Secondary" }),
1548
+ /* @__PURE__ */ e("div", { className: h.tierDesc, children: "Grades 6-12 / Years 7-13" })
1549
+ ] })
1550
+ ] }),
1551
+ /* @__PURE__ */ e("div", { className: h.arrow, children: ">" })
1552
+ ]
1553
+ }
1554
+ ),
1555
+ /* @__PURE__ */ r(
1556
+ "div",
1557
+ {
1558
+ onClick: () => o("both"),
1559
+ className: `${h.tierCard} ${h.both}`,
1560
+ children: [
1561
+ /* @__PURE__ */ r("div", { className: h.cardLeft, children: [
1562
+ /* @__PURE__ */ e("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z" }) }),
1563
+ /* @__PURE__ */ r("div", { className: h.cardText, children: [
1564
+ /* @__PURE__ */ e("div", { className: h.tierTitle, children: "Both Tiers" }),
1565
+ /* @__PURE__ */ e("div", { className: h.tierDesc, children: "Access all grade levels" })
1566
+ ] })
1567
+ ] }),
1568
+ /* @__PURE__ */ e("div", { className: h.arrow, children: ">" })
1569
+ ]
1570
+ }
1571
+ )
1572
+ ] })
1573
+ ]
1574
+ }
1575
+ ), Ha = Ye(Va), Da = "Log in", qa = "Forgot password", Wa = "Reset password", nt = (s) => {
1576
+ const {
1577
+ isLogin: o,
1578
+ isForgotPassword: i,
1579
+ isResetPassword: d,
1580
+ isCreatePassword: m
1581
+ // isLoginTwoFactor
1582
+ } = s, {
1583
+ defaultInfo: u,
1584
+ userLogin: p,
1585
+ googleRecaptchaId: v,
1586
+ handleCancelModelAssign: w,
1587
+ school: k,
1588
+ openModelAssign: x,
1589
+ setIsShowPassword: S,
1590
+ fnIsCheckLogin: R,
1591
+ isLoginGoogle: I,
1592
+ submitLogin: j,
1593
+ infoUser: G,
1594
+ googleClientId: C,
1595
+ isShowPassword: A,
1596
+ fnLoginSSO: Y,
1597
+ extensionEmail: L,
1598
+ handleLoginWidthClever: E,
1599
+ openModalSelectGrade: K,
1600
+ handleRegisterUser: b,
1601
+ handleToggleModelGrade: _,
1602
+ openModalSelectTier: O,
1603
+ handleSelectTier: D,
1604
+ setOpenModalSelectTier: se
1605
+ } = Ia();
1606
+ return Z(() => {
1607
+ o && (document.title = Da), i && (document.title = qa), d && (document.title = Wa);
1608
+ }, [o, i, d]), /* @__PURE__ */ r("div", { className: `${t.login} container-fluid font-family-lato`, children: [
1609
+ /* @__PURE__ */ r(be, { className: "h-100", children: [
1610
+ /* @__PURE__ */ r(
1611
+ ee,
1612
+ {
1613
+ lg: 8,
1614
+ md: 12,
1615
+ xs: 12,
1616
+ className: "d-flex justify-content-center h-100 align-items-center p-3 flex-column",
1617
+ children: [
1618
+ !!v && /* @__PURE__ */ r(
1619
+ Ds,
1620
+ {
1621
+ useRecaptchaNet: !0,
1622
+ reCaptchaKey: v,
1623
+ scriptProps: {
1624
+ async: !0,
1625
+ defer: !0,
1626
+ appendTo: "body"
1627
+ },
1628
+ children: [
1629
+ o && /* @__PURE__ */ e(
1630
+ ta,
1631
+ {
1632
+ userLogin: p,
1633
+ defaultInfo: u,
1634
+ onCancelModelAssign: w,
1635
+ openModelAssign: x,
1636
+ school: k,
1637
+ fnIsCheckLogin: R,
1638
+ googleClientId: C,
1639
+ infoUser: G,
1640
+ isLoginGoogle: I,
1641
+ isShowPassword: A,
1642
+ setIsShowPassword: S,
1643
+ submitLogin: j,
1644
+ fnLoginSSO: Y,
1645
+ extensionEmail: L,
1646
+ onLoginWidthClever: E,
1647
+ openModalSelectGrade: K,
1648
+ handleRegisterUser: b,
1649
+ onToggleModelGrade: _
1650
+ }
1651
+ ),
1652
+ i && /* @__PURE__ */ e(ca, { school: k })
1653
+ ]
1654
+ }
1655
+ ),
1656
+ d && /* @__PURE__ */ e(ma, {}),
1657
+ m && /* @__PURE__ */ e(Ca, {}),
1658
+ /* @__PURE__ */ e(
1659
+ "a",
1660
+ {
1661
+ href: "/privacy-policy/",
1662
+ target: "blank",
1663
+ className: `${t["privacy-policy"]}`,
1664
+ children: "Privacy Policy"
1665
+ }
1666
+ )
1667
+ ]
1668
+ }
1669
+ ),
1670
+ /* @__PURE__ */ e(
1671
+ ee,
1672
+ {
1673
+ className: "p-3 mh-100 d-flex justify-content-end",
1674
+ lg: 4,
1675
+ md: 12,
1676
+ xs: 12,
1677
+ children: /* @__PURE__ */ e(
1678
+ "img",
1679
+ {
1680
+ src: `${ge(window.innerWidth > 992 ? "/images/img-login.png" : "/images/img-login-tablet.png")}`,
1681
+ className: `${t["img-login"]}`
1682
+ }
1683
+ )
1684
+ }
1685
+ )
1686
+ ] }),
1687
+ /* @__PURE__ */ e(
1688
+ Ha,
1689
+ {
1690
+ open: O,
1691
+ onSelectTier: D,
1692
+ onClose: () => se(!1)
1693
+ }
1694
+ )
1695
+ ] });
1696
+ };
1697
+ export {
1698
+ nt as default
1699
+ };