1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3879],{29781:(e,t,r)=>{r.d(t,{C:()=>l,S:()=>i});var o=r(95155),a=r(8395);let i=({title:e,description:t,children:r,...a})=>(0,o.jsx)(c,{...a,children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h3",{children:e}),"string"==typeof t?(0,o.jsx)("p",{children:t}):t,r]})});(0,a.I4)(i)` 2 margin-bottom: 24px; 3`;let l=({title:e,description:t,icon:r,children:a,...i})=>(0,o.jsxs)(n,{...i,children:[r||null,(0,o.jsx)("h3",{children:e}),t&&"string"==typeof t?(0,o.jsx)("p",{children:t}):t,a]}),c=a.I4.div` 4 display: flex; 5 flex-direction: column; 6 justify-content: flex-start; 7 align-items: flex-start; 8 text-align: left; 9 gap: 8px; 10 width: 100%; 11 margin-bottom: 24px; 12 13 && h3 { 14 font-size: 17px; 15 color: var(--privy-color-foreground); 16 } 17 18 /* Sugar assuming children are paragraphs. Otherwise, handling styling on your own */ 19 && p { 20 color: var(--privy-color-foreground-2); 21 font-size: 14px; 22 } 23`,n=(0,a.I4)(c)` 24 align-items: center; 25 text-align: center; 26 gap: 16px; 27 28 h3 { 29 margin-bottom: 24px; 30 } 31`},63879:(e,t,r)=>{r.r(t),r.d(t,{RecoveryOAuthScreen:()=>m,default:()=>m});var o=r(95155),a=r(12115),i=r(60787),l=r(29781),c=r(26927),n=r(98203),s=r(25933),d=r(18836),h=r(85537),p=r(47732),u=r(10328),v=r(64810),w=r(73449);async function y({url:e,popup:t,provider:r}){return t.location=e,new Promise((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)})}async function f({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new s.b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new s.b("User denied confirmation during OAuth flow");try{return(await e.post(h.a8,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(t){let e=(0,s.f)(t);if(e.privyErrorCode)throw new s.b(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode);if("User denied confirmation during OAuth flow"===e.message)throw new s.b("Invalid code during oauth flow.",void 0,s.c.OAUTH_USER_DENIED);throw new s.b("Invalid code during OAuth flow.",void 0,s.c.UNKNOWN_AUTH_ERROR)}}async function g({api:e,provider:t}){let r=(0,p.e)(),o=(0,p.f)(),a=await (0,p.h)(r);try{return"icloud"===t?{url:(await e.post(h.a9,{client_type:"web"})).url}:{url:(await e.post(h.aa,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw(0,s.f)(e)}}r(67454),r(67884),r(12100),r(82849),r(74068);let x={"google-drive":{name:"Google Drive",component:w.G},icloud:{name:"iCloud",component:w.A}},m={component:()=>{let{logout:e}=(0,d.u)(),{navigate:t,setModalData:r,data:h}=(0,d.a)(),{closePrivyModal:p,createAnalyticsEvent:m}=(0,s.u)(),{execute:_}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=(0,s.u)(),{data:o}=(0,d.a)(),{user:a}=(0,d.u)(),i=(0,v.a)(),{create:l}=(0,n.o)();return{execute:async({provider:c,action:n,popup:h,shouldCreateEth:p,shouldCreateSol:v})=>{let w,x;if(!e)throw new s.b("Missing client");function m(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new s.b("Recovery OAuth failed")}switch(c){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await g({api:e.api,provider:c});m(o);try{let a=await y({url:o,popup:h,provider:c});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:i??"",returnedStateCode:t??""}}),new s.b("Unexpected auth flow. This may be a phishing attempt.",void 0,s.c.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:c}}),new s.b("Recovery OAuth failed")}[w,x]=await Promise.all([e.getAccessToken(),f({api:e.api,provider:c,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await g({api:e.api,provider:c});m(t);let{ckWebAuthToken:r}=await y({url:t,popup:h,provider:c});x=r,w=await e.getAccessToken()}}if(!t)throw new s.b("Cannot connect to wallet proxy");if(!w)throw new s.b("Unable to authorize user");
31switch(n){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new s.b("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:c}}),await t.recover({accessToken:w,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:x}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:c}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),p&&v)t=await l({recoveryMethod:c,recoveryAccessToken:x,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await l({chainType:"solana",walletIndex:0,latestUser:t.user});else if(v)t=await l({recoveryMethod:c,recoveryAccessToken:x,chainType:"solana",walletIndex:0,latestUser:a});else{if(!p)throw Error("Invalid args to create wallet");t=await l({recoveryMethod:c,recoveryAccessToken:x,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",s.c.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=(0,d.g)(a);if(!o)throw i("setWalletRecovery","onError",s.c.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:c}});let{entropyId:l,entropyIdVerifier:n}=(0,u.b)(a);await t.setRecovery({accessToken:w,entropyId:l,entropyIdVerifier:n,recoveryMethod:c,recoveryAccessToken:x});let h=(0,d.g)(await r());if(!h)throw i("createWallet","onError",s.c.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:c}}),i("setWalletRecovery","onSuccess",{method:c,wallet:h});break}default:throw new s.b("Unsupported recovery action")}}}})(),[E,A]=(0,a.useState)(!1),{provider:C,action:b,isInAccountCreateFlow:j,shouldCreateEth:R,shouldCreateSol:k}=h?.recoveryOAuthStatus,[O,T]=(0,a.useState)(void 0),[S,L]=(0,a.useState)("create-wallet"===b);if("user-passcode"===C)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let N=x[C].name,M=x[C].component,I=h?.recoverWallet?.onCompleteNavigateTo,U=new n.R(async(e="create-wallet")=>(L(!0),new Promise((t,r)=>{setTimeout(async()=>{try{let r=window.open();await _({provider:C,action:e,popup:r,shouldCreateEth:R,shouldCreateSol:k}),A(!0),t()}catch(t){T({message:`${"recover"===e?"Recovery":"Back up"} with ${N} unsuccessful`,detail:"recover"===b?`Please verify that you are selecting the ${N} account associated with your backup.`:"",retryable:!0}),r()}},0)})));(0,a.useEffect)(()=>{"recover"!==b&&U.execute(j?"create-wallet":"set-recovery")},[]),(0,a.useEffect)(()=>{if(!E)return;let o=setTimeout(()=>{j?(r({createWallet:{onSuccess:()=>{},onFailure:t=>{m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:t,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),t("EmbeddedWalletCreatedScreen")):p({shouldCallAuthOnSuccess:!1})},c.q);return()=>clearTimeout(o)},[E]);let D=(0,a.useCallback)(async()=>{await U.execute("recover"),I?t(I):A(!0)},[]),W="google-drive"===C?"Google Drive":"Apple iCloud",P=E&&`Successfully ${"recover"===b?"recovered":"backed up"} with ${W}.`||O&&O.message||`${"recover"===b?"Recovering":"Backing up"} with ${W}...`,F=O?O.detail:"";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.M,{}),S?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(w.R,{children:[(0,o.jsx)(l.C,{title:P,icon:(0,o.jsx)(M,{style:{width:"38px",height:"38px"}}),description:F}),O&&O?.retryable?(0,o.jsx)(i.P,{onClick:()=>{(0,n.l)(),T(void 0),"create-wallet"===b?U.execute("create-wallet"):D()},disabled:!E&&!O?.retryable,children:"Try again"}):null]})}):(0,o.jsxs)(w.R,{children:[(0,o.jsx)(l.C,{title:"Confirm it's really you",icon:(0,o.jsx)(M,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${W} where your account is backed up.`}),(0,o.jsxs)(i.P,{onClick:D,children:["Confirm with ",W]})]}),(0,o.jsx)(i.B,{})]})}}},73449:(e,t,r)=>{r.d(t,{A:()=>i,G:()=>l,R:()=>c,a:()=>n});var o=r(95155),a=r(8395);let i=e=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,o.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992
310 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,o.jsx)("defs",{children:(0,o.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#3E82F4"}),(0,o.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),l=({style:e,...t})=>(0,o.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,o.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,o.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,o.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,o.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,o.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,o.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_2115_829",children:(0,o.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]}),c=a.I4.div` 32 display: flex; 33 flex-direction: column; 34 gap: 12px; 35 padding-top: 24px; 36 padding-bottom: 24px; 37`,n=a.I4.div` 38 padding-bottom: 24px; 39`}}]);
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.