mario-core 2.0.98-release → 2.0.100-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-BE7Tz-wC.js +1 -0
- package/dist/Dashboard-BVPTDKAu.mjs +206 -0
- package/dist/Dashboard-BXGj0ocj.mjs +206 -0
- package/dist/Dashboard-BmdK8dWK.mjs +206 -0
- package/dist/Dashboard-CGeGXuwV.mjs +206 -0
- package/dist/Dashboard-CexYkfqV.js +1 -0
- package/dist/Dashboard-CmPOEstn.js +1 -0
- package/dist/Dashboard-CutvaymS.js +1 -0
- package/dist/Dashboard-D-5G_YNh.mjs +206 -0
- package/dist/Dashboard-DEZdmPO5.js +1 -0
- package/dist/Dashboard-DJHQuJK8.mjs +206 -0
- package/dist/Dashboard-DQ5FoWMW.js +1 -0
- package/dist/Dashboard-DkxdQmm7.js +1 -0
- package/dist/Dashboard-F_oNZ1ED.mjs +206 -0
- package/dist/Dashboard-LQQNKTQR.mjs +206 -0
- package/dist/Dashboard-xUZwMhtb.js +1 -0
- package/dist/EmailTemplateDetail-8QQkBNYV.js +1 -0
- package/dist/EmailTemplateDetail-BMC8Bo5c.mjs +443 -0
- package/dist/EmailTemplateDetail-BijiTHup.js +1 -0
- package/dist/EmailTemplateDetail-C1dIeruZ.js +1 -0
- package/dist/EmailTemplateDetail-C39gty_Y.mjs +443 -0
- package/dist/EmailTemplateDetail-C9huuy7B.mjs +443 -0
- package/dist/EmailTemplateDetail-CbNeAmA2.mjs +443 -0
- package/dist/EmailTemplateDetail-CekNUyOs.mjs +443 -0
- package/dist/EmailTemplateDetail-CyAGy4Cv.js +1 -0
- package/dist/EmailTemplateDetail-CywZcrAW.js +1 -0
- package/dist/EmailTemplateDetail-DENmArIS.mjs +443 -0
- package/dist/EmailTemplateDetail-De1-TqqT.js +1 -0
- package/dist/EmailTemplateDetail-DhHPKZJb.js +1 -0
- package/dist/EmailTemplateDetail-DlyrGm4B.mjs +443 -0
- package/dist/EmailTemplateDetail-FvgSJs1A.js +1 -0
- package/dist/EmailTemplateDetail-sUkoiG9C.mjs +443 -0
- package/dist/EmailTemplateList-BONYsb7f.js +1 -0
- package/dist/EmailTemplateList-BQRYd0QB.mjs +170 -0
- package/dist/EmailTemplateList-BYwRH-DJ.mjs +170 -0
- package/dist/EmailTemplateList-B_SfhEej.js +1 -0
- package/dist/EmailTemplateList-C19OX7Cw.js +1 -0
- package/dist/EmailTemplateList-C4ffDlup.js +1 -0
- package/dist/EmailTemplateList-CA5uvsLr.js +1 -0
- package/dist/EmailTemplateList-Cn4tUiuG.mjs +170 -0
- package/dist/EmailTemplateList-DFy70sCo.mjs +170 -0
- package/dist/EmailTemplateList-DGwpwvQQ.mjs +170 -0
- package/dist/EmailTemplateList-DIzrlY7K.mjs +170 -0
- package/dist/EmailTemplateList-DPZB3oNQ.js +1 -0
- package/dist/EmailTemplateList-DTkzDmy-.js +1 -0
- package/dist/EmailTemplateList-X20GY4Pt.mjs +170 -0
- package/dist/EmailTemplateList-bNLQgu0y.mjs +170 -0
- package/dist/EmailTemplateList-sY4bOBQm.js +1 -0
- package/dist/GalleryList-6spc98uu.js +1 -0
- package/dist/GalleryList-BCrPPGGW.mjs +329 -0
- package/dist/GalleryList-BIl_P7eK.js +1 -0
- package/dist/GalleryList-BRh6IfWc.js +1 -0
- package/dist/GalleryList-BVDBa2lH.js +1 -0
- package/dist/GalleryList-Byohd3LQ.mjs +329 -0
- package/dist/GalleryList-C0c1Lcei.mjs +329 -0
- package/dist/GalleryList-CJHiz314.mjs +329 -0
- package/dist/GalleryList-DFFOzuli.mjs +329 -0
- package/dist/GalleryList-DZlLHEfU.mjs +329 -0
- package/dist/GalleryList-DmU0bLzG.js +1 -0
- package/dist/GalleryList-OM7afuEA.js +1 -0
- package/dist/GalleryList-ftKYDPMF.mjs +329 -0
- package/dist/GalleryList-jhhAfVvA.js +1 -0
- package/dist/GalleryList-nAAKlOwO.mjs +329 -0
- package/dist/GalleryList-zgcCqEZv.js +1 -0
- package/dist/Login-B7k7o5pF.js +1 -0
- package/dist/Login-BH5OwKv2.mjs +1684 -0
- package/dist/Login-BJuO-SJY.mjs +1684 -0
- package/dist/Login-CJ3aEabk.mjs +1684 -0
- package/dist/Login-CVLUBeZy.mjs +1684 -0
- package/dist/Login-CjImvzwC.mjs +1684 -0
- package/dist/Login-Cw5c4Hje.js +1 -0
- package/dist/Login-D6nwKqRG.js +1 -0
- package/dist/Login-DCT8Zla6.js +1 -0
- package/dist/Login-DCm7LqZh.js +1 -0
- package/dist/Login-DXnaw-U9.js +1 -0
- package/dist/Login-GWyk-eIV.mjs +1684 -0
- package/dist/Login-LXbnE_J4.js +1 -0
- package/dist/Login-cjknCuG9.mjs +1684 -0
- package/dist/Login-jH_kVfj0.mjs +1684 -0
- package/dist/Login-sxZN5lh5.js +1 -0
- package/dist/NotificationList-8-zhewjE.mjs +3982 -0
- package/dist/NotificationList-B5Tfc1vh.js +2 -0
- package/dist/NotificationList-BOG92unY.js +2 -0
- package/dist/NotificationList-BPJUTdNT.mjs +3982 -0
- package/dist/NotificationList-BnttapwN.mjs +3982 -0
- package/dist/NotificationList-C-MUJ7k1.js +2 -0
- package/dist/NotificationList-CQxjO1xN.js +2 -0
- package/dist/NotificationList-CXqG_d0Q.js +2 -0
- package/dist/NotificationList-DTAqMlBa.mjs +3982 -0
- package/dist/NotificationList-DcJvSG4E.js +2 -0
- package/dist/NotificationList-Ds-_PCAt.mjs +3982 -0
- package/dist/NotificationList-GPz6hiiE.mjs +3982 -0
- package/dist/NotificationList-h3voWCem.mjs +3982 -0
- package/dist/NotificationList-nTKZ6iw-.js +2 -0
- package/dist/NotificationList-tFXBjkrF.mjs +3982 -0
- package/dist/NotificationList-uCXmEjtE.js +2 -0
- package/dist/SkillList-B8LVobTk.mjs +386 -0
- package/dist/SkillList-BDzfvD0h.mjs +386 -0
- package/dist/SkillList-B_AU-13O.js +1 -0
- package/dist/SkillList-CDPuumBK.mjs +386 -0
- package/dist/SkillList-CYxkPG8D.js +1 -0
- package/dist/SkillList-CssotCzD.mjs +386 -0
- package/dist/SkillList-CvSUFyiA.js +1 -0
- package/dist/SkillList-D3HXlb9M.js +1 -0
- package/dist/SkillList-DAvTpv0U.js +1 -0
- package/dist/SkillList-DIQD_psl.mjs +386 -0
- package/dist/SkillList-DLOPODfJ.js +1 -0
- package/dist/SkillList-DbE2-E8h.mjs +386 -0
- package/dist/SkillList-DfDTfoeS.js +1 -0
- package/dist/SkillList-DsfWuKg-.mjs +386 -0
- package/dist/SkillList-OnpDgA5G.mjs +386 -0
- package/dist/SkillList-z-eSMnyB.js +1 -0
- package/dist/TeacherSelector-9wlVivPC.js +1 -0
- package/dist/TeacherSelector-B0XXXfse.mjs +30 -0
- package/dist/TeacherSelector-B_92BUDL.js +1 -0
- package/dist/TeacherSelector-CCUv-98Y.js +1 -0
- package/dist/TeacherSelector-CcNAb-MB.js +1 -0
- package/dist/TeacherSelector-CfPGIjnG.js +1 -0
- package/dist/TeacherSelector-Cr3_G_mY.js +1 -0
- package/dist/TeacherSelector-DPFFHSxN.js +1 -0
- package/dist/TeacherSelector-DYOMerDb.mjs +30 -0
- package/dist/TeacherSelector-Dj7mKMoQ.mjs +30 -0
- package/dist/TeacherSelector-DzZEWMyC.mjs +30 -0
- package/dist/TeacherSelector-WfvYnekz.js +1 -0
- package/dist/TeacherSelector-XhHBkMav.mjs +30 -0
- package/dist/TeacherSelector-jcdLTZMD.mjs +30 -0
- package/dist/TeacherSelector-mc9vDN0y.mjs +30 -0
- package/dist/TeacherSelector-xeguITZI.mjs +30 -0
- package/dist/TheContent-BIkZzjYE.mjs +38 -0
- package/dist/TheContent-BPStknsT.js +1 -0
- package/dist/TheContent-C4_dsK-o.js +1 -0
- package/dist/TheContent-CRlLFgZL.mjs +38 -0
- package/dist/TheContent-C_5jY9Fd.mjs +38 -0
- package/dist/TheContent-Cf9YuFhh.mjs +38 -0
- package/dist/TheContent-DBeQ0QXk.js +1 -0
- package/dist/TheContent-DE3BPetK.mjs +38 -0
- package/dist/TheContent-DGQuGUy9.js +1 -0
- package/dist/TheContent-DKplh020.js +1 -0
- package/dist/TheContent-DiY3IBgx.js +1 -0
- package/dist/TheContent-Du3gLW0v.mjs +38 -0
- package/dist/TheContent-Qb9Fb-da.js +1 -0
- package/dist/TheContent-XwBj9mee.mjs +38 -0
- package/dist/TheContent-auxjGmbD.js +1 -0
- package/dist/TheContent-qo1QGRKN.mjs +38 -0
- package/dist/UserContainer-6ETSA4kk.js +5 -0
- package/dist/UserContainer-B0J1Lb8F.js +5 -0
- package/dist/UserContainer-BC1Nx-rS.mjs +2902 -0
- package/dist/UserContainer-C5eQoMmH.js +5 -0
- package/dist/UserContainer-CLZeqc2d.mjs +2902 -0
- package/dist/UserContainer-C_IJbndj.js +5 -0
- package/dist/UserContainer-D0XoTyu2.js +5 -0
- package/dist/UserContainer-DLTqrlwR.mjs +2902 -0
- package/dist/UserContainer-DPz98BAp.mjs +2902 -0
- package/dist/UserContainer-DV_rmkvG.js +5 -0
- package/dist/UserContainer-Db8akIWX.js +5 -0
- package/dist/UserContainer-SYTWVZx1.mjs +2902 -0
- package/dist/UserContainer-dA1dr-0t.mjs +2902 -0
- package/dist/UserContainer-lwLlvGmM.js +5 -0
- package/dist/UserContainer-t_fMY56w.mjs +2902 -0
- package/dist/UserContainer-wsy9oAed.mjs +2902 -0
- package/dist/UserDetail-BN-MRyhQ.js +1 -0
- package/dist/UserDetail-BSNeQSgi.js +1 -0
- package/dist/UserDetail-BsMedbV3.mjs +903 -0
- package/dist/UserDetail-Bt2fAo7o.mjs +903 -0
- package/dist/UserDetail-BxMRSoJh.mjs +903 -0
- package/dist/UserDetail-C6wPT9Mx.mjs +903 -0
- package/dist/UserDetail-C7_3F9NS.js +1 -0
- package/dist/UserDetail-CCxUFgKF.js +1 -0
- package/dist/UserDetail-CHXjVqLB.js +1 -0
- package/dist/UserDetail-CUDDWqBi.mjs +903 -0
- package/dist/UserDetail-DMo9JbeW.js +1 -0
- package/dist/UserDetail-DthL7O9f.mjs +903 -0
- package/dist/UserDetail-IMiq5963.js +1 -0
- package/dist/UserDetail-Ug9AHbbp.mjs +903 -0
- package/dist/UserDetail-ZjC-PMUl.js +1 -0
- package/dist/UserDetail-cbyui91i.mjs +903 -0
- package/dist/UserList-1FQoQqeL.mjs +1252 -0
- package/dist/UserList-1OAuKhh-.js +7 -0
- package/dist/UserList-B01JYovI.mjs +1252 -0
- package/dist/UserList-B2yKOlpQ.mjs +1252 -0
- package/dist/UserList-BBjWqp1-.js +7 -0
- package/dist/UserList-BhJnNp3r.js +7 -0
- package/dist/UserList-C8Qh7KpY.js +7 -0
- package/dist/UserList-DPO2AbqO.mjs +1252 -0
- package/dist/UserList-DQ6zP5rh.js +7 -0
- package/dist/UserList-DXyaNhnd.mjs +1252 -0
- package/dist/UserList-D_GlbCU6.mjs +1252 -0
- package/dist/UserList-Deb2KYP9.js +7 -0
- package/dist/UserList-DmbGHyhL.mjs +1252 -0
- package/dist/UserList-Ds_1RDEb.mjs +1252 -0
- package/dist/UserList-UkUSW1xc.js +7 -0
- package/dist/UserList-vyiB7JTj.js +7 -0
- package/dist/constants-3UvJHA17.mjs +286 -0
- package/dist/constants-BACMK5hA.js +1 -0
- package/dist/constants-BILr1a3t.js +1 -0
- package/dist/constants-BZtXaq-n.mjs +286 -0
- package/dist/constants-BmCYcPr9.js +1 -0
- package/dist/constants-BxS1hwUo.mjs +286 -0
- package/dist/constants-CSKbcUia.mjs +286 -0
- package/dist/constants-CbfEFtSw.js +1 -0
- package/dist/constants-CoDDxmrF.mjs +286 -0
- package/dist/constants-Cz9bXp0n.mjs +286 -0
- package/dist/constants-DI2zgQsc.mjs +286 -0
- package/dist/constants-DRKzJlEG.js +1 -0
- package/dist/constants-DnR9HwqE.js +1 -0
- package/dist/constants-LxsGpdp7.mjs +286 -0
- package/dist/constants-V_8cOeQZ.js +1 -0
- package/dist/constants-fG8OJgka.js +1 -0
- package/dist/index-8-tOP3u8.js +15 -0
- package/dist/index-9T737TY5.mjs +19133 -0
- package/dist/index-AMnSCGum.js +15 -0
- package/dist/index-B3i6X8ri.mjs +19133 -0
- package/dist/index-BjUmah1D.mjs +19113 -0
- package/dist/index-C2r-UaCo.mjs +19133 -0
- package/dist/index-C8fNfHyM.js +15 -0
- package/dist/index-D9-Ga9sC.mjs +19133 -0
- package/dist/index-DVYWdYDu.js +15 -0
- package/dist/index-DWFRxH0g.js +15 -0
- package/dist/index-DsKvKD9f.mjs +19073 -0
- package/dist/index-Js3ivY3E.js +15 -0
- package/dist/index-g0i4I-UC.js +15 -0
- package/dist/index-j6AfCwnN.mjs +19113 -0
- package/dist/index-nsMJX1tN.mjs +19133 -0
- package/dist/index-zAGSNpMb.js +15 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mailCategoryService-BGBzytxF.js +1 -0
- package/dist/mailCategoryService-BIXXOzMs.mjs +11 -0
- package/dist/mailCategoryService-BLU8aExX.js +1 -0
- package/dist/mailCategoryService-CFGoXvP3.mjs +11 -0
- package/dist/mailCategoryService-CGUO5ONE.mjs +11 -0
- package/dist/mailCategoryService-CaoRQeDg.mjs +11 -0
- package/dist/mailCategoryService-CeMO9hpm.mjs +11 -0
- package/dist/mailCategoryService-Cf9BhF09.js +1 -0
- package/dist/mailCategoryService-CsIBOwkv.js +1 -0
- package/dist/mailCategoryService-D7cXi3kx.mjs +11 -0
- package/dist/mailCategoryService-D8t2Pgn2.js +1 -0
- package/dist/mailCategoryService-DusgPUPZ.js +1 -0
- package/dist/mailCategoryService-DzNRiJ8O.mjs +11 -0
- package/dist/mailCategoryService-KGpciCNX.js +1 -0
- package/dist/mailCategoryService-iPjnG0hI.mjs +11 -0
- package/dist/mailCategoryService-pn4IdqS2.js +1 -0
- package/dist/mario-core.css +1 -1
- package/dist/userService--nEN7XIf.mjs +56 -0
- package/dist/userService-BNlww_O3.js +1 -0
- package/dist/userService-Br3qttMz.mjs +56 -0
- package/dist/userService-C-Affz_0.js +1 -0
- package/dist/userService-C0qA8Izq.js +1 -0
- package/dist/userService-CJGYpkqn.js +1 -0
- package/dist/userService-CJZkWIQm.mjs +56 -0
- package/dist/userService-COFqATbD.mjs +56 -0
- package/dist/userService-CPgfiPs8.js +1 -0
- package/dist/userService-CUN5BIDJ.mjs +56 -0
- package/dist/userService-D-Bwf7lN.mjs +56 -0
- package/dist/userService-DDn6vOqd.mjs +56 -0
- package/dist/userService-DIJrzbzO.js +1 -0
- package/dist/userService-DnowdDLU.mjs +56 -0
- package/dist/userService-Dv2QkdOI.js +1 -0
- package/dist/userService-MYXpUjgd.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),m=require("reactstrap"),ee=require("react-router-dom"),e=require("./index-AMnSCGum.js"),Z=require("react-redux"),de=require("formik"),Me=require("yup"),re=require("react-google-recaptcha-v3"),ve=require("@react-oauth/google"),X=require("./types-CTFcZUFS.js"),Se=require("./constants-DnR9HwqE.js"),ae=require("@azure/msal-browser"),Ue=require("@amplitude/analytics-browser");function Le(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const O=Le(Me),oe=Le(Ue),Fe={backgroundColor:"#f7f9fc",borderRadius:"4px",marginBottom:"5px",position:"relative"},Be={backgroundColor:"#ffffff",paddingRight:"50px",color:"#333333",caretColor:"#333333"},ze={fontSize:"20px",position:"absolute",right:"10px",color:"#316CD9"},De=t=>t.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(n,r)=>r.toUpperCase()),ne=({isShowPassword:t,togglePasswordVisible:n,onChange:r,placeholder:i})=>s.jsxs("div",{className:"d-flex align-items-center w-100",style:Fe,children:[s.jsx(m.Input,{className:"border password-input",style:Be,type:t?"text":"password",name:"password",onChange:r,placeholder:i||"Password",autocomplete:i?De(i):"password",required:!0}),s.jsx("i",{className:`far ${t?"fa-eye-slash":"fa-eye"} mx-2 cursor-pointer`,style:ze,onClick:()=>n(),title:t?"Hide":"Show"})]}),qe=({open:t,onConfirm:n,onClose:r,clickHandler:i})=>{const[d,p]=a.useState(Se.GRADE_DEFAULT[0].value);return s.jsxs(m.Modal,{isOpen:t,className:`${e.styles["teacher-code"]}`,style:{zIndex:1201},centered:!0,autoFocus:!1,returnFocusAfterClose:!1,children:[s.jsxs("div",{className:`${e.styles["header-teacher-code"]}`,children:[s.jsx("div",{style:{padding:"16px 24px",margin:0,fontWeight:500,fontSize:"1.25rem"},children:"Select Grade"}),s.jsx("div",{hidden:!r,children:s.jsx(e.MdClose,{onClick:()=>r?.(),className:`${e.styles["close-icon"]}`,size:24,style:{color:"rgba(0, 0, 0, 0.54)"}})})]}),s.jsxs(m.ModalBody,{style:{padding:"20px 24px"},children:[s.jsx("p",{className:`${e.styles["teacher-code-label"]}`,style:{margin:0,marginBottom:"16px",color:"rgba(0, 0, 0, 0.6)"},children:"You are logging in as a student, please select your grade"}),s.jsxs("div",{className:"form-floating",style:{marginTop:"16px",marginBottom:"8px"},children:[s.jsx(m.Input,{type:"select",id:"floatingSelectGrade",value:d,onChange:h=>p(h.target.value),children:Se.GRADE_DEFAULT.map(h=>s.jsx("option",{value:h.value,children:h.label},h.value))}),s.jsx("label",{htmlFor:"floatingSelectGrade",children:"Select grade"})]})]}),s.jsx(m.ModalFooter,{style:{borderTop:"none",padding:"8px 24px"},children:s.jsx(m.Button,{disabled:!d,style:{borderRadius:20,background:"#316cd9",border:"none",opacity:d?1:.65},color:"primary",onClick:()=>n(d,i),children:"Confirm"})})]})};function He(t,n){return JSON.stringify(t)===JSON.stringify(n)}const Ve=a.memo(qe,He),We=O.object({email:O.string().email("Email is invalid").required("Email is required"),password:O.string().required("Password is required"),rememberMe:O.boolean()}),Ke=({onSuccess:t,onError:n})=>{const r=ve.useGoogleLogin({onSuccess:async i=>{try{const d=await fetch("https://www.googleapis.com/oauth2/v3/userinfo",{headers:{Authorization:`Bearer ${i.access_token}`}}).then(h=>h.json()),p={accessToken:i.access_token,googleId:d.sub,profileObj:{email:d.email,familyName:d.family_name,givenName:d.given_name,imageUrl:d.picture,name:d.name}};t(p)}catch(d){n(d)}},onError:i=>n(i)});return s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>r(),children:[s.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"24px",height:"24px",style:{marginRight:"8px"},children:[s.jsx("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"}),s.jsx("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"}),s.jsx("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"}),s.jsx("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"}),s.jsx("path",{fill:"none",d:"M0 0h48v48H0z"})]}),s.jsx("p",{children:"GOOGLE"})]})},Ye=({defaultInfo:t,userLogin:n,school:r,isShowPassword:i,setIsShowPassword:d,fnIsCheckLogin:p,googleClientId:h,fnLoginSSO:y,extensionEmail:E,onLoginWidthClever:N,openModalSelectGrade:L,handleRegisterUser:x,onToggleModelGrade:b})=>{const w=()=>d(!i),B=Z.useDispatch(),{executeRecaptcha:_}=re.useGoogleReCaptcha(),j=a.useCallback(async()=>{if(!_){console.log("execute recaptcha undefined");return}return await _("login")},[_]),I=async C=>{try{await e.AccountSSOLogApi(C)}catch(v){console.error(v)}},z=async C=>{if(C?.accessToken){let{email:v,familyName:D,givenName:S,imageUrl:k,name:P}=C.profileObj,M=C.accessToken,V=C.googleId;const W=window.location.hostname.split(".marioforme.com")?.[0],H=v.split("@")?.[1],me=E?.split(",")?.map(G=>G.trim())?.filter(G=>G).some(G=>H.includes(G));if(!H.includes(W)&&!me){alert("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"),await I([`${H} is incorrect`]);return}const ie={firstName:S,lastName:D,imageUrl:k,fullName:P,email:v,accessToken:M,googleId:V};B(e.setInforUserGoogle(ie)),p(X.TypeLogin.Google,ie,M,j)}};return s.jsxs(a.Fragment,{children:[s.jsx(de.Formik,{initialValues:t,validationSchema:We,onSubmit:async C=>{try{const v=await j();if(!v)return;C.captcha=v,C.loginType=X.LoginType.Default,n(C)}catch(v){console.error(v)}},children:C=>{const{handleBlur:v,handleSubmit:D,values:S,touched:k,errors:P,setFieldValue:M}=C,V=k.email&&P.email,se=k.password&&P.password;return s.jsx("div",{className:`${e.styles["box-login"]} w-100`,children:s.jsx(m.Form,{className:`${e.styles["block-login"]}`,onSubmit:D,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{hidden:!r?.schoolLogo,src:r?.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:r.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Welcome Back!"}),s.jsx("p",{className:`${e.styles["login-description"]} mb-5`,children:"Please enter your MARIO Education account details"}),s.jsxs(m.FormGroup,{className:`${e.styles["form-user-name"]}`,children:[s.jsx(m.Input,{type:"text",name:"email",placeholder:"Email",value:S.email,onChange:W=>M("email",W.target?.value?.trim()||""),autocomplete:"email",onBlur:v("email"),required:!0}),V&&s.jsx(e.ErrorHandler,{text:P.email})]}),s.jsxs(m.FormGroup,{children:[s.jsx(ne,{isShowPassword:i,togglePasswordVisible:w,onChange:W=>M("password",W.target?.value?.trim()||"")}),se&&s.jsx(e.ErrorHandler,{text:P.password})]}),s.jsx(m.FormGroup,{}),s.jsxs("div",{className:"d-flex justify-content-between",children:[s.jsxs("div",{className:"d-flex align-items-center",style:{gap:"8px"},children:[s.jsx("input",{type:"checkbox",checked:!S.isSessionUserBrowser,className:`${e.styles["checkbox-keep-login"]}`,onChange:()=>M("isSessionUserBrowser",!S.isSessionUserBrowser)}),s.jsx("p",{className:`${e.styles["label-keep-login"]} mb-0 ml-2`,children:"Keep me logged in"})]}),s.jsx(ee.Link,{to:"/forgot-password",className:`${e.styles["link-to-login"]}`,children:"Forgot password?"})]}),s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,type:"submit",children:"LOG IN"}),s.jsx("p",{className:`${e.styles["option-text"]} my-3 text-center`,children:"OR"}),s.jsxs(m.Row,{className:"mb-4",children:[s.jsx(m.Col,{lg:6,md:6,xs:12,className:"pr-md-3",children:!!h&&s.jsx(ve.GoogleOAuthProvider,{clientId:h,children:s.jsx(Ke,{onSuccess:z,onError:()=>console.log("Google login failed")})})}),r.schoolId&&s.jsx(m.Col,{lg:6,md:6,xs:12,className:`${e.styles["btn-login-sso"]} pl-md-2`,hidden:!r?.schoolId,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>y(j),children:[s.jsx("img",{src:"images/microsoft-logo.png"}),s.jsx("p",{children:"MICROSOFT"})]})})]}),s.jsx("div",{className:`${e.styles["btn-login-sso"]}`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>window.open("https://launchpad.classlink.com/login"),children:[s.jsx("img",{src:"images/class-link-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLASSLINK"})]})}),s.jsx("div",{className:`${e.styles["btn-login-sso"]} mt-4`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>N(),children:[s.jsx("img",{src:"images/clever-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLEVER"})]})})]})})})}}),s.jsx(Ve,{open:L,onConfirm:x,clickHandler:j,onClose:b})]})},Je={email:"",captcha:""},Ze="/",ye="/login",Qe="Log in",Ee=()=>{const t=new URLSearchParams(ee.useLocation().search),n=t.get("token"),r=t.get("key")??"",i=Z.useDispatch(),d=ee.useNavigate(),[p,h]=a.useState(!1),y=a.useCallback(()=>{h(!p)},[p]),[E,N]=a.useState(!1),[L,x]=a.useState(!1),[b,w]=a.useState({token:"",password:"",reEnterPassword:"",email:"",userId:""}),[B,_]=a.useState(!0),{executeRecaptcha:j}=re.useGoogleReCaptcha();a.useEffect(()=>{document.title=Qe,e.getAccessToken()&&d(Ze)},[]);const I=a.useCallback(async S=>{i(e.setLoading(!0));try{await e.forgotPassword(S),d(ye),i(e.setAlert({type:"success",message:"A mail to reset password was sent"}))}catch(k){i(e.setAlert({type:"danger",message:k.response?.data?.title||k.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}i(e.setLoading(!1))},[]),z=a.useCallback(async(S,k)=>{i(e.setLoading(!0));try{const P=await e.checkResetToken(S,k);P.data?w({...b,token:S,email:P.data}):_(!1)}catch{_(!1)}i(e.setLoading(!1))},[]),C=a.useCallback(async S=>{i(e.setLoading(!0));try{await e.resetPassword({...S,key:r}),d(ye),i(e.setAlert({type:"success",message:"Reset password sucessfully"}))}catch(k){i(e.setAlert({type:"danger",message:k.response?.data?.title||k.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}i(e.setLoading(!1))},[]),v=a.useCallback(async()=>{if(!j){console.log("execute recaptcha undefined");return}return await j("forgetPass")},[j]),D=a.useCallback(()=>{},[]);return a.useEffect(()=>{n&&r&&z(n,r)},[n,r]),{defaultInfo:Je,forgotPasswordRequest:I,checkResetTokenRequest:z,validLink:B,resetPasswordRequest:C,openLogin:p,toggle:y,isShowNewPassword:E,setIsShowNewPassword:N,isShowReTypePassword:L,setIsShowReTypePassword:x,clickHandler:v,handleVerify:D,initialValues:b}},Xe={email:"",captcha:""},es=O.object({email:O.string().email("Email is invalid").required("Email is required")}),ss=({school:t})=>{const{forgotPasswordRequest:n,clickHandler:r,handleVerify:i}=Ee();return s.jsx(de.Formik,{initialValues:Xe,enableReinitialize:!0,validationSchema:es,onSubmit:async d=>{const p=await r();p&&(d.captcha=p,n(d))},children:d=>{const{handleChange:p,handleSubmit:h,values:y,touched:E,errors:N}=d;return s.jsx("div",{className:`${e.styles["box-login"]}`,children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{src:t.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:t.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]} `,children:"Forgot password"}),s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Enter email to recover your account"}),s.jsxs("div",{className:"w-100",children:[s.jsx(m.Input,{type:"text",name:"email",id:"email",placeholder:"Input email",onChange:p,value:y.email}),E.email&&N.email&&s.jsx(e.ErrorHandler,{text:N.email})]}),s.jsx(ee.Link,{to:"/login",className:`${e.styles["link-to-login"]} mt-2`,children:"Return to login"}),s.jsx(re.GoogleReCaptcha,{action:"forgetPass",onVerify:i}),s.jsx(m.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,onClick:()=>h(),children:"Continue"})})]})})})}})},ts=O.object({password:O.string().required("New password is required"),reEnterPassword:O.string().required("Please re-enter new password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),os=()=>{const{validLink:t,resetPasswordRequest:n,isShowNewPassword:r,setIsShowNewPassword:i,isShowReTypePassword:d,setIsShowReTypePassword:p,initialValues:h}=Ee();return s.jsx(de.Formik,{initialValues:h,enableReinitialize:!0,validationSchema:ts,onSubmit:y=>{n(y)},children:y=>{const{setFieldValue:E,handleSubmit:N,touched:L,errors:x,values:b}=y;return s.jsx(m.Row,{className:`${e.styles["box-login"]}`,children:s.jsx(m.Col,{className:"p-0",children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Reset Password"}),s.jsx("div",{className:"w-100",children:t?s.jsxs(a.Fragment,{children:[s.jsx(m.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(m.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:b.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ne,{isShowPassword:r,togglePasswordVisible:()=>i(!r),onChange:w=>E("password",w.target.value)}),L.password&&x.password&&s.jsx(e.ErrorHandler,{text:x.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ne,{placeholder:"Confirm Password",isShowPassword:d,togglePasswordVisible:()=>p(!d),onChange:w=>E("reEnterPassword",w.target.value)}),L.reEnterPassword&&x.reEnterPassword&&s.jsx(e.ErrorHandler,{text:x.reEnterPassword})]})]}):s.jsxs(a.Fragment,{children:[s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Invalid reset password link"}),s.jsx("p",{className:"w-100",children:"It may have been accessed before or expired or you have just tried to reset another account's password"})]})}),t&&s.jsx(m.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>N(),children:"SET A NEW PASSWORD"})})]})})})})}})},be=`${e.BASE_URL}/api/school`,as=()=>e.api.get(`${be}/settings`),ns=()=>e.api.get(`${be}/info`),rs={auth:{clientId:e.isLocalhost?"a27f8ac9-e039-4bbd-a9e1-3096e52a77bb":"90c6897c-f17b-475e-a7a8-9a19651e0060",authority:"https://login.microsoftonline.com/common",redirectUri:"https://sso.marioforme.com/microsoft-login.html"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(t,n,r)=>{if(!r)switch(t){case ae.LogLevel.Error:console.error(n);return;case ae.LogLevel.Info:console.info(n);return;case ae.LogLevel.Verbose:console.debug(n);return;case ae.LogLevel.Warning:console.warn(n);return;default:return}}}}},is={email:"",password:"",captcha:"",rememberMe:!1,isSessionUserBrowser:!!sessionStorage.getItem(e.IS_USER_SESSION_BROWSER)},ls="/home",Ne="/home",cs="/admin/home",ds="/parent",ms="/admin/schools",gs="/list-student",us="Log in",hs=()=>{const t=Z.useDispatch(),n=ee.useNavigate(),[r,i]=a.useState(!1),d=Z.useSelector(o=>o.common.isLoginGoogle),[p,h]=a.useState(""),[y,E]=a.useState(""),[N,L]=a.useState(""),[x,b]=a.useState(!1),w=Z.useSelector(o=>o.common.inforUserGoogle),B=Z.useSelector(o=>o.common.environment),_=new URLSearchParams(location.search),j=_.get("type")==="classlink",I=_.get("token"),z=_.get("isAdminUser"),[C]=a.useState(!1),[v,D]=a.useState({schoolName:"",schoolLogo:"",schoolId:0}),[S,k]=a.useState(null),P=a.useCallback(()=>{i(!r)},[r]),[M,V]=a.useState(!1),[se,W]=a.useState(!1),[H,me]=a.useState({firstName:"",lastName:"",fullName:"",imageUrl:"",email:"",accessToken:"",googleId:""});a.useEffect(()=>{document.title=us;const o=e.getCookieValue("auth-token");if(o){const c=window.location.hostname;if(localStorage.setItem(e.ACCESS_TOKEN,o),document.cookie=`auth-token=;domain=${c.includes("localhost")?c:".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=/",z)return n("/admin/home");pe(o);return}e.getAccessToken()&&n("/"),Ae()},[z,pe,n]);const ie=()=>{localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),localStorage.removeItem("USER_EMAIL")};a.useEffect(()=>{j&&I!=""&&Ie()},[]);const G=()=>{W(!se)},ke=()=>{if(e.isLocalhost){const o="https://clever.com/oauth/instant-login?client_id=44f4bbf55cd873d3f7e5&district_id=6620cba31f1ddde7bd689dc5";window.location.href=o}else{const o=`https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;window.location.href=o}},Ie=async()=>{t(e.setLoading(!0));try{const o={tokenClassLink:I},l=await e.apiInforUserClassLink(o),{email:c,token:f}=l.data;await K({email:c,rememberMe:!1,password:"default",accessToken:f})}catch(o){t(e.setAlert({type:"danger",message:o.response?.data?.title||o.message}))}t(e.setLoading(!1))},ge=window.location.host.includes("-district"),Te=a.useCallback(async()=>{t(e.setLoading(!0));try{const o=await ns(),l=o.data.schoolLogo??"";o.data&&D({schoolName:o.data.schoolName,schoolLogo:l?e.getFileUrl(l):e.getStaticFileUrl("/images/logo_header_blue.png"),schoolId:o.data.schoolId})}catch(o){t(e.setAlert({type:"danger",message:o.response?.data?.title||o.message}))}t(e.setLoading(!1))},[]),[_e,le]=a.useState(!1),[Q,ue]=a.useState(null),te=a.useCallback((o,l,c,f,g,U,A,F,q,T)=>{const R=T?.isSessionUserBrowser??!1;if(R?(sessionStorage.setItem(e.ACCESS_TOKEN,o),sessionStorage.setItem(e.IS_USER_SESSION_BROWSER,String(R))):(sessionStorage.removeItem(e.IS_USER_SESSION_BROWSER),localStorage.setItem(e.ACCESS_TOKEN,o)),localStorage.removeItem(e.NOTIFICATION_ALERT_KEY),t(e.setUser({id:l,firstName:c,lastName:f,roles:g,email:U,profileImageFileName:A})),!localStorage.getItem("ROLES")&&g.includes("Admin")&&localStorage.setItem("ROLES","Admin"),T?.email&&!g.includes("Admin")){oe.init(e.isLocalhost?e.INIT_AMPLITUDE_KEY_STAGE:e.INIT_AMPLITUDE_KEY_PROD,T.email,{defaultTracking:!1});const Y=window.location.hostname,J=new oe.Identify;J.set("domain",Y),oe.identify(J),oe.track("general: session start",{user_id:T.email,domain:Y,roles:g?.toString()}),localStorage.setItem("USER_EMAIL",T.email),F&&oe.track("general: first login",{user_id:T.email,domain:Y,roles:g?.toString()})}const $=Y=>{const J=e.navigateBySchoolLevel(Y,q);window.location.pathname.startsWith("/es")?q==="es"?n(J):window.location.href=J:q==="es"?window.location.href=J:n(J)};ge?$(ms):g.includes("Admin")?$(cs):g.includes("Teacher")||g.includes("Assistant")||g.includes("Counselor")||g.includes("SecondaryTeacher")?$(ls):g.includes("Student")?$(Ne):g.includes("Parent")?$(ds):g.includes("EduTeacher")&&$(gs),t(e.setLoading(!1))},[t,n,ge]),ce=a.useCallback((o,l,c)=>x&&o?.includes("Student")&&(l==="es"||c==="ES")?(t(e.setAlert({type:"danger",message:"Unable to sign in with SSO. Please contact your admin or teacher."})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),t(e.setLoading(!1)),!0):!1,[x,t]),he=a.useCallback(o=>x&&o&&e.ES_GRADES.includes(o.trim())?(t(e.setAlert({type:"danger",message:"Unable to sign in with SSO. Please contact your admin or teacher."})),t(e.setLoading(!1)),!0):!1,[x,t]);async function pe(o){t(e.setLoading(!0));try{const l=await e.getInfo();let{id:c,firstName:f,lastName:g,roles:U,email:A,profileImageFileName:F,isLoginFirst:q,schoolLevel:T,appType:R,preferredAppType:$,needsAppTypeChoice:Y}=l.data;if(Y){ue({email:A}),le(!0),t(e.setLoading(!1));return}T||(R==="ES"||R==="ES, MS"&&$==="ES")&&(T="es"),te(o,c,f,g,U,A,F,q,T,{email:A})}catch(l){t(e.setAlert({type:"danger",message:l.response?.data?.title||l.message||"Login failed"})),t(e.setLoading(!1))}}const Pe=a.useCallback(async o=>{if(le(!1),!Q)return;t(e.setLoading(!0));const l=o==="es"?"ES":o==="ms"?"MS":"ES, MS";try{const c=await e.logIn({...Q,email:Q?.email?.trim(),password:Q?.password?.trim(),preferredAppType:l});let{token:f,id:g,firstName:U,lastName:A,roles:F,email:q,profileImageFileName:T,isLoginFirst:R,schoolLevel:$}=c.data;if(!$&&o==="es"&&($="es"),ce(F,$,c.data.appType))return;te(f,g,U,A,F,q,T,R,$,Q)}catch(c){t(e.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Login failed"})),t(e.setLoading(!1))}},[Q,te,ce,t]),K=a.useCallback(async o=>{t(e.setLoading(!0));try{const l=await e.logIn({...o,email:o?.email?.trim(),password:o?.password?.trim()});let{token:c,id:f,firstName:g,lastName:U,roles:A,email:F,profileImageFileName:q,isLoginFirst:T,schoolLevel:R}=l.data;if(l.data.needsAppTypeChoice){ue(o),le(!0),t(e.setLoading(!1));return}if(R||(l.data.appType==="ES"||l.data.appType==="ES, MS"&&l.data.preferredAppType==="ES")&&(R="es"),ce(A,R,l.data.appType))return;te(c,f,g,U,A,F,q,T,R,o)}catch(l){t(e.setAlert({type:"danger",message:l.response?.data?.title||l.message||"Login failed"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),t(e.setLoading(!1))}},[te,ce,t]),Ae=async()=>{try{const o=await e.getGoogleClientId();h(o.data.googleClientId),E(o.data.googleCaptchaId),L(o.data.extensionEmail),b(o.data.isRestrictedLogin)}catch(o){t(e.setAlert({type:"danger",message:o.response?.data?.title||o.message||"Login failed"}))}},fe=a.useCallback(async(o,l,c,f)=>{t(e.setLoading(!0));try{if((await e.checkUserGoogle(o,l)).data){const A={email:l.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:c,captcha:"",loginType:X.LoginType.Google};if(f!=null){const F=await f();A.captcha=F}await K(A),t(e.setIsLoginGoogle(!1))}else me({...l,token:c}),G()}catch(g){t(e.setAlert({type:"danger",message:g.response?.data?.title||g.message||"Login failed"}))}t(e.setLoading(!1))},[K,t,G]),Re=a.useCallback(async(o,l)=>{t(e.setLoading(!0));try{if(he(o))return;if((await e.registerUserStudent({...H,gradeLevel:o}))?.data){const f={email:H.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:H.accessToken,captcha:"",loginType:X.LoginType.Google};if(l!=null){const g=await l();f.captcha=g}await K(f),G()}}catch(c){t(e.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Login failed"}))}t(e.setLoading(!1))},[he,H,K,G,t]),$e=async(o,l)=>{t(e.setLoading(!0));try{const c={firstName:w.firstName,lastName:w.lastName,imageUrl:w.imageUrl,fullName:w.fullName,email:w.email,accessToken:w.accessToken,teacherId:o};if((await e.registerUserStudent(c)).data){const g=await l(),U={email:w.email,captcha:g,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:w.accessToken,loginType:X.LoginType.Google};t(e.setIsLoginGoogle(!1)),await K(U),n(Ne)}}catch(c){t(e.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Login failed"}))}t(e.setIsLoginGoogle(!1)),t(e.setLoading(!1))},Oe=async()=>{try{const o=await as();t(e.setSandboxMode(o.data.isSandboxMode))}catch(o){console.error(o)}},xe=async o=>{S.handleRedirectPromise().then(async l=>{if(v?.schoolId)if(l){let c=l.account;await we(c,o)}else{const c=S.getAllAccounts();if(c.length===0){const f=B==="PreProduction"?"https://mario1.marioforme.com":e.isLocalhost?"https://brightsoft.marioforme.com":"https://sso.marioforme.com";window.location.href=(window.location.hostname==="localhost"?window.location.origin:f)+`/microsoft-login.html?redirect-uri=${window.location.origin}&schoolId=${v.schoolId}`}else{let f=c[0];await we(f,o)}}}).catch(l=>{console.error(l)})},we=async(o,l)=>{let c=o.name,f={firstName:c.split(" ").slice(0,-1).join(" "),lastName:c.split(" ").slice(-1).join(" "),fullName:c,imageUrl:"",email:o.username,accessToken:o.idTokenClaims.aio,googleId:o.tenantId};t(e.setInforUserGoogle(f)),await fe(X.TypeLogin.MicrosoftSSO,f,o.idTokenClaims.aio,l)},Ge=async()=>{const o=new ae.PublicClientApplication(rs);await o.initialize(),k(o)};return a.useEffect(()=>{let o=window.location.href;S&&o.includes("code")&&o.includes("client_info")&&xe()},[JSON.stringify(S)]),a.useEffect(()=>{Oe(),Ge(),Te()},[]),{defaultInfo:is,userLogin:K,openLogin:r,toggle:P,isShowPassword:M,setIsShowPassword:V,fnIsCheckLogin:fe,isLoginGoogle:d,infoUser:w,submitLogin:$e,googleClientId:p,googleRecaptchaId:y,handleCancelModelAssign:ie,openModelAssign:C,fnLoginSSO:xe,school:v,extensionEmail:N,handleLoginWidthClever:ke,openModalSelectGrade:se,handleRegisterUser:Re,handleToggleModelGrade:G,openModalSelectTier:_e,handleSelectTier:Pe,setOpenModalSelectTier:le}},je="/",ps="/login",Ce="Log in",fs=()=>{const t=Z.useDispatch(),n=ee.useNavigate(),r=location.search,d=new URLSearchParams(r).get("userId"),[p,h]=a.useState(!1),[y,E]=a.useState(!1),[N,L]=a.useState({password:"",reEnterPassword:"",email:"",userId:d??"",token:""}),{executeRecaptcha:x}=re.useGoogleReCaptcha(),b=a.useCallback(async j=>{t(e.setLoading(!0));try{const I=await e.getUserNewPassword(j);L({...N,email:I.data})}catch(I){t(e.setAlert({type:"danger",message:I.message}))}t(e.setLoading(!1))},[]),w=a.useCallback(async j=>{t(e.setLoading(!0));try{await e.createPassword(j),n(ps),t(e.setAlert({type:"success",message:"Create password sucessfully"}))}catch(I){t(e.setAlert({type:"danger",message:I.response?.data?.title||I.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}t(e.setLoading(!1))},[]),B=a.useCallback(async()=>{if(!x){console.log("execute recaptcha undefined");return}return await x("forgetPass")},[x]),_=a.useCallback(()=>{},[]);return a.useEffect(()=>{document.title=Ce,e.getAccessToken()&&n(je),d&&b(d)},[d]),a.useEffect(()=>{document.title=Ce,e.getAccessToken()&&n(je)},[]),{createPasswordRequest:w,isShowNewPassword:p,setIsShowNewPassword:h,isShowReTypePassword:y,setIsShowReTypePassword:E,clickHandler:B,handleVerify:_,initialValues:N}},xs=O.object({password:O.string().required("Password is required"),reEnterPassword:O.string().required("Please re-enter Password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),ws=()=>{const{createPasswordRequest:t,isShowNewPassword:n,setIsShowNewPassword:r,isShowReTypePassword:i,setIsShowReTypePassword:d,initialValues:p}=fs();return s.jsx(de.Formik,{initialValues:p,enableReinitialize:!0,validationSchema:xs,onSubmit:h=>{t(h)},children:h=>{const{setFieldValue:y,handleSubmit:E,touched:N,errors:L,values:x}=h;return s.jsx(m.Row,{className:`${e.styles["box-login"]}`,children:s.jsxs(m.Col,{className:"p-0",children:[s.jsx("div",{hidden:!x.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Create Your Password"}),s.jsx("div",{className:"w-100",children:s.jsxs(a.Fragment,{children:[s.jsx(m.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(m.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:x.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ne,{isShowPassword:n,togglePasswordVisible:()=>r(!n),onChange:b=>y("password",b.target.value)}),N.password&&L.password&&s.jsx(e.ErrorHandler,{text:L.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ne,{placeholder:"Confirm Password",isShowPassword:i,togglePasswordVisible:()=>d(!i),onChange:b=>y("reEnterPassword",b.target.value)}),N.reEnterPassword&&L.reEnterPassword&&s.jsx(e.ErrorHandler,{text:L.reEnterPassword})]})]})}),s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>E(),children:"CREATE YOUR PASSWORD"})]})}),s.jsx("div",{hidden:!!x.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"You cannot regenerate the password"})]})})]})})}})},Ss="_modalContent_1pxxz_1",ys="_closeButton_1pxxz_6",Ns="_modalBody_1pxxz_17",js="_iconWrapper_1pxxz_22",Cs="_title_1pxxz_38",vs="_subtitle_1pxxz_45",Ls="_tierCard_1pxxz_51",Es="_es_1pxxz_60",bs="_tierTitle_1pxxz_71",ks="_tierDesc_1pxxz_76",Is="_arrow_1pxxz_81",Ts="_ms_1pxxz_85",_s="_both_1pxxz_110",Ps="_cardLeft_1pxxz_134",As="_cardText_1pxxz_138",u={modalContent:Ss,closeButton:ys,modalBody:Ns,iconWrapper:js,title:Cs,subtitle:vs,tierCard:Ls,es:Es,tierTitle:bs,tierDesc:ks,arrow:Is,ms:Ts,both:_s,cardLeft:Ps,cardText:As},Rs=({open:t,onSelectTier:n,onClose:r})=>s.jsxs(m.Modal,{isOpen:t,style:{zIndex:1201,maxWidth:450},centered:!0,autoFocus:!1,returnFocusAfterClose:!1,contentClassName:u.modalContent,children:[s.jsx("div",{className:u.closeButton,children:r&&s.jsx(e.MdClose,{onClick:()=>r(),size:24})}),s.jsxs(m.ModalBody,{className:u.modalBody,children:[s.jsx("div",{className:u.iconWrapper,children:s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),s.jsx("h4",{className:u.title,children:"Select Grade Level"}),s.jsx("p",{className:u.subtitle,children:"Select the grade levels you support"}),s.jsxs("div",{onClick:()=>n("es"),className:`${u.tierCard} ${u.es}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Elementary / Primary"}),s.jsx("div",{className:u.tierDesc,children:"Grades 2-5 / Years 3-6"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]}),s.jsxs("div",{onClick:()=>n("ms"),className:`${u.tierCard} ${u.ms}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Middle & High / Secondary"}),s.jsx("div",{className:u.tierDesc,children:"Grades 6-12 / Years 7-13"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]}),s.jsxs("div",{onClick:()=>n("both"),className:`${u.tierCard} ${u.both}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Both Tiers"}),s.jsx("div",{className:u.tierDesc,children:"Access all grade levels"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]})]})]}),$s=a.memo(Rs),Os="Log in",Gs="Forgot password",Ms="Reset password",Us=t=>{const{isLogin:n,isForgotPassword:r,isResetPassword:i,isCreatePassword:d}=t,{defaultInfo:p,userLogin:h,googleRecaptchaId:y,handleCancelModelAssign:E,school:N,openModelAssign:L,setIsShowPassword:x,fnIsCheckLogin:b,isLoginGoogle:w,submitLogin:B,infoUser:_,googleClientId:j,isShowPassword:I,fnLoginSSO:z,extensionEmail:C,handleLoginWidthClever:v,openModalSelectGrade:D,handleRegisterUser:S,handleToggleModelGrade:k,openModalSelectTier:P,handleSelectTier:M,setOpenModalSelectTier:V}=hs();return a.useEffect(()=>{n&&(document.title=Os),r&&(document.title=Gs),i&&(document.title=Ms)},[n,r,i]),s.jsxs("div",{className:`${e.styles.login} container-fluid font-family-lato`,children:[s.jsxs(m.Row,{className:"h-100",children:[s.jsxs(m.Col,{lg:8,md:12,xs:12,className:"d-flex justify-content-center h-100 align-items-center p-3 flex-column",children:[!!y&&s.jsxs(re.GoogleReCaptchaProvider,{useRecaptchaNet:!0,reCaptchaKey:y,scriptProps:{async:!0,defer:!0,appendTo:"body"},children:[n&&s.jsx(Ye,{userLogin:h,defaultInfo:p,onCancelModelAssign:E,openModelAssign:L,school:N,fnIsCheckLogin:b,googleClientId:j,infoUser:_,isLoginGoogle:w,isShowPassword:I,setIsShowPassword:x,submitLogin:B,fnLoginSSO:z,extensionEmail:C,onLoginWidthClever:v,openModalSelectGrade:D,handleRegisterUser:S,onToggleModelGrade:k}),r&&s.jsx(ss,{school:N})]}),i&&s.jsx(os,{}),d&&s.jsx(ws,{}),s.jsx("a",{href:"/privacy-policy/",target:"blank",className:`${e.styles["privacy-policy"]}`,children:"Privacy Policy"})]}),s.jsx(m.Col,{className:"p-3 mh-100 d-flex justify-content-end",lg:4,md:12,xs:12,children:s.jsx("img",{src:`${e.getStaticFileUrl(window.innerWidth>992?"/images/img-login.png":"/images/img-login-tablet.png")}`,className:`${e.styles["img-login"]}`})})]}),s.jsx($s,{open:P,onSelectTier:M,onClose:()=>V(!1)})]})};exports.default=Us;
|