mario-core 3.0.8-admin → 3.0.8-es
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.
- package/dist/Dashboard-DiUm-pc-.js +186 -0
- package/dist/Dashboard-HV1eiElu.cjs +1 -0
- package/dist/EmailTemplateDetail-D0D3bpWO.cjs +1 -0
- package/dist/EmailTemplateDetail-KvZuTCLF.js +411 -0
- package/dist/EmailTemplateList-B3YqSFaY.js +172 -0
- package/dist/EmailTemplateList-BAejgUUG.cjs +1 -0
- package/dist/FaqList-D5XugT5h.js +320 -0
- package/dist/FaqList-DpUzQ2vq.cjs +1 -0
- package/dist/GalleryList-B5QA3Rol.cjs +1 -0
- package/dist/GalleryList-CTo33BcT.js +53 -0
- package/dist/Login-CHAmP5ek.js +897 -0
- package/dist/Login-Cxbto5eM.cjs +1 -0
- package/dist/NotificationList-2Mf_NsOP.js +3631 -0
- package/dist/NotificationList-D1jMOBwH.cjs +8 -0
- package/dist/SchoolList-CClJ_UPT.cjs +1 -0
- package/dist/SchoolList-JmrmL2zE.js +5 -0
- package/dist/SkillList-BMyhRY78.js +406 -0
- package/dist/SkillList-DlMx_Evw.cjs +1 -0
- package/dist/TeacherSelector-B4zvSVhk.js +71 -0
- package/dist/TeacherSelector-DORi8RIb.cjs +1 -0
- package/dist/TheContent-BHmlooLu.cjs +1 -0
- package/dist/TheContent-V2T-Pqz8.js +38 -0
- package/dist/UserContainer-B-4oVOEp.cjs +1 -0
- package/dist/UserContainer-BaHMryYI.js +2337 -0
- package/dist/UserDetail-B-Mq_itT.cjs +1 -0
- package/dist/UserDetail-BBRiU97G.js +665 -0
- package/dist/assets/Images.d.ts +14 -14
- package/dist/components/Alerts/CommonAlert.d.ts +3 -3
- package/dist/components/Alerts/EmptyDataAlert.d.ts +8 -8
- package/dist/components/Alerts/ErrorHandler.d.ts +6 -6
- package/dist/components/Buttons/AddButton.d.ts +8 -7
- package/dist/components/Buttons/AddButtonIcon.d.ts +6 -6
- package/dist/components/Buttons/CloseButton.d.ts +8 -8
- package/dist/components/Buttons/DeleteButtonIcon.d.ts +6 -6
- package/dist/components/Buttons/DetailActionButtons.d.ts +9 -8
- package/dist/components/Buttons/EditButtonIcon.d.ts +6 -6
- package/dist/components/Buttons/LinkEditButton.d.ts +8 -7
- package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
- package/dist/components/Buttons/ToggleButton.d.ts +10 -10
- package/dist/components/Buttons/UploadFileButton.d.ts +13 -13
- package/dist/components/Headers/CommonHeader.d.ts +7 -7
- package/dist/components/Image/UploadImage.d.ts +2 -3
- package/dist/components/Inputs/FileInput.d.ts +8 -8
- package/dist/components/Inputs/PasswordInput.d.ts +8 -8
- package/dist/components/Inputs/SearchBox.d.ts +10 -10
- package/dist/components/Inputs/SearchBoxContainer.d.ts +9 -10
- package/dist/components/Labels/RequiredLabel.d.ts +6 -6
- package/dist/components/Loading/Loading.d.ts +3 -3
- package/dist/components/Modals/CommonModal.d.ts +2 -3
- package/dist/components/Modals/NotificationLogoutModal.d.ts +2 -0
- package/dist/components/Modals/NotificationModal.d.ts +2 -3
- package/dist/components/Others/QuitPrompt.d.ts +5 -2
- package/dist/components/Pagination/CustomPagination.d.ts +2 -3
- package/dist/components/Scroll/ScrollToTop.d.ts +3 -3
- package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
- package/dist/components/Selectors/CreatableSelector.d.ts +2 -3
- package/dist/components/Selectors/CustomSelector.d.ts +2 -3
- package/dist/components/Selectors/MailCategorySelectors.d.ts +2 -3
- package/dist/components/Selectors/QuestionCategorySelector.d.ts +2 -3
- package/dist/components/Selectors/QuestionTypeSelector.d.ts +2 -3
- package/dist/components/Selectors/StarRatingSelector.d.ts +2 -3
- package/dist/components/Selectors/SuggestionCategorySelector.d.ts +2 -3
- package/dist/components/Tabs/CustomTab.d.ts +2 -3
- package/dist/components/Tabs/TabsWithComponent.d.ts +10 -0
- package/dist/configs/editorConfig.d.ts +7 -7
- package/dist/containers/Commons/NotFound.d.ts +3 -3
- package/dist/containers/DistrictSchools/views/SchoolList.d.ts +3 -3
- package/dist/containers/EmailTemplate/components/AttachmentFile.d.ts +8 -7
- package/dist/containers/EmailTemplate/components/MailParam.d.ts +8 -7
- package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +27 -28
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -11
- package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
- package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
- package/dist/containers/Faq/components/FaqDetailModal.d.ts +2 -3
- package/dist/containers/Faq/hooks/useFaqDetail.d.ts +17 -18
- package/dist/containers/Faq/hooks/useFaqList.d.ts +9 -9
- package/dist/containers/Faq/views/FaqList.d.ts +3 -3
- package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
- package/dist/containers/Gallery/components/Filter.d.ts +9 -8
- package/dist/containers/Gallery/components/Media.d.ts +9 -8
- package/dist/containers/Gallery/components/MediaDetail.d.ts +7 -7
- package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
- package/dist/containers/Gallery/components/MediaNav.d.ts +19 -18
- package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -21
- package/dist/containers/Gallery/extensions/helpers.d.ts +4 -4
- package/dist/containers/Gallery/hooks/useGalleryList.d.ts +30 -31
- package/dist/containers/Gallery/views/GalleryList.d.ts +6 -6
- package/dist/containers/Login/components/GoogleLoginButton.d.ts +10 -0
- package/dist/containers/Login/constant/authConfig.d.ts +38 -0
- package/dist/containers/Login/constant/types.d.ts +27 -0
- package/dist/containers/Login/hooks/useForgotPassword.d.ts +20 -21
- package/dist/containers/Login/hooks/useLogin.d.ts +26 -23
- package/dist/containers/Login/hooks/useLoginTwoFactor.d.ts +4 -4
- package/dist/containers/Login/views/Dashboard.d.ts +3 -3
- package/dist/containers/Login/views/Login.d.ts +8 -9
- package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
- package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
- package/dist/containers/Login/views/block/BlockLogin.d.ts +9 -7
- package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
- package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +11 -12
- package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +2 -3
- package/dist/containers/Login/views/block/CloseBlock.d.ts +6 -6
- package/dist/containers/Login/views/block/ContentHomePage.d.ts +5 -5
- package/dist/containers/Login/views/block/IconContent.d.ts +7 -7
- package/dist/containers/Login/views/block/QuoteContent.d.ts +2 -3
- package/dist/containers/Notifications/components/NotificationButton.d.ts +5 -5
- package/dist/containers/Notifications/components/NotificationStatusSelector.d.ts +6 -7
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +17 -17
- package/dist/containers/Notifications/hooks/useUnreadNotification.d.ts +4 -4
- package/dist/containers/Notifications/views/NotificationList.d.ts +2 -3
- package/dist/containers/Skill/components/SkillDetailModal.d.ts +2 -3
- package/dist/containers/Skill/components/SkillSelector.d.ts +2 -3
- package/dist/containers/Skill/hooks/useSkillDetail.d.ts +19 -20
- package/dist/containers/Skill/hooks/useSkillList.d.ts +10 -9
- package/dist/containers/Skill/views/SkillList.d.ts +3 -3
- package/dist/containers/User/components/AssignStudentModal.d.ts +19 -0
- package/dist/containers/User/components/DeleteBulkModel.d.ts +3 -0
- package/dist/containers/User/components/FilterPopover.d.ts +21 -0
- package/dist/containers/User/components/HeaderCell.d.ts +19 -0
- package/dist/containers/User/components/RemoveAssistant.d.ts +3 -0
- package/dist/containers/User/components/RemoveCounselor.d.ts +3 -0
- package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
- package/dist/containers/User/components/TableHeader.d.ts +14 -0
- package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
- package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -10
- package/dist/containers/User/configs/constants.d.ts +62 -0
- package/dist/containers/User/configs/type.d.ts +210 -0
- package/dist/containers/User/configs/userSchema.d.ts +15 -15
- package/dist/containers/User/hooks/useAssignStudent.d.ts +33 -0
- package/dist/containers/User/hooks/useAssignStudentList.d.ts +33 -0
- package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
- package/dist/containers/User/hooks/useClickOutside.d.ts +2 -0
- package/dist/containers/User/hooks/useCounselorList.d.ts +9 -0
- package/dist/containers/User/hooks/useFilterPopover.d.ts +36 -0
- package/dist/containers/User/hooks/useTableHeader.d.ts +19 -0
- package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useUserDetail.d.ts +31 -24
- package/dist/containers/User/hooks/useUserList.d.ts +14 -11
- package/dist/containers/User/hooks/userFilters.d.ts +7 -0
- package/dist/containers/User/views/AssignStudentList.d.ts +2 -0
- package/dist/containers/User/views/UserContainer.d.ts +2 -0
- package/dist/containers/User/views/UserDetail.d.ts +2 -3
- package/dist/containers/User/views/UserList.d.ts +2 -3
- package/dist/hooks/useClassFontSize.d.ts +4 -0
- package/dist/hooks/useFilters.d.ts +7 -8
- package/dist/i18n.d.ts +2 -2
- package/dist/index-C95SWLrn.js +18163 -0
- package/dist/index-DixwqZ17.cjs +29 -0
- package/dist/index.d.ts +111 -110
- package/dist/index.esm-BckW25l9.cjs +1 -0
- package/dist/index.esm-hqKUWCW0.js +15 -0
- package/dist/index.js +1 -10373
- package/dist/index.modern.js +159 -10213
- package/dist/layouts/TheContent.d.ts +3 -3
- package/dist/mailCategoryService-BqDtPJRc.js +10 -0
- package/dist/mailCategoryService-DBMJOyls.cjs +1 -0
- package/dist/mario-core.css +5 -0
- package/dist/redux/assessments/action.d.ts +1 -1
- package/dist/redux/assessments/reducer.d.ts +10 -5
- package/dist/redux/assignment/action.d.ts +1 -1
- package/dist/redux/assignment/reducer.d.ts +4 -2
- package/dist/redux/assistants/action.d.ts +1 -1
- package/dist/redux/assistants/reducer.d.ts +4 -2
- package/dist/redux/badges/action.d.ts +1 -1
- package/dist/redux/badges/reducer.d.ts +4 -2
- package/dist/redux/bandScores/action.d.ts +1 -1
- package/dist/redux/bandScores/reducer.d.ts +4 -2
- package/dist/redux/certificate/action.d.ts +1 -1
- package/dist/redux/certificate/reducer.d.ts +4 -2
- package/dist/redux/classes/action.d.ts +1 -1
- package/dist/redux/classes/reducer.d.ts +4 -2
- package/dist/redux/commons/action.d.ts +18 -18
- package/dist/redux/commons/reducer.d.ts +4 -2
- package/dist/redux/conferenceRubrics/action.d.ts +1 -1
- package/dist/redux/conferenceRubrics/reducer.d.ts +4 -2
- package/dist/redux/customAlert/action.d.ts +1 -1
- package/dist/redux/customAlert/reducer.d.ts +4 -2
- package/dist/redux/dashboard/action.d.ts +5 -5
- package/dist/redux/dashboard/reducer.d.ts +4 -2
- package/dist/redux/dataPlayer/action.d.ts +2 -2
- package/dist/redux/dataPlayer/reducer.d.ts +4 -2
- package/dist/redux/emailTemplates/action.d.ts +1 -1
- package/dist/redux/emailTemplates/reducer.d.ts +4 -2
- package/dist/redux/faqs/action.d.ts +1 -1
- package/dist/redux/faqs/reducer.d.ts +4 -2
- package/dist/redux/feedback/action.d.ts +1 -1
- package/dist/redux/feedback/reducer.d.ts +4 -2
- package/dist/redux/gallery/action.d.ts +2 -2
- package/dist/redux/gallery/reducer.d.ts +4 -2
- package/dist/redux/goalExamples/action.d.ts +1 -1
- package/dist/redux/goalExamples/reducer.d.ts +4 -2
- package/dist/redux/improveMyClass/action.d.ts +1 -1
- package/dist/redux/improveMyClass/reducer.d.ts +4 -2
- package/dist/redux/learningStrategies/action.d.ts +1 -1
- package/dist/redux/learningStrategies/reducer.d.ts +4 -2
- package/dist/redux/learningSupportCategories/action.d.ts +1 -1
- package/dist/redux/learningSupportCategories/reducer.d.ts +4 -2
- package/dist/redux/mailCategories/action.d.ts +1 -1
- package/dist/redux/mailCategories/reducer.d.ts +4 -2
- package/dist/redux/navMobile/action.d.ts +1 -1
- package/dist/redux/navMobile/reducer.d.ts +4 -2
- package/dist/redux/notifications/action.d.ts +3 -3
- package/dist/redux/notifications/reducer.d.ts +4 -2
- package/dist/redux/questionBanks/action.d.ts +1 -1
- package/dist/redux/questionBanks/reducer.d.ts +4 -2
- package/dist/redux/questionByCategory/action.d.ts +8 -8
- package/dist/redux/questionByCategory/reducer.d.ts +4 -2
- package/dist/redux/questionCategory/action.d.ts +1 -1
- package/dist/redux/questionCategory/reducer.d.ts +4 -2
- package/dist/redux/reflectionForms/action.d.ts +1 -1
- package/dist/redux/reflectionForms/reducer.d.ts +4 -2
- package/dist/redux/reflectionResults/action.d.ts +1 -1
- package/dist/redux/reflectionResults/reducer.d.ts +4 -2
- package/dist/redux/schoolBlankDays/action.d.ts +1 -1
- package/dist/redux/schoolBlankDays/reducer.d.ts +4 -2
- package/dist/redux/semester/action.d.ts +1 -1
- package/dist/redux/semester/reducer.d.ts +4 -2
- package/dist/redux/sessionPlayers/action.d.ts +5 -5
- package/dist/redux/sessionPlayers/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplateGeneralClasses/action.d.ts +1 -1
- package/dist/redux/sessionTemplateGeneralClasses/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplates/action.d.ts +1 -1
- package/dist/redux/sessionTemplates/reducer.d.ts +4 -2
- package/dist/redux/skills/action.d.ts +1 -1
- package/dist/redux/skills/reducer.d.ts +4 -2
- package/dist/redux/subjects/action.d.ts +1 -1
- package/dist/redux/subjects/reducer.d.ts +4 -2
- package/dist/redux/suggestionBanks/action.d.ts +1 -1
- package/dist/redux/suggestionBanks/reducer.d.ts +4 -2
- package/dist/redux/teacher/myStudent/action.d.ts +1 -1
- package/dist/redux/teacher/myStudent/reducer.d.ts +4 -2
- package/dist/redux/tutorialScreen/action.d.ts +1 -1
- package/dist/redux/tutorialScreen/reducer.d.ts +10 -5
- package/dist/redux/users/action.d.ts +2 -2
- package/dist/redux/users/reducer.d.ts +4 -2
- package/dist/redux/widget/action.d.ts +1 -1
- package/dist/redux/widget/reducer.d.ts +4 -2
- package/dist/rootReducer.d.ts +96 -49
- package/dist/services/accountService.d.ts +13 -12
- package/dist/services/api.d.ts +3 -3
- package/dist/services/classService.d.ts +1 -1
- package/dist/services/emailTemplateService.d.ts +6 -6
- package/dist/services/faqService.d.ts +6 -6
- package/dist/services/fileServices.d.ts +13 -13
- package/dist/services/galleryService.d.ts +2 -2
- package/dist/services/languageService.d.ts +1 -0
- package/dist/services/mailCategoryService.d.ts +1 -1
- package/dist/services/notificationService.d.ts +7 -7
- package/dist/services/questionCategoryService.d.ts +1 -1
- package/dist/services/schoolService.d.ts +1 -0
- package/dist/services/skillService.d.ts +6 -6
- package/dist/services/suggestionCategoryService.d.ts +1 -1
- package/dist/services/userService.d.ts +21 -9
- package/dist/store.d.ts +3 -3
- package/dist/types/Conversation.d.ts +8 -8
- package/dist/types/ConversationMember.d.ts +5 -5
- package/dist/types/Dashboard.d.ts +5 -5
- package/dist/types/Filter.d.ts +10 -10
- package/dist/types/Language.d.ts +8 -0
- package/dist/types/Message.d.ts +13 -13
- package/dist/types/Notification.d.ts +8 -8
- package/dist/utils/canAccessRoute.d.ts +2 -2
- package/dist/utils/constants.d.ts +77 -67
- package/dist/utils/debounce.d.ts +2 -2
- package/dist/utils/domHelpers.d.ts +2 -2
- package/dist/utils/encodeParams.d.ts +2 -2
- package/dist/utils/firstCheckToken.d.ts +2 -2
- package/dist/utils/generateRandomString.d.ts +2 -2
- package/dist/utils/getAccessToken.d.ts +2 -2
- package/dist/utils/getCookieValue.d.ts +2 -0
- package/dist/utils/getFileUrl.d.ts +2 -2
- package/dist/utils/getStaticFileUrl.d.ts +2 -0
- package/dist/utils/getTextFromHTML.d.ts +2 -2
- package/dist/utils/utcToLocalTime.d.ts +2 -2
- package/package.json +68 -77
- package/dist/components/Alerts/ReactNotification.d.ts +0 -4
- package/dist/containers/Login/constant/type.d.ts +0 -5
- package/dist/containers/Login/views/ModelSelectRole.d.ts +0 -4
- package/dist/index.css +0 -658
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js.map +0 -1
- package/dist/index.test.d.ts +0 -1
- package/dist/layouts/TheFooter.d.ts +0 -3
- package/dist/layouts/TheHeader.d.ts +0 -3
- package/dist/layouts/TheHeaderDropdown.d.ts +0 -3
- package/dist/layouts/TheLanguageDropdown.d.ts +0 -3
- package/dist/layouts/TheLayout.d.ts +0 -4
- package/dist/layouts/TheSidebar.d.ts +0 -3
- package/dist/types/Payload.d.ts +0 -15
- package/dist/utils/amplitude.d.ts +0 -1
|
@@ -0,0 +1,897 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import Q, { useState as L, useCallback as C, useEffect as U } from "react";
|
|
3
|
+
import { Input as se, Form as ye, FormGroup as Y, Row as oe, Col as _, Label as ie } from "reactstrap";
|
|
4
|
+
import { a as Ie, B as ke, i as X, A as x, g as le, s as $, l as Ee, I as Z, N as ve, b as Re, c as G, d as Pe, e as Le, r as Ce, f as $e, h as t, j as xe, k as Te, m as te, E as B, n as Oe, o as Ae, p as Ge } from "./index-C95SWLrn.js";
|
|
5
|
+
import { Formik as ae } from "formik";
|
|
6
|
+
import * as T from "yup";
|
|
7
|
+
import { useDispatch as de } from "react-redux";
|
|
8
|
+
import { useNavigate as me, Link as ge, useLocation as Ue } from "react-router-dom";
|
|
9
|
+
import { LogLevel as W, PublicClientApplication as _e } from "@azure/msal-browser";
|
|
10
|
+
import { useGoogleReCaptcha as he, GoogleReCaptcha as ue, GoogleReCaptchaProvider as Fe } from "react-google-recaptcha-v3";
|
|
11
|
+
import { useGoogleLogin as Me, GoogleOAuthProvider as qe } from "@react-oauth/google";
|
|
12
|
+
const Be = {
|
|
13
|
+
height: "40px",
|
|
14
|
+
backgroundColor: "#f7f9fc",
|
|
15
|
+
borderRadius: "4px",
|
|
16
|
+
marginBottom: "5px",
|
|
17
|
+
position: "relative"
|
|
18
|
+
}, He = {
|
|
19
|
+
backgroundColor: "#ffffff",
|
|
20
|
+
paddingRight: "50px"
|
|
21
|
+
}, Ve = {
|
|
22
|
+
fontSize: "20px",
|
|
23
|
+
position: "absolute",
|
|
24
|
+
right: "10px",
|
|
25
|
+
color: "#316CD9"
|
|
26
|
+
}, ee = ({
|
|
27
|
+
isShowPassword: s,
|
|
28
|
+
togglePasswordVisible: a,
|
|
29
|
+
onChange: n
|
|
30
|
+
}) => /* @__PURE__ */ c("div", { className: "d-flex align-items-center w-100", style: Be, children: [
|
|
31
|
+
/* @__PURE__ */ e(
|
|
32
|
+
se,
|
|
33
|
+
{
|
|
34
|
+
className: "border password-input",
|
|
35
|
+
style: He,
|
|
36
|
+
type: s ? "text" : "password",
|
|
37
|
+
name: "password",
|
|
38
|
+
onChange: n,
|
|
39
|
+
placeholder: "Password",
|
|
40
|
+
required: !0
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
"i",
|
|
45
|
+
{
|
|
46
|
+
className: `far ${s ? "fa-eye-slash" : "fa-eye"} mx-2 cursor-pointer`,
|
|
47
|
+
style: Ve,
|
|
48
|
+
onClick: () => a(),
|
|
49
|
+
title: s ? "Hide" : "Show"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
var ne = /* @__PURE__ */ ((s) => (s[s.Google = 0] = "Google", s[s.ClassLink = 1] = "ClassLink", s[s.MicrosoftSSO = 2] = "MicrosoftSSO", s))(ne || {});
|
|
54
|
+
const je = `${ke}/api/school`, De = () => Ie.get(`${je}/settings`), ze = {
|
|
55
|
+
auth: {
|
|
56
|
+
clientId: X ? "afed1089-7de6-406a-827a-bab9472cb245" : "3845e9f8-aead-4535-b4bb-d363a1d262bd",
|
|
57
|
+
authority: "https://login.microsoftonline.com/common",
|
|
58
|
+
redirectUri: "https://es-sso.marioforme.com/microsoft-login.html"
|
|
59
|
+
},
|
|
60
|
+
cache: {
|
|
61
|
+
cacheLocation: "sessionStorage",
|
|
62
|
+
// This configures where your cache will be stored
|
|
63
|
+
storeAuthStateInCookie: !1
|
|
64
|
+
// Set this to "true" if you are having issues on IE11 or Edge
|
|
65
|
+
},
|
|
66
|
+
system: {
|
|
67
|
+
loggerOptions: {
|
|
68
|
+
loggerCallback: (s, a, n) => {
|
|
69
|
+
if (!n)
|
|
70
|
+
switch (s) {
|
|
71
|
+
case W.Error:
|
|
72
|
+
console.error(a);
|
|
73
|
+
return;
|
|
74
|
+
case W.Info:
|
|
75
|
+
console.info(a);
|
|
76
|
+
return;
|
|
77
|
+
case W.Verbose:
|
|
78
|
+
console.debug(a);
|
|
79
|
+
return;
|
|
80
|
+
case W.Warning:
|
|
81
|
+
console.warn(a);
|
|
82
|
+
return;
|
|
83
|
+
default:
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, We = (s) => {
|
|
90
|
+
var a;
|
|
91
|
+
return ((a = document.cookie.match("(^|;)\\s*" + s + "\\s*=\\s*([^;]+)")) == null ? void 0 : a.pop()) || "";
|
|
92
|
+
}, Je = {
|
|
93
|
+
email: "",
|
|
94
|
+
password: "",
|
|
95
|
+
captcha: "",
|
|
96
|
+
rememberMe: !1,
|
|
97
|
+
isSessionUserBrowser: !!sessionStorage.getItem(Z)
|
|
98
|
+
}, Ke = "/home", Ye = "/home", Qe = "/admin/home", Xe = "/parent", Ze = "/admin/schools", es = "/my-student?isReadOnly=true", ss = "Log in", pe = () => {
|
|
99
|
+
const s = de(), a = me(), [n, d] = L(!1), [g, h] = L(""), [m, l] = L(""), [k, f] = L(), [w, b] = L({
|
|
100
|
+
schoolName: "",
|
|
101
|
+
schoolLogo: "",
|
|
102
|
+
schoolId: 0
|
|
103
|
+
}), [p, E] = L(), S = C(() => {
|
|
104
|
+
d(!n);
|
|
105
|
+
}, [n]), [v, A] = L(!1), [N, y] = L("");
|
|
106
|
+
U(() => {
|
|
107
|
+
document.title = ss;
|
|
108
|
+
const o = We("auth-token");
|
|
109
|
+
if (o) {
|
|
110
|
+
localStorage.setItem(x, o);
|
|
111
|
+
const i = window.location.hostname;
|
|
112
|
+
document.cookie = `auth-token=;domain=${i.includes("localhost") ? i : ".marioforme.com"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`, document.cookie = "auth-token=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/", document.cookie = "redirect-uri=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
|
|
113
|
+
}
|
|
114
|
+
le() && a("/"), H(), re();
|
|
115
|
+
}, []);
|
|
116
|
+
const I = window.location.host.includes("-district"), u = C(async (o) => {
|
|
117
|
+
var r, i, R, F;
|
|
118
|
+
s($(!0));
|
|
119
|
+
try {
|
|
120
|
+
const O = (o == null ? void 0 : o.isSessionUserBrowser) ?? !1, M = await Ee({ ...o, email: (r = o == null ? void 0 : o.email) == null ? void 0 : r.trim(), password: (i = o == null ? void 0 : o.password) == null ? void 0 : i.trim() }), {
|
|
121
|
+
token: J,
|
|
122
|
+
id: q,
|
|
123
|
+
firstName: z,
|
|
124
|
+
lastName: K,
|
|
125
|
+
roles: P,
|
|
126
|
+
email: Ne,
|
|
127
|
+
profileImageFileName: be
|
|
128
|
+
} = M.data;
|
|
129
|
+
O ? (sessionStorage.setItem(x, J), sessionStorage.setItem(Z, O)) : (sessionStorage.removeItem(Z), localStorage.setItem(x, J)), localStorage.removeItem(ve), s(
|
|
130
|
+
Re({
|
|
131
|
+
id: q,
|
|
132
|
+
firstName: z,
|
|
133
|
+
lastName: K,
|
|
134
|
+
roles: P,
|
|
135
|
+
email: Ne,
|
|
136
|
+
profileImageFileName: be
|
|
137
|
+
})
|
|
138
|
+
), !localStorage.getItem("ROLES") && P.includes("Admin") && localStorage.setItem("ROLES", "Admin"), I ? a(Ze) : P.includes("Admin") ? a(Qe) : P.includes("Teacher") || P.includes("Assistant") || P.includes("Counselor") || P.includes("SecondaryTeacher") ? a(Ke) : P.includes("Student") ? a(Ye) : P.includes("Parent") ? a(Xe) : P.includes("EduTeacher") && a(es);
|
|
139
|
+
} catch (O) {
|
|
140
|
+
s(
|
|
141
|
+
G({
|
|
142
|
+
type: "danger",
|
|
143
|
+
message: ((F = (R = O.response) == null ? void 0 : R.data) == null ? void 0 : F.title) || O.message || "Login failed"
|
|
144
|
+
})
|
|
145
|
+
), localStorage.removeItem(x), sessionStorage.removeItem(x);
|
|
146
|
+
}
|
|
147
|
+
s($(!1));
|
|
148
|
+
}, []), H = async () => {
|
|
149
|
+
var o, r;
|
|
150
|
+
try {
|
|
151
|
+
const i = await Pe();
|
|
152
|
+
h(i.data.googleClientId), l(i.data.googleCaptchaId), y(i.data.extensionEmail);
|
|
153
|
+
} catch (i) {
|
|
154
|
+
s(
|
|
155
|
+
G({
|
|
156
|
+
type: "danger",
|
|
157
|
+
message: ((r = (o = i.response) == null ? void 0 : o.data) == null ? void 0 : r.title) || i.message || "Login failed"
|
|
158
|
+
})
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}, V = C(async (o, r, i, R) => {
|
|
162
|
+
var F, O;
|
|
163
|
+
s($(!0));
|
|
164
|
+
try {
|
|
165
|
+
if ((await Le(o, r)).data) {
|
|
166
|
+
const q = await R(), z = {
|
|
167
|
+
email: r.email,
|
|
168
|
+
captcha: q,
|
|
169
|
+
isLoginGoogle: !0,
|
|
170
|
+
rememberMe: !1,
|
|
171
|
+
password: "default",
|
|
172
|
+
accessToken: i
|
|
173
|
+
};
|
|
174
|
+
await u(z);
|
|
175
|
+
} else {
|
|
176
|
+
const q = {
|
|
177
|
+
firstName: r.firstName,
|
|
178
|
+
lastName: r.lastName,
|
|
179
|
+
imageUrl: r.imageUrl,
|
|
180
|
+
fullName: r.fullName,
|
|
181
|
+
email: r.email,
|
|
182
|
+
accessToken: r.accessToken
|
|
183
|
+
};
|
|
184
|
+
if ((await Ce(q)).data) {
|
|
185
|
+
const K = await R(), P = {
|
|
186
|
+
email: r.email,
|
|
187
|
+
captcha: K,
|
|
188
|
+
isLoginGoogle: !0,
|
|
189
|
+
rememberMe: !1,
|
|
190
|
+
password: "default",
|
|
191
|
+
accessToken: r.accessToken
|
|
192
|
+
};
|
|
193
|
+
await u(P);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} catch (M) {
|
|
197
|
+
s(
|
|
198
|
+
G({
|
|
199
|
+
type: "danger",
|
|
200
|
+
message: ((O = (F = M.response) == null ? void 0 : F.data) == null ? void 0 : O.title) || M.message || "Login failed"
|
|
201
|
+
})
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
s($(!1));
|
|
205
|
+
}, []), j = async (o) => {
|
|
206
|
+
p && p.handleRedirectPromise().then(async (r) => {
|
|
207
|
+
if (w != null && w.schoolId)
|
|
208
|
+
if (r) {
|
|
209
|
+
let i = r.account;
|
|
210
|
+
await D(i, o);
|
|
211
|
+
} else {
|
|
212
|
+
const i = p.getAllAccounts();
|
|
213
|
+
if (i.length === 0) {
|
|
214
|
+
const R = X ? "https://es-stage.marioforme.com" : "https://es-sso.marioforme.com";
|
|
215
|
+
window.location.href = (window.location.hostname === "localhost" ? "https://localhost:3000" : R) + `/microsoft-login.html?redirect-uri=${window.location.href}&schoolId=${w.schoolId}`;
|
|
216
|
+
} else {
|
|
217
|
+
let R = i[0];
|
|
218
|
+
await D(R, o);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}).catch((r) => {
|
|
222
|
+
console.error(r);
|
|
223
|
+
});
|
|
224
|
+
}, D = async (o, r) => {
|
|
225
|
+
let i = o.name, R = {
|
|
226
|
+
firstName: i.split(" ").slice(0, -1).join(" "),
|
|
227
|
+
lastName: i.split(" ").slice(-1).join(" "),
|
|
228
|
+
fullName: i,
|
|
229
|
+
imageUrl: "",
|
|
230
|
+
email: o.username,
|
|
231
|
+
accessToken: o.idTokenClaims.aio,
|
|
232
|
+
googleId: o.tenantId
|
|
233
|
+
};
|
|
234
|
+
s($e(R)), await V(ne.MicrosoftSSO, R, o.idTokenClaims.aio, r);
|
|
235
|
+
}, re = async () => {
|
|
236
|
+
try {
|
|
237
|
+
const o = await De();
|
|
238
|
+
b(o.data);
|
|
239
|
+
} catch (o) {
|
|
240
|
+
console.error(o);
|
|
241
|
+
}
|
|
242
|
+
}, we = () => {
|
|
243
|
+
if (X) {
|
|
244
|
+
const o = "https://clever.com/oauth/instant-login?client_id=44f4bbf55cd873d3f7e5&district_id=6620cba31f1ddde7bd689dc5";
|
|
245
|
+
window.location.href = o;
|
|
246
|
+
} else {
|
|
247
|
+
const o = `https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://es-classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;
|
|
248
|
+
window.location.href = o;
|
|
249
|
+
}
|
|
250
|
+
}, Se = async () => {
|
|
251
|
+
const o = new _e(ze);
|
|
252
|
+
await o.initialize(), E(o);
|
|
253
|
+
};
|
|
254
|
+
return U(() => {
|
|
255
|
+
let o = window.location.href;
|
|
256
|
+
p && o.includes("code") && o.includes("client_info") && j();
|
|
257
|
+
}, [JSON.stringify(p)]), U(() => {
|
|
258
|
+
re(), Se();
|
|
259
|
+
}, []), {
|
|
260
|
+
defaultInfo: Je,
|
|
261
|
+
userLogin: u,
|
|
262
|
+
openLogin: n,
|
|
263
|
+
toggle: S,
|
|
264
|
+
isShowPassword: v,
|
|
265
|
+
setIsShowPassword: A,
|
|
266
|
+
fnIsCheckLogin: V,
|
|
267
|
+
infoUser: k,
|
|
268
|
+
setInfoUser: f,
|
|
269
|
+
googleClientId: g,
|
|
270
|
+
googleRecaptchaId: m,
|
|
271
|
+
school: w,
|
|
272
|
+
fnLoginSSO: j,
|
|
273
|
+
handleLoginWidthClever: we,
|
|
274
|
+
extensionEmail: N
|
|
275
|
+
};
|
|
276
|
+
}, os = ({
|
|
277
|
+
extensionEmail: s,
|
|
278
|
+
setInfoUser: a,
|
|
279
|
+
fnIsCheckLogin: n,
|
|
280
|
+
clickHandler: d
|
|
281
|
+
}) => {
|
|
282
|
+
const g = async (m) => {
|
|
283
|
+
try {
|
|
284
|
+
await xe(m);
|
|
285
|
+
} catch (l) {
|
|
286
|
+
console.error(l);
|
|
287
|
+
}
|
|
288
|
+
}, h = Me({
|
|
289
|
+
flow: "implicit",
|
|
290
|
+
onSuccess: async (m) => {
|
|
291
|
+
var l, k;
|
|
292
|
+
try {
|
|
293
|
+
const w = await (await fetch(
|
|
294
|
+
"https://www.googleapis.com/oauth2/v3/userinfo",
|
|
295
|
+
{
|
|
296
|
+
headers: {
|
|
297
|
+
Authorization: `Bearer ${m.access_token}`
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
)).json(), {
|
|
301
|
+
email: b,
|
|
302
|
+
given_name: p,
|
|
303
|
+
family_name: E,
|
|
304
|
+
picture: S,
|
|
305
|
+
name: v,
|
|
306
|
+
sub: A
|
|
307
|
+
} = w, N = window.location.hostname, y = (k = (l = N == null ? void 0 : N.split(".marioforme.com")) == null ? void 0 : l[0]) == null ? void 0 : k.replace(/-es$|^es-/, ""), I = b.split("@")[1];
|
|
308
|
+
if (!I.includes(y) && !I.includes(s)) {
|
|
309
|
+
alert(
|
|
310
|
+
"The email address you used does not match the login information in the database."
|
|
311
|
+
), await g([`${I} is incorrect`]);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const u = {
|
|
315
|
+
firstName: p,
|
|
316
|
+
lastName: E,
|
|
317
|
+
imageUrl: S,
|
|
318
|
+
fullName: v,
|
|
319
|
+
email: b,
|
|
320
|
+
accessToken: m.access_token,
|
|
321
|
+
googleId: A
|
|
322
|
+
};
|
|
323
|
+
a(u), n(ne.Google, u, m.access_token, d);
|
|
324
|
+
} catch (f) {
|
|
325
|
+
await g([`Google login error ${f}`]);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
onError: () => {
|
|
329
|
+
console.log("Google login failed");
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
return /* @__PURE__ */ c(
|
|
333
|
+
"div",
|
|
334
|
+
{
|
|
335
|
+
className: t["btn-login-with-sso"],
|
|
336
|
+
onClick: () => h(),
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ e("img", { src: "images/google-logo.png" }),
|
|
339
|
+
/* @__PURE__ */ e("p", { children: "GOOGLE" })
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
}, ts = T.object({
|
|
344
|
+
email: T.string().email("Email is invalid").required("Email is required"),
|
|
345
|
+
password: T.string().required("Password is required"),
|
|
346
|
+
rememberMe: T.boolean()
|
|
347
|
+
}), as = ({ defaultInfo: s, userLogin: a, school: n }) => {
|
|
348
|
+
let {
|
|
349
|
+
isShowPassword: d,
|
|
350
|
+
setIsShowPassword: g,
|
|
351
|
+
fnIsCheckLogin: h,
|
|
352
|
+
setInfoUser: m,
|
|
353
|
+
googleClientId: l,
|
|
354
|
+
fnLoginSSO: k,
|
|
355
|
+
extensionEmail: f
|
|
356
|
+
} = pe();
|
|
357
|
+
const w = () => g(!d), { executeRecaptcha: b } = he(), p = C(async () => {
|
|
358
|
+
if (!b) {
|
|
359
|
+
console.log("execute recaptcha undefined");
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
return await b("login");
|
|
363
|
+
}, [b]), E = C(() => {
|
|
364
|
+
}, []);
|
|
365
|
+
return /* @__PURE__ */ e(Q.Fragment, { children: /* @__PURE__ */ e(
|
|
366
|
+
ae,
|
|
367
|
+
{
|
|
368
|
+
initialValues: s,
|
|
369
|
+
enableReinitialize: !0,
|
|
370
|
+
validationSchema: ts,
|
|
371
|
+
onSubmit: async (S) => {
|
|
372
|
+
try {
|
|
373
|
+
const v = await p();
|
|
374
|
+
if (!v) return;
|
|
375
|
+
S.captcha = v, a(S);
|
|
376
|
+
} catch (v) {
|
|
377
|
+
console.error(v);
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
children: (S) => {
|
|
381
|
+
const {
|
|
382
|
+
handleChange: v,
|
|
383
|
+
handleBlur: A,
|
|
384
|
+
handleSubmit: N,
|
|
385
|
+
values: y,
|
|
386
|
+
touched: I,
|
|
387
|
+
errors: u,
|
|
388
|
+
setFieldValue: H
|
|
389
|
+
} = S, V = I.email && u.email, j = I.password && u.password;
|
|
390
|
+
return /* @__PURE__ */ e("div", { className: `${t["box-login"]} w-100`, children: /* @__PURE__ */ e(
|
|
391
|
+
ye,
|
|
392
|
+
{
|
|
393
|
+
className: `${t["block-login"]}`,
|
|
394
|
+
onSubmit: N,
|
|
395
|
+
children: /* @__PURE__ */ c("div", { className: `${t["block-form"]}`, children: [
|
|
396
|
+
/* @__PURE__ */ c("div", { className: "d-flex align-items-center mb-4", children: [
|
|
397
|
+
/* @__PURE__ */ e(
|
|
398
|
+
"img",
|
|
399
|
+
{
|
|
400
|
+
src: n.schoolLogo ? Te(`${n.schoolLogo}`) : `${te("/images/mario-logo.png")}`,
|
|
401
|
+
className: `${t["school-icon"]} mr-3`
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
/* @__PURE__ */ e("p", { className: `${t["school-name"]} mb-0`, children: n.schoolName })
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "Welcome Back!" }),
|
|
407
|
+
/* @__PURE__ */ e("p", { className: `${t["login-description"]} mb-5`, children: "Please enter your MARIO Education account details" }),
|
|
408
|
+
/* @__PURE__ */ c(Y, { className: `${t["form-user-name"]}`, children: [
|
|
409
|
+
/* @__PURE__ */ e(
|
|
410
|
+
se,
|
|
411
|
+
{
|
|
412
|
+
type: "text",
|
|
413
|
+
name: "email",
|
|
414
|
+
placeholder: "Email",
|
|
415
|
+
value: y.email,
|
|
416
|
+
onChange: v,
|
|
417
|
+
autoComplete: "email",
|
|
418
|
+
onBlur: A("email"),
|
|
419
|
+
required: !0
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
V && /* @__PURE__ */ e(
|
|
423
|
+
B,
|
|
424
|
+
{
|
|
425
|
+
text: u.email
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] }),
|
|
429
|
+
/* @__PURE__ */ c(Y, { children: [
|
|
430
|
+
/* @__PURE__ */ e(
|
|
431
|
+
ee,
|
|
432
|
+
{
|
|
433
|
+
isShowPassword: d,
|
|
434
|
+
togglePasswordVisible: w,
|
|
435
|
+
onChange: (D) => H(
|
|
436
|
+
"password",
|
|
437
|
+
D.target.value
|
|
438
|
+
)
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
j && /* @__PURE__ */ e(B, { text: u.password })
|
|
442
|
+
] }),
|
|
443
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(
|
|
444
|
+
ue,
|
|
445
|
+
{
|
|
446
|
+
action: "login",
|
|
447
|
+
onVerify: E
|
|
448
|
+
}
|
|
449
|
+
) }),
|
|
450
|
+
/* @__PURE__ */ c("div", { className: "d-flex justify-content-between", children: [
|
|
451
|
+
/* @__PURE__ */ c("div", { className: "d-flex align-items-center", children: [
|
|
452
|
+
/* @__PURE__ */ e(
|
|
453
|
+
"input",
|
|
454
|
+
{
|
|
455
|
+
type: "checkbox",
|
|
456
|
+
checked: !y.isSessionUserBrowser,
|
|
457
|
+
className: `${t["checkbox-keep-login"]}`,
|
|
458
|
+
onChange: () => H(
|
|
459
|
+
"isSessionUserBrowser",
|
|
460
|
+
!y.isSessionUserBrowser
|
|
461
|
+
)
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ e("p", { className: `${t["label-keep-login"]} mb-0 ml-2`, children: "Keep me logged in" })
|
|
465
|
+
] }),
|
|
466
|
+
/* @__PURE__ */ e(
|
|
467
|
+
"a",
|
|
468
|
+
{
|
|
469
|
+
href: "/forgot-password",
|
|
470
|
+
className: `${t["link-to-login"]}`,
|
|
471
|
+
children: "Forgot password?"
|
|
472
|
+
}
|
|
473
|
+
)
|
|
474
|
+
] }),
|
|
475
|
+
/* @__PURE__ */ e(
|
|
476
|
+
"button",
|
|
477
|
+
{
|
|
478
|
+
className: `${t["btn-login"]} mt-5`,
|
|
479
|
+
type: "submit",
|
|
480
|
+
children: "LOG IN"
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
/* @__PURE__ */ e("p", { className: `${t["option-text"]} my-3 text-center`, children: "OR" }),
|
|
484
|
+
/* @__PURE__ */ c(oe, { className: "mb-4", children: [
|
|
485
|
+
/* @__PURE__ */ e(
|
|
486
|
+
_,
|
|
487
|
+
{
|
|
488
|
+
lg: 6,
|
|
489
|
+
md: 6,
|
|
490
|
+
xs: 12,
|
|
491
|
+
className: `${t["btn-login-sso"]} pr-md-2`,
|
|
492
|
+
children: !!l && /* @__PURE__ */ e(qe, { clientId: l, children: /* @__PURE__ */ e(
|
|
493
|
+
os,
|
|
494
|
+
{
|
|
495
|
+
extensionEmail: f,
|
|
496
|
+
setInfoUser: m,
|
|
497
|
+
fnIsCheckLogin: h,
|
|
498
|
+
clickHandler: p
|
|
499
|
+
}
|
|
500
|
+
) })
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ e(
|
|
504
|
+
_,
|
|
505
|
+
{
|
|
506
|
+
lg: 6,
|
|
507
|
+
md: 6,
|
|
508
|
+
xs: 12,
|
|
509
|
+
className: `${t["btn-login-sso"]} pl-md-2`,
|
|
510
|
+
hidden: !(n != null && n.schoolId),
|
|
511
|
+
children: /* @__PURE__ */ c(
|
|
512
|
+
"div",
|
|
513
|
+
{
|
|
514
|
+
className: t["btn-login-with-sso"],
|
|
515
|
+
onClick: () => k(p),
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ e("img", { src: "images/microsoft-logo.png" }),
|
|
518
|
+
/* @__PURE__ */ e("p", { children: "MICROSOFT" })
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
] })
|
|
525
|
+
] })
|
|
526
|
+
}
|
|
527
|
+
) });
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
) });
|
|
531
|
+
}, ns = {
|
|
532
|
+
email: "",
|
|
533
|
+
captcha: ""
|
|
534
|
+
}, rs = "/", ce = "/login", is = "Log in", fe = () => {
|
|
535
|
+
const s = de(), a = me(), [n, d] = L(!1), g = C(() => {
|
|
536
|
+
d(!n);
|
|
537
|
+
}, [n]), [h, m] = L(!1), [l, k] = L(
|
|
538
|
+
!1
|
|
539
|
+
), [f, w] = L(!0), { executeRecaptcha: b } = he();
|
|
540
|
+
U(() => {
|
|
541
|
+
document.title = is, le() && a(rs);
|
|
542
|
+
}, []);
|
|
543
|
+
const p = C(async (N) => {
|
|
544
|
+
var y, I;
|
|
545
|
+
s($(!0));
|
|
546
|
+
try {
|
|
547
|
+
await Oe(N), a(ce), s(
|
|
548
|
+
G({
|
|
549
|
+
type: "success",
|
|
550
|
+
message: "A mail to reset password was sent"
|
|
551
|
+
})
|
|
552
|
+
);
|
|
553
|
+
} catch (u) {
|
|
554
|
+
s(
|
|
555
|
+
G({
|
|
556
|
+
type: "danger",
|
|
557
|
+
message: ((I = (y = u.response) == null ? void 0 : y.data) == null ? void 0 : I.title) || u.message || "Error occured"
|
|
558
|
+
})
|
|
559
|
+
), localStorage.removeItem(x), sessionStorage.removeItem(x);
|
|
560
|
+
}
|
|
561
|
+
s($(!1));
|
|
562
|
+
}, []), E = C(async (N) => {
|
|
563
|
+
s($(!0));
|
|
564
|
+
try {
|
|
565
|
+
await Ae(N);
|
|
566
|
+
} catch {
|
|
567
|
+
w(!1);
|
|
568
|
+
}
|
|
569
|
+
s($(!1));
|
|
570
|
+
}, []), S = C(async (N) => {
|
|
571
|
+
var y, I;
|
|
572
|
+
s($(!0));
|
|
573
|
+
try {
|
|
574
|
+
await Ge(N), a(ce), s(
|
|
575
|
+
G({
|
|
576
|
+
type: "success",
|
|
577
|
+
message: "Reset password sucessfully"
|
|
578
|
+
})
|
|
579
|
+
);
|
|
580
|
+
} catch (u) {
|
|
581
|
+
s(
|
|
582
|
+
G({
|
|
583
|
+
type: "danger",
|
|
584
|
+
message: ((I = (y = u.response) == null ? void 0 : y.data) == null ? void 0 : I.title) || u.message || "Error occured"
|
|
585
|
+
})
|
|
586
|
+
), localStorage.removeItem(x), sessionStorage.removeItem(x);
|
|
587
|
+
}
|
|
588
|
+
s($(!1));
|
|
589
|
+
}, []), v = C(async () => {
|
|
590
|
+
if (!b) {
|
|
591
|
+
console.log("execute recaptcha undefined");
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
return await b("forgetPass");
|
|
595
|
+
}, [b]), A = C(() => {
|
|
596
|
+
}, []);
|
|
597
|
+
return {
|
|
598
|
+
defaultInfo: ns,
|
|
599
|
+
forgotPasswordRequest: p,
|
|
600
|
+
checkResetTokenRequest: E,
|
|
601
|
+
validLink: f,
|
|
602
|
+
resetPasswordRequest: S,
|
|
603
|
+
openLogin: n,
|
|
604
|
+
toggle: g,
|
|
605
|
+
isShowNewPassword: h,
|
|
606
|
+
setIsShowNewPassword: m,
|
|
607
|
+
isShowReTypePassword: l,
|
|
608
|
+
setIsShowReTypePassword: k,
|
|
609
|
+
clickHandler: v,
|
|
610
|
+
handleVerify: A
|
|
611
|
+
};
|
|
612
|
+
}, cs = {
|
|
613
|
+
email: "",
|
|
614
|
+
captcha: ""
|
|
615
|
+
}, ls = T.object({
|
|
616
|
+
email: T.string().email("Email is invalid").required("Email is required")
|
|
617
|
+
}), ds = ({ school: s }) => {
|
|
618
|
+
const {
|
|
619
|
+
forgotPasswordRequest: a,
|
|
620
|
+
clickHandler: n,
|
|
621
|
+
handleVerify: d
|
|
622
|
+
} = fe();
|
|
623
|
+
return /* @__PURE__ */ e(
|
|
624
|
+
ae,
|
|
625
|
+
{
|
|
626
|
+
initialValues: cs,
|
|
627
|
+
enableReinitialize: !0,
|
|
628
|
+
validationSchema: ls,
|
|
629
|
+
onSubmit: async (g) => {
|
|
630
|
+
const h = await n();
|
|
631
|
+
h && (g.captcha = h, a(g));
|
|
632
|
+
},
|
|
633
|
+
children: (g) => {
|
|
634
|
+
const {
|
|
635
|
+
handleChange: h,
|
|
636
|
+
handleSubmit: m,
|
|
637
|
+
values: l,
|
|
638
|
+
touched: k,
|
|
639
|
+
errors: f
|
|
640
|
+
} = g;
|
|
641
|
+
return /* @__PURE__ */ e("div", { className: `${t["box-login"]}`, children: /* @__PURE__ */ e("div", { className: `${t["block-login"]}`, children: /* @__PURE__ */ c("div", { className: `${t["block-form"]}`, children: [
|
|
642
|
+
/* @__PURE__ */ c("div", { className: "d-flex align-items-center mb-4", children: [
|
|
643
|
+
/* @__PURE__ */ e(
|
|
644
|
+
"img",
|
|
645
|
+
{
|
|
646
|
+
src: `${te(
|
|
647
|
+
"/images/mario-logo.png"
|
|
648
|
+
)}`,
|
|
649
|
+
className: `${t["school-icon"]} mr-3`
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
/* @__PURE__ */ e(
|
|
653
|
+
"p",
|
|
654
|
+
{
|
|
655
|
+
className: `${t["school-name"]} mb-0`,
|
|
656
|
+
children: s.schoolName
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
] }),
|
|
660
|
+
/* @__PURE__ */ e("p", { className: `${t["title-login"]} `, children: "Forgot password" }),
|
|
661
|
+
/* @__PURE__ */ e(
|
|
662
|
+
"p",
|
|
663
|
+
{
|
|
664
|
+
className: `${t["recover-account"]} mb-5`,
|
|
665
|
+
children: "Enter email to recover your account"
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
/* @__PURE__ */ c("div", { className: "w-100", children: [
|
|
669
|
+
/* @__PURE__ */ e(
|
|
670
|
+
se,
|
|
671
|
+
{
|
|
672
|
+
type: "text",
|
|
673
|
+
name: "email",
|
|
674
|
+
id: "email",
|
|
675
|
+
placeholder: "Input email",
|
|
676
|
+
onChange: h,
|
|
677
|
+
value: l.email
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
k.email && f.email && /* @__PURE__ */ e(B, { text: f.email })
|
|
681
|
+
] }),
|
|
682
|
+
/* @__PURE__ */ e(
|
|
683
|
+
ge,
|
|
684
|
+
{
|
|
685
|
+
to: "/login",
|
|
686
|
+
className: `${t["link-to-login"]} mt-2`,
|
|
687
|
+
children: "Return to login"
|
|
688
|
+
}
|
|
689
|
+
),
|
|
690
|
+
/* @__PURE__ */ e(
|
|
691
|
+
ue,
|
|
692
|
+
{
|
|
693
|
+
action: "forgetPass",
|
|
694
|
+
onVerify: d
|
|
695
|
+
}
|
|
696
|
+
),
|
|
697
|
+
/* @__PURE__ */ e(_, { className: "p-0", children: /* @__PURE__ */ e(
|
|
698
|
+
"button",
|
|
699
|
+
{
|
|
700
|
+
className: `${t["btn-login"]} mt-5`,
|
|
701
|
+
onClick: () => m(),
|
|
702
|
+
children: "Continue"
|
|
703
|
+
}
|
|
704
|
+
) })
|
|
705
|
+
] }) }) });
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
}, ms = {
|
|
710
|
+
token: "",
|
|
711
|
+
password: "",
|
|
712
|
+
reEnterPassword: ""
|
|
713
|
+
}, gs = T.object({
|
|
714
|
+
password: T.string().required("New password is required"),
|
|
715
|
+
reEnterPassword: T.string().required("Please re-enter new password").test("matching", "Passwords do not match", function() {
|
|
716
|
+
return this.parent.password === this.parent.reEnterPassword;
|
|
717
|
+
})
|
|
718
|
+
}), hs = () => {
|
|
719
|
+
const a = new URLSearchParams(Ue().search).get("token"), {
|
|
720
|
+
checkResetTokenRequest: n,
|
|
721
|
+
validLink: d,
|
|
722
|
+
resetPasswordRequest: g,
|
|
723
|
+
isShowNewPassword: h,
|
|
724
|
+
setIsShowNewPassword: m,
|
|
725
|
+
isShowReTypePassword: l,
|
|
726
|
+
setIsShowReTypePassword: k
|
|
727
|
+
} = fe();
|
|
728
|
+
return U(() => {
|
|
729
|
+
n(a);
|
|
730
|
+
}, []), /* @__PURE__ */ e(
|
|
731
|
+
ae,
|
|
732
|
+
{
|
|
733
|
+
initialValues: ms,
|
|
734
|
+
enableReinitialize: !0,
|
|
735
|
+
validationSchema: gs,
|
|
736
|
+
onSubmit: (f) => {
|
|
737
|
+
g(f);
|
|
738
|
+
},
|
|
739
|
+
children: (f) => {
|
|
740
|
+
const {
|
|
741
|
+
setFieldValue: w,
|
|
742
|
+
handleSubmit: b,
|
|
743
|
+
touched: p,
|
|
744
|
+
errors: E
|
|
745
|
+
} = f;
|
|
746
|
+
return U(() => {
|
|
747
|
+
w("token", a);
|
|
748
|
+
}, []), /* @__PURE__ */ e(oe, { className: `${t["box-login"]}`, children: /* @__PURE__ */ e(_, { className: "p-0", children: /* @__PURE__ */ e("div", { className: `${t["block-login"]}`, children: /* @__PURE__ */ c("div", { className: `${t["block-form"]}`, children: [
|
|
749
|
+
/* @__PURE__ */ e("p", { className: `${t["title-login"]}`, children: "Reset Password" }),
|
|
750
|
+
/* @__PURE__ */ e("div", { className: "w-100", children: d ? /* @__PURE__ */ c(Q.Fragment, { children: [
|
|
751
|
+
/* @__PURE__ */ e(ie, { for: "emailForgot", className: "mb-3", children: "New password" }),
|
|
752
|
+
/* @__PURE__ */ e(
|
|
753
|
+
ee,
|
|
754
|
+
{
|
|
755
|
+
isShowPassword: h,
|
|
756
|
+
togglePasswordVisible: () => m(
|
|
757
|
+
!h
|
|
758
|
+
),
|
|
759
|
+
onChange: (S) => w(
|
|
760
|
+
"password",
|
|
761
|
+
S.target.value
|
|
762
|
+
)
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
p.password && E.password && /* @__PURE__ */ e(
|
|
766
|
+
B,
|
|
767
|
+
{
|
|
768
|
+
text: E.password
|
|
769
|
+
}
|
|
770
|
+
),
|
|
771
|
+
/* @__PURE__ */ e(ie, { for: "emailForgot", className: "mt-3 mb-3", children: "Re-enter new password" }),
|
|
772
|
+
/* @__PURE__ */ e(
|
|
773
|
+
ee,
|
|
774
|
+
{
|
|
775
|
+
isShowPassword: l,
|
|
776
|
+
togglePasswordVisible: () => k(
|
|
777
|
+
!l
|
|
778
|
+
),
|
|
779
|
+
onChange: (S) => w(
|
|
780
|
+
"reEnterPassword",
|
|
781
|
+
S.target.value
|
|
782
|
+
)
|
|
783
|
+
}
|
|
784
|
+
),
|
|
785
|
+
p.reEnterPassword && E.reEnterPassword && /* @__PURE__ */ e(
|
|
786
|
+
B,
|
|
787
|
+
{
|
|
788
|
+
text: E.reEnterPassword
|
|
789
|
+
}
|
|
790
|
+
)
|
|
791
|
+
] }) : /* @__PURE__ */ c(Q.Fragment, { children: [
|
|
792
|
+
/* @__PURE__ */ e(
|
|
793
|
+
"p",
|
|
794
|
+
{
|
|
795
|
+
className: `${t["recover-account"]} mb-5`,
|
|
796
|
+
children: "Invalid reset password link"
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
/* @__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" })
|
|
800
|
+
] }) }),
|
|
801
|
+
d && /* @__PURE__ */ e(_, { className: "p-0", children: /* @__PURE__ */ e(
|
|
802
|
+
"button",
|
|
803
|
+
{
|
|
804
|
+
className: `${t["btn-login"]} mt-4`,
|
|
805
|
+
onClick: () => b(),
|
|
806
|
+
children: "Confirm"
|
|
807
|
+
}
|
|
808
|
+
) }),
|
|
809
|
+
/* @__PURE__ */ c("p", { className: "d-flex justify-content-between", children: [
|
|
810
|
+
/* @__PURE__ */ e(
|
|
811
|
+
ge,
|
|
812
|
+
{
|
|
813
|
+
to: "/login",
|
|
814
|
+
className: `${t["link-to-login"]}`,
|
|
815
|
+
children: "Return to login"
|
|
816
|
+
}
|
|
817
|
+
),
|
|
818
|
+
/* @__PURE__ */ e(
|
|
819
|
+
"a",
|
|
820
|
+
{
|
|
821
|
+
href: "/privacy-policy/",
|
|
822
|
+
target: "blank",
|
|
823
|
+
className: `${t["link-to-login"]}`,
|
|
824
|
+
children: "Privacy Policy"
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
] })
|
|
828
|
+
] }) }) }) });
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
);
|
|
832
|
+
}, us = "Log in", ps = "Forgot password", fs = "Reset password", Ps = (s) => {
|
|
833
|
+
const {
|
|
834
|
+
isLogin: a,
|
|
835
|
+
isForgotPassword: n,
|
|
836
|
+
isResetPassword: d
|
|
837
|
+
// isLoginTwoFactor
|
|
838
|
+
} = s, { defaultInfo: g, userLogin: h, googleRecaptchaId: m, school: l } = pe();
|
|
839
|
+
return U(() => {
|
|
840
|
+
a && (document.title = us), n && (document.title = ps), d && (document.title = fs);
|
|
841
|
+
}, [a, n, d]), /* @__PURE__ */ e("div", { className: `${t.login} container-fluid font-family-lato`, children: /* @__PURE__ */ c(oe, { className: "h-100", children: [
|
|
842
|
+
/* @__PURE__ */ c(
|
|
843
|
+
_,
|
|
844
|
+
{
|
|
845
|
+
lg: 8,
|
|
846
|
+
md: 12,
|
|
847
|
+
xs: 12,
|
|
848
|
+
className: "d-flex justify-content-center h-100 align-items-center p-3 flex-column",
|
|
849
|
+
children: [
|
|
850
|
+
!!m && /* @__PURE__ */ c(
|
|
851
|
+
Fe,
|
|
852
|
+
{
|
|
853
|
+
useRecaptchaNet: !0,
|
|
854
|
+
reCaptchaKey: m,
|
|
855
|
+
scriptProps: {
|
|
856
|
+
async: !0,
|
|
857
|
+
defer: !0,
|
|
858
|
+
appendTo: "body"
|
|
859
|
+
},
|
|
860
|
+
children: [
|
|
861
|
+
a && /* @__PURE__ */ e(
|
|
862
|
+
as,
|
|
863
|
+
{
|
|
864
|
+
userLogin: h,
|
|
865
|
+
defaultInfo: g,
|
|
866
|
+
school: l
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
n && /* @__PURE__ */ e(ds, { school: l })
|
|
870
|
+
]
|
|
871
|
+
}
|
|
872
|
+
),
|
|
873
|
+
d && /* @__PURE__ */ e(hs, {}),
|
|
874
|
+
/* @__PURE__ */ e(
|
|
875
|
+
"a",
|
|
876
|
+
{
|
|
877
|
+
href: "/privacy-policy/",
|
|
878
|
+
target: "blank",
|
|
879
|
+
className: `${t["privacy-policy"]}`,
|
|
880
|
+
children: "Privacy Policy"
|
|
881
|
+
}
|
|
882
|
+
)
|
|
883
|
+
]
|
|
884
|
+
}
|
|
885
|
+
),
|
|
886
|
+
!d && /* @__PURE__ */ e(_, { className: "p-3 mh-100 d-flex justify-content-end", lg: 4, md: 12, xs: 12, children: /* @__PURE__ */ e(
|
|
887
|
+
"img",
|
|
888
|
+
{
|
|
889
|
+
src: `${te(window.innerWidth > 992 ? "/images/img-login.png" : "/images/img-login-tablet.png")}`,
|
|
890
|
+
className: `${t["img-login"]}`
|
|
891
|
+
}
|
|
892
|
+
) })
|
|
893
|
+
] }) });
|
|
894
|
+
};
|
|
895
|
+
export {
|
|
896
|
+
Ps as default
|
|
897
|
+
};
|