1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3371],{2269:(e,n,o)=>{o.d(n,{C:()=>m});var t=o(95155),r=o(12115),l=o(30218),a=o(54801),i=o(13213),s=o(4939),c=o(68331),d=o(59807),u=o(81684);let h=({value:e,onChange:n})=>(0,t.jsx)("select",{value:e,onChange:n,children:a.QN.map(e=>(0,t.jsxs)("option",{value:e.code,children:[e.code," +",e.callCode]},e.code))}),m=(0,r.forwardRef)((e,n)=>{let o=(0,s.u)(),[l,m]=(0,r.useState)(!1),{accountType:f}=(0,c.h)(),[y,j]=(0,r.useState)(""),[g,v]=(0,r.useState)(e.defaultCountry??o?.intl.defaultCountry??"US"),w=(0,a.Q7)(y,g),b=(0,a.qi)(g),C=(0,a.jZ)(g),k=(0,i.K)(g),S=!w,[M,E]=(0,r.useState)(!1),F=k.length,P=n=>{let o=n.target.value;v(o),j(""),e.onChange&&e.onChange({rawPhoneNumber:y,qualifiedPhoneNumber:(0,a.n4)(y,o),countryCode:o,isValid:(0,a.Q7)(y,g)})},R=(n,o)=>{try{let t=n.replace(/\D/g,"")===y.replace(/\D/g,"")?n:b.input(n);j(t),e.onChange&&e.onChange({rawPhoneNumber:t,qualifiedPhoneNumber:(0,a.n4)(n,o),countryCode:o,isValid:(0,a.Q7)(n,o)})}catch(e){console.error("Error processing phone number:",e)}},T=()=>{E(!0);let n=(0,a.n4)(y,g);e.onSubmit({rawPhoneNumber:y,qualifiedPhoneNumber:n,countryCode:g,isValid:(0,a.Q7)(y,g)}).finally(()=>E(!1))};return(0,r.useEffect)(()=>{if(e.defaultValue){let n=(0,a.oj)(e.defaultValue);b.reset(),P({target:{value:n.countryCode}}),R(n.phone,n.countryCode)}},[e.defaultValue]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{children:(0,t.jsxs)(p,{$callingCodeLength:F,$stacked:e.stacked,children:[(0,t.jsx)(h,{value:g,onChange:P}),(0,t.jsx)("input",{ref:n,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:C,onFocus:()=>m(!0),onChange:e=>{R(e.target.value,g)},onKeyUp:e=>{"Enter"===e.key&&T()},value:y,autoComplete:"tel"}),"phone"!==f||l||e.hideRecent?e.stacked||e.noIncludeSubmitButton?(0,t.jsx)("span",{}):(0,t.jsx)(d.E,{isSubmitting:M,onClick:T,disabled:S,children:"Submit"}):(0,t.jsx)(u.C,{color:"gray",children:"Recent"})]})}),e.stacked&&!e.noIncludeSubmitButton?(0,t.jsx)(d.P,{loading:M,loadingText:null,onClick:T,disabled:S,children:"Submit"}):null]})}),x=l.I4.div` 2 width: 100%; 3`,p=l.I4.label` 4 --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.$callingCodeLength}px)); 5 --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.$callingCodeLength}px)); 6 display: block; 7 position: relative; 8 width: 100%; 9 10 /* Tablet and Up */ 11 @media (min-width: 441px) { 12 --country-code-dropdown-width: calc(52px + calc(10 * ${e=>e.$callingCodeLength}px)); 13 } 14 15 && > select { 16 font-size: 16px; 17 height: 24px; 18 position: absolute; 19 margin: 13px calc(var(--country-code-dropdown-width) / 4); 20 line-height: 24px; 21 width: var(--country-code-dropdown-width); 22 background-color: var(--privy-color-background); 23 background-size: auto; 24 background-position-x: right; 25 cursor: pointer; 26 27 /* Tablet and Up */ 28 @media (min-width: 441px) { 29 font-size: 14px; 30 width: var(--country-code-dropdown-width); 31 } 32 33 :focus { 34 outline: none; 35 box-shadow: none; 36 } 37 } 38 39 && > input { 40 font-size: 16px; 41 line-height: 24px; 42 color: var(--privy-color-foreground); 43 44 overflow: hidden; 45 white-space: nowrap; 46 text-overflow: ellipsis; 47 48 width: calc(100% - var(--country-code-dropdown-width)); 49 50 padding: 12px 88px 12px 51 calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left)); 52 padding-right: ${e=>e.$stacked?"16px":"88px"}; 53 flex-grow: 1; 54 background: var(--privy-color-background); 55 border: 1px solid var(--privy-color-foreground-4); 56 border-radius: var(--privy-border-radius-md); 57 width: 100%; 58 59 :focus { 60 outline: none; 61 border-color: var(--privy-color-accent); 62 } 63 64 :autofill, 65 :-webkit-autofill { 66 background: var(--privy-color-background); 67 } 68 69 /* Tablet and Up */ 70 @media (min-width: 441px) { 71 font-size: 14px; 72 padding-right: 78px; 73 } 74 } 75 76 && > :last-child { 77 right: 16px; 78 position: absolute; 79 top: 50%; 80 transform: translate(0, -50%); 81 } 82 83 && > button:last-child { 84 right: 0px; 85 line-height: 24px; 86 padding: 13px 17px; 87 88 :focus { 89 outline: none; 90 border-color: var(--privy-color-accent); 91 } 92 } 93 94 && > input::placeholder { 95 color: var(--privy-color-foreground-3); 96 } 97`},6956:(e,n,o)=>{o.d(n,{A:()=>r});var t=o(12115);let r=t.forwardRef(function(e,n){let{title:o,titleId:r,...l}=e;return t.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),o?t.createElement("title",{id:r},o):null,t.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"}))})},13371:(e,n,o)=>{o.r(n),o.d(n,{MfaEnrollmentFlowScreen:()=>k,default:()=>k});var t=o(95155),r=o(8443),l=o(24287),a=o(12115);let i=a.forwardRef(function(e,n){let{title:o,titleId:t,...r}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
97currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),o?a.createElement("title",{id:t},o):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"}))}),s=a.forwardRef(function(e,n){let{title:o,titleId:t,...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":t},r),o?a.createElement("title",{id:t},o):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=o(59807),d=o(68331),u=o(4939),h=o(43425),m=o(62855),x=o(90154),p=o(66745),f=o(25118),y=o(6956),j=o(49852),g=o(54801),v=o(2269),w=o(87123),b=o(501);o(68463),o(92253),o(50205),o(13902),o(52769);let C=({appName:e,onComplete:n,onReset:o,onClose:r})=>{let[l,i]=(0,a.useState)(""),[s,d]=(0,a.useState)(!1),[h,x]=(0,a.useState)(null),[f,C]=(0,a.useState)("enroll"),{initEnrollmentWithSms:k,submitEnrollmentWithSms:S}=(0,p.h)(),{data:M}=(0,m.u)(),E=(0,u.u)();function F(){M?.mfaEnrollmentFlow?.onSuccess(),n()}return h?(0,t.jsx)(b.ErrorScreenView,{allowlistConfig:E.allowlistConfig,error:h,onBack:()=>x(null),onRetry:()=>x(null)}):(0,t.jsxs)(t.Fragment,"enroll"===f?{children:[(0,t.jsx)(c.M,{backFn:o,onClose:r},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(j.A,{})}),(0,t.jsx)(w.T,{children:"Set up SMS verification"}),(0,t.jsxs)(w.S,{children:["We'll text a verification code to this mobile device whenever you use your ",e," ","wallet."]}),(0,t.jsxs)(w.C,{children:[(0,t.jsx)(v.C,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await k({phoneNumber:e}),i(e),C("verify")}catch(e){x(e)}},hideRecent:!0}),(0,t.jsxs)(w.c,{children:["By providing your mobile number, you agree to receive text messages from ",E?.name,". Some carrier charges may apply"]})]}),(0,t.jsx)(c.b,{})]}:s?{children:[(0,t.jsx)(c.M,{onClose:F},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(y.A,{})}),(0,t.jsx)(w.T,{children:"SMS verification added"}),(0,t.jsxs)(w.S,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",e," wallet."]}),(0,t.jsx)(w.B,{children:(0,t.jsx)(c.P,{onClick:F,children:"Done"})}),(0,t.jsx)(c.b,{})]}:{children:[(0,t.jsx)(c.M,{backFn:function(){"verify"===f?C("enroll"):o()},onClose:r},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(j.A,{})}),(0,t.jsx)(w.T,{children:"Enter enrollment code"}),(0,t.jsxs)(w.C,{children:[(0,t.jsx)(w.N,{onChange:async function(e){try{if(!e)return;await S({phoneNumber:l,mfaCode:e}),d(!0)}catch(e){if((0,p.i)(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if((0,p.d)(e))throw Error("The code you entered is not valid");if((0,p.f)(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw(0,p.j)(e)?Error("Verification canceled"):Error("Unknown error")}}}),(0,t.jsxs)(w.S,{children:["To continue, enter the 6-digit code sent to ",(0,t.jsx)("strong",{children:(0,g.Ds)(l)})]})]}),(0,t.jsx)(c.b,{})]})},k={component:()=>{let{user:e,enrollInMfa:n,ready:o}=(0,x.u)(),[y,j]=(0,a.useState)(null),{unenrollWithSms:g,unenrollWithTotp:v,unenrollWithPasskey:b,submitEnrollmentWithTotp:k,initEnrollmentWithPasskey:S,submitEnrollmentWithPasskey:M,initEnrollmentWithTotp:E}=(0,p.h)(),{data:F,onUserCloseViaDialogOrKeybindRef:P}=(0,m.u)(),R=(0,u.u)(),{closePrivyModal:T}=(0,h.u)(),{promptMfa:A}=(0,p.u)(),[B,N]=(0,a.useState)(!1),[I,L]=(0,a.useState)(null),[U,W]=(0,a.useState)(null),$=()=>{T({shouldCallAuthOnSuccess:!0}),n(!1),setTimeout(()=>{j(null),L(null)},500)},[V,Z]=(0,a.useState)(!1),[O,q]=(0,a.useState)();P.current=$;let z=e?.mfaMethods.includes("sms"),D=!!e?.phone,Q=e?.mfaMethods.includes("totp"),H=e?.mfaMethods.includes("passkey"),_=z||Q||H,K=e?.linkedAccounts.filter(e=>"passkey"===e.type).map(e=>e.credentialId)??[];function Y(){j(null),L(null)}async function G(e=K){Z(!0);try{return await S(),await M({credentialIds:e},{removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),F?.mfaEnrollmentFlow?.onSuccess(),$()}catch(e){q(e)}finally{Z(!1)}}if((0,a.useEffect)(()=>{_&&N(!0)},[_]),!o||!e||!R)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{onClose:$},"header"),(0,t.jsx)(w.A,{children:(0,t.jsx)(f.M,{})}),(0,t.jsx)(w.C,{children:(0,t.jsx)(d.L,{})}),(0,t.jsx)(c.b,{})]});if("sms"===y)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{backFn:Y,onClose:$},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(r.A,{})}),(0,t.jsx)(w.T,{children:"Remove SMS verification?"}),(0,t.jsxs)(w.S,{children:["MFA adds an extra layer of security to your ",R?.name," account. Make sure you have other methods to secure your account."]}),(0,t.jsx)(w.B,{children:(0,t.jsx)(c.P,{$warn:!0,onClick:async function(){j(null);try{await g()}catch(e){j(null)}},children:"Remove"})}),(0,t.jsx)(c.b,{})]});if("totp"===y)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{backFn:Y,onClose:$},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(r.A,{})}),(0,t.jsx)(w.T,{children:"Remove authenticator app verification?"}),(0,t.jsxs)(w.S,{children:["MFA adds an extra layer of security to your ",R?.name," account. Make sure you have other methods to secure your account."]}),(0,t.jsx)(w.B,{children:(0,t.jsx)(c.P,{$warn:!0,onClick:async function(){j(null);try{await v()}catch(e){j(null)}},children:"Remove"})}),(0,t.jsx)(c.b,{})]});if("passkey"===y){let e=F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{backFn:Y,onClose:$},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(r.A,{})}),(0,t.jsx)(w.T,{children:"Are you sure you want to remove this passkey?"}),(0,t.jsx)(w.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,t.jsx)(w.B,{children:(0,t.jsx)(c.P,{$warn:!0,onClick:async function(){j(null);try{await b({removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){j(null)}},children:"Remove"})}),(0,t.jsx)(c.b,{})]})}if(0===F.mfaEnrollmentFlow.mfaMethods.length&&!_)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{onClose:$},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(l.A,{})}),(0,t.jsx)(w.T,{children:"Add more security"}),(0,t.jsxs)(w.S,{children:[R?.name," does not have any verification methods enabled."]}),(0,t.jsx)(w.B,{children:(0,t.jsx)(c.P,{onClick:$,children:"Close"})}),(0,t.jsx)(c.b,{})]});let J=!_&&!B;return J?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.M,{onClose:$},"header"),(0,t.jsx)(w.I,{style:{marginBottom:"1.5rem"},children:(0,t.jsx)(l.A,{})}),(0,t.jsx)(w.T,{children:"Transaction Protection"}),(0,t.jsx)(w.S,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,t.jsxs)(w.L,{children:[(0,t.jsxs)(w.a,{children:[(0,t.jsx)(w.b,{children:(0,t.jsx)(i,{})}),"Enable 2-Step verification for your ",R?.name," wallet."]}
97),(0,t.jsxs)(w.a,{children:[(0,t.jsx)(w.b,{children:(0,t.jsx)(s,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,t.jsxs)(w.B,{children:[(0,t.jsx)(c.P,{onClick:()=>N(!0),children:"Continue"}),(0,t.jsx)(c.S,{onClick:$,children:"Not now"})]}),(0,t.jsx)(c.b,{})]}):"sms"===I?(0,t.jsx)(C,{appName:R?.name||"Privy",onComplete:$,onReset:Y,onClose:$}):"totp"===I&&U?(0,t.jsx)(f.E,{onClose:$,onReset:Y,submitEnrollmentWithTotp:({mfaCode:e})=>(async function(e){try{return q(void 0),await k({mfaCode:e}),F?.mfaEnrollmentFlow?.onSuccess(),$()}catch(e){q(e)}finally{j(null)}})(e),totpInfo:{...U,appName:R?.name||"Privy"}}):"passkey"===I?(0,t.jsx)(f.a,{onReset:Y,onClose:$,submitEnrollmentWithPasskey:G}):(0,t.jsx)(f.b,{showIntro:J,userMfaMethods:e.mfaMethods,appMfaMethods:R.mfa.methods,userHasAuthSms:D,backFn:function(){N(!1)},handleSelectMethod:async function(e){try{await A()}catch(e){return void q(e)}return"totp"===e?(L(e),W(null),void E().then(e=>{W(e)}).catch(()=>{W(null),Y()})):"passkey"===e&&1===K.length?await G():void L(e)},isTotpLoading:"totp"===I&&!U,isPasskeyLoading:V,error:O,onClose:$,setRemovingMfaMethod:async e=>{try{await A()}catch(e){return void q(e)}j(e)}})}}}}]);
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.