1import{_ as U}from"./B_xGn9Iq.js";import{_ as z}from"./_SA84Ghv.js";import{_ as R}from"./i_oGQRLb.js";import{L as T}from"./DJWk2446.js";import{I as $}from"./CcPPHZck.js";import{b as q,B as E}from"./CRmEIWDb.js";import{_ as M}from"./BJKZZiH-.js";import{c as j}from"./Ct8leY2u.js";import{e as F,A as G,B as O,D as W,E as D,G as K,r as l,s as H,H as J,c as Q,o as i,b as a,a as t,w as u,z as X,h as c,m as Y,d as n,I as Z,J as ee,K as g,O as te,P as S,Q as oe,R as P,L as d,g as se,M as ae}from"#entry";import{L as _}from"./Dgyd19qE.js";import"./DlAUqK2U.js";import"./OaRjpU2K.js";import"./C50x5zDf.js";import"./BkLtITBR.js";import"./0f0XNADI.js";import"./BSMlXKon.js";import"./DxYjk6yg.js";const ne={class:"relative h-screen flex flex-col items-center justify-center container md:grid lg:grid-cols-2 lg:max-w-none lg:px-0"},ie={class:"relative hidden h-full flex-col p-10 text-white lg:flex dark:border-r"},re={class:"relative z-20 flex items-center text-lg font-medium"},le={class:"lg:p-8"},ue={class:"mx-auto w-full flex flex-col justify-center sm:w-[350px] space-y-6"},ce={class:"grid gap-6"},de={class:"grid gap-2"},me={class:"grid gap-1"},Ne=F({__name:"login",setup(pe){const{t:fe}=G(),w=O();ae();const k=J(),m=ee();W();const v=D();K(v);const r=l(!1),p=l(""),y=l(!1),x=l(!1);l(null);const C=H(()=>{const o={...k.query};return{path:w("/auth/signup"),query:o.redirect?{redirect:o.redirect,priceId:o.priceId}:{}}});async function A(o){o.preventDefault(),r.value=!0;try{const e={url:`${window.location.origin}${w("/auth/verify")}`,handleCodeInApp:!0};await Z(m,p.value,e),window.localStorage.setItem("emailForSignIn",p.value),g.success("Magic link sent! Check your email.")}catch(e){console.error(e),g.error("Failed to send magic link. Please try again.")}finally{r.value=!1}}async function I(o){const e=o==="google"?y:x;e.value=!0;try{if(o==="google"){const s=new te;await S(m,s)}else{const s=new oe("apple.com");s.addScope("email"),s.addScope("name"),await S(m,s)}if(g.success("Successfully signed in!"),m.currentUser)if(await v.fetchAuthMe(),v.isAdmin)await P("/dashboard");else{const s=k.query.redirect;await P(s||"/")}}catch(f){console.error(f),g.error(`Failed to sign in with ${o}. Please try again.`)}finally{e.value=!1}}return(o,e)=>{const f=U,s=z,B=R,V=T,N=$,h=E,L=M;return i(),Q("div",ne,[a(f,{to:C.value,class:X(("cn"in o?o.cn:c(j))(c(q)({variant:"ghost"}),"absolute right-4 top-4 md:right-8 md:top-8"))},{default:u(()=>[...e[3]||(e[3]=[n(" Sign Up ",-1)])]),_:1},8,["to","class"]),t("div",ie,[a(s,{src:"/auth/auth-banner.png",class:"absolute inset-0 object-cover w-full h-full",alt:"Auth banner",width:"1000",height:"1000"}),e[4]||(e[4]=t("div",{class:"absolute inset-0 bg-zinc-900/70"},null,-1)),t("div",re,[a(B)]),e[5]||(e[5]=t("div",{class:"relative z-20 mt-auto"},[t("blockquote",{class:"space-y-2"},[t("p",{class:"text-lg"}," âI absolutely love this app! It's a blast to use with my friends' photos. We've had so much fun playing around with it and sharing the results. It's become our go-to for some laughs and creativity!â "),t("footer",{class:"text-sm"},"Bedirhan Celayir")])],-1))]),t("div",le,[t("div",ue,[e[11]||(e[11]=t("div",{class:"flex flex-col text-center space-y-2"},[t("h1",{class:"text-2xl font-semibold tracking-tight"}," Login to your account "),t("p",{class:"text-muted-foreground text-sm"}," Enter your email below to login to your account ")],-1)),t("div",ce,[t("form",{onSubmit:A},[t("div",de,[t("div",me,[a(V,{class:"sr-only",for:"email"},{default:u(()=>[...e[6]||(e[6]=[n("Email",-1)])]),_:1}),a(N,{id:"email",modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=b=>p.value=b),placeholder:"[email protected]",type:"email",autocapitalize:"none",autocomplete:"email",autocorrect:"off",disabled:r.value},null,8,["modelValue","disabled"])]),a(h,{disabled:r.value},{default:u(()=>[r.value?(i(),d(c(_),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):se("",!0),e[7]||(e[7]=n(" Send Magic Link ",-1))]),_:1},8,["disabled"])])],32),e[10]||(e[10]=Y('<div class="relative"><div class="absolute inset-0 flex items-center"><span class="w-full border-t"></span></div><div class="relative flex justify-center text-xs uppercase"><span class="bg-background text-muted-foreground px-2"> Or continue with </span></div></div>',1)),a(h,{variant:"outline",type:"button",disabled:y.value,onClick:e[1]||(e[1]=b=>I("google"))},{default:u(()=>[y.value?(i(),d(c(_),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):(i(),d(L,{key:1,type:"google",class:"mr-2"})),e[8]||(e[8]=n(" Google ",-1))]),_:1},8,["disabled"]),a(h,{variant:"outline",type:"button",disabled:x.value,onClick:e[2]||(e[2]=b=>I("apple"))},{default:u(()=>[x.value?(i(),d(c(_),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):(i(),d(L,{key:1,type:"apple",class:"mr-2"})),e[9]||(e[9]=n(" Apple ",-1))]),_:1},8,["disabled"])]),e[12]||(e[12]=t("p",{class:"text-muted-foreground px-8 text-center text-sm"},[n(" By clicking continue, you agree to our "),t("a",{href:"/terms",class:"hover:text-primary underline underline-offset-4"}," Terms of Service "),n(" and "),t("a",{href:"/privacy",class:"hover:text-primary underline underline-offset-4"}," Privacy Policy "),n(". ")],-1))])])])}}});
1export{Ne as default};
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.