PageSourceSearch

https://studycafe.se/_next/static/chunks/pages/register-82b62a1fdf116052.js

js studycafe.se collected 2026-10-08 03:21:00 UTC 23,524 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{76276:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register",function(){return n(52693)}])},49346:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var r=n(85893),i=n(90948),o=n(99226),a=n(41664),l=n.n(a),s=n(42293),c=n(10155),d=n(23918),u=n(67294),h=n(2734),x=n(98396),g=n(26447),p=n(83321),m=n(77533),f=n(78462),v=n(19294),b=n(98619),j=n(67720),Z=n(59334),C=n(25675),k=n.n(C),w={src:"/_next/static/media/StudyCafeLogoSmall.3bf6a510.svg",height:27,width:130,blurWidth:0,blurHeight:0},y=n(11163),S=n.n(y),I=n(85946),B=n(93946),T=n(63730),P=n(67218),D=n(53508),L=n(28411);let R=(0,i.ZP)(l())(e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",textDecoration:"none",marginRight:t.spacing(8)}}),W=()=>{let e=(0,h.Z)(),{settings:t}=(0,d.r)(),{skin:n}=t,{user:i}=(0,P.a)(),a=(0,x.Z)(e.breakpoints.up("md"),{defaultMatches:!0}),l=()=>{S().push("/dashboard/")},u=()=>{S().push("/")},p=()=>{S().push("/login")};return(0,r.jsx)(s.Z,{color:"default",position:"sticky",elevation:"bordered"===n?0:3,sx:{boxShadow:"bordered"===n?"none":"0px 3px 6px 0px #8C98A440",backgroundColor:"background.paper",..."bordered"===n&&{borderBottom:"1px solid ".concat(e.palette.divider)}},children:(0,r.jsx)(c.Z,{sx:{justifyContent:"space-between",p:e=>"".concat(e.spacing(0,a?20:5)," !important"),minHeight:"".concat(e.mixins.toolbar.minHeight-("bordered"===n?1:0),"px !important")},children:(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{height:"100%",width:"100%"},children:[(0,r.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(k(),{src:w,alt:"StudyCafe Logo",onClick:u,style:{cursor:"pointer",marginTop:"7.5px"},width:"120",height:"25"}),a&&(0,r.jsx)(g.Z,{direction:"row",spacing:2,sx:{marginLeft:4},children:(0,r.jsx)(E,{})})]}),a?(0,r.jsx)(o.Z,{children:(0,r.jsxs)(g.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(D.r,{})," ",(0,r.jsx)(L.Z,{})]})}):(0,r.jsx)(O,{onGoToAppClick:l,onLoginClick:p})]})})})},E=e=>(0,r.jsxs)(g.Z,{direction:"row",sx:{pl:5},children:[(0,r.jsx)(R,{href:"/pricing",children:(0,r.jsx)(p.Z,{variant:"text",sx:{color:"customColors.websiteText",fontWeight:500,textTransform:"none",fontSize:"16px","&:hover":{color:"text.primary"}},children:(0,I.t)("appBarComponent.pricing")})}),(0,r.jsx)(R,{href:"/about",children:(0,r.jsx)(p.Z,{variant:"text",sx:{color:"customColors.websiteText",fontWeight:500,textTransform:"none",fontSize:"16px","&:hover":{color:"text.primary"}},children:(0,I.t)("appBarComponent.about")})}),(0,r.jsx)(R,{href:"/contact",children:(0,r.jsx)(p.Z,{variant:"text",sx:{color:"customColors.websiteText",fontWeight:500,textTransform:"none",fontSize:"16px","&:hover":{color:"customColors.websiteText"}},children:(0,I.t)("appBarComponent.contact")})})]}),O=e=>{let[t,n]=u.useState(!1),{user:i}=(0,P.a)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.Z,{onClick:()=>n(!0),children:(0,r.jsx)(T.Z,{icon:"mdi:menu",fontSize:30,color:"black"})}),(0,r.jsx)(m.ZP,{open:t,onClose:()=>n(!1),children:(0,r.jsxs)(o.Z,{sx:{width:250},role:"presentation",onClick:()=>n(!1),children:[(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(v.ZP,{disablePadding:!0,children:(0,r.jsx)(b.Z,{href:"/",children:(0,r.jsx)(k(),{src:w,alt:"StudyCafe Logo",style:{cursor:"pointer",marginTop:"7.5px"},width:"120",height:"25"})})}),(0,r.jsx)(j.Z,{}),(0,r.jsx)(v.ZP,{disablePadding:!0,children:(0,r.jsx)(b.Z,{href:"/pricing",children:(0,r.jsx)(Z.Z,{primary:(0,I.t)("appBarComponent.pricing")})})}),(0,r.jsx)(v.ZP,{disablePadding:!0,children:(0,r.jsx)(b.Z,{href:"/about",children:(0,r.jsx)(Z.Z,{primary:(0,I.t)("appBarComponent.about")})})}),(0,r.jsx)(v.ZP,{disablePadding:!0,children:(0,r.jsx)(b.Z,{href:"/contact",children:(0,r.jsx)(Z.Z,{primary:(0,I.t)("appBarComponent.contact")})})})]}),(0,r.jsx)(j.Z,{}),(0,r.jsx)(f.Z,{children:(0,r.jsx)(v.ZP,{disablePadding:!0,children:(0,r.jsx)(b.Z,{sx:A.primaryButton,onClick:i?e.onGoToAppClick:e.onLoginClick,children:(0,r.jsx)(Z.Z,{sx:A.primaryButtonText,primary:(0,I.t)(i?"appBarComponent.goToApp":"appBarComponent.logIn"),disableTypography:!0})})})})]})})]})},A={primaryButton:{borderRadius:"10px",marginLeft:"8px",marginRight:"8px",border:"0px",backgroundColor:"#5A7E28"},primaryButtonText:{color:"#FFFFFF"}},z=(0,i.ZP)(o.Z)(e=>{let{theme:t}=e;return{height:"100vh","& .content-center":{display:"flex",alignItems:"center",justifyContent:"center",padding:t.spacing(5),minHeight:"calc(100vh - ".concat(t.spacing(t.mixins.toolbar.minHeight/4),")")},"& .content-right":{display:"flex",overflowX:"hidden",position:"relative",minHeight:"calc(100vh - ".concat(t.spacing(t.mixins.toolbar.minHeight/4),")")}}}),N=e=>{let{children:t}=e;return(0,r.jsxs)(z,{children:[(0,r.jsx)(W,{}),(0,r.jsx)(o.Z,{className:"app-content",sx:{overflowX:"hidden",position:"relative",minHeight:e=>"calc(100vh - ".concat(e.spacing(e.mixins.toolbar.minHeight/4),")")},children:t})]})};var _=N},31535:function(e,t,n){"use strict";var r=n(63805),i=n.n(r);let o=()=>{let e=i()({tablet:!0,featureDetect:!0}),t=!!navigator.userAgent.match(/CriOS/),n=!!navigator.userAgent.match(/FxiOS/),r=!!navigator.userAgent.match(/OPT/),o=!!navigator.userAgent.match(/Android/i);return{isMobileOrTablet:e,isChromeOnAppleDevice:t,isFirefoxOnAppleDevice:n,isOperaTouchOnAppleDevice:r,isAndroidDevice:o}};t.Z=o}
1,53508:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});var r=n(85893),i=n(2734),o=n(83321),a=n(11163),l=n(22120),s=n(67218);let c=()=>{let{user:e}=(0,s.a)(),{t}=(0,l.$G)(),n=(0,a.useRouter)(),c=(0,i.Z)(),d=()=>{n.push("/dashboard/")},u=()=>{n.push("/login")};return(0,r.jsx)(o.Z,{variant:"contained",color:"primary",sx:{backgroundColor:c.palette.green[700],borderRadius:"10px",textTransform:"none",fontSize:"18px",marginLeft:2},onClick:e?d:u,children:t(e?"appBarComponent.goToApp":"appBarComponent.logIn")})}},52693:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return er}});var r,i,o,a,l=n(85893),s=n(2734),c=n(98396),d=n(99226),u=n(15861),h=n(86886),x=n(50135),g=n(50480),p=n(69368),m=n(67294),f=n(7631),v=n(51049),b=n(22120),j=n(11163),Z=n(67218),C=n(25675),k=n.n(C),w=n(10575),y={src:"/_next/static/media/LinkExternal.de75f976.svg",height:21,width:21,blurWidth:0,blurHeight:0},S=n(41664),I=n.n(S),B=n(28615),T=n(90948),P=n(23795),D=n(83321),L={src:"/_next/static/media/BankID_logo.64abf2ed.svg",height:37,width:46,blurWidth:0,blurHeight:0},R=n(31535);(0,T.ZP)(P.Z)({display:"flex",alignItems:"center",textDecoration:"none",cursor:"pointer"});let W=e=>{let t=(0,R.Z)(),{t:n}=(0,b.$G)();return t.isMobileOrTablet?(0,l.jsxs)(h.ZP,{container:!0,justifyContent:"center",alignItems:"center",columnSpacing:2,rowGap:2,direction:"column",children:[(0,l.jsx)(v.KM,{fullWidth:!0,startIcon:(0,l.jsx)(k(),{src:L,alt:"BankID Logo",width:50,height:50}),onClick:()=>{e.onAuthOnSameDevice()},style:{backgroundColor:"rgba(90, 126, 40, 1)",width:"355px",marginLeft:"7px",height:"50px",textTransform:"none",fontSize:"16px",fontWeight:500,borderRadius:"10px",marginTop:"20px",marginBottom:"10px"},children:n("bankIdButton.startBankId")}),(0,l.jsx)(D.Z,{fullWidth:!0,onClick:()=>e.onAuthOnOtherDevice(),style:{maxWidth:"350px"},children:n("bankIdButton.mobileOtherDevice")})]}):(0,l.jsx)(v.KM,{fullWidth:!0,startIcon:(0,l.jsx)(k(),{src:L,alt:"BankID Logo",width:50,height:50}),onClick:()=>e.onAuthOnOtherDevice(),style:{backgroundColor:"rgba(90, 126, 40, 1)",width:"355px",height:"50px",textTransform:"none",fontSize:"16px",fontWeight:500,borderRadius:"10px",marginTop:"20px",marginBottom:"10px"},children:n("bankIdButton.mobileOtherDevice")})};var E=n(96682),O=n(18377),A=n(92592),z=n(30381),N=n.n(z),_=n(51492),G={src:"/_next/static/media/bankid-open-mobile.e418f061.svg",height:184,width:133,blurWidth:0,blurHeight:0};let M={width:200,margin:3,errorCorrectionLevel:"L"},H=e=>{console.log({BankIdOpenMobileImage:G});let{t}=(0,b.$G)(),n=(0,E.Z)(),r=(0,c.Z)(n.breakpoints.up("md"),{defaultMatches:!0}),[i,o]=(0,m.useState)(),[a,s]=(0,m.useState)(),[d,h]=(0,m.useState)(),[x,g]=(0,m.useState)(0),[p,j]=(0,m.useState)(null),Z=(0,f.m)(),C=m.useRef(),y=e=>{e&&A.toDataURL(e,M).then(e=>{o(e)}).catch(()=>{o(void 0)})},S=async()=>{let e=await Z.bankId.authenticate();s(e.data),j(N()())},I=async()=>{if(!(null==a?void 0:a.orderRef))return;let t=await Z.bankId.collect(null==a?void 0:a.orderRef);"complete"===t.data.status&&(e.onComplete(t.data),clearInterval(C.current)),h(t.data),y(t.data.qrCode||"")},B=async()=>{(null==a?void 0:a.orderRef)&&(await Z.bankId.cancel(a.orderRef),e.onCancel(a.orderRef))};return((0,m.useEffect)(()=>{if(a)return y(a.qrCode||""),C.current=setInterval(()=>{I()},2e3),()=>clearInterval(C.current)},[a]),(0,m.useEffect)(()=>{S()},[]),i)?(0,l.jsxs)(O.Z,{maxWidth:"500px",marginTop:r?20:12,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",rowGap:6,padding:8,sx:{backgroundColor:"white"},children:[(0,l.jsx)(k(),{src:w.Z,alt:"StudyCafe Logo"}),(0,l.jsx)(u.Z,{fontSize:"32px",color:"customColors.websiteText",sx:{fontWeight:800},align:"center",gutterBottom:!0,children:t("components.bankIdAuth.identifyWithBankId")}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",lineHeight:"28px",fontWeight:400,align:"center"}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",lineHeight:"28px",fontWeight:400,align:"center",children:t((null==d?void 0:d.hintCode)?"bankId.hintcode-qr-".concat(null==d?void 0:d.hintCode):"bankId.hintcode-qr-outstandingTransaction")}),(null==d?void 0:d.hintCode)==="userSign"?(0,l.jsx)(k(),{src:G,alt:"bankid user sign"}):(0,l.jsx)("img",{src:i,alt:"bankid qr"}),(null==a?void 0:a.orderRef)&&(0,l.jsx)(v.kq,{onClick:B,children:t("components.bankIdAuth.cancelButton")})]}):(0,l.jsx)(O.Z,{display:"flex",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(_.Z,{})})},F=()=>{let[e,t]=(0,m.useState)({});return(0,m.useEffect)(()=>{let e=()=>{let e=window.location.hash.substring(1),n=new URLSearchParams(e),r={};for(let[e,t]of n.entries())r[e]=t;t(r)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e};var $=n(59692),U=n(86501);let q=e=>{console.log("try mobile bankid");let{t}=(0,b.$G)(),n=(0,E.Z)(),r=(0,c.Z)(n.breakpoints.up("md"),{defaultMatches:!0}),[i,o]=(0,m.useState)(null),a=(0,f.m)(),s=(0,j.useRouter)(),d=(0,R.Z)();F();let[h,x]=(0,m.useState)(),g=async()=>{var e;let t=await a.bankId.authenticate();localStorage.setItem($.B.BankIdOrderRef,t.data.orderRef.toString()),x(null===(e=t.data.orderRef)||void 0===e?void 0:e.toString()),v(t.data)},p=e=>d.isChromeOnAppleDevice?encodeURIComponent("googlechrome://"):d.isFirefoxOnAppleDevice?encodeURIComponent("firefox://"):d.isOperaTouchOnAppleDevice?encodeURIComponent("".concat(window.location.href.replace("http","touch-http"),"#initiated=true")):d.isAndroidDevice?"null":encodeURIComponent("".concat(window.location.href,"#initiated=true")),v=e=>{if(!e)return;let t=p(e);window.location.href="https://app.bankid.com/?autostarttoken=".concat(e.autoStartToken,"&redirect=").concat(t)},Z=async()=>
1{if(h)try{let t=await a.bankId.collect(h);"complete"===t.data.status?(e.onComplete(t.data),localStorage.removeItem($.B.BankIdOrderRef)):"failed"===t.data.status&&(U.ZP.error("Session failed, try again"),localStorage.removeItem($.B.BankIdOrderRef)),o(t.data)}catch(e){console.log("failed collect"),localStorage.removeItem($.B.BankIdOrderRef)}},C=async()=>{h&&(await a.bankId.cancel(h),e.onCancel(h),localStorage.removeItem($.B.BankIdOrderRef),x(void 0),o(null),s.reload())};return((0,m.useEffect)(()=>{let e=setInterval(()=>{Z()},2e3);return()=>clearInterval(e)},[h]),(0,m.useEffect)(()=>{let e=localStorage.getItem($.B.BankIdOrderRef);x(e),e||g()},[]),h)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O.Z,{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(_.Z,{sx:{height:"150px"}})}),(0,l.jsx)(u.Z,{children:t("bankIdMobile.waitingForResponseMessage")}),(0,l.jsx)(D.Z,{onClick:C,variant:"text",sx:{marginTop:"20px"},children:t("bankIdMobile.cancelAuthButtonLabel")})]}):(0,l.jsx)(O.Z,{maxWidth:"500px",marginTop:r?20:12,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",rowGap:6,padding:8,sx:{backgroundColor:"white"},children:(0,l.jsx)(u.Z,{fontSize:"38px",color:"customColors.websiteText",sx:{fontWeight:800},align:"center",gutterBottom:!0,children:"Identifiera dig med BankID"})})};(r=o||(o={}))[r.SameDevice=1]="SameDevice",r[r.OtherDevice=2]="OtherDevice";let K=e=>{let t=(0,E.Z)(),n=(0,c.Z)(t.breakpoints.up("md"),{defaultMatches:!0});return(console.log("method",e.method),e.method===o.SameDevice)?(0,l.jsx)(O.Z,{height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(O.Z,{maxWidth:"600px",marginBottom:4,marginTop:n?20:12,children:(0,l.jsx)(O.Z,{display:"flex",flexDirection:"column",rowGap:2,children:(0,l.jsx)(q,{onComplete:e.onComplete,onCancel:e.onCancel})})})}):(0,l.jsx)(O.Z,{height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(O.Z,{maxWidth:"600px",marginBottom:4,marginTop:n?20:12,children:(0,l.jsx)(O.Z,{display:"flex",flexDirection:"column",rowGap:2,children:(0,l.jsx)(H,{onComplete:e.onComplete,onCancel:e.onCancel})})})})};var X=n(49346);let J=Number("3"),V=Number("1"),Y=Number("2");(i=a||(a={}))[i.BankId=0]="BankId",i[i.Email=1]="Email",i[i.SubscriptionPlan=2]="SubscriptionPlan",i[i.RedirectToLogin=3]="RedirectToLogin";let Q=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,ee=e=>Q.test(e),et=e=>{var t,n;if(!(null===(t=e.completionData)||void 0===t?void 0:null===(n=t.user)||void 0===n?void 0:n.personalNumber))return;let r=new Date().getFullYear()-parseInt(e.completionData.user.personalNumber.substring(0,4));return r>=15&&r<=20?V:r<15?J:r>=21?Y:void 0},en=()=>{let{t:e}=(0,b.$G)(),t=(0,s.Z)(),n=(0,c.Z)(t.breakpoints.up("md"),{defaultMatches:!0});(0,R.Z)();let{silentLogin:r,user:i,token:o,tokenIsValidated:h,refreshSubscription:x}=(0,Z.a)();e("registerPage.studyLevels.elementary"),e("registerPage.studyLevels.highSchool"),e("registerPage.studyLevels.adultEducation");let g=(0,f.m)(),p=(0,j.useRouter)(),[C,k]=m.useState(o?a.SubscriptionPlan:a.BankId),[w,y]=m.useState(!1),[S,I]=m.useState(),[B,T]=m.useState(),[P,D]=m.useState(i?i.email:""),L=e=>"string"!=typeof e?"":e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),W=async t=>{var n,a,l,s,c,d,u,h,m,f,v,b,j,Z,C;if(P&&t&&(S||i)){if(i&&t===Number("3")){await p.replace("/register/success");return}y(!0);try{let e,C;let k=o;if(!i&&S){let t=await g.user.register({ssn:null===(a=S.completionData)||void 0===a?void 0:null===(l=a.user)||void 0===l?void 0:l.personalNumber,firstName:L(null===(s=S.completionData)||void 0===s?void 0:null===(c=s.user)||void 0===c?void 0:c.givenName),lastName:L(null===(d=S.completionData)||void 0===d?void 0:null===(u=d.user)||void 0===u?void 0:u.surname),email:P,organizationId:et(S)});if(window.promotekit.refer(P),!t.ok)throw Error((null===(b=t.error)||void 0===b?void 0:b.detail)||"Failed to create user");await r(t.data.auth),await x(),e=null===(h=t.data.user)||void 0===h?void 0:h.id,C=null===(m=t.data.user)||void 0===m?void 0:null===(f=m.activeOrganization)||void 0===f?void 0:f.id,k=null===(v=t.data.auth)||void 0===v?void 0:v.token}else e=null==i?void 0:i.id,C=null==i?void 0:null===(j=i.activeOrganization)||void 0===j?void 0:j.id;if(t===Number("3")){await p.replace("/register/success");return}let w=await g.stripe.createSession({productId:t,userId:e,organizationId:C,promotekitReferral:window.promotekit_referral},{headers:{Authorization:"Bearer ".concat(k)}});if(!w.ok)throw Error((null===(Z=w.error)||void 0===Z?void 0:Z.detail)||"Failed to create checkout session");w.ok&&(null===(n=w.data)||void 0===n?void 0:n.url)&&await p.replace(w.data.url)}catch(t){(null===(C=t.error)||void 0===C?void 0:C.message)==="user-already-exists"&&T(e("registerPage.errors.userAlreadyExists")||"User already exists"),console.error(t)}}},E=e=>{I(e),e.auth?k(a.RedirectToLogin):k(a.Email)},O=()=>{k(a.BankId)},A=e=>{D(e),k(a.SubscriptionPlan)},z=e=>{W(e)};return(m.useEffect(()=>{let e=()=>{y(!0)},t=()=>{y(!1)},n=e=>{e.persisted&&y(!1)};return p.events.on("routeChangeStart",e),p.events.on("routeChangeComplete",t),p.events.on("routeChangeError",t),window.addEventListener("pageshow",n),()=>{p.events.off("routeChangeStart",e),p.events.off("routeChangeComplete",t),p.events.off("routeChangeError",t),window.removeEventListener("pageshow",n)}},[p]),m.useEffect(()=>{y(!!o&&!h)},[o,h]),B)?(0,l.jsx)(d.Z,{height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(d.Z,{maxWidth:"600px",marginBottom:4,marginTop:n?20:12,children:(0,l.jsxs)(d.Z,{display:"flex",flexDirection:"column",rowGap:2,children:[(0,l.jsx)(u.Z,{variant:"h6",children:B}),(0,l.jsx)(v.kq,{onClick:()=>{p.replace("/")},children:e("registerPage.errors.backButton")})]})})}):w?(0,l.jsx)(d.Z,{textAlign:"center",p:4,children:(0,l.jsx)(_.Z,{})}):(0,l.jsx)(d.Z,{height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(d.Z,{maxWidth:n?"1120px":"100%",marginBottom:4,marginTop:n?20:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",id:"HEJ",children:(()=>{switch(C){case a.BankId:return(0,l.jsx)(ei,{onBankIdVerified:E,onBankIdCancel:O});case a.Email:return(0,l.jsx)(eo,{bankIdCollectResponse:S,onNextClick:A});case a.SubscriptionPlan:return(0,l.jsx)(ea,{onSelectPlan:z});case a.RedirectToLogin:return(0,l.jsx)(el,{bankIdCollectResult:S})}})()})})};en.getLayout=e=>(0,l.jsx)(X.Z,{children:e}),en.guestGuard=!1,en.authGuard=!1;var er=en;let ei=e=>{let{onBankIdVerified:t,onBankIdCancel:n}=e,{t:r}=(0,b.$G)();(0,j.useRouter)();let i=(0,s.Z)(),a=(0,c.Z)(i.breakpoints.up("md"),{defaultMatches:!0}),[h,x]=(0,m.useState)(),[g,p]=m.useState(null),f=e=>{p(null),n(e)},v=()=>{let e=localStorage.getItem($.B.BankIdOrderRef);x(e)};return((0,m.useEffect)(()=>{v()},[]),g||h)?(0,l.jsx)(K,{method:g||o.SameDevice,onComplete:t,onCancel:f}):(0,l.jsx)(d.Z,{height:"100%",display:"flex",justifyContent:"center",alignItems:"center",width:"90%",children:(0,l.jsxs)(d.Z,{maxWidth:"440px",marginBottom:4,marginTop:a?20:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(k(),{src:w.Z,alt:"StudyCafe Logo"}),(0,l.jsx)(u.Z,{fontSize:"48px",color:"customColors.websiteText",sx:{fontWeight:800,fontSize:32,paddingTop:16,paddingBottom:4},align:"center",gutterBottom:!0,children:r("registerPage.bankIdStep.title")}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",lineHeight:"28px",fontWeight:400,align:"center",children:r("registerPage.bankIdStep.description")}),(0,l.jsx)(d.Z,{mt:4,children:(0,l.jsx)(W,{onAuthOnOtherDevice:()=>p(o.OtherDevice),onAuthOnSameDevice:()=>p(o.SameDevice)})}),(0,l.jsxs)(d.Z,{mt:4,style:{display:"flex",alignItems:"center"},children:[(0,l.jsx)(I(),{target:"blank",href:"/gdpr",style:{fontSize:"16px",color:"#222",textDecoration:"none"},children:r("registerPage.bankIdStep.gdprLink")}),(0,l.jsx)(k(),{src:y,alt:"External Link",width:20,height:20,style:{marginLeft:8}})]})]})})},eo=e=>{var t;let{bankIdCollectResponse:n,onNextClick:r}=e,i=(0,s.Z)(),o=(0,c.Z)(i.breakpoints.up("md"),{defaultMatches:!0}),{t:a}=(0,b.$G)(),[f,j]=m.useState(""),[Z,C]=m.useState(!1),k=[{value:J,label:a("registerPage.studyLevels.elementary")},{value:V,label:a("registerPage.studyLevels.highSchool")},{value:Y,label:a("registerPage.studyLevels.adultEducation")}],w=e=>{C(e.target.checked)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(d.Z,{maxWidth:o?"440px":"90%",children:[(0,l.jsx)(u.Z,{fontSize:"48px",color:"customColors.websiteText",sx:{fontWeight:800,fontSize:32,paddingTop:16,paddingBottom:4},align:"center",gutterBottom:!0,children:a("registerPage.emailStep.title")}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",lineHeight:"28px",fontWeight:400,align:"center",children:a("registerPage.emailStep.description")}),(0,l.jsxs)(d.Z,{style:{border:"1px solid #BEC0C0",borderRadius:"5px",width:"100%",padding:"10px 16px"},children:[(0,l.jsx)(u.Z,{fontSize:"48px",sx:{fontWeight:500,fontSize:16,color:"#44484A"},align:"left",gutterBottom:!0,children:a("registerPage.emailStep.studyLevelLabel")}),(0,l.jsx)(u.Z,{fontSize:"48px",sx:{fontWeight:500,fontSize:16,color:"#44484A"},align:"left",gutterBottom:!0,children:null===(t=k.find(e=>e.value===et(n)))||void 0===t?void 0:t.label}),(0,l.jsx)(I(),{href:"/contact",as:"button",style:{textDecoration:"none"},children:(0,l.jsx)(u.Z,{fontSize:"48px",sx:{fontWeight:500,fontSize:14,color:i.palette.green[700]},align:"left",gutterBottom:!0,children:a("registerPage.emailStep.studyLevelIncorrectContact")})})]})]}),(0,l.jsxs)(d.Z,{sx:{marginTop:8,width:"100%",maxWidth:o?"440px":"90%"},children:[(0,l.jsx)(h.ZP,{children:(0,l.jsx)(x.Z,{label:a("adminPage.users.emailInput"),value:f,onChange:e=>j(e.target.value),sx:{width:"100%"},onKeyDown:e=>{if("Enter"===e.key){e.preventDefault();let t=document.getElementById("nextButton");t&&t.click()}}})}),(0,l.jsx)(g.Z,{control:(0,l.jsx)(p.Z,{checked:Z,onChange:w}),label:(0,l.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,l.jsx)(u.Z,{fontSize:"14px",children:a("registerPage.emailStep.agreeLabel")}),(0,l.jsx)(I(),{href:"/gdpr",target:"_blank",style:{color:i.palette.green[700],textDecoration:"none",fontSize:"14px",marginLeft:"5px"},children:a("registerPage.emailStep.gdprPolicyLabel")})]}),sx:{marginTop:2}}),(0,l.jsx)(v.KM,{sx:{display:"block",width:"100%",maxWidth:"440px",mx:"auto",mt:2,borderRadius:"10px",backgroundColor:i.palette.green[700],height:"50px",textTransform:"none",fontSize:"18px",fontWeight:500},onClick:()=>r(f),disabled:!ee(f)||!Z,id:"nextButton",children:a("registerPage.emailStep.createAccountButton")})]})]})},ea=e=>{let{onSelectPlan:t}=e,{t:n}=(0,b.$G)();return(0,l.jsx)(B.ZP,{headerText:n("registerPage.subscriptionStep.title")||"Pricing",subheaderText:n("registerPage.subscriptionStep.description")||"Explore our customizable pricing packages to find what suits you best",enableOwnedProduct:!0,onSelect:e=>{t(e)}})},el=e=>{var t,n,r,i,o,a;let{bankIdCollectResult:h}=e,x=(0,j.useRouter)(),{silentLogin:g}=(0,Z.a)(),{t:p}=(0,b.$G)(),m=(0,s.Z)(),f=(0,c.Z)(m.breakpoints.up("md"),{defaultMatches:!0}),C=async()=>{await g(h.auth),x.push("/dashboard")};return(0,l.jsx)(d.Z,{maxWidth:f?"440px":"90%",children:(0,l.jsxs)(d.Z,{maxWidth:"440px",marginBottom:4,marginTop:f?20:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(k(),{src:w.Z,alt:"StudyCafe Logo"}),(0,l.jsxs)(u.Z,{color:"customColors.websiteText",sx:{paddingTop:16,paddingBottom:4},align:"center",gutterBottom:!0,children:[p("registerPage.redirectStep.accountExistsMessage")," ",(0,l.jsx)("b",{children:null===(t=h.auth)||void 0===t?void 0:null===(n=t.user)||void 0===n?void 0:n.ssn}
1)]}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",align:"center",gutterBottom:!0,children:p("registerPage.redirectStep.loginPrompt")}),(0,l.jsx)(u.Z,{color:"customColors.websiteText",align:"center",gutterBottom:!0,children:(0,l.jsxs)("b",{children:[null===(r=h.auth)||void 0===r?void 0:null===(i=r.user)||void 0===i?void 0:i.firstName," ",null===(o=h.auth)||void 0===o?void 0:null===(a=o.user)||void 0===a?void 0:a.lastName]})}),(0,l.jsx)(d.Z,{mt:4,children:(0,l.jsx)(v.KM,{onClick:C,children:p("registerPage.redirectStep.loginButton")})})]})})}}},function(e){e.O(0,[4885,6886,2395,135,690,8615,9774,2888,179],function(){return e(e.s=76276)}),_N_E=e.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.