import{bo as b,j as n,a as t,d2 as f,f as g,d3 as m,L as c,a3 as C,a5 as y,W as h,aJ as l,t as j,d4 as r,bJ as w,D as v,aH as p,bd as L}from"./index-_eM6l4Nf.js";const S=({banners:e,error:a,register:s,login:x,loginHelp:d,children:o})=>{const i=b();return n.jsxs(t,{mt:"50px",flexDirection:"column",alignItems:"center",autoComplete:"on",children:[n.jsx(f,{}),n.jsx(g,{mb:"60px",mt:"15px",fontFamily:"Inter",fontSize:"18px",primary:!0,children:"Hopsworks"}),n.jsx(t,{width:"466px",mb:"15px",children:n.jsx(m,{banners:e})}),a&&n.jsx(c,{width:"466px",mb:"20px",children:n.jsx(C,{type:y.error,content:a.message})}),o,s&&n.jsx(c,{sx:{h4:{fontSize:"12px"}},children:n.jsx(h,{mb:"20px",width:"466px",actions:n.jsx(l,{intent:"secondary",onClick:()=>i(j.auth.register),children:"Register"}),title:"Don’t have an account?"})}),x&&n.jsx(c,{sx:{h4:{fontSize:"12px !important"}},children:n.jsx(h,{mb:"20px",width:"466px",actions:n.jsx(l,{intent:"secondary",onClick:()=>i(j.auth.login),children:"Login"}),title:"Already have an account?"})}),d&&n.jsx(t,{as:"div",mb:"60px",children:n.jsx(r,{})})]})},k=({needConsent:e,remoteUser:a,chosenEmail:s,setChosenEmail:x,handleSubmit:d,onCancel:o})=>{const i=w(u=>u.loading.effects.auth.oauthLogin);return n.jsx(h,{width:"466px",mb:"20px",title:"Complete registration",children:i?n.jsx(v,{}):n.jsxs(n.Fragment,{children:[n.jsxs(t,{flexDirection:"row",justifyContent:"space-between",mb:"20px",children:[n.jsx(p,{width:"203px",label:"First name",name:"firstName",disabled:!0,value:a==null?void 0:a.givenName}),n.jsx(p,{width:"203px",label:"Last name",name:"lastName",disabled:!0,value:a==null?void 0:a.surname})]}),a!=null&&a.email&&(a==null?void 0:a.email.length)>1?n.jsx(L,{width:"100%",label:"Choose an email",noDataMessage:"No email found",options:(a==null?void 0:a.email)||[],value:s,onChange:x}):n.jsx(p,{width:"100%",label:"Email",name:"email",value:s||"No email found",disabled:!0}),n.jsxs(t,{justifyContent:"flex-end",mt:"20px",children:[e&&n.jsx(l,{mr:"20px",intent:"secondary",type:"button",alignSelf:"flex-end",onClick:o,children:"Cancel"}),n.jsx(l,{intent:"primary",type:"button",alignSelf:"flex-end",isLoading:i,onClick:d,children:"Register"})]})]})})};export{k as C,S as L};
