1import{dd as M,df as W,d7 as m,dk as j,dD as h,d9 as y,dE as D,dF as U,dG as N}from"./index-BAH2Utb5.js";import{n as O}from"./ScreenLayout-DF3DCKOK-DC_BFClp.js";import{getErrorDetails as L}from"./ConnectionStatusScreen-mk5beBL7-CsQoWFQu.js";import"./ModalHeader-rCMpqA2a-BBQ19Rsn.js";import"./Screen-CV2tt2Ap-4GkOBRRn.js";import"./index-Dq_xe9dz-cxOyW04R.js";import"./Link-DJ5gq9Di-Cuq80jAU.js";import"./useI18n-Dk9y58cU-BlQ6qjDF.js";import"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_-CS9JU3Wo.js";const $=({walletLogo:c,success:r,errorMessage:a,title:w,subtitle:p,onRetry:l,onUseDifferentWallet:d,onBack:e,numRetries:s,maxRetries:t})=>y.jsx(O,{title:w,subtitle:p,icon:c,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!a},primaryCta:a===N.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:d}:!r&&a?.retryable&&s<t?{label:"Retry",onClick:l,disabled:!a?.retryable||s>=t}:!r&&a&&s>=t?{label:"Use a different wallet",onClick:d}:void 0,onBack:e,watermark:!0}),A={component:()=>{let c,{navigateBack:r,navigate:a,lastScreen:w,currentScreen:p,data:l,setModalData:d}=M(),{walletConnectionStatus:e,closePrivyModal:s}=W(),[t,C]=m.useState(void 0),[f,R]=m.useState(0),g=j(e?.connector?.walletClientType||"unknown"),i=e?.status==="connected",k=e?.status==="switching_to_supported_chain";m.useEffect((()=>{if(i){let o;if(l?.externalConnectWallet?.onCompleteNavigateTo){let v=l.externalConnectWallet.onCompleteNavigateTo,E=e.connectedWallet?.address;o=setTimeout((()=>{if(l.funding&&e.connector){let _=e.connector.wallets.find((B=>B.address===E));d({...l,funding:{...l.funding,connectedWallet:_}})}a(v({address:E,walletClientType:e.connector?.walletClientType,walletChainType:e.connector?.chainType}))}),h)}else o=setTimeout(s,h);return()=>clearTimeout(o)}}),[i]),m.useEffect((()=>{var o;e?.connectError&&(o=e?.connectError,C(L(o)))}),[e]);let b=e?.connector?.connectorType||"injected",S=e?.connector?.walletClientType||"unknown",u=g?.metadata?.shortName||g?.name||e?.connector?.walletBranding.name||"Browser Extension",T=g?.image_url?.md||e?.connector?.walletBranding.icon||(o=>y.jsx(D,{...o})),x=u==="Browser Extension"?u.toLowerCase():u;c=i?`Successfully connected with ${x}`:t?t.message:k?"Switching networks":`Waiting for ${x}`;let n="Donât see your wallet? Check your other browser windows.";return i?n="Youâre good to go!":f>=2&&t?n="Unable to connect wallet":t?n=t.detail:k?n="Switch your wallet to the requested network.":S==="metamask"&&U.isMobile?n="Click to continue to open and connect MetaMask.":S==="metamask"?n="For the best experience, connect only one wallet at a time.":b==="wallet_connect_v2"?n="Open your mobile wallet app to continue":b==="coinbase_wallet"&&(n="Confirm in the Coinbase app/popup to continue."),y.jsx($,{walletName:u,walletLogo:T,success:i,errorMessage:t,title:c,subtitle:n,onRetry:()=>{R(f+1),C(void 0),e?.connectRetry()},onUseDifferentWallet:r,onBack:p===w?void 0:r,numRetries:f,maxRetries:2})}};export{A as ConnectOnlyStatusScreen,$ as ConnectOnlyStatusScreenView,A 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.