1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3459],{83236:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return t(22999)}])},5478:function(n,e,t){"use strict";var r=t(82729),i=t(85893),o=t(19521),s=t(41664),l=t.n(s),a=t(609),c=t(9473);function _templateObject(){let n=(0,r._)(["\n padding: 16px;\n border-radius: 4px;\n display: flex;\n align-items: center;\n gap: 16px;\n\n p,\n span {\n margin: 0px;\n }\n\n p {\n color: ",';\n font-family: "Mulish", sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 150%;\n }\n\n span {\n font-style: normal;\n font-weight: 700;\n line-height: 150%;\n text-decoration-line: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 2px;\n }\n']);return _templateObject=function(){return n},n}let d=o.default.div.withConfig({componentId:"sc-7c74cba6-0"})(_templateObject(),n=>{let{theme:e}=n;return e.mode,e.colors.palette.grey["950"]});e.Z=function(n){let{type:e,includeLink:t="",textContent:r}=n;(0,c.v9)(a.o4);let o={error:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:[(0,i.jsx)("rect",{width:"2",height:"2",transform:"matrix(1 0 0 -1 11.5 9)",fill:"#F43F5E"}),(0,i.jsx)("rect",{width:"2",height:"6",transform:"matrix(1 0 0 -1 11.5 17)",fill:"#F43F5E"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5 3H7.5V5H5.5V7H3.5V17H5.5V19H7.5V21H17.5V19H19.5V17H21.5V7H19.5V5H17.5V3ZM17.5 5V7H19.5V17H17.5V19H7.5V17H5.5V7H7.5V5H17.5Z",fill:"#F43F5E"})]}),success:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 6H20V8H18V6ZM16 10V8H18V10H16ZM14 12V10H16V12H14ZM12 14H14V12H12V14ZM10 16H12V14H10V16ZM8 16V18H10V16H8ZM6 14H8V16H6V14ZM6 14H4V12H6V14Z",fill:"#84CC16"})})},s={error:{border:"#FECDD3",background:"#FFF1F2",textAccent:"#020617"},success:{border:"#D9F99D",background:"#F7FEE7",textAccent:"#020617"}}[e];return(0,i.jsxs)(d,{"data-aos":"fade-down","data-aos-duration":"400",style:{border:"2px solid ".concat(s.border),backgroundColor:s.background},className:"alert-bar",children:[(0,i.jsx)("div",{className:"icon",children:o[e]}),(0,i.jsxs)("p",{children:[r," ",t&&(0,i.jsx)(l(),{href:t,style:{all:"unset"},target:"_blank",children:(0,i.jsx)("span",{style:{color:s.textAccent},className:"nes-pointer",children:"View submission"})})]})]})}},27936:function(n,e,t){"use strict";var r=t(82729),i=t(85893),o=t(19521);function _templateObject(){let n=(0,r._)(["\n position: absolute;\n width: 30vw;\n height: 0px;\n z-index: 10;\n overflow: hidden;\n\n h1,\n p {\n height: 10rem;\n }\n"]);return _templateObject=function(){return n},n}let s=o.default.main.withConfig({componentId:"sc-e8309d9d-0"})(_templateObject());e.Z=function(n){let{h1:e,description:t="",canonical:r=""}=n;return e?(0,i.jsxs)(s,{children:[(0,i.jsx)("h1",{children:e}),t?(0,i.jsx)("p",{className:"description",children:t}):null,r?(0,i.jsx)("link",{rel:"canonical",href:r}):null]}):null}},22999:function(n,e,t){"use strict";t.r(e),t.d(e,{__N_SSG:function(){return O},default:function(){return login}});var r=t(85893),i=t(67294),o=t(11163),s=t(9473),l=t(62286),a=t.n(l),c=t(99428),d=t(82729),u=t(19521),x=t(41664),p=t.n(x),f=t(43910),g=t(87536),h=t(47010),m=t(92369),w=t(35258),b=t(66207),j=t(94322),v=t(41514),y=t(20759),_=t(86417),H=t(73857),V=t(77172),N=t(42933),E=t(73845),k=t(85673);function _templateObject(){let n=(0,d._)(['\n width: 100%;\n\n .pixel-border {\n background-color: #fff;\n padding: 32px;\n height: fit-content;\n display: flex;\n flex-direction: column;\n gap: 24px;\n\n p {\n margin: 0px;\n font-family: "Mulish", sans-serif;\n }\n\n .button-container {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n\n button {\n flex: 1;\n min-width: 200px;\n\n .btn-content {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n }\n }\n\n .or-container {\n display: flex;\n gap: 12px;\n align-items: center;\n\n p {\n margin: 0px;\n color: #64748b;\n text-align: center;\n\n font-size: 12px;\n font-weight: 700;\n line-height: normal;\n letter-spacing: 1.68px;\n }\n\n div {\n flex: 1;\n height: 2px;\n background-color: #e2e8f0;\n }\n }\n\n form {\n display: flex;\n flex-direction: column;\n gap: 24px;\n\n .input-fields {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n }\n\n .submit-btn-container {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n\n button {\n .loader {\n margin-top: 5px;\n line-height: 1;\n }\n }\n\n p {\n margin: 0px;\n color: #475569;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n\n span {\n text-decoration-line: underline;\n text-underline-position: from-font;\n\n a {\n all: unset;\n }\n }\n }\n }\n }\n\n .need-account {\n color: #020617;\n text-align: center;\n\n font-size: 16px;\n font-weight: 500;\n\n a {\n color: #0065ab;\n text-decoration-line: underline;\n text-underline-position: from-font;\n }\n }\n\n .reset-password {\n text-align: center;\n a {\n color: #0065ab;\n\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 150%; /* 24px */\n text-decoration-line: underline;\n\n text-underline-position: from-font;\n }\n }\n }\n']);
1return _templateObject=function(){return n},n}let Z=u.default.main.withConfig({componentId:"sc-89c32906-0"})(_templateObject());var molecules_Login=function(n){var e;let{signInErrors:t,setSignInErrors:s}=n,[l,c]=(0,i.useState)({}),[d,u]=(0,i.useState)(!1),[x,F]=(0,i.useState)((0,j.I)()),[S,I]=(0,i.useState)(!1);(0,o.useRouter)();let D=(0,E.T)(),C=(0,i.useRef)(null),{register:M,handleSubmit:A,formState:{errors:L}}=(0,g.cI)(),O=(0,i.useCallback)(async function(n){let{email:e,password:r}=n;u(!0);let{auth:i}=(0,m.UM)();try{var o;let n=await (0,f.e5)(i,e,r);(0,v.ur)({uid:n.user.uid,email:n.user.email,name:n.user.displayName}),(0,v.h1)();let t=await (null===(o=n.user)||void 0===o?void 0:o.getIdToken());a().set(null,"codedextoken",t,{maxAge:2592e3,path:"/",sameSite:"lax",secure:!0})}catch(n){if(C.current&&(clearTimeout(C.current),C.current=null),n.code===f.kq.INVALID_PASSWORD)s({...t,wrongPassword:!0}),C.current=setTimeout(()=>{s({wrongPassword:!1,userNotFound:!1}),C.current=null},6e3);else if(n.code===f.kq.NEED_CONFIRMATION||f.kq.EMAIL_EXISTS){let{email:e}=n.customData,t=await (0,f.Nr)(i,e);"google.com"===t[0]?D((0,k.fz)({message:"Account exists. Use Login with Google."})):"password"===t[0]?D((0,k.fz)({message:"Account exists. Use Email and Password to Login."})):D((0,k.fz)({message:"Account exists. Use Login with GitHub."})),c({email:e,provider:t[0]})}else n.code===f.kq.USER_DELETED?(s({userNotFound:!0,wrongPassword:!1}),C.current=setTimeout(()=>{s({wrongPassword:!1,userNotFound:!1}),C.current=null},6e3)):n.code===f.kq.USER_DISABLED&&(s(n=>({...n,userDisabled:!0})),C.current=setTimeout(()=>{s({userDisabled:!1}),C.current=null},6e3))}finally{u(!1)}},[D,s,t]),R=(0,i.useCallback)(n=>{let{email:e,password:t}=n;O({email:e,password:t})},[O]);return(0,r.jsx)(Z,{children:(0,r.jsxs)(y.Z,{borderColor:"CBD5E1",className:"pixel-border",children:[x?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"button-container",children:[(0,r.jsx)(w.Z,{setAccountExistsLocal:c,children:"Google"}),(0,r.jsx)(b.Z,{setAccountExistsLocal:c,children:"GitHub"})]}),(0,r.jsxs)("div",{className:"or-container",children:[(0,r.jsx)("div",{}),(0,r.jsx)("p",{className:"or",children:"OR"}),(0,r.jsx)("div",{})]})]}),(0,r.jsxs)("form",{onSubmit:A(R),children:[(0,r.jsxs)("div",{className:"input-fields",children:[(0,r.jsx)(_.Z,{placeholder:"Email",register:{...M("email",{required:!0,pattern:/^\S+@\S+$/i})},error:(null==L?void 0:null===(e=L.email)||void 0===e?void 0:e.type)=="pattern"?{type:"critical",message:"Invalid email"}:null}),(0,r.jsx)(_.Z,{placeholder:"Password",register:{...M("password",{required:!0})},type:S?"text":"password",icon:S?(0,r.jsx)(N.Z,{}):(0,r.jsx)(V.Z,{}),iconAction:()=>I(!S)})]}),(0,r.jsx)("div",{className:"submit-btn-container",children:(0,r.jsx)(H.Z,{variant:"blue",type:"submit",children:d?(0,r.jsx)(h.Z,{color:"#ffff",className:"loader",size:13}):"Log in"})})]}),(0,r.jsxs)("p",{className:"need-account",children:["Need an account? ",(0,r.jsx)(p(),{href:"/signup",children:"Sign up"})]}),(0,r.jsx)("p",{className:"reset-password",children:(0,r.jsx)(p(),{href:"/forgot",children:"Reset password"})})]})})},F=t(78128),S=t(609),I=t(27936),D=t(17596),C=t(5478),M=t(2711),A=t.n(M);t(20927);var L=t(70198),O=!0,login=function(){let n=(0,o.useRouter)(),e=(0,s.v9)(S.ot),t=void 0!==a().get().codedextoken,l=(0,s.v9)(k.Cq),[d,u]=(0,i.useState)((0,j.I)()),x=(0,s.v9)(S.o4)||"dark",p="dark"===x,[f,g]=(0,i.useState)({wrongPassword:!1,userNotFound:!1,userDisabled:!1});return((0,i.useEffect)(()=>{A().init({mirror:!1,disable:"mobile",once:!0})},[]),(0,i.useEffect)(function(){async function redirectUser(){try{let{auth:e}=(0,m.UM)();if(null!==e.currentUser){let e=1;for(;Math.abs(e)<=l.length;){let t=l.at(-e),r=["/signup","/login","/forgot"];if(r.includes(t))e++;else try{if("/"===t)return n.push("/home");return n.push(t)}catch(n){break}}return n.push("/home")}}catch(e){n.reload()}}let e=setInterval(()=>{redirectUser()},2500);return()=>{e&&clearInterval(e)}},[n,t,l,e]),t)?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{}),(0,r.jsx)(I.Z,{h1:"Log in",description:"Log in to your account to start your co
1ding adventure!"}),(0,r.jsxs)(F.Z,{isDark:p,style:{backgroundImage:p?"url(/images/login-signup/dark-cloud.webp), linear-gradient(180deg, #030721, #050b4b)":"url(/images/login-signup/light-clouds.webp), linear-gradient(180deg, #B6E4FF 0%, #DEF1FF 100%)"},children:[(0,r.jsxs)("div",{className:"container",children:[(null==f?void 0:f.wrongPassword)===!0&&(0,r.jsx)(C.Z,{type:"error",textContent:"Invalid email and/or password"}),(null==f?void 0:f.userNotFound)===!0&&(0,r.jsx)(C.Z,{type:"error",textContent:"An account with this email does not exist."}),(null==f?void 0:f.userDisabled)===!0&&(0,r.jsx)(C.Z,{type:"error",textContent:"This account has been disabled."}),(0,r.jsx)("h2",{className:"page-title",children:"Log in"}),(0,r.jsx)(D.Z,{text:"Log in to resume your journey~",lightModeOnly:!0}),(0,r.jsx)(molecules_Login,{signInErrors:f,setSignInErrors:g})]}),(0,r.jsx)(L.Z,{})]})]})}}},function(n){n.O(0,[1272,8700,5445,994,4153,1622,9280,7536,9428,5382,9774,2888,179],function(){return n(n.s=83236)}),_N_E=n.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.