"use strict";(self.webpackChunksmu_app=self.webpackChunksmu_app||[]).push([[875],{7986:function(e,t,r){r.r(t),r.d(t,{default:function(){return de}});var n=r(7294),o=r(5444),a=r(3332),i=r(7462),s=r(638),c={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},l=function(e){return(0,i.Z)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};var u=(0,s.Z)((function(e){return{"@global":{html:c,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,i.Z)({margin:0},l(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,r=void 0===t?null:t;return e.classes,n.createElement(n.Fragment,null,r)})),p=r(5987),d=r(5505),m=[0,1,2,3,4,5,6,7,8,9,10],g=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=parseFloat(e);return"".concat(r/t).concat(String(e).replace(String(r),"")||"px")}var h=n.forwardRef((function(e,t){var r=e.alignContent,o=void 0===r?"stretch":r,a=e.alignItems,s=void 0===a?"stretch":a,c=e.classes,l=e.className,u=e.component,m=void 0===u?"div":u,g=e.container,f=void 0!==g&&g,h=e.direction,x=void 0===h?"row":h,b=e.item,y=void 0!==b&&b,v=e.justify,w=e.justifyContent,k=void 0===w?"flex-start":w,E=e.lg,S=void 0!==E&&E,C=e.md,Z=void 0!==C&&C,W=e.sm,j=void 0!==W&&W,P=e.spacing,z=void 0===P?0:P,K=e.wrap,M=void 0===K?"wrap":K,N=e.xl,R=void 0!==N&&N,T=e.xs,F=void 0!==T&&T,G=e.zeroMinWidth,I=void 0!==G&&G,L=(0,p.Z)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),O=(0,d.Z)(c.root,l,f&&[c.container,0!==z&&c["spacing-xs-".concat(String(z))]],y&&c.item,I&&c.zeroMinWidth,"row"!==x&&c["direction-xs-".concat(String(x))],"wrap"!==M&&c["wrap-xs-".concat(String(M))],"stretch"!==s&&c["align-items-xs-".concat(String(s))],"stretch"!==o&&c["align-content-xs-".concat(String(o))],"flex-start"!==(v||k)&&c["justify-content-xs-".concat(String(v||k))],!1!==F&&c["grid-xs-".concat(String(F))],!1!==j&&c["grid-sm-".concat(String(j))],!1!==Z&&c["grid-md-".concat(String(Z))],!1!==S&&c["grid-lg-".concat(String(S))],!1!==R&&c["grid-xl-".concat(String(R))]);return n.createElement(m,(0,i.Z)({className:O,ref:t},L))})),x=(0,s.Z)((function(e){return(0,i.Z)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,t){var r={};return m.forEach((function(n){var o=e.spacing(n);0!==o&&(r["spacing-".concat(t,"-").concat(n)]={margin:"-".concat(f(o,2)),width:"calc(100% + ".concat(f(o),")"),"& > $item":{padding:f(o,2)}})})),r}(e,"xs"),e.breakpoints.keys.reduce((function(t,r){return function(e,t,r){var n={};g.forEach((function(e){var t="grid-".concat(r,"-").concat(e);if(!0!==e)if("auto"!==e){var o="".concat(Math.round(e/12*1e8)/1e6,"%");n[t]={flexBasis:o,flexGrow:0,maxWidth:o}}else n[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else n[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===r?(0,i.Z)(e,n):e[t.breakpoints.up(r)]=n}(t,e,r),t}),{}))}),{name:"MuiGrid"})(h),b=x,y=r(2982),v=(r(5697),r(4131));function w(e,t){var r={};return Object.keys(e).forEach((function(n){-1===t.indexOf(n)&&(r[n]=e[n])})),r}function k(e){var t=function(t){var r=e(t);return t.css?(0,i.Z)({},(0,v.Z)(r,e((0,i.Z)({theme:t.theme},t.css))),w(t.css,[e.filterProps])):t.sx?(0,i.Z)({},(0,v.Z)(r,e((0,i.Z)({theme:t.theme},t.sx))),w(t.sx,[e.filterProps])):r};return t.propTypes={},t.filterProps=["css","sx"].concat((0,y.Z)(e.filterProps)),t}var E=k;var S=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=function(e){return t.reduce((function(t,r){var n=r(e);return n?(0,v.Z)(t,n):t}),{})};return n.propTypes={},n.filterProps=t.reduce((function(e,t){return e.concat(t.filterProps)}),[]),n},C=r(4942),Z=r(3592);function W(e,t){return t&&"string"==typeof t?t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e):null}var j=function(e){var t=e.prop,r=e.cssProperty,n=void 0===r?e.prop:r,o=e.themeKey,a=e.transform,i=function(e){if(null==e[t])return null;var r=e[t],i=W(e.theme,o)||{};return(0,Z.k)(e,r,(function(e){var t;return"function"==typeof i?t=i(e):Array.isArray(i)?t=i[e]||e:(t=W(i,e)||e,a&&(t=a(t))),!1===n?t:(0,C.Z)({},n,t)}))};return i.propTypes={},i.filterProps=[t],i};function P(e){return"number"!=typeof e?e:"".concat(e,"px solid")}var z=S(j({prop:"border",themeKey:"borders",transform:P}),j({prop:"borderTop",themeKey:"borders",transform:P}),j({prop:"borderRight",themeKey:"borders",transform:P}),j({prop:"borderBottom",themeKey:"borders",transform:P}),j({prop:"borderLeft",themeKey:"borders",transform:P}),j({prop:"borderColor",themeKey:"palette"}),j({prop:"borderRadius",themeKey:"shape"})),K=S(j({prop:"displayPrint",cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}}),j({prop:"display"}),j({prop:"overflow"}),j({prop:"textOverflow"}),j({prop:"visibility"}),j({prop:"whiteSpace"})),M=S(j({prop:"flexBasis"}),j({prop:"flexDirection"}),j({prop:"flexWrap"}),j({prop:"justifyContent"}),j({prop:"alignItems"}),j({prop:"alignContent"}),j({prop:"order"}),j({prop:"flex"}),j({prop:"flexGrow"}),j({prop:"flexShrink"}),j({prop:"alignSelf"}),j({prop:"justifyItems"}),j({prop:"justifySelf"})),N=S(j({prop:"gridGap"}),j({prop:"gridColumnGap"}),j({prop:"gridRowGap"}),j({prop:"gridColumn"}),j({prop:"gridRow"}),j({prop:"gridAutoFlow"}),j({prop:"gridAutoColumns"}),j({prop:"gridAutoRows"}),j({prop:"gridTemplateColumns"}),j({prop:"gridTemplateRows"}),j({prop:"gridTemplateAreas"}),j({prop:"gridArea"})),R=S(j({prop:"position"}),j({prop:"zIndex",themeKey:"zIndex"}),j({prop:"top"}),j({prop:"right"}),j({prop:"bottom"}),j({prop:"left"})),T=S(j({prop:"color",themeKey:"palette"}),j({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"})),F=j({prop:"boxShadow",themeKey:"shadows"});function G(e){return e<=1?"".concat(100*e,"%"):e}var I,L=j({prop:"width",transform:G}),O=j({prop:"maxWidth",transform:G}),A=j({prop:"minWidth",transform:G}),B=j({prop:"height",transform:G}),U=j({prop:"maxHeight",transform:G}),D=j({prop:"minHeight",transform:G}),H=(j({prop:"size",cssProperty:"width",transform:G}),j({prop:"size",cssProperty:"height",transform:G}),S(L,O,A,B,U,D,j({prop:"boxSizing"}))),q=r(5408),V=S(j({prop:"fontFamily",themeKey:"typography"}),j({prop:"fontSize",themeKey:"typography"}),j({prop:"fontStyle",themeKey:"typography"}),j({prop:"fontWeight",themeKey:"typography"}),j({prop:"letterSpacing"}),j({prop:"lineHeight"}),j({prop:"textAlign"})),J=r(6410),X=E(S(z,K,M,N,R,T,F,H,q.Z,V)),_=(0,J.Z)("div")(X,{name:"MuiBox"}),$=r(920),Q=r(1664),Y=n.forwardRef((function(e,t){var r=e.classes,o=e.className,a=e.component,s=void 0===a?"div":a,c=e.disableGutters,l=void 0!==c&&c,u=e.fixed,m=void 0!==u&&u,g=e.maxWidth,f=void 0===g?"lg":g,h=(0,p.Z)(e,["classes","className","component","disableGutters","fixed","maxWidth"]);return n.createElement(s,(0,i.Z)({className:(0,d.Z)(r.root,o,m&&r.fixed,l&&r.disableGutters,!1!==f&&r["maxWidth".concat((0,Q.Z)(String(f)))]),ref:t},h))})),ee=(0,s.Z)((function(e){return{root:(0,C.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"block"},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),disableGutters:{paddingLeft:0,paddingRight:0},fixed:Object.keys(e.breakpoints.values).reduce((function(t,r){var n=e.breakpoints.values[r];return 0!==n&&(t[e.breakpoints.up(r)]={maxWidth:n}),t}),{}),maxWidthXs:(0,C.Z)({},e.breakpoints.up("xs"),{maxWidth:Math.max(e.breakpoints.values.xs,444)}),maxWidthSm:(0,C.Z)({},e.breakpoints.up("sm"),{maxWidth:e.breakpoints.values.sm}),maxWidthMd:(0,C.Z)({},e.breakpoints.up("md"),{maxWidth:e.breakpoints.values.md}),maxWidthLg:(0,C.Z)({},e.breakpoints.up("lg"),{maxWidth:e.breakpoints.values.lg}),maxWidthXl:(0,C.Z)({},e.breakpoints.up("xl"),{maxWidth:e.breakpoints.values.xl})}}),{name:"MuiContainer"})(Y),te=r(453),re=r(1097),ne=I||(I={});ne.Pop="POP",ne.Push="PUSH",ne.Replace="REPLACE";var oe=function(e){return e};function ae(e){e.preventDefault(),e.returnValue=""}function ie(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function se(){return Math.random().toString(36).substr(2,8)}function ce(e){var t=e.pathname,r=e.search;return(void 0===t?"/":t)+(void 0===r?"":r)+(void 0===(e=e.hash)?"":e)}function le(e){var t={};if(e){var r=e.indexOf("#");0<=r&&(t.hash=e.substr(r),e=e.substr(0,r)),0<=(r=e.indexOf("?"))&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var ue=r(7977),pe=(0,$.Z)((function(e){var t;return{paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(3)},submit:(t={margin:e.spacing(3,0,2),padding:2,height:40,backgroundColor:"#E3B680",color:"#1E4C38",width:"100%"},t.height="40pt",t.textTransform="none",t.fontWeight="bold",t.marginTop="5%",t.fontFamily="Verdana",t),rightgrid:{backgroundColor:"white",width:"100%"},title:{fontWeight:"bold",color:"#1E4C38"},outsidegrid:{backgroundColor:"linear-gradient(to right, #12c2e9, #c471ed, #f64f59)",height:"100%"},insidegrid:{},lefttitle:{fontWeight:"bold",color:"black",margin:"2px"},text:{color:"#1E4C38"}}}));function de(e){var t=(0,n.useState)({loading:!1,msg:null,hasMsg:!1,success:!1,showPassword:!1}),r=t[0],s=t[1],c=(0,n.useState)((function(){var e=localStorage.getItem("username");return JSON.parse(e)||""})),l=c[0],p=c[1],d=(0,n.useState)(""),m=(d[0],d[1]),g=function(e){function t(){var e=s.location,t=c.state||{};return[t.idx,oe({pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"})]}function r(e){return"string"==typeof e?e:ce(e)}function n(e,t){return void 0===t&&(t=null),oe((0,i.Z)({},d,"string"==typeof e?le(e):e,{state:t,key:se()}))}function o(e){u=e,e=t(),p=e[0],d=e[1],m.call({action:u,location:d})}function a(e){c.go(e)}void 0===e&&(e={});var s=void 0===(e=e.window)?document.defaultView:e,c=s.history,l=null;s.addEventListener("popstate",(function(){if(l)g.call(l),l=null;else{var e=I.Pop,r=t(),n=r[0];if(r=r[1],g.length){if(null!=n){var i=p-n;i&&(l={action:e,location:r,retry:function(){a(-1*i)}},a(i))}}else o(e)}}));var u=I.Pop,p=(e=t())[0],d=e[1],m=ie(),g=ie();return null==p&&(p=0,c.replaceState((0,i.Z)({},c.state,{idx:p}),"")),{get action(){return u},get location(){return d},createHref:r,push:function e(t,a){var i=I.Push,l=n(t,a);if(!g.length||(g.call({action:i,location:l,retry:function(){e(t,a)}}),0)){var u=[{usr:l.state,key:l.key,idx:p+1},r(l)];l=u[0],u=u[1];try{c.pushState(l,"",u)}catch(d){s.location.assign(u)}o(i)}},replace:function e(t,a){var i=I.Replace,s=n(t,a);g.length&&(g.call({action:i,location:s,retry:function(){e(t,a)}}),1)||(s=[{usr:s.state,key:s.key,idx:p},r(s)],c.replaceState(s[0],"",s[1]),o(i))},go:a,back:function(){a(-1)},forward:function(){a(1)},listen:function(e){return m.push(e)},block:function(e){var t=g.push(e);return 1===g.length&&s.addEventListener("beforeunload",ae),function(){t(),g.length||s.removeEventListener("beforeunload",ae)}}}}(),f=function(){g.push("/menu"),window.location.reload()},h=function(){g.push("/professormenu"),window.location.reload()},x=pe();return document.body.classList.add("no-scroll"),(0,n.useEffect)((function(){localStorage.setItem("username",JSON.stringify(l))}),[l]),n.createElement(_,{display:"flex",justifyContent:"center",bgcolor:"gray",style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},width:"50%"},n.createElement(ee,{component:"main",width:"50%",justify:"center"},n.createElement(u,null),n.createElement(b,{container:!0,direction:"row",width:"100",position:"absolute",top:"50%",left:"50%","margin-right":"-50%",className:x.insidegrid},n.createElement(b,{item:!0,sm:12,md:12,className:x.rightGrid},n.createElement("div",{className:x.paper},n.createElement(b,{container:!0,justify:"center"},n.createElement(b,{item:!0},n.createElement(te.Z,{component:"h1",variant:"h5",justify:"flex-start",className:x.title},"Login"))),n.createElement("div",null),n.createElement("br",null),n.createElement(b,{container:!0,justify:"center"},n.createElement(b,{item:!0},n.createElement("img",{src:ue.Z,alt:"SMU Logo"}))),n.createElement("form",{id:"registerUserForm",name:"registerUserForm",className:x.form,onSubmit:function(e){e.preventDefault(),s((function(e){return Object.assign({},e,{loadin:!0})}));r.email,r.password;var t=document.forms.registerUserForm.username.value,n=document.forms.registerUserForm.password.value;["markpal@smu.edu.sg","ttest@smu.edu.sg","ttesta@smu.edu.sg","markpalm@smu.edu.sg","wileym@smu.edu.sg","allieam@smu.edu.sg","vigneshsinha@smu.edu.sg","otism@smu.edu.sg","derekstoughton@smu.edu.sg","kirkg@smu.edu.sg","jacquelynyoung@smu.edu.sg","jacobmims@smu.edu.sg","calizonn@smu.edu.sg","psastri@smu.edu.sg"].includes(t)?["password","hokies3","pass321","password1","benjithedog2","batman123","password123","qwery","picture1","passwordabc123","abcdefg","villains2"].includes(n)?f():console.log("The password is incorrect."):["buketavci@smu.edu.sg","shchan@smu.edu.sg","kmchan@smu.edu.sg","dbhave@smu.edu.sg","mbashshur@smu.edu.sg","rbledow@smu.edu.sg","eboehmer@smu.edu.sg","oboyabatli@smu.edu.sg","sandeepc@smu.edu.sg","shantanub@smu.edu.sg"].includes(t)?["password"].includes(n)?h():console.log("The password is incorrect."):console.log("The username is incorrect.")}},n.createElement(b,{container:!0,spacing:2,justify:"center"},n.createElement(b,{item:!0,xs:11,sm:11},n.createElement(re.Z,{autoFocus:"true",required:!0,fullWidth:!0,id:"username",label:"Username",name:"username",type:"email",autoComplete:"email",onChange:function(e){return p(e.target.value)}})),n.createElement(b,{item:!0,xs:11,sm:11},n.createElement(re.Z,{required:!0,fullWidth:!0,name:"password",label:"Password",id:"password",type:r.showPassword?"text":"password",onChange:function(e){return m(e.target.value)},autoComplete:"current-password"})),n.createElement(b,{item:!0,xs:12,sm:12,align:"left"},n.createElement(o.rU,{href:"#",variant:"body2",className:x.text},"Forgot Password?")),n.createElement(b,{item:!0,xs:12,sm:12,align:"right"},n.createElement(a.Z,{variant:"outline-light",size:"lg"},n.createElement(o.rU,{to:"/signup"},"Not a member yet?")))),n.createElement(b,{container:!0,justify:"center"},n.createElement(b,{item:!0,xs:12,sm:12},n.createElement(te.Z,{style:(r.hasMsg,{color:r.success?"green":"red"}),component:"p",variant:"subtitle1",justify:"center",align:"center"},r.msg)),n.createElement(b,{item:!0,xs:4,sm:4},n.createElement(a.Z,{type:"submit",fullWidth:!0,variant:"contained",color:"dark",padding:5,className:x.submit},"Submit")))))))))}},7977:function(e,t,r){t.Z=r.p+"static/smu-498a32d8bc812a51e9d0f02c78c3b0a9.png"}}]);
//# sourceMappingURL=component---src-pages-login-js-c43dbbbb34293f88d03d.js.map