import{o as e}from"./rolldown-runtime.js";import{n as t,t as n}from"./jsx-runtime.js";import{At as r,Mt as i,Vt as a,j as o,kt as s}from"./useActiveWallet-CEs8euQ3.js";import{k as c,x as l}from"./context-Cdw68BC2.js";import{t as u}from"./modal-context-DHfp-mFQ.js";import{t as d}from"./circle-check-big.js";import{t as f}from"./ScreenLayout-Dy-3vlz4.js";var p=n(),m=e(t(),1);o();var h=({title:e,description:t,onClose:n})=>(0,p.jsx)(f,{title:e,subtitle:t,icon:d,iconVariant:`success`,watermark:!0,onBack:n}),g={component:()=>{let{user:e}=i(),{closePrivyModal:t,isNewUserThisSession:n,updateWallets:o}=a(),{data:d,onUserCloseViaDialogOrKeybindRef:f}=u(),g=c(),{onSuccess:_,onFailure:v,callAuthOnSuccessOnClose:y}=d.createWallet,b=()=>{let n=s(e)??r(e);e&&n?(o(),_({user:e,account:n})):v(Error(`Failed to create wallet`)),t({shouldCallAuthOnSuccess:y})};(0,m.useEffect)((()=>{let e=setTimeout(b,l);return()=>clearTimeout(e)}),[]),f.current=b;let x=n&&!((e?.linkedAccounts?.length??0)>1);return(0,p.jsx)(h,{title:x?`Welcome`+(g?.name?` to ${g?.name}`:``):`All set!`,description:x?`You've successfully created an account.`:`Your account is secured.`,onClose:b})}};export{g as EmbeddedWalletCreatedScreen,g as default,h as EmbeddedWalletCreatedScreenView};