import{bx as y,aj as C,dd as v,j as n,q as t,de as L,d as F,df as S,F as h,a4 as N,a5 as k,f as u,aJ as x,x as w,dg as H,bX as z,L as M,aH as j,be as P}from"./index-Cox3ZWL0.js";const q=({banners:o,error:i,register:e,login:d,loginHelp:c,children:p})=>{var m,f,b,r;const s=y(),{colorMode:l}=C(),{data:a}=v(),g=((m=a==null?void 0:a[l])==null?void 0:m.logo)??((f=a==null?void 0:a.light)==null?void 0:f.logo)??((b=a==null?void 0:a.dark)==null?void 0:b.logo)??((r=a==null?void 0:a[l])==null?void 0:r.logoWithText);return n.jsxs(t,{mt:"50px",flexDirection:"column",alignItems:"center",autoComplete:"on",children:[g?n.jsx(t,{height:"120px",width:"100%",py:"5px",px:"20px",mb:"60px",mt:"15px",sx:{justifyContent:"center"},children:n.jsx(t,{as:"img",src:g,sx:{width:"auto",objectFit:"contain",maxHeight:"100%"}})}):n.jsxs(n.Fragment,{children:[n.jsx(L,{}),n.jsx(F,{mb:"60px",mt:"15px",fontFamily:"Inter",fontSize:"18px",primary:!0,children:"Hopsworks"})]}),n.jsx(t,{width:"466px",mb:"15px",children:n.jsx(S,{banners:o})}),i&&n.jsx(h,{width:"466px",mb:"20px",children:n.jsx(N,{type:k.error,content:i.message})}),p,e&&n.jsx(h,{sx:{h4:{fontSize:"12px"}},children:n.jsx(u,{mb:"20px",width:"466px",actions:n.jsx(x,{intent:"secondary",onClick:()=>s(w.auth.register),children:"Register"}),title:"Don’t have an account?"})}),d&&n.jsx(h,{sx:{h4:{fontSize:"12px !important"}},children:n.jsx(u,{mb:"20px",width:"466px",actions:n.jsx(x,{intent:"secondary",onClick:()=>s(w.auth.login),children:"Login"}),title:"Already have an account?"})}),c&&n.jsx(t,{as:"div",mb:"60px",children:n.jsx(H,{})})]})},A=({needConsent:o,remoteUser:i,chosenEmail:e,setChosenEmail:d,handleSubmit:c,onCancel:p})=>{const s=z(l=>l.loading.effects.auth.oauthLogin);return n.jsx(u,{width:"466px",mb:"20px",title:"Complete registration",children:s?n.jsx(M,{}):n.jsxs(n.Fragment,{children:[n.jsxs(t,{flexDirection:"row",justifyContent:"space-between",mb:"20px",children:[n.jsx(j,{width:"203px",label:"First name",name:"firstName",disabled:!0,value:i==null?void 0:i.givenName}),n.jsx(j,{width:"203px",label:"Last name",name:"lastName",disabled:!0,value:i==null?void 0:i.surname})]}),i!=null&&i.email&&(i==null?void 0:i.email.length)>1?n.jsx(P,{width:"100%",label:"Choose an email",noDataMessage:"No email found",options:(i==null?void 0:i.email)||[],value:e,onChange:d}):n.jsx(j,{width:"100%",label:"Email",name:"email",value:e||"No email found",disabled:!0}),n.jsxs(t,{justifyContent:"flex-end",mt:"20px",children:[o&&n.jsx(x,{mr:"20px",intent:"secondary",type:"button",alignSelf:"flex-end",onClick:p,children:"Cancel"}),n.jsx(x,{intent:"primary",type:"button",alignSelf:"flex-end",isLoading:s,onClick:c,children:"Register"})]})]})})};export{A as C,q as L};
