mario-core 2.0.2 → 2.0.3-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.
- package/dist/Dashboard-C8i4BvyG.js +1 -0
- package/dist/Dashboard-CZW-qGyN.mjs +206 -0
- package/dist/EmailTemplateDetail-CITCgbC8.mjs +417 -0
- package/dist/EmailTemplateDetail-mdYeUDJg.js +1 -0
- package/dist/EmailTemplateList-BV-QOv5K.mjs +168 -0
- package/dist/EmailTemplateList-Dgf0hucr.js +1 -0
- package/dist/GalleryList-BYwvWx1S.js +1 -0
- package/dist/GalleryList-JJbcEbTi.mjs +329 -0
- package/dist/Login-BWsVc8Np.mjs +1384 -0
- package/dist/Login-SxZya_gO.js +1 -0
- package/dist/NotificationList-BDtxAveg.js +2 -0
- package/dist/NotificationList-BFTZrMUI.mjs +3878 -0
- package/dist/SchoolList-CClJ_UPT.js +1 -0
- package/dist/SchoolList-JmrmL2zE.mjs +5 -0
- package/dist/SkillList-B8uw4QZF.mjs +386 -0
- package/dist/SkillList-D_tQAQqL.js +1 -0
- package/dist/TeacherSelector-BKSay316.mjs +30 -0
- package/dist/TeacherSelector-DXv_vBJI.js +1 -0
- package/dist/TheContent-CDVWxnOm.js +1 -0
- package/dist/TheContent-mTUR10lr.mjs +28 -0
- package/dist/UserContainer-CilrSMeD.mjs +2771 -0
- package/dist/UserContainer-DuoEITq2.js +5 -0
- package/dist/UserDetail-GaRReB9G.mjs +902 -0
- package/dist/UserDetail-qXX-264Q.js +1 -0
- package/dist/UserList-7gE8aU_I.js +5 -0
- package/dist/UserList-B7sk8bc6.mjs +1162 -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/Alerts/SandboxAlert.d.ts +3 -0
- package/dist/components/Buttons/AddButton.d.ts +7 -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 +7 -6
- package/dist/components/Buttons/DetailActionButtons.d.ts +8 -8
- package/dist/components/Buttons/EditButtonIcon.d.ts +7 -6
- package/dist/components/Buttons/LinkEditButton.d.ts +7 -7
- package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
- package/dist/components/Buttons/SyncButton.d.ts +8 -0
- 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 +9 -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 -0
- package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
- package/dist/components/Selectors/CategorySelector.d.ts +2 -0
- 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/Selectors/constants/constant.d.ts +10 -0
- package/dist/components/Selectors/hooks/useCategorySelector.d.ts +5 -0
- 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/constants-CGewtxeZ.mjs +320 -0
- package/dist/constants-CNvNsffe.js +1 -0
- 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 +7 -7
- package/dist/containers/EmailTemplate/components/MailParam.d.ts +7 -7
- package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +28 -28
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -12
- package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
- package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
- package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
- package/dist/containers/Gallery/components/Filter.d.ts +8 -8
- package/dist/containers/Gallery/components/Media.d.ts +7 -8
- package/dist/containers/Gallery/components/MediaDetail.d.ts +6 -7
- package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
- package/dist/containers/Gallery/components/MediaNav.d.ts +17 -18
- package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -20
- 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/constant/authConfig.d.ts +38 -0
- package/dist/containers/Login/constant/types.d.ts +34 -0
- package/dist/containers/Login/hooks/useCreatePassword.d.ts +12 -0
- package/dist/containers/Login/hooks/useForgotPassword.d.ts +22 -21
- package/dist/containers/Login/hooks/useLogin.d.ts +29 -16
- 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 +9 -9
- package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
- package/dist/containers/Login/views/block/BlockCreatePassword.d.ts +2 -0
- package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
- package/dist/containers/Login/views/block/BlockLogin.d.ts +21 -7
- package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
- package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +10 -0
- 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 -7
- 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 -14
- 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 +9 -10
- package/dist/containers/Skill/views/SkillList.d.ts +3 -3
- package/dist/containers/User/components/AssignStudentModal.d.ts +20 -0
- package/dist/containers/User/components/DeleteBulkModel copy.d.ts +4 -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/RemoveSupportTeacher.d.ts +3 -0
- package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
- package/dist/containers/User/components/SwitchDataTeacherModel.d.ts +12 -0
- package/dist/containers/User/components/SwitchTeacherModal.d.ts +2 -0
- package/dist/containers/User/components/TableHeader.d.ts +15 -0
- package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
- package/dist/containers/User/components/UploadCSVButton.d.ts +11 -0
- package/dist/containers/User/components/UserDeletedModal.d.ts +2 -0
- package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -0
- package/dist/containers/User/configs/userSchema.d.ts +13 -15
- package/dist/containers/User/configs/utils.d.ts +8 -0
- package/dist/containers/User/constants/constants.d.ts +63 -0
- package/dist/containers/User/constants/types.d.ts +265 -0
- package/dist/containers/User/hooks/useAssignStudent.d.ts +44 -0
- package/dist/containers/User/hooks/useAssignStudentList.d.ts +36 -0
- package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
- package/dist/containers/User/hooks/useCSVImport.d.ts +37 -0
- package/dist/containers/User/hooks/useCSVImportTab.d.ts +45 -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/useExportUsersCsv.d.ts +5 -0
- package/dist/containers/User/hooks/useFilterPopover.d.ts +37 -0
- package/dist/containers/User/hooks/useResendMail.d.ts +5 -0
- package/dist/containers/User/hooks/useRosterUserSelector.d.ts +8 -0
- package/dist/containers/User/hooks/useSecondaryTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useTableHeader.d.ts +20 -0
- package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useUserDeletedList.d.ts +21 -0
- package/dist/containers/User/hooks/useUserDeletedModal.d.ts +13 -0
- package/dist/containers/User/hooks/useUserDetail.d.ts +41 -22
- package/dist/containers/User/hooks/useUserList.d.ts +18 -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/CSVImport.d.ts +3 -0
- package/dist/containers/User/views/RosterUserSelector.d.ts +8 -0
- package/dist/containers/User/views/UserContainer.d.ts +2 -0
- package/dist/containers/User/views/UserDeletedList.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/useFilters.d.ts +7 -0
- package/dist/hooks/useLanguages.d.ts +9 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index-B4U_4-fu.js +15 -0
- package/dist/index-CFvswiRi.mjs +17591 -0
- package/dist/index.css +1037 -296
- package/dist/index.d.ts +114 -101
- package/dist/index.esm-B63qcj54.js +1 -0
- package/dist/index.esm-D6Zacg53.mjs +19 -0
- package/dist/index.js +24 -7493
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +28540 -6956
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/TheContent.d.ts +2 -3
- package/dist/mailCategoryService-CEgGm2FV.js +1 -0
- package/dist/mailCategoryService-Dis1n9kR.mjs +11 -0
- package/dist/mario-core.css +1 -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 +23 -8
- 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 -4
- 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 -0
- package/dist/redux/navMobile/reducer.d.ts +4 -0
- 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 -4
- 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/weeklyQuests/action.d.ts +2 -0
- package/dist/redux/weeklyQuests/reducer.d.ts +12 -0
- package/dist/redux/widget/action.d.ts +1 -1
- package/dist/redux/widget/reducer.d.ts +4 -2
- package/dist/rootReducer.d.ts +106 -48
- package/dist/services/accountService.d.ts +22 -8
- package/dist/services/api.d.ts +3 -3
- package/dist/services/classService.d.ts +1 -1
- package/dist/services/csvImportService.d.ts +9 -0
- package/dist/services/csvService.d.ts +8 -0
- package/dist/services/emailTemplateService.d.ts +7 -6
- package/dist/services/fileServices.d.ts +13 -13
- package/dist/services/galleryService.d.ts +2 -2
- package/dist/services/mailCategoryService.d.ts +1 -1
- package/dist/services/notificationService.d.ts +7 -6
- package/dist/services/questionCategoryService.d.ts +3 -1
- package/dist/services/schoolService.d.ts +2 -0
- package/dist/services/skillService.d.ts +6 -6
- package/dist/services/suggestionCategoryService.d.ts +1 -1
- package/dist/services/userService.d.ts +37 -7
- 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 +16 -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/types/Payload.d.ts +17 -0
- package/dist/types/user.d.ts +3 -0
- package/dist/types-BvnbDeJF.mjs +5 -0
- package/dist/types-CTFcZUFS.js +1 -0
- package/dist/utils/canAccessRoute.d.ts +2 -2
- package/dist/utils/constants.d.ts +87 -57
- 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 +1 -2
- package/package.json +79 -63
- package/dist/components/Alerts/ReactNotification.d.ts +0 -4
- package/dist/containers/Faq/components/FaqDetailModal.d.ts +0 -3
- package/dist/containers/Faq/hooks/useFaqDetail.d.ts +0 -18
- package/dist/containers/Faq/hooks/useFaqList.d.ts +0 -10
- package/dist/containers/Faq/views/FaqList.d.ts +0 -3
- 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/TheLayout.d.ts +0 -3
- package/dist/layouts/TheSidebar.d.ts +0 -3
- package/dist/services/faqService.d.ts +0 -6
|
@@ -0,0 +1,1384 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as L, Fragment as te, useState as E, useEffect as V } from "react";
|
|
3
|
+
import { Input as Q, Form as Me, FormGroup as Y, Row as ie, Col as F } from "reactstrap";
|
|
4
|
+
import { Link as Ee, useLocation as Ve, useNavigate as ue } from "react-router-dom";
|
|
5
|
+
import { s as o, E as z, a as Le, A as qe, g as ne, b as f, f as Be, c as $, d as T, e as Fe, r as He, h as J, i as Ce, B as De, j as oe, k as ze, l as je, m as We, n as Ke, I as he, N as Ye, o as Je, p as Ze, q as Qe, t as Xe, u as es, v as ge, w as ye, x as ss, y as os, z as as } from "./index-CFvswiRi.mjs";
|
|
6
|
+
import { useDispatch as re, useSelector as Ie } from "react-redux";
|
|
7
|
+
import { Formik as le } from "formik";
|
|
8
|
+
import * as A from "yup";
|
|
9
|
+
import { useGoogleReCaptcha as pe, GoogleReCaptcha as Re, GoogleReCaptchaProvider as ts } from "react-google-recaptcha-v3";
|
|
10
|
+
import { GoogleOAuthProvider as ns, useGoogleLogin as is } from "@react-oauth/google";
|
|
11
|
+
import { L as ae, T as Te } from "./types-BvnbDeJF.mjs";
|
|
12
|
+
import { LogLevel as se, PublicClientApplication as rs } from "@azure/msal-browser";
|
|
13
|
+
import * as K from "@amplitude/analytics-browser";
|
|
14
|
+
const ls = {
|
|
15
|
+
height: "40px",
|
|
16
|
+
backgroundColor: "#f7f9fc",
|
|
17
|
+
borderRadius: "4px",
|
|
18
|
+
marginBottom: "5px",
|
|
19
|
+
position: "relative"
|
|
20
|
+
}, cs = {
|
|
21
|
+
backgroundColor: "#ffffff",
|
|
22
|
+
paddingRight: "50px"
|
|
23
|
+
}, ds = {
|
|
24
|
+
fontSize: "20px",
|
|
25
|
+
position: "absolute",
|
|
26
|
+
right: "10px",
|
|
27
|
+
color: "#316CD9"
|
|
28
|
+
}, ms = (a) => a.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (t, r) => r.toUpperCase()), Z = ({
|
|
29
|
+
isShowPassword: a,
|
|
30
|
+
togglePasswordVisible: t,
|
|
31
|
+
onChange: r,
|
|
32
|
+
placeholder: n
|
|
33
|
+
}) => /* @__PURE__ */ l("div", { className: "d-flex align-items-center w-100", style: ls, children: [
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
Q,
|
|
36
|
+
{
|
|
37
|
+
className: "border password-input",
|
|
38
|
+
style: cs,
|
|
39
|
+
type: a ? "text" : "password",
|
|
40
|
+
name: "password",
|
|
41
|
+
onChange: r,
|
|
42
|
+
placeholder: n || "Password",
|
|
43
|
+
autocomplete: n ? ms(n) : "password",
|
|
44
|
+
required: !0
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
"i",
|
|
49
|
+
{
|
|
50
|
+
className: `far ${a ? "fa-eye-slash" : "fa-eye"} mx-2 cursor-pointer`,
|
|
51
|
+
style: ds,
|
|
52
|
+
onClick: () => t(),
|
|
53
|
+
title: a ? "Hide" : "Show"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }), gs = A.object({
|
|
57
|
+
email: A.string().email("Email is invalid").required("Email is required"),
|
|
58
|
+
password: A.string().required("Password is required"),
|
|
59
|
+
rememberMe: A.boolean()
|
|
60
|
+
}), hs = ({ onSuccess: a, onError: t }) => {
|
|
61
|
+
const r = is({
|
|
62
|
+
onSuccess: async (n) => {
|
|
63
|
+
try {
|
|
64
|
+
const i = await fetch("https://www.googleapis.com/oauth2/v3/userinfo", {
|
|
65
|
+
headers: { Authorization: `Bearer ${n.access_token}` }
|
|
66
|
+
}).then((u) => u.json()), h = {
|
|
67
|
+
accessToken: n.access_token,
|
|
68
|
+
googleId: i.sub,
|
|
69
|
+
profileObj: {
|
|
70
|
+
email: i.email,
|
|
71
|
+
familyName: i.family_name,
|
|
72
|
+
givenName: i.given_name,
|
|
73
|
+
imageUrl: i.picture,
|
|
74
|
+
name: i.name
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
a(h);
|
|
78
|
+
} catch (i) {
|
|
79
|
+
t(i);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
onError: (n) => t(n)
|
|
83
|
+
});
|
|
84
|
+
return /* @__PURE__ */ l("div", { className: o["btn-login-with-sso"], onClick: () => r(), children: [
|
|
85
|
+
/* @__PURE__ */ l("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", width: "24px", height: "24px", style: { marginRight: "8px" }, children: [
|
|
86
|
+
/* @__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" }),
|
|
87
|
+
/* @__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" }),
|
|
88
|
+
/* @__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" }),
|
|
89
|
+
/* @__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" }),
|
|
90
|
+
/* @__PURE__ */ e("path", { fill: "none", d: "M0 0h48v48H0z" })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ e("p", { children: "GOOGLE" })
|
|
93
|
+
] });
|
|
94
|
+
}, us = ({
|
|
95
|
+
defaultInfo: a,
|
|
96
|
+
userLogin: t,
|
|
97
|
+
school: r,
|
|
98
|
+
isShowPassword: n,
|
|
99
|
+
setIsShowPassword: i,
|
|
100
|
+
fnIsCheckLogin: h,
|
|
101
|
+
// isLoginGoogle,
|
|
102
|
+
// submitLogin,
|
|
103
|
+
// infoUser,
|
|
104
|
+
googleClientId: u,
|
|
105
|
+
fnLoginSSO: w,
|
|
106
|
+
extensionEmail: k,
|
|
107
|
+
onLoginWidthClever: S
|
|
108
|
+
}) => {
|
|
109
|
+
const y = () => i(!n), c = re(), { executeRecaptcha: p } = pe(), C = L(async () => {
|
|
110
|
+
if (!p) {
|
|
111
|
+
console.log("execute recaptcha undefined");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
return await p("login");
|
|
115
|
+
}, [p]), U = L(() => {
|
|
116
|
+
}, []), O = async (d) => {
|
|
117
|
+
try {
|
|
118
|
+
await qe(d);
|
|
119
|
+
} catch (N) {
|
|
120
|
+
console.error(N);
|
|
121
|
+
}
|
|
122
|
+
}, P = async (d) => {
|
|
123
|
+
if (d?.accessToken) {
|
|
124
|
+
let {
|
|
125
|
+
email: N,
|
|
126
|
+
familyName: x,
|
|
127
|
+
givenName: _,
|
|
128
|
+
imageUrl: M,
|
|
129
|
+
name: R
|
|
130
|
+
// fullName
|
|
131
|
+
} = d.profileObj, I = d.accessToken, G = d.googleId;
|
|
132
|
+
const j = window.location.hostname.split(".marioforme.com")?.[0], H = N.split("@")?.[1], ce = k?.split(",")?.map((D) => D.trim())?.filter((D) => D).some((D) => H.includes(D));
|
|
133
|
+
if (!H.includes(j) && !ce) {
|
|
134
|
+
alert(
|
|
135
|
+
"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"
|
|
136
|
+
), await O([`${H} is incorrect`]);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const q = {
|
|
140
|
+
firstName: _,
|
|
141
|
+
lastName: x,
|
|
142
|
+
imageUrl: M,
|
|
143
|
+
fullName: R,
|
|
144
|
+
email: N,
|
|
145
|
+
accessToken: I,
|
|
146
|
+
googleId: G
|
|
147
|
+
};
|
|
148
|
+
c(Le(q)), h(
|
|
149
|
+
Te.Google,
|
|
150
|
+
q,
|
|
151
|
+
I,
|
|
152
|
+
C
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
157
|
+
le,
|
|
158
|
+
{
|
|
159
|
+
initialValues: a,
|
|
160
|
+
validationSchema: gs,
|
|
161
|
+
onSubmit: async (d) => {
|
|
162
|
+
try {
|
|
163
|
+
const N = await C();
|
|
164
|
+
if (!N) return;
|
|
165
|
+
d.captcha = N, d.loginType = ae.Default, t(d);
|
|
166
|
+
} catch (N) {
|
|
167
|
+
console.error(N);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
children: (d) => {
|
|
171
|
+
const {
|
|
172
|
+
handleChange: N,
|
|
173
|
+
handleBlur: x,
|
|
174
|
+
handleSubmit: _,
|
|
175
|
+
values: M,
|
|
176
|
+
touched: R,
|
|
177
|
+
errors: I,
|
|
178
|
+
setFieldValue: G
|
|
179
|
+
} = d, X = R.email && I.email, j = R.password && I.password;
|
|
180
|
+
return /* @__PURE__ */ e("div", { className: `${o["box-login"]} w-100`, children: /* @__PURE__ */ e(
|
|
181
|
+
Me,
|
|
182
|
+
{
|
|
183
|
+
className: `${o["block-login"]}`,
|
|
184
|
+
onSubmit: _,
|
|
185
|
+
children: /* @__PURE__ */ l("div", { className: `${o["block-form"]}`, children: [
|
|
186
|
+
/* @__PURE__ */ l("div", { className: "d-flex align-items-center mb-4", children: [
|
|
187
|
+
/* @__PURE__ */ e(
|
|
188
|
+
"img",
|
|
189
|
+
{
|
|
190
|
+
hidden: !r?.schoolLogo,
|
|
191
|
+
src: r?.schoolLogo,
|
|
192
|
+
className: `${o["school-icon"]} mr-3`
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ e(
|
|
196
|
+
"p",
|
|
197
|
+
{
|
|
198
|
+
className: `${o["school-name"]} mb-0`,
|
|
199
|
+
children: r.schoolName
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ e("p", { className: `${o["title-login"]}`, children: "Welcome Back!" }),
|
|
204
|
+
/* @__PURE__ */ e(
|
|
205
|
+
"p",
|
|
206
|
+
{
|
|
207
|
+
className: `${o["login-description"]} mb-5`,
|
|
208
|
+
children: "Please enter your MARIO Education account details"
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ l(
|
|
212
|
+
Y,
|
|
213
|
+
{
|
|
214
|
+
className: `${o["form-user-name"]}`,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ e(
|
|
217
|
+
Q,
|
|
218
|
+
{
|
|
219
|
+
type: "text",
|
|
220
|
+
name: "email",
|
|
221
|
+
placeholder: "Email",
|
|
222
|
+
value: M.email,
|
|
223
|
+
onChange: N,
|
|
224
|
+
autocomplete: "email",
|
|
225
|
+
onBlur: x("email"),
|
|
226
|
+
required: !0
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
X && /* @__PURE__ */ e(
|
|
230
|
+
z,
|
|
231
|
+
{
|
|
232
|
+
text: I.email
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ l(Y, { children: [
|
|
239
|
+
/* @__PURE__ */ e(
|
|
240
|
+
Z,
|
|
241
|
+
{
|
|
242
|
+
isShowPassword: n,
|
|
243
|
+
togglePasswordVisible: y,
|
|
244
|
+
onChange: (H) => G(
|
|
245
|
+
"password",
|
|
246
|
+
H.target.value
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
j && /* @__PURE__ */ e(
|
|
251
|
+
z,
|
|
252
|
+
{
|
|
253
|
+
text: I.password
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(
|
|
258
|
+
Re,
|
|
259
|
+
{
|
|
260
|
+
action: "login",
|
|
261
|
+
onVerify: U
|
|
262
|
+
}
|
|
263
|
+
) }),
|
|
264
|
+
/* @__PURE__ */ l("div", { className: "d-flex justify-content-between", children: [
|
|
265
|
+
/* @__PURE__ */ l("div", { className: "d-flex align-items-center", style: { gap: "8px" }, children: [
|
|
266
|
+
/* @__PURE__ */ e(
|
|
267
|
+
"input",
|
|
268
|
+
{
|
|
269
|
+
type: "checkbox",
|
|
270
|
+
checked: !M.isSessionUserBrowser,
|
|
271
|
+
className: `${o["checkbox-keep-login"]}`,
|
|
272
|
+
onChange: () => G(
|
|
273
|
+
"isSessionUserBrowser",
|
|
274
|
+
!M.isSessionUserBrowser
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ e(
|
|
279
|
+
"p",
|
|
280
|
+
{
|
|
281
|
+
className: `${o["label-keep-login"]} mb-0 ml-2`,
|
|
282
|
+
children: "Keep me logged in"
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ e(
|
|
287
|
+
Ee,
|
|
288
|
+
{
|
|
289
|
+
to: "/forgot-password",
|
|
290
|
+
className: `${o["link-to-login"]}`,
|
|
291
|
+
children: "Forgot password?"
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
] }),
|
|
295
|
+
/* @__PURE__ */ e(
|
|
296
|
+
"button",
|
|
297
|
+
{
|
|
298
|
+
className: `${o["btn-login"]} mt-5`,
|
|
299
|
+
type: "submit",
|
|
300
|
+
children: "LOG IN"
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ e(
|
|
304
|
+
"p",
|
|
305
|
+
{
|
|
306
|
+
className: `${o["option-text"]} my-3 text-center`,
|
|
307
|
+
children: "OR"
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ l(ie, { className: "mb-4", children: [
|
|
311
|
+
/* @__PURE__ */ e(
|
|
312
|
+
F,
|
|
313
|
+
{
|
|
314
|
+
lg: 6,
|
|
315
|
+
md: 6,
|
|
316
|
+
xs: 12,
|
|
317
|
+
className: "pr-md-3",
|
|
318
|
+
children: !!u && /* @__PURE__ */ e(
|
|
319
|
+
ns,
|
|
320
|
+
{
|
|
321
|
+
clientId: u,
|
|
322
|
+
children: /* @__PURE__ */ e(
|
|
323
|
+
hs,
|
|
324
|
+
{
|
|
325
|
+
onSuccess: P,
|
|
326
|
+
onError: () => console.log("Google login failed")
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
),
|
|
333
|
+
/* @__PURE__ */ e(
|
|
334
|
+
F,
|
|
335
|
+
{
|
|
336
|
+
lg: 6,
|
|
337
|
+
md: 6,
|
|
338
|
+
xs: 12,
|
|
339
|
+
className: `${o["btn-login-sso"]} pl-md-2`,
|
|
340
|
+
hidden: !r?.schoolId,
|
|
341
|
+
children: /* @__PURE__ */ l(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
className: o["btn-login-with-sso"],
|
|
345
|
+
onClick: () => w(C),
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ e("img", { src: "images/microsoft-logo.png" }),
|
|
348
|
+
/* @__PURE__ */ e("p", { children: "MICROSOFT" })
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
)
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ e(
|
|
356
|
+
"div",
|
|
357
|
+
{
|
|
358
|
+
className: `${o["btn-login-sso"]}`,
|
|
359
|
+
children: /* @__PURE__ */ l(
|
|
360
|
+
"div",
|
|
361
|
+
{
|
|
362
|
+
className: o["btn-login-with-sso"],
|
|
363
|
+
onClick: () => window.open(
|
|
364
|
+
"https://launchpad.classlink.com/login"
|
|
365
|
+
),
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ e("img", { src: "images/class-link-icon.png" }),
|
|
368
|
+
/* @__PURE__ */ e("p", { children: "SIGN IN WITH CLASSLINK" })
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ e(
|
|
375
|
+
"div",
|
|
376
|
+
{
|
|
377
|
+
className: `${o["btn-login-sso"]} mt-4`,
|
|
378
|
+
children: /* @__PURE__ */ l(
|
|
379
|
+
"div",
|
|
380
|
+
{
|
|
381
|
+
className: o["btn-login-with-sso"],
|
|
382
|
+
onClick: () => S(),
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ e("img", { src: "images/clever-icon.png" }),
|
|
385
|
+
/* @__PURE__ */ e("p", { children: "SIGN IN WITH CLEVER" })
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
] })
|
|
392
|
+
}
|
|
393
|
+
) });
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
) });
|
|
397
|
+
}, ps = {
|
|
398
|
+
email: "",
|
|
399
|
+
captcha: ""
|
|
400
|
+
}, fs = "/", be = "/login", ws = "Log in", $e = () => {
|
|
401
|
+
const a = new URLSearchParams(Ve().search), t = a.get("token"), r = a.get("key") ?? "", n = re(), i = ue(), [h, u] = E(!1), w = L(() => {
|
|
402
|
+
u(!h);
|
|
403
|
+
}, [h]), [k, S] = E(!1), [y, c] = E(!1), [p, C] = E({
|
|
404
|
+
token: "",
|
|
405
|
+
password: "",
|
|
406
|
+
reEnterPassword: "",
|
|
407
|
+
email: "",
|
|
408
|
+
userId: ""
|
|
409
|
+
}), [U, O] = E(!0), { executeRecaptcha: P } = pe();
|
|
410
|
+
V(() => {
|
|
411
|
+
document.title = ws, ne() && i(fs);
|
|
412
|
+
}, []);
|
|
413
|
+
const d = L(async (R) => {
|
|
414
|
+
n(f(!0));
|
|
415
|
+
try {
|
|
416
|
+
await Be(R), i(be), n(
|
|
417
|
+
$({
|
|
418
|
+
type: "success",
|
|
419
|
+
message: "A mail to reset password was sent"
|
|
420
|
+
})
|
|
421
|
+
);
|
|
422
|
+
} catch (I) {
|
|
423
|
+
n(
|
|
424
|
+
$({
|
|
425
|
+
type: "danger",
|
|
426
|
+
message: I.response?.data?.title || I.message || "Error occured"
|
|
427
|
+
})
|
|
428
|
+
), localStorage.removeItem(T), sessionStorage.removeItem(T);
|
|
429
|
+
}
|
|
430
|
+
n(f(!1));
|
|
431
|
+
}, []), N = L(
|
|
432
|
+
async (R, I) => {
|
|
433
|
+
n(f(!0));
|
|
434
|
+
try {
|
|
435
|
+
const G = await Fe(R, I);
|
|
436
|
+
G.data ? C({
|
|
437
|
+
...p,
|
|
438
|
+
token: R,
|
|
439
|
+
email: G.data
|
|
440
|
+
}) : O(!1);
|
|
441
|
+
} catch {
|
|
442
|
+
O(!1);
|
|
443
|
+
}
|
|
444
|
+
n(f(!1));
|
|
445
|
+
},
|
|
446
|
+
[]
|
|
447
|
+
), x = L(async (R) => {
|
|
448
|
+
n(f(!0));
|
|
449
|
+
try {
|
|
450
|
+
await He({ ...R, key: r }), i(be), n(
|
|
451
|
+
$({
|
|
452
|
+
type: "success",
|
|
453
|
+
message: "Reset password sucessfully"
|
|
454
|
+
})
|
|
455
|
+
);
|
|
456
|
+
} catch (I) {
|
|
457
|
+
n(
|
|
458
|
+
$({
|
|
459
|
+
type: "danger",
|
|
460
|
+
message: I.response?.data?.title || I.message || "Error occured"
|
|
461
|
+
})
|
|
462
|
+
), localStorage.removeItem(T), sessionStorage.removeItem(T);
|
|
463
|
+
}
|
|
464
|
+
n(f(!1));
|
|
465
|
+
}, []), _ = L(async () => {
|
|
466
|
+
if (!P) {
|
|
467
|
+
console.log("execute recaptcha undefined");
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
return await P("forgetPass");
|
|
471
|
+
}, [P]), M = L(() => {
|
|
472
|
+
}, []);
|
|
473
|
+
return V(() => {
|
|
474
|
+
N(t, r);
|
|
475
|
+
}, []), {
|
|
476
|
+
defaultInfo: ps,
|
|
477
|
+
forgotPasswordRequest: d,
|
|
478
|
+
checkResetTokenRequest: N,
|
|
479
|
+
validLink: U,
|
|
480
|
+
resetPasswordRequest: x,
|
|
481
|
+
openLogin: h,
|
|
482
|
+
toggle: w,
|
|
483
|
+
isShowNewPassword: k,
|
|
484
|
+
setIsShowNewPassword: S,
|
|
485
|
+
isShowReTypePassword: y,
|
|
486
|
+
setIsShowReTypePassword: c,
|
|
487
|
+
clickHandler: _,
|
|
488
|
+
handleVerify: M,
|
|
489
|
+
initialValues: p
|
|
490
|
+
};
|
|
491
|
+
}, Ss = {
|
|
492
|
+
email: "",
|
|
493
|
+
captcha: ""
|
|
494
|
+
}, Ns = A.object({
|
|
495
|
+
email: A.string().email("Email is invalid").required("Email is required")
|
|
496
|
+
}), ys = ({ school: a }) => {
|
|
497
|
+
const {
|
|
498
|
+
forgotPasswordRequest: t,
|
|
499
|
+
clickHandler: r,
|
|
500
|
+
handleVerify: n
|
|
501
|
+
} = $e();
|
|
502
|
+
return /* @__PURE__ */ e(
|
|
503
|
+
le,
|
|
504
|
+
{
|
|
505
|
+
initialValues: Ss,
|
|
506
|
+
enableReinitialize: !0,
|
|
507
|
+
validationSchema: Ns,
|
|
508
|
+
onSubmit: async (i) => {
|
|
509
|
+
const h = await r();
|
|
510
|
+
h && (i.captcha = h, t(i));
|
|
511
|
+
},
|
|
512
|
+
children: (i) => {
|
|
513
|
+
const {
|
|
514
|
+
handleChange: h,
|
|
515
|
+
handleSubmit: u,
|
|
516
|
+
values: w,
|
|
517
|
+
touched: k,
|
|
518
|
+
errors: S
|
|
519
|
+
} = i;
|
|
520
|
+
return /* @__PURE__ */ e("div", { className: `${o["box-login"]}`, children: /* @__PURE__ */ e("div", { className: `${o["block-login"]}`, children: /* @__PURE__ */ l("div", { className: `${o["block-form"]}`, children: [
|
|
521
|
+
/* @__PURE__ */ l("div", { className: "d-flex align-items-center mb-4", children: [
|
|
522
|
+
/* @__PURE__ */ e(
|
|
523
|
+
"img",
|
|
524
|
+
{
|
|
525
|
+
src: a.schoolLogo,
|
|
526
|
+
className: `${o["school-icon"]} mr-3`
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ e(
|
|
530
|
+
"p",
|
|
531
|
+
{
|
|
532
|
+
className: `${o["school-name"]} mb-0`,
|
|
533
|
+
children: a.schoolName
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
] }),
|
|
537
|
+
/* @__PURE__ */ e("p", { className: `${o["title-login"]} `, children: "Forgot password" }),
|
|
538
|
+
/* @__PURE__ */ e(
|
|
539
|
+
"p",
|
|
540
|
+
{
|
|
541
|
+
className: `${o["recover-account"]} mb-5`,
|
|
542
|
+
children: "Enter email to recover your account"
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
/* @__PURE__ */ l("div", { className: "w-100", children: [
|
|
546
|
+
/* @__PURE__ */ e(
|
|
547
|
+
Q,
|
|
548
|
+
{
|
|
549
|
+
type: "text",
|
|
550
|
+
name: "email",
|
|
551
|
+
id: "email",
|
|
552
|
+
placeholder: "Input email",
|
|
553
|
+
onChange: h,
|
|
554
|
+
value: w.email
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
k.email && S.email && /* @__PURE__ */ e(z, { text: S.email })
|
|
558
|
+
] }),
|
|
559
|
+
/* @__PURE__ */ e(
|
|
560
|
+
Ee,
|
|
561
|
+
{
|
|
562
|
+
to: "/login",
|
|
563
|
+
className: `${o["link-to-login"]} mt-2`,
|
|
564
|
+
children: "Return to login"
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ e(
|
|
568
|
+
Re,
|
|
569
|
+
{
|
|
570
|
+
action: "forgetPass",
|
|
571
|
+
onVerify: n
|
|
572
|
+
}
|
|
573
|
+
),
|
|
574
|
+
/* @__PURE__ */ e(F, { className: "p-0", children: /* @__PURE__ */ e(
|
|
575
|
+
"button",
|
|
576
|
+
{
|
|
577
|
+
className: `${o["btn-login"]} mt-5`,
|
|
578
|
+
onClick: () => u(),
|
|
579
|
+
children: "Continue"
|
|
580
|
+
}
|
|
581
|
+
) })
|
|
582
|
+
] }) }) });
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
}, Is = A.object({
|
|
587
|
+
password: A.string().required("New password is required"),
|
|
588
|
+
reEnterPassword: A.string().required("Please re-enter new password").test("matching", "Passwords do not match", function() {
|
|
589
|
+
return this.parent.password === this.parent.reEnterPassword;
|
|
590
|
+
})
|
|
591
|
+
}), bs = () => {
|
|
592
|
+
const {
|
|
593
|
+
validLink: a,
|
|
594
|
+
resetPasswordRequest: t,
|
|
595
|
+
isShowNewPassword: r,
|
|
596
|
+
setIsShowNewPassword: n,
|
|
597
|
+
isShowReTypePassword: i,
|
|
598
|
+
setIsShowReTypePassword: h,
|
|
599
|
+
initialValues: u
|
|
600
|
+
} = $e();
|
|
601
|
+
return /* @__PURE__ */ e(
|
|
602
|
+
le,
|
|
603
|
+
{
|
|
604
|
+
initialValues: u,
|
|
605
|
+
enableReinitialize: !0,
|
|
606
|
+
validationSchema: Is,
|
|
607
|
+
onSubmit: (w) => {
|
|
608
|
+
t(w);
|
|
609
|
+
},
|
|
610
|
+
children: (w) => {
|
|
611
|
+
const { setFieldValue: k, handleSubmit: S, touched: y, errors: c, values: p } = w;
|
|
612
|
+
return /* @__PURE__ */ e(ie, { className: `${o["box-login"]}`, children: /* @__PURE__ */ e(F, { className: "p-0", children: /* @__PURE__ */ e("div", { className: `${o["block-login"]}`, children: /* @__PURE__ */ l("div", { className: `${o["block-form"]}`, children: [
|
|
613
|
+
/* @__PURE__ */ e(
|
|
614
|
+
"img",
|
|
615
|
+
{
|
|
616
|
+
src: `${J(
|
|
617
|
+
"/images/horizontal-logo-blue.svg"
|
|
618
|
+
)}`,
|
|
619
|
+
className: `${o["img-login-rectangle"]}`
|
|
620
|
+
}
|
|
621
|
+
),
|
|
622
|
+
/* @__PURE__ */ e("p", { className: `${o["title-login"]}`, children: "Reset Password" }),
|
|
623
|
+
/* @__PURE__ */ e("div", { className: "w-100", children: a ? /* @__PURE__ */ l(te, { children: [
|
|
624
|
+
/* @__PURE__ */ e(
|
|
625
|
+
Y,
|
|
626
|
+
{
|
|
627
|
+
className: `${o["form-user-name"]}`,
|
|
628
|
+
children: /* @__PURE__ */ e(
|
|
629
|
+
Q,
|
|
630
|
+
{
|
|
631
|
+
disabled: !0,
|
|
632
|
+
type: "text",
|
|
633
|
+
name: "email",
|
|
634
|
+
placeholder: "Email",
|
|
635
|
+
value: p.email,
|
|
636
|
+
autocomplete: "email",
|
|
637
|
+
required: !0,
|
|
638
|
+
className: `${o.input}`
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
/* @__PURE__ */ l(
|
|
644
|
+
"div",
|
|
645
|
+
{
|
|
646
|
+
className: `${o["form-user-name"]}`,
|
|
647
|
+
children: [
|
|
648
|
+
/* @__PURE__ */ e(
|
|
649
|
+
Z,
|
|
650
|
+
{
|
|
651
|
+
isShowPassword: r,
|
|
652
|
+
togglePasswordVisible: () => n(
|
|
653
|
+
!r
|
|
654
|
+
),
|
|
655
|
+
onChange: (C) => k(
|
|
656
|
+
"password",
|
|
657
|
+
C.target.value
|
|
658
|
+
)
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
y.password && c.password && /* @__PURE__ */ e(
|
|
662
|
+
z,
|
|
663
|
+
{
|
|
664
|
+
text: c.password
|
|
665
|
+
}
|
|
666
|
+
)
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
),
|
|
670
|
+
/* @__PURE__ */ l(
|
|
671
|
+
"div",
|
|
672
|
+
{
|
|
673
|
+
className: `${o["form-user-name"]}`,
|
|
674
|
+
children: [
|
|
675
|
+
/* @__PURE__ */ e(
|
|
676
|
+
Z,
|
|
677
|
+
{
|
|
678
|
+
placeholder: "Confirm Password",
|
|
679
|
+
isShowPassword: i,
|
|
680
|
+
togglePasswordVisible: () => h(
|
|
681
|
+
!i
|
|
682
|
+
),
|
|
683
|
+
onChange: (C) => k(
|
|
684
|
+
"reEnterPassword",
|
|
685
|
+
C.target.value
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
y.reEnterPassword && c.reEnterPassword && /* @__PURE__ */ e(
|
|
690
|
+
z,
|
|
691
|
+
{
|
|
692
|
+
text: c.reEnterPassword
|
|
693
|
+
}
|
|
694
|
+
)
|
|
695
|
+
]
|
|
696
|
+
}
|
|
697
|
+
)
|
|
698
|
+
] }) : /* @__PURE__ */ l(te, { children: [
|
|
699
|
+
/* @__PURE__ */ e(
|
|
700
|
+
"p",
|
|
701
|
+
{
|
|
702
|
+
className: `${o["recover-account"]} mb-5`,
|
|
703
|
+
children: "Invalid reset password link"
|
|
704
|
+
}
|
|
705
|
+
),
|
|
706
|
+
/* @__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" })
|
|
707
|
+
] }) }),
|
|
708
|
+
a && /* @__PURE__ */ e(F, { className: "p-0", children: /* @__PURE__ */ e(
|
|
709
|
+
"button",
|
|
710
|
+
{
|
|
711
|
+
className: `${o["btn-login"]} ${o["btn-rounder"]} mt-4`,
|
|
712
|
+
onClick: () => S(),
|
|
713
|
+
children: "SET A NEW PASSWORD"
|
|
714
|
+
}
|
|
715
|
+
) })
|
|
716
|
+
] }) }) }) });
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
}, xe = `${De}/api/school`, ks = () => Ce.get(`${xe}/settings`), Ps = () => Ce.get(`${xe}/info`), vs = {
|
|
721
|
+
auth: {
|
|
722
|
+
clientId: oe ? "a27f8ac9-e039-4bbd-a9e1-3096e52a77bb" : "90c6897c-f17b-475e-a7a8-9a19651e0060",
|
|
723
|
+
authority: "https://login.microsoftonline.com/common",
|
|
724
|
+
redirectUri: "https://sso.marioforme.com/microsoft-login.html"
|
|
725
|
+
},
|
|
726
|
+
cache: {
|
|
727
|
+
cacheLocation: "sessionStorage",
|
|
728
|
+
// This configures where your cache will be stored
|
|
729
|
+
storeAuthStateInCookie: !1
|
|
730
|
+
// Set this to "true" if you are having issues on IE11 or Edge
|
|
731
|
+
},
|
|
732
|
+
system: {
|
|
733
|
+
loggerOptions: {
|
|
734
|
+
loggerCallback: (a, t, r) => {
|
|
735
|
+
if (!r)
|
|
736
|
+
switch (a) {
|
|
737
|
+
case se.Error:
|
|
738
|
+
console.error(t);
|
|
739
|
+
return;
|
|
740
|
+
case se.Info:
|
|
741
|
+
console.info(t);
|
|
742
|
+
return;
|
|
743
|
+
case se.Verbose:
|
|
744
|
+
console.debug(t);
|
|
745
|
+
return;
|
|
746
|
+
case se.Warning:
|
|
747
|
+
console.warn(t);
|
|
748
|
+
return;
|
|
749
|
+
default:
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}, Es = {
|
|
756
|
+
email: "",
|
|
757
|
+
password: "",
|
|
758
|
+
captcha: "",
|
|
759
|
+
rememberMe: !1,
|
|
760
|
+
isSessionUserBrowser: !!sessionStorage.getItem(he)
|
|
761
|
+
}, Ls = "/home", ke = "/home", Cs = "/admin/home", Rs = "/parent", Ts = "/admin/schools", $s = "/list-student", xs = "Log in", As = () => {
|
|
762
|
+
const a = re(), t = ue(), [r, n] = E(!1), i = Ie(
|
|
763
|
+
(s) => s.common.isLoginGoogle
|
|
764
|
+
), [h, u] = E(""), [w, k] = E(""), [S, y] = E(""), c = Ie((s) => s.common.inforUserGoogle), p = new URLSearchParams(location.search), C = p.get("type") === "classlink", U = p.get("token"), O = p.get("isAdminUser"), [
|
|
765
|
+
P
|
|
766
|
+
/*, setOpenModelAssign*/
|
|
767
|
+
] = E(!1), [d, N] = E({
|
|
768
|
+
schoolName: "",
|
|
769
|
+
schoolLogo: "",
|
|
770
|
+
schoolId: 0
|
|
771
|
+
}), [x, _] = E(null), M = L(() => {
|
|
772
|
+
n(!r);
|
|
773
|
+
}, [r]), [R, I] = E(!1);
|
|
774
|
+
V(() => {
|
|
775
|
+
document.title = xs;
|
|
776
|
+
const s = ze("auth-token");
|
|
777
|
+
if (s) {
|
|
778
|
+
const g = window.location.hostname;
|
|
779
|
+
if (localStorage.setItem(T, s), document.cookie = `auth-token=;domain=${g.includes("localhost") ? g : ".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=/", O)
|
|
780
|
+
return t("/admin/home");
|
|
781
|
+
}
|
|
782
|
+
ne() && t("/"), D();
|
|
783
|
+
}, [O]);
|
|
784
|
+
const G = () => {
|
|
785
|
+
localStorage.removeItem(T), sessionStorage.removeItem(T), localStorage.removeItem("USER_EMAIL");
|
|
786
|
+
};
|
|
787
|
+
V(() => {
|
|
788
|
+
C && U != "" && j();
|
|
789
|
+
}, []);
|
|
790
|
+
const X = () => {
|
|
791
|
+
if (oe) {
|
|
792
|
+
const s = "https://clever.com/oauth/instant-login?client_id=c3da6c669d239c70d48e&district_id=66132a6f222bda41cc8abe5d";
|
|
793
|
+
window.location.href = s;
|
|
794
|
+
} else {
|
|
795
|
+
const s = `https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;
|
|
796
|
+
window.location.href = s;
|
|
797
|
+
}
|
|
798
|
+
}, j = async () => {
|
|
799
|
+
a(f(!0));
|
|
800
|
+
try {
|
|
801
|
+
const m = await je({
|
|
802
|
+
tokenClassLink: U
|
|
803
|
+
}), { email: g, token: b } = m.data;
|
|
804
|
+
await q({
|
|
805
|
+
email: g,
|
|
806
|
+
rememberMe: !1,
|
|
807
|
+
password: "default",
|
|
808
|
+
accessToken: b
|
|
809
|
+
});
|
|
810
|
+
} catch (s) {
|
|
811
|
+
a(
|
|
812
|
+
$({
|
|
813
|
+
type: "danger",
|
|
814
|
+
message: s.response?.data?.title || s.message
|
|
815
|
+
})
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
a(f(!1));
|
|
819
|
+
}, H = window.location.host.includes("-district"), ce = L(async () => {
|
|
820
|
+
a(f(!0));
|
|
821
|
+
try {
|
|
822
|
+
const s = await Ps(), m = s.data.schoolLogo ?? "";
|
|
823
|
+
s.data && N({
|
|
824
|
+
schoolName: s.data.schoolName,
|
|
825
|
+
schoolLogo: m ? We(m) : J("/images/logo_header_blue.png"),
|
|
826
|
+
schoolId: s.data.schoolId
|
|
827
|
+
});
|
|
828
|
+
} catch (s) {
|
|
829
|
+
a(
|
|
830
|
+
$({
|
|
831
|
+
type: "danger",
|
|
832
|
+
message: s.response?.data?.title || s.message
|
|
833
|
+
})
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
a(f(!1));
|
|
837
|
+
}, []), q = L(async (s) => {
|
|
838
|
+
a(f(!0));
|
|
839
|
+
try {
|
|
840
|
+
const m = s?.isSessionUserBrowser ?? !1, g = await Ke({
|
|
841
|
+
...s,
|
|
842
|
+
email: s?.email?.trim(),
|
|
843
|
+
password: s?.password?.trim()
|
|
844
|
+
}), {
|
|
845
|
+
token: b,
|
|
846
|
+
id: B,
|
|
847
|
+
firstName: ee,
|
|
848
|
+
lastName: W,
|
|
849
|
+
roles: v,
|
|
850
|
+
email: de,
|
|
851
|
+
profileImageFileName: Ge,
|
|
852
|
+
isLoginFirst: _e
|
|
853
|
+
} = g.data;
|
|
854
|
+
if (m ? (sessionStorage.setItem(T, b), sessionStorage.setItem(
|
|
855
|
+
he,
|
|
856
|
+
m
|
|
857
|
+
)) : (sessionStorage.removeItem(he), localStorage.setItem(T, b)), localStorage.removeItem(Ye), a(
|
|
858
|
+
Je({
|
|
859
|
+
id: B,
|
|
860
|
+
firstName: ee,
|
|
861
|
+
lastName: W,
|
|
862
|
+
roles: v,
|
|
863
|
+
email: de,
|
|
864
|
+
profileImageFileName: Ge
|
|
865
|
+
})
|
|
866
|
+
), !localStorage.getItem("ROLES") && v.includes("Admin") && localStorage.setItem("ROLES", "Admin"), s?.email && !v.includes("Admin")) {
|
|
867
|
+
K.init(
|
|
868
|
+
oe ? Qe : Ze,
|
|
869
|
+
s.email,
|
|
870
|
+
{
|
|
871
|
+
defaultTracking: !1
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
const me = window.location.hostname, Ne = new K.Identify();
|
|
875
|
+
Ne.set("domain", me), K.identify(Ne), K.track("general: session start", {
|
|
876
|
+
user_id: s.email,
|
|
877
|
+
domain: me,
|
|
878
|
+
roles: s?.roles?.toString()
|
|
879
|
+
}), localStorage.setItem("USER_EMAIL", s.email), _e && K.track("general: first login", {
|
|
880
|
+
user_id: s.email,
|
|
881
|
+
domain: me,
|
|
882
|
+
roles: s?.roles?.toString()
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
H ? t(Ts) : v.includes("Admin") ? t(Cs) : v.includes("Teacher") || v.includes("Assistant") || v.includes("Counselor") || v.includes("SecondaryTeacher") ? t(Ls) : v.includes("Student") ? t(ke) : v.includes("Parent") ? t(Rs) : v.includes("EduTeacher") && t($s);
|
|
886
|
+
} catch (m) {
|
|
887
|
+
a(
|
|
888
|
+
$({
|
|
889
|
+
type: "danger",
|
|
890
|
+
message: m.response?.data?.title || m.message || "Login failed"
|
|
891
|
+
})
|
|
892
|
+
), localStorage.removeItem(T), sessionStorage.removeItem(T);
|
|
893
|
+
}
|
|
894
|
+
a(f(!1));
|
|
895
|
+
}, []), D = async () => {
|
|
896
|
+
try {
|
|
897
|
+
const s = await Xe();
|
|
898
|
+
u(s.data.googleClientId), k(s.data.googleCaptchaId), y(s.data.extensionEmail);
|
|
899
|
+
} catch (s) {
|
|
900
|
+
a(
|
|
901
|
+
$({
|
|
902
|
+
type: "danger",
|
|
903
|
+
message: s.response?.data?.title || s.message || "Login failed"
|
|
904
|
+
})
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
}, fe = L(
|
|
908
|
+
async (s, m, g, b) => {
|
|
909
|
+
a(f(!0));
|
|
910
|
+
try {
|
|
911
|
+
if ((await es(s, m)).data) {
|
|
912
|
+
const W = {
|
|
913
|
+
email: m.email,
|
|
914
|
+
isLoginGoogle: !0,
|
|
915
|
+
rememberMe: !1,
|
|
916
|
+
password: "default",
|
|
917
|
+
accessToken: g,
|
|
918
|
+
captcha: "",
|
|
919
|
+
loginType: ae.Google
|
|
920
|
+
};
|
|
921
|
+
if (b != null) {
|
|
922
|
+
const v = await b();
|
|
923
|
+
W.captcha = v;
|
|
924
|
+
}
|
|
925
|
+
await q(W), a(ge(!1));
|
|
926
|
+
} else if ((await ye(m))?.data) {
|
|
927
|
+
const v = {
|
|
928
|
+
email: m.email,
|
|
929
|
+
isLoginGoogle: !0,
|
|
930
|
+
rememberMe: !1,
|
|
931
|
+
password: "default",
|
|
932
|
+
accessToken: g,
|
|
933
|
+
captcha: "",
|
|
934
|
+
loginType: ae.Google
|
|
935
|
+
};
|
|
936
|
+
if (b != null) {
|
|
937
|
+
const de = await b();
|
|
938
|
+
v.captcha = de;
|
|
939
|
+
}
|
|
940
|
+
await q(v);
|
|
941
|
+
}
|
|
942
|
+
} catch (B) {
|
|
943
|
+
a(
|
|
944
|
+
$({
|
|
945
|
+
type: "danger",
|
|
946
|
+
message: B.response?.data?.title || B.message || "Login failed"
|
|
947
|
+
})
|
|
948
|
+
);
|
|
949
|
+
}
|
|
950
|
+
a(f(!1));
|
|
951
|
+
},
|
|
952
|
+
[]
|
|
953
|
+
), Ae = async (s, m) => {
|
|
954
|
+
a(f(!0));
|
|
955
|
+
try {
|
|
956
|
+
const g = {
|
|
957
|
+
firstName: c.firstName,
|
|
958
|
+
lastName: c.lastName,
|
|
959
|
+
imageUrl: c.imageUrl,
|
|
960
|
+
fullName: c.fullName,
|
|
961
|
+
email: c.email,
|
|
962
|
+
accessToken: c.accessToken,
|
|
963
|
+
teacherId: s
|
|
964
|
+
};
|
|
965
|
+
if ((await ye(g)).data) {
|
|
966
|
+
const B = await m(), ee = {
|
|
967
|
+
email: c.email,
|
|
968
|
+
captcha: B,
|
|
969
|
+
isLoginGoogle: !0,
|
|
970
|
+
rememberMe: !1,
|
|
971
|
+
password: "default",
|
|
972
|
+
accessToken: c.accessToken,
|
|
973
|
+
loginType: ae.Google
|
|
974
|
+
};
|
|
975
|
+
a(ge(!1)), await q(ee), t(ke);
|
|
976
|
+
}
|
|
977
|
+
} catch (g) {
|
|
978
|
+
a(
|
|
979
|
+
$({
|
|
980
|
+
type: "danger",
|
|
981
|
+
message: g.response?.data?.title || g.message || "Login failed"
|
|
982
|
+
})
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
a(ge(!1)), a(f(!1));
|
|
986
|
+
}, Oe = async () => {
|
|
987
|
+
try {
|
|
988
|
+
const s = await ks();
|
|
989
|
+
a(ss(s.data.isSandboxMode));
|
|
990
|
+
} catch (s) {
|
|
991
|
+
console.error(s);
|
|
992
|
+
}
|
|
993
|
+
}, we = async (s) => {
|
|
994
|
+
x.handleRedirectPromise().then(async (m) => {
|
|
995
|
+
if (d?.schoolId)
|
|
996
|
+
if (m) {
|
|
997
|
+
let g = m.account;
|
|
998
|
+
await Se(g, s);
|
|
999
|
+
} else {
|
|
1000
|
+
const g = x.getAllAccounts();
|
|
1001
|
+
if (g.length === 0) {
|
|
1002
|
+
const b = oe ? "https://brightsoft.marioforme.com" : "https://sso.marioforme.com";
|
|
1003
|
+
window.location.href = (window.location.hostname === "localhost" ? "https://localhost:3000" : b) + `/microsoft-login.html?redirect-uri=${window.location.href}&schoolId=${d.schoolId}`;
|
|
1004
|
+
} else {
|
|
1005
|
+
let b = g[0];
|
|
1006
|
+
await Se(b, s);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}).catch((m) => {
|
|
1010
|
+
console.error(m);
|
|
1011
|
+
});
|
|
1012
|
+
}, Se = async (s, m) => {
|
|
1013
|
+
let g = s.name, b = {
|
|
1014
|
+
firstName: g.split(" ").slice(0, -1).join(" "),
|
|
1015
|
+
lastName: g.split(" ").slice(-1).join(" "),
|
|
1016
|
+
fullName: g,
|
|
1017
|
+
imageUrl: "",
|
|
1018
|
+
email: s.username,
|
|
1019
|
+
accessToken: s.idTokenClaims.aio,
|
|
1020
|
+
googleId: s.tenantId
|
|
1021
|
+
};
|
|
1022
|
+
a(Le(b)), await fe(
|
|
1023
|
+
Te.MicrosoftSSO,
|
|
1024
|
+
b,
|
|
1025
|
+
s.idTokenClaims.aio,
|
|
1026
|
+
m
|
|
1027
|
+
);
|
|
1028
|
+
}, Ue = async () => {
|
|
1029
|
+
const s = new rs(vs);
|
|
1030
|
+
await s.initialize(), _(s);
|
|
1031
|
+
};
|
|
1032
|
+
return V(() => {
|
|
1033
|
+
let s = window.location.href;
|
|
1034
|
+
x && s.includes("code") && s.includes("client_info") && we();
|
|
1035
|
+
}, [JSON.stringify(x)]), V(() => {
|
|
1036
|
+
Oe(), Ue(), ce();
|
|
1037
|
+
}, []), {
|
|
1038
|
+
defaultInfo: Es,
|
|
1039
|
+
userLogin: q,
|
|
1040
|
+
openLogin: r,
|
|
1041
|
+
toggle: M,
|
|
1042
|
+
isShowPassword: R,
|
|
1043
|
+
setIsShowPassword: I,
|
|
1044
|
+
fnIsCheckLogin: fe,
|
|
1045
|
+
isLoginGoogle: i,
|
|
1046
|
+
infoUser: c,
|
|
1047
|
+
submitLogin: Ae,
|
|
1048
|
+
googleClientId: h,
|
|
1049
|
+
googleRecaptchaId: w,
|
|
1050
|
+
handleCancelModelAssign: G,
|
|
1051
|
+
openModelAssign: P,
|
|
1052
|
+
// handleAssignTeacherByCode,
|
|
1053
|
+
fnLoginSSO: we,
|
|
1054
|
+
school: d,
|
|
1055
|
+
extensionEmail: S,
|
|
1056
|
+
handleLoginWidthClever: X
|
|
1057
|
+
};
|
|
1058
|
+
}, Pe = "/", Os = "/login", ve = "Log in", Us = () => {
|
|
1059
|
+
const a = re(), t = ue(), r = location.search, i = new URLSearchParams(r).get("userId"), [h, u] = E(!1), [w, k] = E(
|
|
1060
|
+
!1
|
|
1061
|
+
), [S, y] = E({
|
|
1062
|
+
password: "",
|
|
1063
|
+
reEnterPassword: "",
|
|
1064
|
+
email: "",
|
|
1065
|
+
userId: i ?? "",
|
|
1066
|
+
token: ""
|
|
1067
|
+
}), { executeRecaptcha: c } = pe(), p = L(async (P) => {
|
|
1068
|
+
a(f(!0));
|
|
1069
|
+
try {
|
|
1070
|
+
const d = await os(P);
|
|
1071
|
+
y({ ...S, email: d.data });
|
|
1072
|
+
} catch (d) {
|
|
1073
|
+
a(
|
|
1074
|
+
$({
|
|
1075
|
+
type: "danger",
|
|
1076
|
+
message: d.message
|
|
1077
|
+
})
|
|
1078
|
+
);
|
|
1079
|
+
}
|
|
1080
|
+
a(f(!1));
|
|
1081
|
+
}, []), C = L(async (P) => {
|
|
1082
|
+
a(f(!0));
|
|
1083
|
+
try {
|
|
1084
|
+
await as(P), t(Os), a(
|
|
1085
|
+
$({
|
|
1086
|
+
type: "success",
|
|
1087
|
+
message: "Create password sucessfully"
|
|
1088
|
+
})
|
|
1089
|
+
);
|
|
1090
|
+
} catch (d) {
|
|
1091
|
+
a(
|
|
1092
|
+
$({
|
|
1093
|
+
type: "danger",
|
|
1094
|
+
message: d.response?.data?.title || d.message || "Error occured"
|
|
1095
|
+
})
|
|
1096
|
+
), localStorage.removeItem(T), sessionStorage.removeItem(T);
|
|
1097
|
+
}
|
|
1098
|
+
a(f(!1));
|
|
1099
|
+
}, []), U = L(async () => {
|
|
1100
|
+
if (!c) {
|
|
1101
|
+
console.log("execute recaptcha undefined");
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
return await c("forgetPass");
|
|
1105
|
+
}, [c]), O = L(() => {
|
|
1106
|
+
}, []);
|
|
1107
|
+
return V(() => {
|
|
1108
|
+
document.title = ve, ne() && t(Pe), i && p(i);
|
|
1109
|
+
}, [i]), V(() => {
|
|
1110
|
+
document.title = ve, ne() && t(Pe);
|
|
1111
|
+
}, []), {
|
|
1112
|
+
createPasswordRequest: C,
|
|
1113
|
+
isShowNewPassword: h,
|
|
1114
|
+
setIsShowNewPassword: u,
|
|
1115
|
+
isShowReTypePassword: w,
|
|
1116
|
+
setIsShowReTypePassword: k,
|
|
1117
|
+
clickHandler: U,
|
|
1118
|
+
handleVerify: O,
|
|
1119
|
+
initialValues: S
|
|
1120
|
+
};
|
|
1121
|
+
}, Gs = A.object({
|
|
1122
|
+
password: A.string().required("Password is required"),
|
|
1123
|
+
reEnterPassword: A.string().required("Please re-enter Password").test("matching", "Passwords do not match", function() {
|
|
1124
|
+
return this.parent.password === this.parent.reEnterPassword;
|
|
1125
|
+
})
|
|
1126
|
+
}), _s = () => {
|
|
1127
|
+
const {
|
|
1128
|
+
createPasswordRequest: a,
|
|
1129
|
+
isShowNewPassword: t,
|
|
1130
|
+
setIsShowNewPassword: r,
|
|
1131
|
+
isShowReTypePassword: n,
|
|
1132
|
+
setIsShowReTypePassword: i,
|
|
1133
|
+
initialValues: h
|
|
1134
|
+
} = Us();
|
|
1135
|
+
return /* @__PURE__ */ e(
|
|
1136
|
+
le,
|
|
1137
|
+
{
|
|
1138
|
+
initialValues: h,
|
|
1139
|
+
enableReinitialize: !0,
|
|
1140
|
+
validationSchema: Gs,
|
|
1141
|
+
onSubmit: (u) => {
|
|
1142
|
+
a(u);
|
|
1143
|
+
},
|
|
1144
|
+
children: (u) => {
|
|
1145
|
+
const {
|
|
1146
|
+
setFieldValue: w,
|
|
1147
|
+
handleSubmit: k,
|
|
1148
|
+
touched: S,
|
|
1149
|
+
errors: y,
|
|
1150
|
+
values: c
|
|
1151
|
+
} = u;
|
|
1152
|
+
return /* @__PURE__ */ e(ie, { className: `${o["box-login"]}`, children: /* @__PURE__ */ l(F, { className: "p-0", children: [
|
|
1153
|
+
/* @__PURE__ */ e(
|
|
1154
|
+
"div",
|
|
1155
|
+
{
|
|
1156
|
+
hidden: !c.email,
|
|
1157
|
+
className: `${o["block-login"]}`,
|
|
1158
|
+
children: /* @__PURE__ */ l("div", { className: `${o["block-form"]}`, children: [
|
|
1159
|
+
/* @__PURE__ */ e(
|
|
1160
|
+
"img",
|
|
1161
|
+
{
|
|
1162
|
+
src: `${J(
|
|
1163
|
+
"/images/horizontal-logo-blue.svg"
|
|
1164
|
+
)}`,
|
|
1165
|
+
className: `${o["img-login-rectangle"]}`
|
|
1166
|
+
}
|
|
1167
|
+
),
|
|
1168
|
+
/* @__PURE__ */ e("p", { className: `${o["title-login"]}`, children: "Create Your Password" }),
|
|
1169
|
+
/* @__PURE__ */ e("div", { className: "w-100", children: /* @__PURE__ */ l(te, { children: [
|
|
1170
|
+
/* @__PURE__ */ e(
|
|
1171
|
+
Y,
|
|
1172
|
+
{
|
|
1173
|
+
className: `${o["form-user-name"]}`,
|
|
1174
|
+
children: /* @__PURE__ */ e(
|
|
1175
|
+
Q,
|
|
1176
|
+
{
|
|
1177
|
+
disabled: !0,
|
|
1178
|
+
type: "text",
|
|
1179
|
+
name: "email",
|
|
1180
|
+
placeholder: "Email",
|
|
1181
|
+
value: c.email,
|
|
1182
|
+
autocomplete: "email",
|
|
1183
|
+
required: !0,
|
|
1184
|
+
className: `${o.input}`
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ l(
|
|
1190
|
+
"div",
|
|
1191
|
+
{
|
|
1192
|
+
className: `${o["form-user-name"]}`,
|
|
1193
|
+
children: [
|
|
1194
|
+
/* @__PURE__ */ e(
|
|
1195
|
+
Z,
|
|
1196
|
+
{
|
|
1197
|
+
isShowPassword: t,
|
|
1198
|
+
togglePasswordVisible: () => r(
|
|
1199
|
+
!t
|
|
1200
|
+
),
|
|
1201
|
+
onChange: (p) => w(
|
|
1202
|
+
"password",
|
|
1203
|
+
p.target.value
|
|
1204
|
+
)
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
S.password && y.password && /* @__PURE__ */ e(
|
|
1208
|
+
z,
|
|
1209
|
+
{
|
|
1210
|
+
text: y.password
|
|
1211
|
+
}
|
|
1212
|
+
)
|
|
1213
|
+
]
|
|
1214
|
+
}
|
|
1215
|
+
),
|
|
1216
|
+
/* @__PURE__ */ l(
|
|
1217
|
+
"div",
|
|
1218
|
+
{
|
|
1219
|
+
className: `${o["form-user-name"]}`,
|
|
1220
|
+
children: [
|
|
1221
|
+
/* @__PURE__ */ e(
|
|
1222
|
+
Z,
|
|
1223
|
+
{
|
|
1224
|
+
placeholder: "Confirm Password",
|
|
1225
|
+
isShowPassword: n,
|
|
1226
|
+
togglePasswordVisible: () => i(
|
|
1227
|
+
!n
|
|
1228
|
+
),
|
|
1229
|
+
onChange: (p) => w(
|
|
1230
|
+
"reEnterPassword",
|
|
1231
|
+
p.target.value
|
|
1232
|
+
)
|
|
1233
|
+
}
|
|
1234
|
+
),
|
|
1235
|
+
S.reEnterPassword && y.reEnterPassword && /* @__PURE__ */ e(
|
|
1236
|
+
z,
|
|
1237
|
+
{
|
|
1238
|
+
text: y.reEnterPassword
|
|
1239
|
+
}
|
|
1240
|
+
)
|
|
1241
|
+
]
|
|
1242
|
+
}
|
|
1243
|
+
)
|
|
1244
|
+
] }) }),
|
|
1245
|
+
/* @__PURE__ */ e(
|
|
1246
|
+
"button",
|
|
1247
|
+
{
|
|
1248
|
+
className: `${o["btn-login"]} ${o["btn-rounder"]} mt-4`,
|
|
1249
|
+
onClick: () => k(),
|
|
1250
|
+
children: "CREATE YOUR PASSWORD"
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1253
|
+
] })
|
|
1254
|
+
}
|
|
1255
|
+
),
|
|
1256
|
+
/* @__PURE__ */ e(
|
|
1257
|
+
"div",
|
|
1258
|
+
{
|
|
1259
|
+
hidden: !!c.email,
|
|
1260
|
+
className: `${o["block-login"]}`,
|
|
1261
|
+
children: /* @__PURE__ */ l("div", { className: `${o["block-form"]}`, children: [
|
|
1262
|
+
/* @__PURE__ */ e(
|
|
1263
|
+
"img",
|
|
1264
|
+
{
|
|
1265
|
+
src: `${J(
|
|
1266
|
+
"/images/horizontal-logo-blue.svg"
|
|
1267
|
+
)}`,
|
|
1268
|
+
className: `${o["img-login-rectangle"]}`
|
|
1269
|
+
}
|
|
1270
|
+
),
|
|
1271
|
+
/* @__PURE__ */ e("p", { className: `${o["title-login"]}`, children: "You cannot regenerate the password" })
|
|
1272
|
+
] })
|
|
1273
|
+
}
|
|
1274
|
+
)
|
|
1275
|
+
] }) });
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
}, Ms = "Log in", Vs = "Forgot password", qs = "Reset password", Qs = (a) => {
|
|
1280
|
+
const {
|
|
1281
|
+
isLogin: t,
|
|
1282
|
+
isForgotPassword: r,
|
|
1283
|
+
isResetPassword: n,
|
|
1284
|
+
isCreatePassword: i
|
|
1285
|
+
// isLoginTwoFactor
|
|
1286
|
+
} = a, {
|
|
1287
|
+
defaultInfo: h,
|
|
1288
|
+
userLogin: u,
|
|
1289
|
+
googleRecaptchaId: w,
|
|
1290
|
+
handleCancelModelAssign: k,
|
|
1291
|
+
school: S,
|
|
1292
|
+
openModelAssign: y,
|
|
1293
|
+
setIsShowPassword: c,
|
|
1294
|
+
fnIsCheckLogin: p,
|
|
1295
|
+
isLoginGoogle: C,
|
|
1296
|
+
submitLogin: U,
|
|
1297
|
+
infoUser: O,
|
|
1298
|
+
googleClientId: P,
|
|
1299
|
+
isShowPassword: d,
|
|
1300
|
+
fnLoginSSO: N,
|
|
1301
|
+
extensionEmail: x,
|
|
1302
|
+
handleLoginWidthClever: _
|
|
1303
|
+
} = As();
|
|
1304
|
+
return V(() => {
|
|
1305
|
+
t && (document.title = Ms), r && (document.title = Vs), n && (document.title = qs);
|
|
1306
|
+
}, [t, r, n]), /* @__PURE__ */ e("div", { className: `${o.login} container-fluid font-family-lato`, children: /* @__PURE__ */ l(ie, { className: "h-100", children: [
|
|
1307
|
+
/* @__PURE__ */ l(
|
|
1308
|
+
F,
|
|
1309
|
+
{
|
|
1310
|
+
lg: 8,
|
|
1311
|
+
md: 12,
|
|
1312
|
+
xs: 12,
|
|
1313
|
+
className: "d-flex justify-content-center h-100 align-items-center p-3 flex-column",
|
|
1314
|
+
children: [
|
|
1315
|
+
!!w && /* @__PURE__ */ l(
|
|
1316
|
+
ts,
|
|
1317
|
+
{
|
|
1318
|
+
useRecaptchaNet: !0,
|
|
1319
|
+
reCaptchaKey: w,
|
|
1320
|
+
scriptProps: {
|
|
1321
|
+
async: !0,
|
|
1322
|
+
defer: !0,
|
|
1323
|
+
appendTo: "body"
|
|
1324
|
+
},
|
|
1325
|
+
children: [
|
|
1326
|
+
t && /* @__PURE__ */ e(
|
|
1327
|
+
us,
|
|
1328
|
+
{
|
|
1329
|
+
userLogin: u,
|
|
1330
|
+
defaultInfo: h,
|
|
1331
|
+
onCancelModelAssign: k,
|
|
1332
|
+
openModelAssign: y,
|
|
1333
|
+
school: S,
|
|
1334
|
+
fnIsCheckLogin: p,
|
|
1335
|
+
googleClientId: P,
|
|
1336
|
+
infoUser: O,
|
|
1337
|
+
isLoginGoogle: C,
|
|
1338
|
+
isShowPassword: d,
|
|
1339
|
+
setIsShowPassword: c,
|
|
1340
|
+
submitLogin: U,
|
|
1341
|
+
fnLoginSSO: N,
|
|
1342
|
+
extensionEmail: x,
|
|
1343
|
+
onLoginWidthClever: _
|
|
1344
|
+
}
|
|
1345
|
+
),
|
|
1346
|
+
r && /* @__PURE__ */ e(ys, { school: S })
|
|
1347
|
+
]
|
|
1348
|
+
}
|
|
1349
|
+
),
|
|
1350
|
+
n && /* @__PURE__ */ e(bs, {}),
|
|
1351
|
+
i && /* @__PURE__ */ e(_s, {}),
|
|
1352
|
+
/* @__PURE__ */ e(
|
|
1353
|
+
"a",
|
|
1354
|
+
{
|
|
1355
|
+
href: "/privacy-policy/",
|
|
1356
|
+
target: "blank",
|
|
1357
|
+
className: `${o["privacy-policy"]}`,
|
|
1358
|
+
children: "Privacy Policy"
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
]
|
|
1362
|
+
}
|
|
1363
|
+
),
|
|
1364
|
+
/* @__PURE__ */ e(
|
|
1365
|
+
F,
|
|
1366
|
+
{
|
|
1367
|
+
className: "p-3 mh-100 d-flex justify-content-end",
|
|
1368
|
+
lg: 4,
|
|
1369
|
+
md: 12,
|
|
1370
|
+
xs: 12,
|
|
1371
|
+
children: /* @__PURE__ */ e(
|
|
1372
|
+
"img",
|
|
1373
|
+
{
|
|
1374
|
+
src: `${J(window.innerWidth > 992 ? "/images/img-login.png" : "/images/img-login-tablet.png")}`,
|
|
1375
|
+
className: `${o["img-login"]}`
|
|
1376
|
+
}
|
|
1377
|
+
)
|
|
1378
|
+
}
|
|
1379
|
+
)
|
|
1380
|
+
] }) });
|
|
1381
|
+
};
|
|
1382
|
+
export {
|
|
1383
|
+
Qs as default
|
|
1384
|
+
};
|