PageSourceSearch

https://www.staycalminvesting.com/static/js/ResetPassword-7jPYNQum-chunk.js

js staycalminvesting.com collected 2026-10-06 07:49:00 UTC 12,725 bytes, 2 lines download raw bytes

1import{j as s,D as T,r as p,P as r}from"./main-aA_EcOIv.js";import{D as k}from"./DataContainer-DrXYfX7k-chunk.js";import{A,a as F,c as I}from"./AccessAndAuth2FactorIdentifyForm-B9-M6tuG-chunk.js";import{a as V,A as N}from"./AccessAndAuthSubfooter-CpZoC0v0-chunk.js";import{a as C,A as P}from"./AccessAndAuthAnswerQuestions-BnQJoAtY-chunk.js";import{g as d}from"./getDecodedHtml-wzi1zZCi-chunk.js";import{F as O,a as L,I as _}from"./formik.esm-B6WgQKgg-chunk.js";import{B as b}from"./ButtonAction-_-WZ22id-chunk.js";import{v as R}from"./validation-lc7zt_eW-chunk.js";import{C as m}from"./ContentSplitted-DkbfECwl-chunk.js";import{A as M}from"./AccessAndAuthPasswordForm-BKo6KaYH-chunk.js";import"./pdfmake-BRJ3kdkn-chunk.js";import"./ImageArrowLeft-BcwSnCFc-chunk.js";import"./MaskedInput-D86EFdcN-chunk.js";import"./DotLoader-C4UGrJ9L-chunk.js";import"./getRegexFromUsername-DVYmDAaT-chunk.js";const x=({label:c,email:e,changeLabel:t,click:a})=>{let i=s.jsx(s.Fragment,{});return t&&a&&(i=s.jsx("span",{className:"reset-password-top-bar-change text-body-xxs text-color-teal-900",dangerouslySetInnerHTML:{__html:d(t)},role:"button",tabIndex:0,onClick:a,onKeyUp:n=>{T(n)||a()}})),s.jsxs("div",{className:"reset-password-top-bar","data-testid":"passwordTopBar",children:[s.jsx("div",{className:"reset-password-top-bar-label text-label-xxs-bold text-color-cool-gray-900",dangerouslySetInnerHTML:{__html:d(c)}}),s.jsx("div",{className:"reset-password-top-bar-email text-body-xs",dangerouslySetInnerHTML:{__html:e}}),i]})};class g extends p.Component{constructor(e){super(e),this.validateFormik=null,this.state={focused:!1,submitting:!1,error:"",tooManyAttempts:""}}bindValidateFormik=e=>{this.validateFormik=e};handleFocus=()=>{this.state.focused||this.setState({focused:!0}),this.bindValidateFormik()};initialValues=()=>({email:""});validate=e=>{let t={};return e.email?R("email",e.email.trim())||(t.email=this.props.errors.email.invalid):t.email=this.props.errors.required,t};handleSubmit=e=>{const t=e.email.toLowerCase();fetch(`${this.props.lang.url}?email=${encodeURIComponent(t)}`,{credentials:"same-origin",method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(a=>a.json()).then(a=>{switch(a.status){case"success":{const i=[];Object.hasOwn(a,"verifyIdentity")&&i.push({key:"verifyIdentity",object:a.verifyIdentity}),i.push({key:"email",object:e.email,state:"main"}),this.props.next(null,i),this.setState({error:"",tooManyAttempts:"",submitting:!1})}break;case"error":this.setState({error:a.error,submitting:!1});break}}).catch(()=>{this.setState({submitting:!1})})};render(){const{lang:e}=this.props;return e?s.jsxs("div",{className:this.props.step!==1?" access-and-auth-hidden":"",children:[s.jsx("p",{className:"reset-password-instruction text-body-xs t-align-center",dangerouslySetInnerHTML:{__html:d(e.instruction)}}),s.jsx(O,{initialValues:this.initialValues(),validate:this.validate,onSubmit:this.handleSubmit,children:({values:t,touched:a,errors:i,handleChange:n,handleBlur:l,validateForm:o})=>{this.bindValidateFormik(o);const u=!!(i.email||!this.state.focused||!t.email);return s.jsxs(L,{autoComplete:"off",children:[s.jsx(_,{label:e.emailLabel,type:"text",name:"email",value:t.email,error:i.email,touched:a.email,handleChange:n,handleFocus:this.handleFocus,formikHandleBlur:l}),s.jsx(b,{className:"",type:"solid",width:"full",label:d(e.nextButton),isButton:"true",buttonType:"submit",disabled:u})]})}}),s.jsx("div",{className:"reset-password-steps-email-forgot text-body-xs t-align-center",dangerouslySetInnerHTML:{__html:d(e.forgotEverything)}})]}):null}}g.propTypes={step:r.number,lang:r.object,errors:r.object,next:r.func};class y extends p.Component{constructor(e){super(e),this.state={step:2}}handleSendCode=e=>{fetch(this.props.lang.url,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({factorType:e,email:this.props.email})}).then(t=>t.json()).then(t=>{switch(t.status){case"success":{const a=[];Object.hasOwn(t,"textVerification")&&t.textVerification&&a.push({key:"textVerification",object:t.textVerification}),Object.hasOwn(t,"callVerification")&&t.callVerification&&a.push({key:"callVerification",object:t.callVerification}),this.props.next(null,a,Object.hasOwn(t,"textVerification")&&t.textVerification?6:7)}break}}).catch(()=>{this.setState({submitting:!1})})};handleResetViaEmail=()=>
1{fetch(this.props.lang.resetViaEmailLink,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({email:this.props.email})}).then(e=>e.json()).then(e=>{switch(e.status){case"success":{const t=[];Object.hasOwn(e,"emailSent")&&t.push({key:"emailSent",object:e.emailSent}),this.props.next(null,t)}break}}).catch(()=>{this.setState({submitting:!1})})};render(){const{step:e,lang:t}=this.props;let a=e!==this.state.step;if(!t)return null;const i={cta:this.handleResetViaEmail,class:"reset-password-steps-identify-alternative-link"};return s.jsxs("div",{className:"reset-password-steps-identify"+(a?" access-and-auth-hidden":""),"data-testid":"resetPasswordIdentify",children:[s.jsx(A,{lang:t,handleSendCode:this.handleSendCode}),s.jsx(m,{subject:t.alternative,extra:i})]})}}y.propTypes={step:r.number,lang:r.object,next:r.func};const j=({step:c,lang:e,next:t,alternative:a})=>e?s.jsxs("div",{className:"reset-password-steps-email-sent"+(c!==3?" access-and-auth-hidden":""),"data-testid":"resetPasswordEmailSent",children:[s.jsx("div",{className:"access-and-auth-second-factor-identify-instruction text-body-xs",dangerouslySetInnerHTML:{__html:d(e.message)}}),s.jsx(m,{className:"access-and-auth-second-factor-identify-alternative",subject:a,extra:{cta:()=>t(null,null,2)}})]}):null;j.propTypes={step:r.number,lang:r.object};class S extends p.Component{constructor(e){super(e),this.validateFormik=null,this.state={step:4}}success=e=>{Object.hasOwn(e,"passwordForm")&&this.props.next(null,[{key:"passwordForm",object:e.passwordForm}],8)};cancel=()=>{const{cancelUrl:e=""}=this.props.lang;window.location.replace(e)};render(){const{step:e,lang:t,next:a,email:i,stateToken:n}=this.props;let l=e!==this.state.step;if(!t)return null;let o=null,u=null;return t.error?u=s.jsx("div",{className:"access-and-auth-error text-body-sm text-color-red-800 reset-password-steps-questions-error",dangerouslySetInnerHTML:{__html:d(t.error)}}):o=s.jsx(C,{step:e,lang:t,next:a,success:this.success,email:i,stateToken:n,isLoading:!l,cancel:this.cancel}),s.jsxs("div",{className:l?"access-and-auth-hidden":"","data-testid":"resetPasswordQuestions",children:[u,o]})}}S.propTypes={step:r.number,lang:r.object,next:r.func};class h extends p.Component{constructor(e){super(e),this.state={step:e.customStep,phoneCountry:null,isInvalid:"",code:""}}componentDidUpdate(e,t){!t.isInvalid&&t.isInvalid!==this.state.isInvalid&&typeof this.validateFormik=="function"&&this.validateFormik({code:this.state.code})}getInitialValues(){return{code:""}}cta=()=>{this.props.next(null,null,2)};handleSubmit=(e,{resetForm:t})=>{this.state.submitting||(this.setState({submitting:!0}),fetch(this.props.lang.url,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({code:e.code,factorType:this.props.type,email:this.props.email})}).then(a=>a.json()).then(a=>{switch(a.status){case"success":a.passwordForm&&(this.props.next(null,[{key:"passwordForm",object:a.passwordForm}],8),t());break;case"error":this.setState({isInvalid:a.error});break}this.setState({submitting:!1})}).catch(a=>{console.log("error: ",a),this.setState({submitting:!1})}))};sendAgain=()=>{const{sendAgainUrl:e,type:t,email:a}=this.props;fetch(e,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({email:a,factorType:t})}).then(i=>i.json()).then(i=>{i.status}).catch(i=>{console.log("error: ",i),this.setState({submitting:!1})})};bindValidateForm=e=>{this.validateFormik=e};validate=e=>{const t={};return this.state.isInvalid?t.code=this.state.isInvalid:e.code||(t.code=this.props.errors.required),t};onPhoneCountrySelected=(e,t)=>{this.setState({phoneNumber:e.key}),t()};handleKeyUp=e=>{this.setState({isInvalid:"",code:e.currentTarget.value})};render(){const{step:e,lang:t,prev:a,alternative:i}=this.props;let n=e!==this.state.step;return t?s.jsxs("div",{className:n?" access-and-auth-hidden":"","data-testid":"resetPasswordVerification",children:[s.jsx(F,{lang:this.props.lang,prev:a,getInitialValues:this.getInitialValues,handleKeyUp:this.handleKeyUp,validate:this.validate,handleSubmit:this.handleSubmit,bindValidateForm:this.bindValidateForm,sendAgain:this.sendAgain}),s.jsx(m,{subject:i,extra:{cta:this.cta},className:"access-and-auth-second-factor-identify-alternative"})]}):null}}h.propTypes={customStep:r.number,step:r.number,lang:r.object,errors:r.object,type:r.oneOf(["sms","call"]),next:r.func,prev:r.func,sendAgainUrl:r.string};class U extends p.Component{constructor(e){super(e),this.state={step:8}}success=e=>{e.resetSuccessfully&&this.props.next(null,[{key:"resetSuccessfully",object:e.resetSuccessfully}])};render(){const{step:e,lang:t,errors:a,email:i,stateToken:n}=this.props;return this.props.lang?s.jsx(M,{customStep:this.state.step,step:e,lang:t,errors:a,success:this.success,cancelClick:this.cancel,email:i,stateToken:n,breakpoint:980}):null}}const v=({step:c,lang:e})=>e?s.jsxs("div",{className:"reset-password-steps-successful"+(c!==9?" access-and-auth-hidden":""),children:[s.jsx("div",{className:"reset-password-instruction text-body-xs t-align-center",dangerouslySetInnerHTML:{__html:d(e.message)}}),s.jsx("div",{className:"reset-password-steps-successful-button",children:s.jsx(b,{url:e.url,className:"",type:"solid",width:"full",label:e.nextButton,isButton:"false"})})]}):null;v.propTypes={step:r.number,lang:r.object};class w extends p.Component{constructor(e){super(e),this.state={email:e.data&&e.data.email?e.data.email:"",step:e.data&&e.data.questionsForm?4:1,lastStep:null,totalSteps:10,lang:e.data||{title:"Reset Password"},isMobile:!1}}componentDidUpdate(e){const{data:t}=this.props;t&&!e.data&&this.setState({lang:t,email:t&&t.email?t.email:"",step:t&&t.questionsForm?4:1})}componentDidMount(){window.onresize=this.onResize}onResize=()=>{this.setState({isMobile:window.innerWidth<=767})};nextStep=(e,t=null,a=null)=>{const i=I(this.state),n=this.state.step;let l=!1;e&&e.preventDefault(),t!==null&&t.length&&(t.forEach(o=>{typeof o.state>"u"?i.lang[o.key]=o.object:o.state==="main"?i[o.key]=o.object:i[o.state][o.key]=o.object}),l=!0),a!==null&&a>0?(i.lastStep=n,i.step=a,l=!0):n<=this.state.totalSteps&&(i.lastStep=n,i.step=n+1,l=!0),l&&this.setState(i)};prevStep=e=>{e&&e.preventDefault(),this.state.step>0&&this.setState({step:this.state.step-1})};render(){const{step:e,lang:t,email:a,isMobile:i}=this.state,{nextStep:n,prevStep:l}=this;let o=null,u=null;const f=e!==1&&e!==4;return e===3||e===8||e===9?o=s.jsx(x,{label:t.emailLabel,email:this.state.email}):f&&(o=s.jsx(x,{label:t.emailLabel,email:this.state.email,changeLabel:t.changeLabel,click:()=>{n(null,null,1)}})),e<9&&(u=s.jsx("div",{className:"reset-password-subfooter text-body-sm text-color-teal-600 t-align-center",children:s.jsx("a",{href:t.returnToLoginUrl,"aria-label":t.returnToLogin,dangerouslySetInnerHTML:{__html:d(t.returnToLogin)}})})),s.jsxs(V,{title:t.title,backgroundImage:t.backgroundImage,children:[s.jsx(P,{className:"reset-password-box reset-password-zero-padding",children:s.jsxs(p.Fragment,{children:[o,s.jsxs("div",{className:"reset-password"+(f?" reset-password-zero-top-padding":""),children:[s.jsx(g,{step:e,lang:t.emailForm,errors:t.errors,next:n,prev:l}),s.jsx(y,{step:e,lang:t.verifyIdentity,next:n,prev:l,email:a}),s.jsx(j,{step:e,lang:t.emailSent,next:n,alternative:t.alternative}),s.jsx(S,{step:e,lang:t.questionsForm,next:n,prev:l,email:a,stateToken:t.stateToken}),s.jsx(h,{customStep:6,step:e,lang:t.textVerification,errors:t.errors,type:"sms",next:n,sendAgainUrl:t.verifyIdentity?t.verifyIdentity.url:null,email:a,alternative:t.alternative}),s.jsx(h,{customStep:7,step:e,lang:t.callVerification,errors:t.errors,type:"call",next:n,sendAgainUrl:t.verifyIdentity?t.verifyIdentity.url:null,email:a,alternative:t.alternative}),s.jsx(U,{isMobile:i,step:e,lang:t.passwordForm,errors:t.errors,next:n,email:a,stateToken:t.stateToken}),s.jsx(v,{step:e,lang:t.resetSuccessfully})]})]})}),s.jsx(N,{children:u})]})}}w.propTypes={data:r.object};class te extends p.Component{render(){return s.jsx(k,{data:"resetPasswordData",children:s.jsx(w,{})})}}export{te as default};
2//# sourceMappingURL=ResetPassword-7jPYNQum-chunk.js.map

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.