1"use strict";(self["webpackChunkracqforms20"]=self["webpackChunkracqforms20"]||[]).push([[6464],{56648:function(e,t,n){n.d(t,{D$:function(){return d},E0:function(){return i},FS:function(){return m},FT:function(){return b},I1:function(){return y},JE:function(){return v},MF:function(){return C},My:function(){return o},QO:function(){return l},Uj:function(){return s},_2:function(){return u},dj:function(){return h},hd:function(){return p},jo:function(){return A},kE:function(){return r},mn:function(){return c},uI:function(){return g},wr:function(){return f},zh:function(){return a}});const i="We need to talk to you to arrange your roadside assistance",a="We need to talk to you to finalise your assistance. When you speak to an agent please quote: Reference number",o="Non-member",s="Existing RSA Coverage",r="Existing member no RSA Coverage",l="User under 21 years old",u="User under 16 years old",c="RSA eligibility API check technical failure",d="RSA member with product in reminder produced or pending payment",p="Failed RSA eligibility check or invalid product status",m="Location not serviceable",f="System failure",y="Vehicle eligibility check failed",b="User under 16 years old",v="No Immediate Assistance offered for Business",A="Your vehicle must be a legally registered vehicle",h="Payment retries exhausted",g="Vehicle is not eligible for Business RSA",C="Vehicle is not eligible for any products"},66464:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});n(18111),n(22489),n(20116);var i=n(20641),a=n(50953),o=n(90033),s=n(53751),r=n(40651),l=n(54793),u=n(1260),c=n(90888),d=n(49332),p=n(79583),m=n(6821),f=n(37753),y=n(32508),b=n(42302),v=n(14874),A=n(28933),h=n(11479),g=n(12177),C=n(67378),k=n(56648),R=n(20903),x=n(8903);const D={class:"flex flex-col pb-6"},P={class:"flex flex-col gap-8 md:gap-6"},S={key:0},T={class:"m-0 p-0 flex flex-col gap-8 md:gap-6"},F={key:0},I={class:"text-base-bold"},w=["innerHTML"],E={class:"my-4"},B={class:"flex"};var L=(0,i.pM)({__name:"BuyRoadside_Payment",props:{step:{}},setup(e){const t=e,n=(0,u.xt)(),L=(0,u.I6)(),M=(0,u.J5)(),N=(0,u.Jf)(),{formInputData:V}=(0,l.Ay)(t.step.formInputs),W=(0,a.KR)({}),Y=(0,a.KR)(!1),_=(0,a.KR)(""),K=(0,a.KR)(""),Q=(0,a.KR)(),U=(0,a.KR)(""),$=(0,a.KR)(!1),q=(0,a.KR)(!1),j=(0,a.KR)(""),G=(0,a.KR)(""),J=(0,i.EW)((()=>t.step.formInputs?.paymentMethod?.fields?.find((e=>"fzPaymentSection"===e.name)))),O=(0,i.EW)((()=>{const e=(0,R.A)(t.step.formInputs?.paymentMethod?.fields[0]);return"true"===Q.value&&e?.AcceptPaymentTypes&&(e.AcceptPaymentTypes=e.AcceptPaymentTypes.filter((e=>e.name!==x.Y0[x.Y0.GooglePay]&&e.name!==x.Y0[x.Y0.ApplePay]))),e})),X=J?.value?.SubmitPaymentButtonLabel?.value,H=(0,i.EW)((()=>n.currentStepIndex===t.step.stepIndex)),Z=(0,i.EW)((()=>L.isBusiness?t.step.formInputs?.waitingPeriodTextBusiness?.label?.value:t.step.formInputs?.waitingPeriodText?.label?.value));function z(){N.amount=L.apttusResponse.price.toString(),N.reference=(0,b.A)(),N.selectedPaymentFrequency=A.l.Annually,X&&(N.buttonText=X),N.submitPaymentCallback=re}function ee(){Q.value="true";const e=new Date;e.setFullYear(e.getFullYear()+1);const t={day:"numeric",month:"long",year:"numeric"},n=e.toLocaleDateString("en-GB",t);K.value=(0,f.t3)("nextDirectDebitDate",V("directDebitDescription").label,n)}function te(){_.value=(0,y.vv)(L.apttusResponse?.price,2)??"0";const e=L.buyRoadsideDetails.vehicle;j.value=`${e?.vehicleMake} ${e?.vehicleModel} ${e?.vehicleRegistration}`;let t=L.apttusResponse?.productName??"";L.isBusiness&&(t=`${C.QZ} ${t}`),G.value=t}function ne(){$.value&&(q.value=!0)}function ie(){const e=n.inScopeSteps.find((e=>e.id==t.step.id));e&&(e.isVisible=!1),n.goPrevStep()}async function ae(){const e=3;if(L.checkQuoteFinalisation())return!0;if(L.finaliseQuoteAttemptCount>=e)return await se();L.finaliseQuoteAttemptCount++;const t=await L.finaliseQuote();return!!t||await ae()}async function oe(){const e=3;if(!L.isQuoteFinalised||L.paymentAttemptCount>=e)return L.pushAnalytics({event:g.c.PAYMENT_ATTEMPT,form:{},payment:{paymentAttempt:L.paymentAttemptCount.toString()}}),await se();L.paymentAttemptCount++;const t=await L.submitPurchase();
1return"Approved"!==t?.result?(L.pushAnalytics({event:g.c.PAYMENT_ATTEMPT,form:{},payment:{paymentAttempt:L.paymentAttemptCount.toString()}}),L.paymentAttemptCount>=e?(L.pushAnalytics({event:g.c.JEOPARDY,form:{formErrorType:h.cX,formErrorDetail:k.dj},omitProductName:!0,omitDetail:!0}),await se(!0)):(Y.value=!0,await(0,i.dY)(N.resetIframe),!1)):(Y.value=!1,!0)}async function se(e){return await M.showJeopardyPanel({jpCode:h.cX,backBtnDisabled:!0,formAnalyticsOverride:e?null:void 0}),n.setFormCompleted(),!1}async function re(){try{n.showLoadingForCurrentStep(),L.mapPaymentDetails({cardToken:N.cardDetails?.token,cardHolder:N.cardDetails?.cardHoldersName,MaskedCardNumber:N.cardDetails?.maskedCardNumber,cardExpiry:`${N.cardDetails?.cardExpiryMonth}/${N.cardDetails?.cardExpiryYear}`,cardType:N.cardDetails?.cardType,autoRenew:Q.value});const e=await ae();if(!e)return;const t=await oe();if(n.showLoadingForCurrentStep(!1),!t)return;n.goNextStep()}catch(e){throw n.showLoadingForCurrentStep(!1),console.error(e),e}}return(0,i.wB)(H,(e=>{e&&te()})),(0,i.wB)((()=>$.value),(()=>{!$.value&&q&&(q.value=!1)})),(0,i.wB)((()=>Q.value),(e=>{U.value="true"===e?L.isBusiness?V("termsAndConditionsBusinessTextWithDirectDebit").label:V("termsAndConditionsTextWithDirectDebit").label:L.isBusiness?V("termsAndConditionsBusinessTextWithoutDirectDebit").label:V("termsAndConditionsTextWithoutDirectDebit").label,$.value=!1})),(0,i.sV)((()=>{L.pushAnalytics({event:g.c.STEP,form:{stepName:t.step.stepName}}),z(),te(),ee()})),(e,n)=>{const l=(0,i.g2)("FormKit");return(0,i.uX)(),(0,i.Wv)(l,{modelValue:W.value,"onUpdate:modelValue":n[3]||(n[3]=e=>W.value=e),type:"form",onSubmit:n[4]||(n[4]=e=>ne())},{default:(0,i.k6)((()=>[(0,i.Lk)("div",D,[(0,i.Lk)("div",P,[(0,i.bF)(v.A,{titles:{primary:G.value,secondary:j.value},premiumInfo:{annual:(0,a.R1)(L).apttusResponse?.price??0,frequencyLabel:"per year"},stepFormInputs:e.step.formInputs,showPaymentFrequencyDropdown:!1},null,8,["titles","premiumInfo","stepFormInputs"]),!(0,a.R1)(L).isLoggedIn&&!(0,a.R1)(L).isPartyMatched||(0,a.R1)(L).isBusiness?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("div",S,[(0,i.bF)(p.A,{type:(0,a.R1)(m.Z).SUCCESS,description:t.step.formInputs?.loggedInDiscountText?.label?.value},null,8,["type","description"])])),(0,i.Lk)("div",null,[(0,i.bF)(p.A,{type:(0,a.R1)(m.Z).INFO,description:Z.value},null,8,["type","description"])])]),(0,i.Lk)("div",T,[(0,i.bF)(c.A,{id:"directDebitSection",title:e.step.formInputs?.directDebit?.title,class:"mt-8 md:mt-6"},{sectionPanelContent:(0,i.k6)((()=>[(0,i.bF)(r.A,{modelValue:Q.value,"onUpdate:modelValue":n[0]||(n[0]=e=>Q.value=e),bindings:(0,a.R1)(V)("directDebitRadio")},null,8,["modelValue","bindings"]),"true"===Q.value?((0,i.uX)(),(0,i.CE)("div",F,[(0,i.Lk)("div",I,(0,o.v_)((0,a.R1)(V)("directDebitText")?.label),1),(0,i.Lk)("div",{class:"text-base-bold text-racq-dark-grey",innerHTML:K.value},null,8,w)])):(0,i.Q3)("",!0)])),_:1},8,["title"]),(0,i.bF)(c.A,{id:"termsAndConditionsSection",title:e.step.formInputs?.termsAndConditions?.title},{sectionPanelContent:(0,i.k6)((()=>[(0,i.bF)(r.A,{modelValue:$.value,"onUpdate:modelValue":n[1]||(n[1]=e=>$.value=e),name:"termsAndConditionsCheckbox",bindings:{id:"termsAndConditionsCheckbox",label:U.value,name:"termsAndConditionsCheckbox",type:"checkbox",placeholder:"ack",validation:[["accepted"]],validationMessages:{accepted:"Please accept the terms and conditions"},outerClass:"input-spacing pt-3",innerClass:"!self-start pt-1"}},null,8,["modelValue","bindings"])])),_:1},8,["title"]),(0,i.bo)((0,i.Lk)("div",E,[(0,i.bF)(p.A,{type:(0,a.R1)(m.Z).ERROR,title:e.step.formInputs?.paymentErrorInformationBox?.title?.value,description:e.step.formInputs?.paymentErrorInformationBox?.content?.value},null,8,["type","title","description"])],512),[[s.aG,Y.value&&!e.step.isLoading]]),(0,i.bo)((0,i.Lk)("div",null,[(0,i.bF)(c.A,{id:"paymentMethodSection",sectionTitle:e.step.formInputs?.paymentMethod?.SectionTitle?.value,class:"mb-8 md:mb-6"},{sectionPanelContent:(0,i.k6)((()=>[(0,i.bF)(d.A,(0,o._B)((0,i.Ng)(O.value)),null,16)])),_:1},8,["sectionTitle"])],512),[[s.aG,q.value]])])]),(0,i.Lk)("div",B,[(0,i.bF)(l,{type:"button",inputClass:"btn btn-secondary",label:e.step.btnPrev,onClick:ie},null,8,["label"]),(0,i.bo)((0,i.bF)(l,{type:"submit",inputClass:"btn btn-primary",outerClass:"ml-auto",label:e.step.btnNext,onClick:n[2]||(n[2]=e=>ne())},null,8,["label"]),[[s.aG,!q.value]])])])),_:1},8,["modelValue"])}}});const M=L;var N=M}}]); 2//# sourceMappingURL=6464.3a948315.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.