1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5596],{25596:(e,n,t)=>{t.r(n),t.d(n,{MfaEnrollmentFlowScreen:()=>M,default:()=>M});var o=t(37876),r=t(65283),l=t(41575),a=t(14232);let s=a.forwardRef(function(e,n){let{title:t,titleId:o,...r}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},r),t?a.createElement("title",{id:o},t):null,a.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}),i=a.forwardRef(function(e,n){let{title:t,titleId:o,...r}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},r),t?a.createElement("title",{id:o},t):null,a.createElement("path",{fillRule:"evenodd",d:"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z",clipRule:"evenodd"}))});var c=t(5513),d=t(32426),u=t(43873),h=t(36161),m=t(55265),x=t(50246),f=t(62077),j=t(32002),y=t(96668),w=t(52620),p=t(45383),v=t(46761),g=t(99390),k=t(65109);t(94085),t(13799),t(62465),t(29454),t(33551),t(43617);let C=({appName:e,onComplete:n,onReset:t,onClose:r})=>{let[l,s]=(0,a.useState)(""),[i,d]=(0,a.useState)(!1),[m,j]=(0,a.useState)(null),[C,M]=(0,a.useState)("enroll"),{initEnrollmentWithSms:S,submitEnrollmentWithSms:b}=(0,f.d)(),{data:E}=(0,x.a)(),F=(0,h.u)();function R(){E?.mfaEnrollmentFlow?.onSuccess(),n()}return m?(0,o.jsx)(k.ErrorScreenView,{allowlistConfig:F.allowlistConfig,error:m,onBack:()=>j(null),onRetry:()=>j(null)}):(0,o.jsxs)(o.Fragment,"enroll"===C?{children:[(0,o.jsx)(u.M,{backFn:t,onClose:r},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(w.A,{})}),(0,o.jsx)(g.T,{children:"Set up SMS verification"}),(0,o.jsxs)(g.S,{children:["We'll text a verification code to this mobile device whenever you use your ",e," ","wallet."]}),(0,o.jsxs)(g.C,{children:[(0,o.jsx)(v.C,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await S({phoneNumber:e}),s(e),M("verify")}catch(e){j(e)}},hideRecent:!0}),(0,o.jsxs)(g.a,{children:["By providing your mobile number, you agree to receive text messages from ",F?.name,". Some carrier charges may apply"]})]}),(0,o.jsx)(u.a,{})]}:i?{children:[(0,o.jsx)(u.M,{onClose:R},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(y.A,{})}),(0,o.jsx)(g.T,{children:"SMS verification added"}),(0,o.jsxs)(g.S,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",e," wallet."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{onClick:R,children:"Done"})}),(0,o.jsx)(u.a,{})]}:{children:[(0,o.jsx)(u.M,{backFn:function(){"verify"===C?M("enroll"):t()},onClose:r},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(w.A,{})}),(0,o.jsx)(g.T,{children:"Enter enrollment code"}),(0,o.jsxs)(g.C,{children:[(0,o.jsx)(g.N,{onChange:async function(e){try{if(!e)return;await b({phoneNumber:l,mfaCode:e}),d(!0)}catch(e){if((0,f.f)(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");
1if((0,f.g)(e))throw Error("The code you entered is not valid");if((0,f.h)(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw(0,f.i)(e)?Error("Verification canceled"):Error("Unknown error")}}}),(0,o.jsxs)(g.S,{children:["To continue, enter the 6-digit code sent to ",(0,o.jsx)("strong",{children:(0,p.Ds)(l)})]})]}),(0,o.jsx)(u.a,{})]})},M={component:()=>{let{user:e,enrollInMfa:n,ready:t}=(0,x.u)(),[y,w]=(0,a.useState)(null),{unenrollWithSms:p,unenrollWithTotp:v,unenrollWithPasskey:k,submitEnrollmentWithTotp:M,initEnrollmentWithPasskey:S,submitEnrollmentWithPasskey:b,initEnrollmentWithTotp:E}=(0,f.d)(),{data:F,onUserCloseViaDialogOrKeybindRef:R}=(0,x.a)(),A=(0,h.u)(),{closePrivyModal:B}=(0,m.u)(),{promptMfa:P}=(0,f.u)(),[T,I]=(0,a.useState)(!1),[W,N]=(0,a.useState)(null),[L,Z]=(0,a.useState)(null),O=()=>{B({shouldCallAuthOnSuccess:!0}),n(!1),setTimeout(()=>{w(null),N(null)},500)},[U,H]=(0,a.useState)(!1),[V,_]=(0,a.useState)();R.current=O;let D=e?.mfaMethods.includes("sms"),Y=!!e?.phone,$=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),K=D||$||q,z=e?.linkedAccounts.filter(e=>"passkey"===e.type).map(e=>e.credentialId)??[];function G(){w(null),N(null)}async function J(e=z){H(!0);try{return await S(),await b({credentialIds:e},{removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),F?.mfaEnrollmentFlow?.onSuccess(),O()}catch(e){_(e)}finally{H(!1)}}if((0,a.useEffect)(()=>{K&&I(!0)},[K]),!t||!e||!A)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{onClose:O},"header"),(0,o.jsx)(g.A,{children:(0,o.jsx)(j.M,{})}),(0,o.jsx)(g.C,{children:(0,o.jsx)(d.L,{})}),(0,o.jsx)(u.a,{})]});if("sms"===y)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Remove SMS verification?"}),(0,o.jsxs)(g.S,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await p()}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(u.a,{})]});if("totp"===y)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Remove authenticator app verification?"}),(0,o.jsxs)(g.S,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await v()}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(u.a,{})]});if("passkey"===y){let e=F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Are you sure you want to remove this passkey?"}),(0,o.jsx)(g.S,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await k({removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(u.a,{})]})}if(0===F.mfaEnrollmentFlow.mfaMethods.length&&!K)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(l.A,{})}),(0,o.jsx)(g.T,{children:"Add more security"}),(0,o.jsxs)(g.S,{children:[A?.name," does not have any verification methods enabled."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{onClick:O,children:"Close"})}),(0,o.jsx)(u.a,{})]});let Q=!K&&!T;return Q?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.M,{onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(l.A,{})}),(0,o.jsx)(g.T,{children:"Transaction Protection"}),(0,o.jsx)(g.S,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,o.jsxs)(g.L,{children:[(0,o.jsxs)(g.b,{children:[(0,o.jsx)(g.c,{children:(0,o.jsx)(s,{})}),"Enable 2-Step verification for your ",A?.name," wallet."]}
1),(0,o.jsxs)(g.b,{children:[(0,o.jsx)(g.c,{children:(0,o.jsx)(i,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,o.jsxs)(g.B,{children:[(0,o.jsx)(c.P,{onClick:()=>I(!0),children:"Continue"}),(0,o.jsx)(c.S,{onClick:O,children:"Not now"})]}),(0,o.jsx)(u.a,{})]}):"sms"===W?(0,o.jsx)(C,{appName:A?.name||"Privy",onComplete:O,onReset:G,onClose:O}):"totp"===W&&L?(0,o.jsx)(j.E,{onClose:O,onReset:G,submitEnrollmentWithTotp:({mfaCode:e})=>(async function(e){try{return _(void 0),await M({mfaCode:e}),F?.mfaEnrollmentFlow?.onSuccess(),O()}catch(e){_(e)}finally{w(null)}})(e),totpInfo:{...L,appName:A?.name||"Privy"}}):"passkey"===W?(0,o.jsx)(j.a,{onReset:G,onClose:O,submitEnrollmentWithPasskey:J}):(0,o.jsx)(j.b,{showIntro:Q,userMfaMethods:e.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:Y,backFn:function(){I(!1)},handleSelectMethod:async function(e){try{await P()}catch(e){return void _(e)}return"totp"===e?(N(e),Z(null),void E().then(e=>{Z(e)}).catch(()=>{Z(null),G()})):"passkey"===e&&1===z.length?await J():void N(e)},isTotpLoading:"totp"===W&&!L,isPasskeyLoading:U,error:V,onClose:O,setRemovingMfaMethod:async e=>{try{await P()}catch(e){return void _(e)}w(e)}})}}},96668:(e,n,t)=>{t.d(n,{A:()=>r});var o=t(14232);let r=o.forwardRef(function(e,n){let{title:t,titleId:r,...l}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},l),t?o.createElement("title",{id:r},t):null,o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})}}]);
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.