import{d as B,aT as d,W as c,a3 as s,u as e,X as o,bK as a,a2 as m,bh as i,U as f,bP as C,F as _,b2 as L,Q as P,O as g}from"./vendor-reka-Edfq1EPl.js";import{usePage as H,useForm as N,Head as F}from"./vendor/inertia-CR4tWtMT.js";import{A as M}from"./AuthLayout-Ck4KMD0f.js";import{n as U,g as j,d as w}from"./registry-DyIszw9-.js";import{_ as z,a as A,b as E,c as S}from"./CardContent.vue_vue_type_script_setup_true_lang-DPd7KJ8I.js";import{_ as D}from"./CardDescription.vue_vue_type_script_setup_true_lang-Ds2CuvUf.js";import{_ as x,a as y,b as v}from"./FormMessage.vue_vue_type_script_setup_true_lang-CIPMOSQA.js";import{_ as $}from"./Input.vue_vue_type_script_setup_true_lang-D6nVx0lb.js";import{s as K}from"./sanitize-WJtyuR8o.js";const O={class:"flex min-h-screen items-center justify-center bg-muted/40"},Q={key:0,class:"mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive"},W={class:"relative my-4"},X={class:"relative flex justify-center text-xs uppercase"},q={class:"bg-background px-2 text-muted-foreground"},G={class:"space-y-2"},I=["innerHTML"],ie=B({layout:M,__name:"Login",setup(J){const{t:n}=U(),k=j(),p=H(),b=g(()=>{var r;return((r=p.props.auth)==null?void 0:r.socialProviders)??[]}),h=g(()=>{var r;return((r=p.props.flash)==null?void 0:r.error)??null}),t=N({email:"",password:""});function V(){t.post(`/${k}/login`)}function T(r){window.location.href=r}return(r,u)=>(d(),c(_,null,[s(e(F),{title:e(n)("builder.auth.login")},null,8,["title"]),o("div",O,[s(S,{class:"w-full max-w-sm"},{default:a(()=>[s(z,null,{default:a(()=>[s(A,{class:"text-xl"},{default:a(()=>[m(i(e(n)("builder.auth.title")),1)]),_:1}),s(D,null,{default:a(()=>[m(i(e(n)("builder.auth.subtitle")),1)]),_:1})]),_:1}),s(E,null,{default:a(()=>[h.value?(d(),c("div",Q,i(h.value),1)):f("",!0),o("form",{class:"space-y-4",onSubmit:C(V,["prevent"])},[s(x,null,{default:a(()=>[s(y,{error:!!e(t).errors.email,for:"email"},{default:a(()=>[m(i(e(n)("builder.auth.email")),1)]),_:1},8,["error"]),s($,{id:"email",modelValue:e(t).email,"onUpdate:modelValue":u[0]||(u[0]=l=>e(t).email=l),type:"email",name:"email",autocomplete:"email",placeholder:"you@example.com"},null,8,["modelValue"]),s(v,{message:e(t).errors.email},null,8,["message"])]),_:1}),s(x,null,{default:a(()=>[s(y,{error:!!e(t).errors.password,for:"password"},{default:a(()=>[m(i(e(n)("builder.auth.password")),1)]),_:1},8,["error"]),s($,{id:"password",modelValue:e(t).password,"onUpdate:modelValue":u[1]||(u[1]=l=>e(t).password=l),type:"password",name:"password",autocomplete:"current-password"},null,8,["modelValue"]),s(v,{message:e(t).errors.password},null,8,["message"])]),_:1}),s(w,{type:"submit",disabled:e(t).processing,class:"w-full"},{default:a(()=>[m(i(e(n)("builder.auth.login")),1)]),_:1},8,["disabled"])],32),b.value.length>0?(d(),c(_,{key:1},[o("div",W,[u[2]||(u[2]=o("div",{class:"absolute inset-0 flex items-center"},[o("span",{class:"w-full border-t"})],-1)),o("div",X,[o("span",q,i(e(n)("builder.auth.or_continue_with")),1)])]),o("div",G,[(d(!0),c(_,null,L(b.value,l=>(d(),P(w,{key:l.identifier,type:"button",variant:"outline",class:"w-full",onClick:R=>T(l.url)},{default:a(()=>[l.icon?(d(),c("span",{key:0,class:"size-4 shrink-0",innerHTML:e(K)(l.icon)},null,8,I)):f("",!0),m(" "+i(l.label),1)]),_:2},1032,["onClick"]))),128))])],64)):f("",!0)]),_:1})]),_:1})])],64))}});export{ie as default};
