import"./rolldown-runtime.js";import{n as e,t}from"./jsx-runtime.js";import{Vt as n,j as r}from"./useActiveWallet-CEs8euQ3.js";import"./context-Cdw68BC2.js";import{t as i}from"./index-CKYEOQWW.js";import{t as a}from"./modal-context-DHfp-mFQ.js";import{t as o}from"./fingerprint-pattern.js";import{t as s}from"./ScreenLayout-Dy-3vlz4.js";var c=t();e(),r();var l=({title:e=`Log in or create a new account?`,subtitle:t=`Create a new account with a passkey or use a passkey to log in to an existing account.`,onSignup:n,onLogin:r})=>(0,c.jsx)(s,{title:e,subtitle:t,icon:o,primaryCta:{label:`Create new account`,onClick:n},secondaryCta:{label:`Log in with a passkey`,onClick:r},watermark:!0}),u={component:()=>{let{enabled:e,token:t}=i(),{navigate:r,setModalData:o}=a(),{initSignupWithPasskey:s,initLoginWithPasskey:u}=n();return(0,c.jsx)(l,{onSignup:async()=>{e&&!t?(o({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:e=>s({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:`PasskeyStatusScreen`,onErrorNavigateTo:`ErrorScreen`}}),r(`CaptchaScreen`)):(await s({withPrivyUi:!0,captchaToken:t}),o({passkeyAuthModalData:{passkeySignupFlow:!0}}),r(`PasskeyStatusScreen`))},onLogin:async()=>{e&&!t?(o({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>u({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:`PasskeyStatusScreen`,onErrorNavigateTo:`ErrorScreen`}}),r(`CaptchaScreen`)):(await u({withPrivyUi:!0,captchaToken:t}),o({passkeyAuthModalData:{passkeySignupFlow:!1}}),r(`PasskeyStatusScreen`))}})}};export{u as PasskeySelectSignupOrLogin,u as default,l as PasskeySelectSignupOrLoginView};