1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5598],{75598:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var s=a(37876),n=a(14232),l=a(48230),r=a.n(l),i=a(75731),o=a(81502),c=a(17260),d=a(5474),u=a(66092),m=a(35782),x=a(80392),p=a(55858),v=a(27983),f=a(35280),g=a(95862),h=a(30960),b=a(88318);let{general:j,incorrectMFACode:y,mfaCodeResendSuccess:S}=a(77250).Ay;function N(e){let{passSuccessToParent:t,parentSuccessHandler:a}=e,l=(0,c.useAuth)(),p=(0,d.Y_)(),[N,T]=(0,n.useState)(!1),[E,C]=(0,n.useState)(!1),[w,A]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),[I,O]=(0,n.useState)(!1),[P,_]=(0,n.useState)(!1),[D,L]=(0,n.useState)(!1),[z,F]=(0,n.useState)(!1),[M,U]=(0,n.useState)(null),[B,Y]=(0,n.useState)(!1),K=(0,n.useCallback)(()=>{l.logout()},[l]);(0,n.useEffect)(()=>{if(z)return void window.addEventListener("beforeunload",K);window.removeEventListener("beforeunload",K)},[z,K]);let V=(0,n.useCallback)(()=>{R(!1),O(!1),_(!1)},[]);(0,n.useEffect)(()=>{(null==w?void 0:w.length)&&V()},[w,V]);let W=(0,n.useCallback)(async e=>{var s,n,r;if(t)return void a(!0);let i=null==e||null==(n=e.data)||null==(s=n.user)?void 0:s.accountType,o=await l.getRouteOnSuccessfulAuth({isLogin:!0,trackLogin:!0,accountType:i});l.navigateToRoute({route:o,authToken:null==e||null==(r=e.data)?void 0:r.token})},[t,a,l]),G=(0,n.useCallback)(async e=>{T(!0),R(!1);let t=e||w,a=await l.mfaSmsValidate(t,!0,B);if((null==a?void 0:a.state)===u.ApiResponseState.SUCCESS){if(l.userNeedsToReacceptTerms){U(a),F(!0);return}W(a)}(null==a?void 0:a.state)===u.ApiResponseState.ERROR&&(V(),R(!0)),T(!1)},[w,l,B,W,V]),H=async()=>{C(!0),L(!0);let e=await l.mfaSmsSendCode();if((null==e?void 0:e.state)===u.ApiResponseState.ERROR){var t;if((null==e||null==(t=e.error)?void 0:t.message)===m.f.MFA_RESEND_INVALID)return void l.navigateToRoute({route:"".concat(i.__.LOGIN,"?code=session")});V(),O(!0)}if((null==e?void 0:e.state)===u.ApiResponseState.SUCCESS){if(l.userNeedsToReacceptTerms)return void F(!0);V(),_(!0)}setTimeout(()=>L(!1),2e3),C(!1)},$=(0,n.useRef)(G);(0,n.useEffect)(()=>{$.current=G},[G]);let Q=(0,n.useCallback)(e=>{$.current(e)},[]),X=l.mfaDigits?(0,s.jsxs)("span",{children:["to the number ending in"," ",(0,s.jsx)("strong",{children:l.mfaDigits})]}):(0,s.jsx)("span",{children:"you"}),q=async()=>{let e=[u.PolicyType.TOS,u.PolicyType.PP],t=await l.acceptPolicies(e,"login");(null==t?void 0:t.state)===u.ApiResponseState.SUCCESS&&(F(!1),l.setUserNeedsToReacceptTerms(!1),W(M)),(null==t?void 0:t.state)===u.ApiResponseState.ERROR&&F(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(b.A,{titleText:"Two-step verification",children:[(0,s.jsxs)("h4",{className:"text-base text-left lg:text-center font-body font-normal px-4",children:["Enter the code we just sent"," ",X," ","to confirm your identity and access your account."]}),(0,s.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),w&&(null==w?void 0:w.toString().length)===6)return void G();V(),R(!0)},noValidate:!0,children:[(0,s.jsx)("div",{className:"flex flex-col justify-center mt-6",children:(0,s.jsx)(o.A,{showError:k,captureNum:A,triggerAutoSubmit:Q,isDisabled:N||E,numberOfDigits:6})}),k&&(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(f.Y,{id:"incorrect-code-error",variant:null==y?void 0:y.level,message:null==y?void 0:y.mainText})}),P&&(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(f.Y,{id:"error",variant:null==S?void 0:S.level,message:null==S?void 0:S.mainText})}),(0,s.jsx)("div",{className:"flex justify-center mt-6",children:(0,s.jsx)("div",{className:"w-auto",children:(0,s.jsx)(h.Y,{id:"remember-device","data-testid":"remember-device",label:"Remember this device",checked:B,onCheckedChange:()=>Y(!B)})})}),I&&(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(f.Y,{id:"general-error",variant:null==j?void 0:j.level,message:null==j?void 0:j.mainText,actions:[{id:"chat-link",label:null==j?void 0:j.linkText,onClick:()=>{p.toggleChat()}}]})}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(g.$,{id:"submit-code","data-testid":"submit-code",type:"submit",size:"lg",variant:"primary",loading:N,className:"w-full my-4",children:"Submit"})})]}),(0,s.jsx)(g.$,{id:"resend-code","data-testid":"resend-code",type:"submit",disabled:D||N,variant:"outline",size:"lg",onClick:H,loading:E,className:"w-full mt-4",children:"Resend code"})]}),(0,s.jsx)("h4",{className:"text-base text-center font-body font-normal",children:(0,s.jsx)("span",{className:"text-primary-hover font-bold pointer",children:(0,s.jsx)(r(),{href:i.__.LOGIN,children:"Back to Log in"})})}),z&&(0,s.jsx)(x.A,{isTOSModalOpen:z,onModalClose:()=>{l.setUserNeedsToReacceptTerms(!1),l.logout(),l.navigateToRoute({route:"".concat(i.__.LOGIN,"?status=").concat(v.F.LOGOUT)}),F(!1)},handleModalAccept:q,handleAcceptWithoutCloseEvent:!0,mainText:"Updates to our Terms of Service and Privacy Policy",subText:"We've updated our Terms of Service and Privacy Policy. Please Review and accept them to continue to use Trust & Will."})]})}N.backgroundImages={imageOneSrc:"/img/svg/books.svg",imageOneAlt:"Illustration of books",imageOneCustomClasses:"lg:w-48 lg:mt-4 lg:ml-4 w-28 xs:w-36 top-24 mt-7 xs:mt-12 right-48 xs:right-64",imageTwoSrc:"/img/svg/lock.svg",imageTwoAlt:"Illustration of a padlock",imageTwoCustomClasses:"w-36 xs:w-48 lg:w-56 right-0 xs:right-4",customHeight:"top-32 xs:top-20 lg:top-24 mt-0 lg:mt-48"},N.getLayout=function(e){return(0,s.jsx)(p.A,{backgroundImages:N.backgroundImages,children:e})},N.pageTitle="Two-Factor Verification"},80392:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(37876);a(14232);var n=a(21401),l=a(97891),r=a(95402);function i(e){let{isTOSModalOpen:t,handleModalAccept:a,onModalClose:i,mainText:o,subText:c,handleAcceptWithoutCloseEvent:d}=e,u=(0,s.jsxs)("div",{className:"mb-10",children:[(0,s.jsx)("p",{className:"text-sm",children:c}),(0,s.jsxs)("a",{href:r.yd,target:"_blank",className:"inline-link flex flex-nowrap my-4",rel:"noopener",children:["Terms of Service",(0,s.jsx)("span",{className:"ml-1",children:(0,s.jsx)(l.I,{className:"!text-primary-emphasis",name:"external-link",variant:"outlined",size:"xs"})})]}),(0,s.jsxs)("a",{href:r.wu,target:"_blank",className:"inline-link flex flex-nowrap mt-4 mb-8",rel:"noopener",children:["Privacy Policy",(0,s.jsx)("span",{className:"ml-1",children:(0,s.jsx)(l.I,{className:"!text-primary-emphasis",name:"external-link",variant:"outlined",size:"xs"})})]})]});return(0,s.jsx)(n.A,{isOpen:t,settings:{role:"Some Modal Role text",maxWidth:512,disableClose:!1,showStillHaveQuestions:!0},data:{title:o,subTitle:"TERMS OF SERVICE",icon:{url:"img/svg/books.svg",description:""},showPrimaryCTA:!0,primaryCTAText:"Accept",showSecondaryCTA:!0,secondaryCTAText:"Decline",content:u,extendPrimaryCTAEvent:a},onClose:i,handleAcceptWithoutCloseEvent:d})}},81502:(e,t,a)=>{a.d(t,{A:()=>m});var s=a(46045),n=a(16690),l=a(37876),r=a(14232),i=a(35280),o=a(97891),c=function(e){return e.BACKSPACE="deleteContentBackward",e.DELETE="deleteContentForward",e.INSERT_TEXT="insertText",e}({}),d=function(e){return e.BACKSPACE="Backspace",e.DELETE="Delete",e.DASH="-",e.ENTER="Enter",e}({});let{pasteOnlyNumbers:u}=a(77250).Ay;function m(e){let{captureNum:t,triggerAutoSubmit:a,isDisabled:m=!0,showError:x,errorMessage:p,warningMessage:v,isLocked:f=!1,numberOfDigits:g=6,justifyStart:h}=e,b=(0,r.useRef)([]),j=(0,r.useMemo)(()=>Array.from(Array(g).keys()),[g]),y={};
1j.forEach(e=>{y["numInput-".concat(e)]=""});let[S,N]=(0,r.useState)(y),[T,E]=(0,r.useState)(null),[C,w]=(0,r.useState)(!1),[A,k]=(0,r.useState)(!1),R=(0,r.useCallback)(()=>{let e={};j.forEach(t=>{e["numInput-".concat(t)]=""}),N(e)},[j]);(0,r.useEffect)(()=>{x&&R()},[x,R]);let I=e=>{if(!e)return;null==e||e.focus();let[,t]=e.name.split("-");(t=parseInt(t))&&E(t)};(0,r.useEffect)(()=>{var e;(null==b||null==(e=b.current)?void 0:e.length)&&I(b.current[0])},[]),(0,r.useEffect)(()=>{var e;let s=Object.values(S),n=s.join("");t(n);let l=(null==(e=s.filter(e=>""!==e&&!isNaN(e)))?void 0:e.length)===g;l&&T===g-1&&(k(!1),a(n)),l&&C&&(k(!1),a(n)),w(!1)},[S,T,g,t,a,C]);let O=(e,t)=>{let a=e.trim();if(isNaN(a))return void k(!0);let n=a.split(""),l=(0,s._)({},S);n.forEach((e,a)=>{let s=parseInt(t+a);s+1>g||isNaN(e)||(l["numInput-".concat(s)]=parseInt(e))}),k(!1),w(!0),N(l)},P=e=>{var t;let{maxLength:a,value:l,name:r}=e.target,i=l,[,o]=r.split("-"),d=parseInt(o),{inputType:u}=e.nativeEvent;if(isNaN(i))return void k(!0);if(6===i.length&&O(i,o),2===i.length){let[e,t]=i.split(""),a=S["numInput-".concat(o)];a===parseInt(e)&&(i=t),a===parseInt(t)&&(i=e)}if(i.length>1)return;k(!1);let m="0"===(t=i)?0:parseInt(t)?parseInt(t):"";if(N((0,n._)((0,s._)({},S),{[r]:m})),l.length>=a&&d<g&&u!==c.BACKSPACE&&u!==c.DELETE){let e=b.current[d+1]||null;null!==e&&I(e)}},_=e=>{e.preventDefault();let{name:t}=e.target,a=parseInt(t.slice(-1));O(e.clipboardData.getData("text/plain"),a)},D="reset-number-input rounded-md border placeholder-muted w-10 sm-mx-2 py-3 text-center xs:text-left xs:pl-3.5 ".concat(x?"border-danger":m?"text-muted-foreground border-border":"border-border hover:border-primary-hover text-foreground"),L=e=>{let{name:t}=e.target,[,a]=t.split("-"),s=parseInt(a),{key:n}=e;if(n===d.BACKSPACE){let e=b.current[s-1]||null;e&&I(e)}},z=e=>{var t;null==e||null==(t=e.target)||t.select()};return(0,l.jsxs)("div",{className:"lato",children:[(0,l.jsx)("div",{className:"flex flex-nowrap flex-row space-x-2 ".concat(h?"justify-start":"justify-center"),children:j.map(e=>(0,l.jsx)("input",{min:"0",max:"9",id:e,ref:t=>{b.current[e]=t},name:"numInput-".concat(e),pattern:"[0-9]*",inputMode:"numeric",className:D,placeholder:"0","aria-invalid":x,"aria-describedby":"num-error",value:S["numInput-".concat(e)],onChange:P,disabled:m,readOnly:f,onPaste:_,onKeyUp:L,onFocus:z},e))}),x&&p&&(0,l.jsxs)("div",{className:"mt-2 text-danger flex flex-row ".concat(h?"justify-start":"-ml-2 justify-center"),children:[(0,l.jsx)(o.I,{className:"mr-1",name:"close",variant:"outlined",size:"sm"}),(0,l.jsx)("p",{className:"mb-0 text-sm",id:"num-error",children:p})]}),f&&v&&(0,l.jsxs)("div",{className:"mt-2 text-carrot-darken-15 flex flex-row ".concat(h?"justify-start":"-ml-2 justify-center"),children:[(0,l.jsx)(o.I,{className:"mr-1",name:"alert-triangle",variant:"filled",size:"sm"}),(0,l.jsx)("p",{className:"mb-0 text-sm",children:v})]}),A&&(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(i.Y,{id:"mfa=error",variant:null==u?void 0:u.level,message:null==u?void 0:u.mainText})})]})}},88318:(e,t,a)=>{a.d(t,{A:()=>l});var s=a(37876),n=a(42493);function l(e){let{children:t,preText:a,titleText:l,titleCenter:r,className:i,compact:o=!1}=e;return(0,s.jsx)("div",{className:o?"pt-4 pb-6 px-0 lg:px-8":"pt-4 pb-6 px-8",children:(0,s.jsxs)("div",{className:"bg-background-card rounded-xl shadow-card ".concat(o?"p-4 lg:p-8":"p-8"," mb-0 relative ").concat(i||"sm:max-w-xl"," mx-auto"),children:[a&&a,(0,s.jsx)(n.o,{as:"h1",variant:"title-xxl",textAlign:r?"center":"left",className:"font-spiritsm font-normal tracking-tighter mb-4 mx-auto ".concat(r?"":"lg:text-center"),style:{fontFamily:"New Spirit Semibold Condensed",fontSize:"var(--tw-typography-title-xxl-size)",lineHeight:"var(--tw-typography-title-xxl-line-height)"},children:l}),t]})})}}}]);
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.