1import{_ as J}from"./B8pfZ2vy.js";import{C as q,O as c,X as s,f as N,Y as H,a0 as ee,d as m,o as te,Q as D,Z as P,al as oe,B as e,$ as x,a5 as f,l as S,ai as se,ak as C,e as h,b as _}from"./D2PenvMZ.js";import{t as ne}from"./CXbhu34a.js";import{u as re,a as ae}from"./5AARiwyN.js";import{z as B}from"./BJN2arqO.js";import{M as A}from"./I7kO0aKf.js";import{_ as R}from"./DFb0KwtK.js";import{_ as ie}from"./CTAs1fSO.js";import{f as le,aR as me,e as ue,bj as pe,bL as de,j as ce,af as fe,h as k,aH as be,x as ge,aS as xe,a7 as ye,a9 as ve,aa as l,aT as U,bi as O,aW as $,a_ as he,a2 as _e}from"./aLrIR-cP.js";import{_ as ke}from"./DqOLFPxv.js";import{ac as we,ad as Ne}from"./BBGT4EBI.js";import{S as F}from"./C3lJZ8mP.js";import{_ as Te}from"./D1CUO1Hw.js";import{M as Me}from"./Dnrckf9f.js";import{I as Pe}from"./CF6CYov-.js";import{u as Se}from"./CDohe6EK.js";import"./CN5T0Qha.js";import"./Lw3U55bO.js";import"./B98lbH4P.js";import"./Bc5JSocz.js";import"./BWhgzynv.js";import"./DQUCbd5I.js";import"./VbBNGKlU.js";import"./i3NPDlg4.js";import"./0y-DGERM.js";import"./Hzq2TwJG.js";const w=""+new URL("amc-leaf.9v86ugGm.svg",import.meta.url).href,Le={class:"flex flex-row items-center justify-center rounded-[10px] bg-slate-100 p-sp1"},Ee={key:0,class:"flex items-center justify-center h-full pr-[12px] pl-[8px]"},Ie=["src"],Ve=q({__name:"ToolTipV2",props:{icon:{default:Pe},msg:{},useBlueText:{type:Boolean}},setup(L){const o=L;return(T,E)=>(m(),c("div",Le,[o.icon?(m(),c("div",Ee,[s("img",{src:o.icon,alt:"Tip Icon",class:"desktop:h-[32px] desktop:w-[32px] mobile-sm:h-[24px] mobile-sm:w-[24px]"},null,8,Ie)])):N("",!0),s("div",{class:ee(["justify-center font-work-sans text-sm font-medium leading-5",[o.useBlueText?"text-[#005472]":"text-[#4A4A4A]"]])},H(o.msg),3)]))}}),De={class:"flex flex-col items-center"},Ce={class:"mobile-sm:w-full mobile-sm:text-[24px] mobile-sm:leading-[32px] desktop:w-[648px] desktop:text-[32px] desktop:leading-[43px]"},Be={key:0,class:"w-full max-w-[634px] pb-[8px]"},Ae={class:"flex flex-col items-center gap-6 rounded-xl bg-amc-gray-300 p-6 tablet:p-8"},Re={key:0,class:"m-0 -my-2 px-2 text-center font-work-sans text-base font-semibold leading-[22px] text-amc-gray-900 tablet:px-0 tablet:text-lg tablet:leading-[26px]"},Ue={key:1,class:"px-2 text-center font-work-sans text-base font-semibold leading-[22px] text-amc-gray-900 mobile-sm:w-[210px] tablet:px-0 tablet:text-lg tablet:leading-[26px] desktop:w-full"},Oe=["id"],$e={key:0,class:"-mb-6 mt-6 hidden flex-row items-center gap-2 desktop:flex"},Fe=["src"],qe=["src"],He={key:2,class:"mt-4 flex flex-row items-center gap-2 desktop:hidden"},je=["src"],We=["src"],ze=q({__name:"phone-number",setup(L){le({title:Ne,meta:[{name:"description",content:we}]});const o=me(),T=ue(),E=o.getApiType(),y=(o.getPhoneNumber()||o.getPrimaryBorrower()?.phoneNumber||"").replace(/\D/g,""),u=pe()&&y.length>=10,j=u?y.substring(3,6):void 0,b=_(""),v=_(!1),{defineField:W,errors:z}=re({validationSchema:ne(B.object({phoneNumber:B.string().min(10,"Please number must be at least 10 digits.")})),initialValues:{phoneNumber:u?"":o.getPrimaryBorrower()?.phoneNumber??""}}),[d]=W("phoneNumber"),M=ae("phoneNumber"),{wrapForAutoLoadingWithArgs:Y,loading:G}=Se(),K=new de(o.getApi()),X=new ce(o.getApi()),I=_(),p=_(""),V=r=>{d.value=r},Q=r=>{v.value=!0,b.value=r.replace(/\D/g,"").slice(0,4),p.value=""},Z=async()=>{const r=b.value.replace(/\D/g,"");if(r.length!==4)return p.value="The last 4 digits of your phone number are required.",null;if(r===y.slice(-4))return y;const t=o.getAppId();if(!t)return p.value="Unable to verify phone number. Please try again.",null;let a;try{a=await X.borrowerPhoneNumberValidation({appId:t,phoneLast4Digits:r})}catch{a={success:!1,phoneNumber:""}}return!a.success||!a.phoneNumber?(p.value="Invalid phone number.",null):a.phoneNumber.replace(/\D/g,"")},g=Y(async r=>{if(T.pushCtaClickEvent({ctaName:"NextStep"}),u){v.value=!0;const a=await Z();if(!a)return;const i=o.getPrimaryBorrower();return o.setPhoneNumber(a),i&&o.setPrimaryBorrower(new U({...i,phoneNumber:a})),k().$navigate.to(O)}if(!M.value){p.value=z.value.phoneNumber??"Phone number is required.";return}return o.setPhoneNumber(d.value.toString()),await o.for($).updateBorrowersAppData({borrowers:o.getBorrowers().map((a,i)=>i===0?new U({...a,phoneNumber:d.value.toString()}):a)}),T.push({event:"phone_collected"}),o.getOtp().phoneNumbers[d.value]?.isVerified?E==="cashoutChallengerFlow"?o.exitModule({currentStep:$}):k().$navigate.to(he):k().$navigate.to(O,{query:{amount:I.value?.toString()}})});te(()=>{if(u)return;const r=fe().getLeadsPrefillData();r?.phoneNumber&&(d.value=r.phoneNumber)}),D(async()=>{k().$trackingInfo()?.sourceId===be&&K.getPayout(ge().getTransactionType()??"").then(r=>{I.value=r?.payout})}),D(async()=>{o.getLayout()!==void 0&&xe(o.getLayout())});const n=ye().getTestResult(ve.CO_PII_PHONE_FIRST_AS143_TEST);return(r,t)=>{const a=J;return m(),c("div",De,[P(a,null,oe({_:2},[e(u)?{name:"innerText",fn:x(()=>[t[5]||(t[5]=f(" Verify your identity by entering",-1)),t[6]||(t[6]=s("br",null,null,-1)),t[7]||
1(t[7]=f("the last 4 digits of your phone number ",-1))]),key:"0"}:e(n)===e(l).v1||e(n)===e(l).v4?{name:"innerText",fn:x(()=>[t[8]||(t[8]=s("div",{class:"mobile-sm:w-[343px] mobile-sm:text-[24px] mobile-sm:leading-[32px] desktop:w-[798px] desktop:text-[32px] desktop:leading-[43px]"},[s("span",null,"Unlock your quote by verifying your identity using your mobile number")],-1))]),key:"1"}:e(n)===e(l).v2||e(n)===e(l).v3?{name:"innerText",fn:x(()=>[s("div",Ce,[s("span",null,[f(H(e(o).getPrimaryBorrower()?.firstName)+", your personalized quote ",1),t[9]||(t[9]=s("br",{class:"hidden md:block"},null,-1)),t[10]||(t[10]=f(" is almost ready",-1))])])]),key:"2"}:{name:"innerText",fn:x(()=>[t[11]||(t[11]=f("Verify your identity by providing",-1)),t[12]||(t[12]=s("br",null,null,-1)),t[13]||(t[13]=f("your mobile number",-1))]),key:"3"}]),1024),!e(u)&&(e(n)===e(l).v3||e(n)===e(l).v4)?(m(),c("div",Be,[s("div",Ae,[e(n)===e(l).v3?(m(),c("span",Re,[...t[14]||(t[14]=[f("Unlock your quote by verifying your identity using",-1),s("br",{class:"hidden tablet:block"},null,-1),f(" your mobile number",-1)])])):e(n)===e(l).v4?(m(),c("span",Ue,"Your personalized quote is almost ready")):N("",!0),P(ie,{errorMessage:e(p),iconUrl:e(Me),invalid:!e(M)&&e(p).length,onChange:V,id:"phoneNumber",name:"phoneNumber",label:"Enter Mobile Number",modelValue:e(d),"onUpdate:modelValue":t[0]||(t[0]=i=>S(d)?d.value=i:null),autocomplete:"tel-national","background-color":"bg-amc-white","wrapper-class":"w-full border-2 border-solid border-amc-gray-900 rounded-lg tablet:max-w-[352px]"},null,8,["errorMessage","iconUrl","invalid","modelValue"])])])):(m(),c("form",{key:1,id:e(u)?"phoneLast4Form":"phoneNumberForm",class:"w-full max-w-[400px]",onSubmit:t[3]||(t[3]=C((...i)=>e(g)&&e(g)(...i),["prevent"])),onKeydown:t[4]||(t[4]=se(C((...i)=>e(g)&&e(g)(...i),["prevent"]),["enter"]))},[e(u)?(m(),h(R,{key:0,errorMessage:e(v)&&e(p)?e(p):void 0,iconUrl:e(A),invalid:!!(e(v)&&e(p)),onChange:Q,id:"phoneLast4",name:"phoneLast4",label:"Mobile Number",modelValue:e(b),"onUpdate:modelValue":t[1]||(t[1]=i=>S(b)?b.value=i:null),phoneMiddleDigits:e(j),autocomplete:"tel-national"},null,8,["errorMessage","iconUrl","invalid","modelValue","phoneMiddleDigits"])):(m(),h(R,{key:1,errorMessage:e(p),iconUrl:e(A),invalid:!e(M)&&e(p).length,onChange:V,id:"phoneNumber",name:"phoneNumber",label:"Mobile Number",modelValue:e(d),"onUpdate:modelValue":t[2]||(t[2]=i=>S(d)?d.value=i:null),autocomplete:"tel-national"},null,8,["errorMessage","iconUrl","invalid","modelValue"])),!e(u)&&(e(n)===e(l).v1||e(n)===e(l).v2)?(m(),h(Ve,{key:2,icon:e(F),msg:"We use your mobile number to confirm its really you and protect your loan details",class:"mb-[20px] max-w-[600px] mobile-sm:mt-[20px] desktop:mt-[60px]"},null,8,["icon"])):(m(),h(Te,{key:3,icon:e(F),msg:"We use your mobile number to confirm its really you and protect your loan details",class:"mb-[20px] max-w-[600px] mobile-sm:mt-[20px] desktop:mt-[60px]"},null,8,["icon"]))],40,Oe)),P(ke,{"on-next-click":e(g),loading:e(G),"button-text":e(u)?"Continue":"Text Verification Code","container-class":"mt-[20px]","disable-padding":!0},{innerNavButtons:x(()=>[!e(u)&&(e(n)===e(l).v3||e(n)===e(l).v4)?(m(),c("div",$e,[s("img",{src:e(w),alt:"AMC Leaf Icon",class:"h-[50px]"},null,8,Fe),t[15]||(t[15]=s("div",{class:"flex flex-col items-center"},[s("span",{class:"font-work-sans text-base font-semibold -tracking-[2%] text-amc-gray-900"},"$130 billion in loans financed"),s("span",{class:"text-center font-work-sans text-sm font-normal -tracking-[2%] text-amc-gray-900"},"Trusted by thousands of homeowners")],-1)),s("img",{src:e(w),alt:"AMC Leaf Icon",class:"h-[50px] -scale-x-100"},null,8,qe)])):N("",!0)]),_:1},8,["on-next-click","loading","button-text"]),!e(u)&&(e(n)===e(l).v3||e(n)===e(l).v4)?(m(),c("div",He,[s("img",{src:e(w),alt:"AMC Leaf Icon",class:"h-[50px]"},null,8,je),t[16]||(t[16]=s("div",{class:"flex flex-col items-center"},[s("span",{class:"font-work-sans text-base font-semibold -tracking-[2%] text-amc-gray-900"},"$130 billion in loans financed"),s("span",{class:"text-center font-work-sans text-sm font-normal -tracking-[2%] text-amc-gray-900"},"Trusted by thousands of homeowners")],-1)),s("img",{src:e(w),alt:"AMC Leaf Icon",class:"h-[50px] -scale-x-100"},null,8,We)])):N("",!0)])}}}),ht=_e(ze,[["__scopeId","data-v-ad7c2227"]]);export{ht as default};
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.