1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CGnAmv0C.js","./B6lg6KyC.js","./C25kqpX7.js","./C_CL4Z4N.js","./D8PQbvXD.js","./CQEEBDAB.js","./CgR5oH26.js","./DlQsPAEo.js"])))=>i.map(i=>d[i]); 2import{d as qe,b as je,c as g,o as i,n as ne,a as c,e as o,h as v,v as Qe,t as m,u as e,x as pe,w as I,y as le,_ as xe,bb as Me,g as F,a9 as Pe,bl as ke,j as Q,H as we,Q as at,bc as Je,m as J,K as st,i as Ye,s as Ge,bo as mt,bn as gt,C as We,B as De,I as Te,ac as $e,N as He,cx as kt,b5 as Re,U as ve,aW as fe,ad as Ae,am as Ce,by as ot,bz as rt,bO as wt,aB as Xe,Y as Ke,b0 as Ze,b1 as $t,bH as St,b$ as At,A as Ut,k as Dt,R as Et,a5 as Vt,a4 as dt,bI as et,aD as Ct,M as qt,af as xt,z as It,bK as Ot,bP as Tt}from"./B6lg6KyC.js";import{F as _t}from"./DLzcF_Cf.js";import{F as lt}from"./CLhVU4Sh.js";import{F as Ue}from"./D8PQbvXD.js";import{F as nt}from"./DDx4DumQ.js";import{F as ct}from"./DBQIqQs2.js";import{a as it,u as ut}from"./Ffb9oXbg.js";import{F as jt,b as Bt}from"./Dfb6AAF0.js";import{F as Lt}from"./CnHmGF-u.js";import{a as Pt}from"./DKPRQeYQ.js";import{u as Ht,F as Rt}from"./BmJq4pVu.js";import{F as Mt}from"./Bt91gAWs.js";import{F as Ve}from"./Dv0_FRrT.js";import{F as ze}from"./xlREZCgE.js";import{F as Nt}from"./CGnAmv0C.js";import{F as Jt}from"./DqoZuwk6.js";import{S as Yt}from"./CCW201KW.js";import{F as Gt}from"./BKX5c3Py.js";import{F as Wt}from"./DG58zalt.js";import{u as zt}from"./BNDL1TPj.js";const Qt={key:0,class:"journey-outcome__next-steps"},tt=xe(qe({__name:"journey-outcome",props:{componentName:{default:"journey-outcome"},status:{},heading:{},body:{},bodyParams:{default:void 0},nextSteps:{default:void 0}},emits:["close"],setup(t,{emit:G}){const{t:_}=je(),p=G;return(s,$)=>(i(),g("div",{class:ne([t.componentName,`${t.componentName}--${t.status}`])},[c(Qe,{icon:t.status==="success"?"icon-message-success":"icon-message-fail",size:{height:48,width:48}},null,8,["icon"]),o("h3",null,m(e(_)(t.heading)),1),o("p",null,m(e(_)(t.body,t.bodyParams??{})),1),t.nextSteps?(i(),g("p",Qt,m(e(_)(t.nextSteps)),1)):v("",!0),c(e(pe),{class:"journey-outcome__close",variant:"primary-solid","width-type":"fill",type:"button",onClick:$[0]||($[0]=l=>p("close"))},{default:I(()=>[le(m(e(_)("close")),1)]),_:1})],2))}}),[["__scopeId","data-v-e8d8313a"]]),Kt={class:"header"},Zt={key:3,class:"ctas"},Xt={class:"contact"},Be=xe(qe({__name:"journey-complete",props:{componentName:{default:"journey-complete"},status:{default:null},message:{default:"thank-you-reservation"},details:{default:"thank-you-reservation-details"},contactEmail:{default:void 0},contactNumber:{default:void 0},vehicle:{default:void 0},hasNewFormStyles:{type:Boolean}},emits:["back","toggle-enquiry-form"],setup(t,{emit:G}){const{t:_}=je(),p=t,{isDealLoading:s}=Me(),$=F(()=>p.hasNewFormStyles&&p.status==="reservation-success"),l=F(()=>p.hasNewFormStyles&&p.status==="reservation-failure"),C=F(()=>!$.value&&!l.value),h=F(()=>{switch(p.status){case"payment-success":case"reservation-success":default:return"icon-message-success";case"reservation-failure":return"icon-message-fail"}}),R=F(()=>{var b;return p.vehicle&&Pe(p.vehicle)&&ke(p.vehicle)?(b=p.vehicle.site)==null?void 0:b.telephone:p.contactNumber||!1}),r=F(()=>{var b;return p.vehicle&&Pe(p.vehicle)&&ke(p.vehicle)?(b=p.vehicle.site)==null?void 0:b.email:p.contactEmail||!1}),A=G;return(b,U)=>e(s)?v("",!0):(i(),g("div",{key:0,class:ne([t.componentName])},[e($)?(i(),Q(tt,{key:0,status:"success",heading:"exp-reservation-success-heading",body:"exp-reservation-success-body","next-steps":"exp-reservation-success-next-steps",onClose:U[0]||(U[0]=x=>A("back"))})):e(l)?(i(),Q(tt,{key:1,status:"fail",heading:"there-has-been-an-error-with-your-payment",body:"there-was-an-error-creating-your-deal",onClose:U[1]||(U[1]=x=>A("back"))})):e(C)?(i(),g(we,{key:2},[o("div",Kt,[c(Qe,{icon:e(h),size:{height:48,width:48}},null,8,["icon"]),o("h3",null,m(e(_)(t.message)),1)]),o("p",null,m(e(_)(t.details)),1)],64)):v("",!0),e(C)?(i(),g("div",Zt,[o("div",Xt,[e(R)?(i(),Q(e(pe),{key:0,"icon-position":"prepend","icon-type":"icon-phone",href:`tel:${e(R)}`,title:e(_)("call-us"),variant:"neutral"},{default:I(()=>[le(m(e(R)),1)]),_:1},8,["href","title"])):v("",!0),e(r)?(i(),Q(e(pe),{key:1,"icon-position":"prepend","icon-type":"icon-mail",variant:"neutral",onClick:U[2]||(U[2]=x=>A("toggle-enquiry-form"))},{default:I(()=>[le(m(e(_)("email-us")),1)]),_:1})):v("",!0)]),c(e(pe),{class:"cta-back","width-type":"fill",title:e(_)("return-to-vehicle-summary"),variant:"neutral",onClick:U[3]||(U[3]=x=>A("back"))},{default:I(()=>[le(m(e(_)("return-to-vehicle-summary")),1)]),_:1},8,["title"])])):v("",!0)],2))}}),[["__scopeId","data-v-0c24c8cd"]]),ea={key:1,class:"col-12 loader"},ta={key:2},aa={class:"deal-stacker-form row"},sa={key:0,class:"form-section-heading"},oa={key:1,class:"form-section-heading"},ra={class:"flex space-between center items-center"}
2,la={class:"row space-between items-end"},na={key:0,class:"form-section-heading grow-1"},ca={class:"postcode-lookup-toggle"},ia={class:"row full"},ua={key:0},da={class:"row flexed-cols"},ma={class:"col-12"},_a=xe(qe({__name:"journey-checkout",props:{componentName:{default:"journey-checkout"},vehicle:{},hasNewFormStyles:{type:Boolean}},emits:["back","toggle-enquiry-form","form-submitted"],setup(t,{emit:G}){const _=$e(()=>Ae(()=>import("./CGnAmv0C.js").then(a=>a.p),__vite__mapDeps([0,1]),import.meta.url)),p=$e(()=>Ae(()=>import("./C25kqpX7.js"),__vite__mapDeps([2,1]),import.meta.url)),s=$e(()=>Ae(()=>import("./C_CL4Z4N.js"),__vite__mapDeps([3,1,4]),import.meta.url)),{t:$}=je(),{fireGtmEvent:l,fireReservationEvent:C}=at(),{completeDeal:h,createDeal:R,dealStackerFormData:r,disableTermsCheckbox:A,isDealLoading:b,setLoadingState:U,updateDeal:x,updateDealStackerFormData:T,updateNestedData:u}=Me(),{dealStackerDealItems:f,updateDealStackerDealItems:n}=Je(),{inlineFieldErrors:S,debouncedValidateSingleField:j,getTouchedState:B,translateError:V}=it(),{CheckoutJourneySchema:k}=ut(),ee=J(!0),{formCustomerTitleOptions:Z}=st(),z=t,ue=Ye(),{dealStackerConfig:re}=Ge(ue),de=G,me=J(1),L=J(!1),se=J(null),K=J(!1),E=J(!1),y=F(()=>K.value&&!r.value.guid),P=J({}),ge=async()=>{var a;if(Fe("terms_accepted",!0),!r.value.guid&&!K.value&&((a=re==null?void 0:re.value)==null?void 0:a.reserve_on_terms_accepted)){if(!k.safeParse(r.value).success)return;try{E.value=!0,K.value=!0,await R(r.value,z.vehicle).catch(q=>{var oe;K.value=!1,P.value["Submission Error"]=(oe=q.data)==null?void 0:oe.message})}catch(q){Ce(`Failed to create deal when accepting terms: ${q}`,"DealStacker",!1)}finally{E.value=!1}}},ye=F(()=>{var a;return((a=r.value)==null?void 0:a.guid)||r.value.invoice_guid||void 0}),ce=F(()=>!!(mt(z.vehicle)&&f.value.paymentMethod==="reserve")),ie=()=>{ee.value=!ee.value},_e=a=>{const q=a==null?void 0:a.field,oe=a==null?void 0:a.value;u("customer_current_address",{...r.value.customer_current_address,[q]:oe},"formData")},Ne=()=>{P.value={},L.value=!1},he=a=>{const q={building:a.building??"",building_name:a.building_name??"",line_1:a.line_1??"",line_2:a.line_2??"",line_3:a.line_3??"",city:a.city??"",county:a.county??"",street:a.street??"",town:a.town??"",country:a.country??"",postcode:a.postcode??""};T({customer_current_address:{...r.value.customer_current_address,...q}})},X=async()=>{if(!b.value&&!L.value&&me.value===1){if(!(a=>{L.value=!0,P.value={};const q=a.safeParse(r.value);if(!q.success){const oe={};for(const te of q.error.issues){const O=te.path.join("."),w=V(te.message);oe[O]=w,S[O]=w}return P.value=oe,L.value=!1,Xe(".app-content"),!1}return Xe(".app-content"),!0})(k))return void(L.value=!1);U(!0);try{ce.value&&C("start",z.vehicle),r.value.guid||K.value?r.value.guid&&(me.value=2):(K.value=!0,await R(r.value,z.vehicle).then(async()=>{me.value=2}).catch(a=>{var q;K.value=!1,P.value["Submission Error"]=(q=a.data)==null?void 0:q.message})),me.value===2&&ce.value&&C("details",z.vehicle,d())}catch(a){Ce(a)}finally{U(!1),L.value=!1}}},N=F(()=>{var a;return ke(z.vehicle)&&"site"in z.vehicle&&((a=z.vehicle.site)!=null&&a.id)?z.vehicle.site.id:"default"}),W=F(()=>{var q,oe;const a=r.value;return!(Object.values(S).some(te=>te!=="")||!a.customer_title||!a.customer_first_name||!a.customer_last_name||!a.customer_email||!a.customer_telephone||!((q=a.customer_current_address)!=null&&q.line_1)||!((oe=a.customer_current_address)!=null&&oe.postcode))}),Ee=F(()=>!W.value||!r.value.terms_accepted),Fe=(a,q)=>{T({[a]:q}),P.value={},j(a,q)},Ie=F(()=>{var a;return((a=re.value)==null?void 0:a.payments)||"stripe"}),ae=()=>{se.value="fail"},M=async()=>{await x(r.value,f.value,z.vehicle)},d=()=>ot(r.value,rt("targeting")),H=a=>{var oe;const q=d();a?C("paid",z.vehicle,q):l("deal_builder_complete_"+((oe=String(f.value.payment_type))==null?void 0:oe.toLocaleLowerCase()),q?{enhanced_conversion_data:q}:{})},D=()=>{de("form-submitted"),H(ce.value)};return(a,q)=>{const oe=gt("f-loader-inline");return i(),g("div",{id:"payment-container",class:ne([t.componentName])},[e(P)&&Object.keys(e(P)).length&&!e(b)?(i(),Q(e(p),{key:0,id:"error-container","show-heading":!1,onGoBack:Ne},{default:I(()=>[c(e(We),{class:"flexed-cols",variant:"error","prepend-icon-type":e(De).Icon.NotificationsError},{default:I(()=>[(i(!0),g(we,null,Te(e(P),(te,O)=>(i(),g("p",{key:O,class:"text-primary"},m(te),1))),128))]),_:1}
2,8,["prepend-icon-type"])]),_:1})):v("",!0),e(L)&&!e(b)?(i(),g("div",ea,[c(oe,{message:e($)("loading")},null,8,["message"])])):v("",!0),e(L)?v("",!0):(i(),g("div",ta,[e(se)||e(me)!==1?v("",!0):(i(),g(we,{key:0},[!z.vehicle||e(b)||t.hasNewFormStyles?v("",!0):(i(),Q(e(kt),{key:0,"display-tag-listing":!1,"display-attention-grabber":!1,"use-headings":!1,vehicle:z.vehicle,variant:"dealstacker"},null,8,["vehicle"])),He(o("form",aa,[t.hasNewFormStyles?v("",!0):(i(),g("h3",sa,m(e($)("your-details")),1)),c(e(Ue),{id:"customer-title",name:"customer_title",error:e(S).customer_title||e(P).customer_title||"",success:e(B)(e(r).customer_title,e(S).customer_title||e(P).customer_title),label:e($)("title"),"background-color":"secondary",options:e(Z),"model-value":e(r).customer_title,required:"","onUpdate:modelValue":q[0]||(q[0]=te=>Fe("customer_title",String(te)))},null,8,["error","success","label","options","model-value"]),c(e(ve),{id:"customer_first_name",label:e($)("first-name"),name:"customer_first_name",error:e(S).customer_first_name||e(P).customer_first_name||"",success:e(B)(e(r).customer_first_name,e(S).customer_first_name||e(P).customer_first_name),"background-color":"secondary",required:"","model-value":e(r).customer_first_name,"onUpdate:modelValue":q[1]||(q[1]=te=>Fe("customer_first_name",te))},null,8,["label","error","success","model-value"]),c(e(ve),{id:"customer_last_name",label:e($)("last-name"),error:e(S).customer_last_name||e(P).customer_last_name||"",success:e(B)(e(r).customer_last_name,e(S).customer_last_name||e(P).customer_last_name),"background-color":"secondary",name:"customer_last_name",required:"","model-value":e(r).customer_last_name,"onUpdate:modelValue":q[2]||(q[2]=te=>Fe("customer_last_name",te))},null,8,["label","error","success","model-value"]),t.hasNewFormStyles?v("",!0):(i(),g("h3",oa,m(e($)("how-can-we-contact-you")),1)),c(e(lt),{id:"user-email",label:e($)("email-address"),error:e(S).customer_email||e(P).customer_email||"",success:e(B)(e(r).customer_email,e(S).customer_email||e(P).customer_email),"background-color":"secondary",name:"customer_email",required:"","model-value":e(r).customer_email,"onUpdate:modelValue":q[3]||(q[3]=te=>
2Fe("customer_email",te))},null,8,["label","error","success","model-value"]),c(e(nt),{id:"user-phone",label:e($)("contact-number"),"background-color":"secondary",error:e(S).customer_telephone||e(P).customer_telephone||"",success:e(B)(e(r).customer_telephone,e(S).customer_telephone||e(P).customer_telephone),name:"customer_telephone",required:"","model-value":e(r).customer_telephone,"onUpdate:modelValue":q[4]||(q[4]=te=>Fe("customer_telephone",te))},null,8,["label","error","success","model-value"]),o("div",ra,[o("div",la,[t.hasNewFormStyles?v("",!0):(i(),g("h3",na,m(e($)("your-address")),1)),o("div",ca,[c(e(pe),{variant:"hyperlink",type:"button","padding-size":"none",onClick:ie},{default:I(()=>[le(m(e(ee)?e($)("enter-manually"):e($)("postcode-lookup")),1)]),_:1})])])]),o("div",ia,[c(e(_t),{class:"col-12",address:e(r).customer_current_address,success:e(B)(e(r).customer_current_address.postcode,e(S).postcode||e(P).postcode),"input-placeholder":e($)("start-typing-a-postcode"),"background-color":"secondary","using-postcode-lookup":e(ee),"onUpdate:field":_e,"onUpdate:postcodeField":he},null,8,["address","success","input-placeholder","using-postcode-lookup"])]),c(e(ct),{id:"terms-checkbox",disabled:e(A)||!e(W),label:`${e($)("i-have-read-the")} ${e($)("terms-and-conditions")}`,error:e(S).terms_accepted||e(P).terms_accepted||"",success:e(B)(e(r).terms_accepted,e(S).terms_accepted||e(P).terms_accepted),name:"termsCheckbox","background-color":"secondary",required:"",checked:!1,"is-link":!0,"model-value":e(r).terms_accepted,"onUpdate:modelValue":ge},null,8,["disabled","label","error","success","model-value"]),c(e(pe),{type:"button",variant:"primary-solid","width-type":"fill",disabled:e(Ee)||e(y)||e(b)||e(L),onClick:X},{default:I(()=>[le(m(e(b)||e(L)?e($)("loading"):e($)("add-payment-details")),1)]),_:1},8,["disabled"]),c(e(pe),{id:"cancel-button",type:"button",variant:"hyperlink",onClick:q[5]||(q[5]=te=>de("back"))},{default:I(()=>[le(m(e($)("cancel")),1)]),_:1})],512),[[Re,!e(b)||e(E)]])],64)),c(fe,{name:"fade-in"},{default:I(()=>[e(se)==="success"?(i(),Q(Be,{key:0,class:ne(t.hasNewFormStyles?null:e(se)),status:"reservation-success",vehicle:t.vehicle,"has-new-form-styles":t.hasNewFormStyles,onBack:q[6]||(q[6]=te=>de("back")),onToggleEnquiryForm:q[7]||(q[7]=te=>de("toggle-enquiry-form"))},null,8,["class","vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(se)==="fail"?(i(),Q(Be,{key:0,class:ne(t.hasNewFormStyles?null:e(se)),status:"reservation-failure",vehicle:t.vehicle,"has-new-form-styles":t.hasNewFormStyles,onBack:q[8]||(q[8]=te=>de("back")),onToggleEnquiryForm:q[9]||(q[9]=te=>de("toggle-enquiry-form"))},null,8,["class","vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(se)||e(me)!==2?v("",!0):He((i(),g("div",ua,[o("div",da,[o("div",ma,[e(Ie)==="stripe"?(i(),Q(e(s),{key:0,"allow-full-payment-switch":e(f).pay_in_full===!0&&!e(ce),"dealership-id":e(N),vehicle:t.vehicle,onSuccessfulPayment:q[10]||(q[10]=te=>(async O=>{const w=ce.value;se.value="success",n({paymentMethod:"cash",payment_response:O}),await M();const be=await h(r.value,f.value,z.vehicle);se.value="success",de("form-submitted"),H(w),be&&(be!=null&&be.success)&&setTimeout(()=>{window==null||window.location.reload()},250)})(te)),onFailedPayment:ae,onBack:q[11]||(q[11]=te=>de("back"))},null,8,["allow-full-payment-switch","dealership-id","vehicle"])):e(Ie)==="prommt"?(i(),Q(e(_),{key:1,"allow-full-payment-switch":e(f).pay_in_full===!0&&!e(ce),"dealership-id":e(N),"has-new-form-styles":t.hasNewFormStyles,vehicle:t.vehicle,"is-reserve-context":e(ce),"invoice-guid":e(ye),"onUpdate:paymentType":q[12]||(q[12]=te=>[e(n)({payment_type:te}),M()]),onSuccessfulPayment:D,onFailedPayment:ae,onBack:q[13]||(q[13]=te=>de("back")),onClose:q[14]||(q[14]=te=>[void("slug"in z.vehicle&&z.vehicle.slug&&wt(`vehicle-${z.vehicle.slug}`)),de("back",{shouldClose:!0})])},null,8,["allow-full-payment-switch","dealership-id","has-new-form-styles","vehicle","is-reserve-context","invoice-guid"])):v("",!0)])])],512)),[[Re,!e(b)]])]),_:1})]))],2)}}}),[["__scopeId","data-v-13c20f6b"]]);function Sr(t){var G,_,p;return ke(t)?[(G=t.site)==null?void 0:G.line1,(_=t.site)==null?void 0:_.line2,(p=t.site)==null?void 0:p.county].filter(
2Boolean).join(", "):""}function qr(t){var G,_,p;return ke(t)?[(G=t.site)==null?void 0:G.line3,(_=t.site)==null?void 0:_.city_town,(p=t.site)==null?void 0:p.postcode].filter(Boolean).join(", "):""}function xr(t){var G;return ke(t)?(G=t.site)==null?void 0:G.location_page_slug:""}function pa(t){var G;return ke(t)?(G=t.site)==null?void 0:G.telephone:""}const va={class:"row"},ya={class:"col-12"},ha={key:0,class:"sub subheading"},ba=xe(qe({__name:"journey-enquiry",props:{componentName:{default:"journey-enquiry"},vehicle:{default:void 0},hasNewFormStyles:{type:Boolean}},emits:["back","scroll-to","update:modelValue","form-submitted","close"],setup(t,{emit:G}){const _=$e(()=>Ae(()=>import("./CQEEBDAB.js"),__vite__mapDeps([5,1]),import.meta.url)),p=Ye(),{siteConfig:s}=Ge(p),{t:$}=je(),{dealStackerDealItems:l}=Je(),C=F(()=>{var S,j,B,V,k,ee,Z,z,ue,re,de,me,L;let x=(j=(S=h.vehicle)==null?void 0:S.make)==null?void 0:j.trim().toLowerCase().replace(/\s+/g,"-");const T=h.vehicle,u=(V=(B=s==null?void 0:s.value)==null?void 0:B.manufacturer_filter_overrides)==null?void 0:V.volkswagen_commercial;(function(se,K){var y;if(!se||!K||((y=se.make)==null?void 0:y.toLowerCase())!=="volkswagen")return!1;const E=Object.entries(K);return!!E.length&&E.every(([P,ge])=>{if(!Array.isArray(ge)||!Object.keys(se).includes(P))return!1;const ye=(se[P]??"").toString().toLowerCase();return ge.map(ce=>ce.toString().toLowerCase()).includes(ye)})})(T,u)&&(x="volkswagen-commercial"),((k=T==null?void 0:T.make)==null?void 0:k.toLowerCase())==="mg motor uk"&&(x="mg");const f=((ee=l.value)==null?void 0:ee.offer_form_ids)??{},n=((Z=l.value)==null?void 0:Z.motability_form_ids)??{};if(T&&x){if((ue=(z=s.value)==null?void 0:z.vdp_config)!=null&&ue.sold_enquiry_form_id&&(T==null?void 0:T.status)==="SOLD")return s.value.vdp_config.sold_enquiry_form_id;if(Ke(T))return f[x]??((re=l.value)==null?void 0:re.offer_form)??((de=l.value)==null?void 0:de.enquiry_form)??0;if(Ze(T))return n[x]??((me=l.value)==null?void 0:me.motability_form)??((L=l.value)==null?void 0:L.enquiry_form)??0;if($t(T))return l.value.leasing_form??l.value.enquiry_form}return l.value.enquiry_form??0}),h=t,R=G,r=F(()=>h.vehicle&&Pe(h.vehicle)&&ke(h.vehicle)&&pa(h.vehicle)||""),A=F(()=>{let x="general_enquiry";if(h.vehicle&&Pe(h.vehicle))switch(h.vehicle.advert_classification){case"OFFER":x="vehicle_offer_enquiries";break;case"NEW":x="new_vehicle";break;case"USED":x="used_vehicle";break;default:x="general_enquiry"}return h.vehicle&&Ze(h.vehicle)&&(x="motability_vehicle_enquiries"),x}),b=F(()=>{var x,T,u,f;if(h.vehicle&&ke(h.vehicle))return((T=(x=h.vehicle)==null?void 0:x.site)==null?void 0:T.id)??!1;if(h.vehicle&&Ze(h.vehicle)&&h.vehicle.make_slug){const n=((f=(u=s.value)==null?void 0:u.motability)==null?void 0:f.motability_vehicle_site_map)||void 0;return(n==null?void 0:n[h.vehicle.make_slug])||!1}return!1}),U=F(()=>{if(h.vehicle&&ke(h.vehicle))return h.vehicle.site});return(x,T)=>(i(),g("div",{class:ne([t.componentName])},[o("div",va,[o("div",ya,[t.hasNewFormStyles?v("",!0):(i(),g("p",ha,m(e($)("please-fill-in-the-fields-to-contact-us")),1)),c(e(jt),{"form-id":Number(e(C)),"has-header-got-top-padding":!1,"hide-header":!0,"show-contact-information":!0,"show-return-button":!t.hasNewFormStyles,"input-background-color":t.hasNewFormStyles?"primary":"secondary","additional-data":{enquiry_type:"General Enquiry"},"none-form-gtm-event":e(A),"organisation-unit":e(U),vehicle:t.vehicle,"display-marketing-preferences-heading":!0,"locked-organisation-unit-id":e(b),variant:"transparent","submit-button-text":t.hasNewFormStyles?"Let's Do This!":"",class:ne({"exp-form-test":t.hasNewFormStyles}),onClearForm:T[1]||(T[1]=u=>R("back")),onFormSubmitted:T[2]||(T[2]=u=>[R("scroll-to"),R("form-submitted")])},St({_:2},[t.hasNewFormStyles?{name:"success-content",fn:I(()=>[c(tt,{status:"success",heading:"exp-enquiry-success-heading",body:"exp-enquiry-success-body","body-params":{number:e(r)},"next-steps":"exp-enquiry-success-next-steps",onClose:T[0]||(T[0]=u=>R("close"))},null,8,["body-params"])]),key:"0"}:void 0]),1032,["form-id","show-return-button","input-background-color","none-form-gtm-event","organisation-unit","vehicle","locked-organisation-unit-id","submit-button-text","class"])])]),t.vehicle&&e(Ke)(t.vehicle)?(i(),Q(e(_),{key:0,vehicle:t.vehicle},null,8,["vehicle"])):v("",!0)],2))}}),[["__scopeId","data-v-5447880a"]]),Ft="first-stage-reservations";function ht(){try{const t=JSON.parse(localStorage.getItem(Ft)||"{}"),G=Date.now()-36e5;return Object.fromEntries(Object.entries(t).filter(([,_])=>Number(_)>G))}catch{return{}}}const fa={key:0,class:"step-1-wrapper"},ga={key:0,class:"sub-heading sub"},ka={class:"deal-stacker-form row"},wa={key:0,class:"form-section-heading"},Sa={key:1,class:"form-section-heading"},qa={key:2,class:"form-section-heading"},xa={key:3,class:"move-closer flex flex-col gap-smaller"},ja={class:"flex flex-col gap-x-small"},Na={class:"heading bold"},Fa={key:0,class:"subeading sub"},$a={class:"marketing-preferences-heading"},Aa=["innerHTML"],Ua={class:"col-12"},Da={key:0,class:"step-2-wrapper"},Ea=xe(qe({__name:"journey-reserve",props:{componentName:{default:"journey-reserve"},vehicle:{},hasNewFormStyles:{type:Boolean}},emits:["back","scroll-to","toggle-enquiry-form","form-submitted"],async setup(t,{emit:G}){let _,p;const s=$e(()=>Ae(()=>import("./C25kqpX7.js"),__vite__mapDeps([2,1]),import.meta.url)),$=$e(()=>Ae(()=>import("./CGnAmv0C.js").then(O=>O.p),__vite__mapDeps([0,1]),import.meta.url)),l=$e(()=>Ae(()=>import("./C_CL4Z4N.js"),__vite__mapDeps([3,1,4]),import.meta.url)),{cancelReservation:C,completeReservation:h,createReservation:R,dealStackerFormData:r,isDealLoading:A,setLoadingState:b,updateDeal:U,updateDealStackerFormData:x,updateNestedData:T}=Me(),u=At(),{executeRecaptcha:f}=Pt(),{dealStackerDealItems:n,updateDealStackerDealItems:S}=Je(),{t:j}=je(),B=Ye(),{dealStackerConfig:V}=Ge(B),{inlineFieldErrors:k,debouncedValidateSingleField:ee,getTouchedState:Z}=it(),{fireReservationEvent:z}=at(),ue=()=>ot(r.value,rt("targeting")),{ReservationSchema:re}=ut(),{getSnippet:de}=Ut(),{handleInternalLinkClick:me}=Dt(),L=t,se=F(()=>{var O;return ke(L.vehicle)&&"site"in L.vehicle&&((O=L.vehicle.site)!=null&&O.id)?L.vehicle.site.id:"default"}),K=J(!1),E=J({}),y=F(()=>{var O;return Number((O=n.value)==null?void 0:O.reservation_form)}),P=F(()=>{var O;return((O=L.vehicle)==null?void 0:O.slug)||""}),{submitForm:ge,ready:ye}=Ht(y.value,{_organisational_unit:se.value}),ce=F(()=>{var O;return{form_id:y.value,first_name:r.value.customer_first_name,last_name:r.value.customer_last_name,address:r.value.customer_current_address.line_1+", "+r.value.customer_current_address.town+", "+r.value.customer_current_address.postcode,email:r.value.customer_email,telephone:r.value.customer_telep
2hone,terms_accepted:r.value.terms_accepted,vehicle_name:L.vehicle.name,vehicle_url:L.vehicle.url,location:((O=L.vehicle.site)==null?void 0:O.name)||"Default Dealership",timestamp:new Date().toISOString(),post_code:r.value.customer_current_address.postcode,preferred_branch:r.value.preferred_branch}}),ie=G,_e=J(void 0),Ne=J(void 0),he=J(1),X=J(null),N=F(()=>{var O;return(O=V.value)==null?void 0:O.enable_move_closer_reservation_form}),W=F(()=>{var O;return((O=V.value)==null?void 0:O.payments)||"stripe"}),Ee=J(!1),Fe=F(()=>W.value==="prommt"&&he.value===2&&!X.value&&!Ee.value),Ie=()=>{E.value={},K.value=!1},ae=async()=>{if(!(A.value||K.value)){if(E.value={},_e.value&&(W.value!=="prommt"||Ne.value))return void(he.value=2);if(K.value=!0,(w=>{K.value=!0,E.value={};const be=w.safeParse(r.value);if(!be.success){const Y={};for(const Se of be.error.issues)Y[Se.path.join(".")]=Se.message;return E.value=Y,K.value=!1,Xe(".app-content"),!1}return Xe(".app-content"),!0})(re)){b(!0);try{if(z("start",L.vehicle),!(O=P.value)||!ht()[O]){const be=await f("form_submit"),{success:Y}=await ge({formFields:ce.value,includeRecaptcha:!!V.value.enquiry_form_recaptcha_enabled,gtmEventLabel:"reservation_first_steps"},be);Y&&function(Se){if(Se)try{localStorage.setItem(Ft,JSON.stringify({...ht(),[Se]:Date.now()}))}catch{}}(P.value)}const w=await R(q.value,L.vehicle);if(!(w!=null&&w.reservationId))throw new Error("Failed to create reservation.");_e.value=w.reservationId,Ne.value=(w==null?void 0:w.invoiceGuid)||void 0,he.value=2,z("details",L.vehicle,ue())}catch(w){Ce(w),E.value={"Submission Error":(w==null?void 0:w.message)||"An unexpected error occurred. Please try again."}}finally{b(!1),K.value=!1,ie("scroll-to")}var O}else K.value=!1}},M=async()=>{await U(r.value,n.value,L.vehicle)},d=()=>{Ee.value=!0,z("paid",L.vehicle,ue()),ie("form-submitted")};Et(()=>{S({paymentMethod:"reserve"}),K.value=!1});const H=()=>{X.value="fail",ie("form-submitted"),_e.value&&C(_e.value).catch(O=>{var w;throw new Error((w=O.data)==null?void 0:w.message)}),ie("scroll-to")},D=()=>{"slug"in L.vehicle&&L.vehicle.slug&&wt(`vehicle-${L.vehicle.slug}`)},a=()=>{D(),ie("back")},q=F(()=>{var be,Y,Se,Le,Oe,pt,vt,yt;const O=new Date,w=r.value.opt_in||[];return{title:r.value.customer_title,first_name:r.value.customer_first_name,last_name:r.value.customer_last_name,telephone:r.value.customer_telephone,email:r.value.customer_email,address_1:r.value.customer_current_address.line_1||"",address_2:r.value.customer_current_address.line_2||"",address_3:r.value.customer_current_address.line_3||"",county:r.value.customer_current_address.county||"",town_city:r.value.customer_current_address.town||"",post_code:r.value.customer_current_address.postcode,visit_date:String(O.toISOString().split("T")[0]),time:String(((be=O.toTimeString().split(" ")[0])==null?void 0:be.slice(0,5))||"00:00"),appointment_time:"",appointment_date:"",terms:r.value.terms_accepted,vehicle_id:(Y=L.vehicle)==null?void 0:Y.id,vehicle_vrm:((Se=L.vehicle)==null?void 0:Se.vrm)||"",vehicle_name:((Le=L.vehicle)==null?void 0:Le.name)||"",vehicle_url:((Oe=L.vehicle)==null?void 0:Oe.url)||L.vehicle.website_url||"",vehicle_mileage:L.vehicle.odometer_value||0,additional_comments:"",paymentMethodPreferred:"CARD",description:"",date_paid:new Date().toISOString(),amount:Number((pt=n.value)==null?void 0:pt.deposit_fee),currency:j("stripe-currency"),enquiry_source:u.enquirySource,site_id:((yt=(vt=L.vehicle)==null?void 0:vt.site)==null?void 0:yt.id)||"default",opt_in:w,preferred_branch:N.value?r.value.preferred_branch:""}}),oe=(O,w)=>{x({[O]:w}),E.value={},ee(O,w)},te=F(()=>{const O=r.value,w=!!(O.customer_first_name&&O.customer_last_name&&O.customer_current_address.line_1&&O.customer_current_address.town&&O.customer_current_address.postcode&&O.customer_email&&O.customer_telephone&&O.terms_accepted),be=!N.value||!!O.preferred_branch;return!(w&&be)});return[_,p]=Vt(()=>ye),await _,p(),(O,w)=>{var be;return i(),g("div",{id:"payment-container",class:ne([t.componentName,{"exp-form-test":t.hasNewFormStyles,"payment-container":t.hasNewFormStyles&&Fe.value}])},[E.value&&Object.keys(E.value).length?(i(),Q(e(s),{key:0,id:"error-container","show-heading":!1,onGoBack:Ie},{default:I(()=>[c(e(We),{class:"flexed-cols",variant:"error","prepend-icon-type":e(De).Icon.NotificationsError},{default:I(()=>[(i(!0),g(we,null,Te(E.value,(Y,Se)=>(i(),g("p",{key:Se,class:"text-primary"},m(Y),1))),128))]),_:1}
2,8,["prepend-icon-type"])]),_:1})):v("",!0),K.value?v("",!0):(i(),g(we,{key:1},[X.value||he.value!==1?v("",!0):(i(),g("div",fa,[e(A)||t.hasNewFormStyles?v("",!0):(i(),g("p",ga,m(e(j)("reserve-copy")),1)),!L.vehicle||e(A)||t.hasNewFormStyles?v("",!0):(i(),Q(e(kt),{key:1,"display-tag-listing":!1,"display-attention-grabber":!1,"use-headings":!1,vehicle:L.vehicle,variant:"dealstacker"},null,8,["vehicle"])),He(o("form",ka,[t.hasNewFormStyles?v("",!0):(i(),g("h3",wa,m(e(j)("your-details")),1)),c(e(ve),{id:"customer_first_name",label:e(j)("first-name"),error:e(k).customer_first_name||E.value.customer_first_name||"",success:e(Z)(e(r).customer_first_name,e(k).customer_first_name||E.value.customer_first_name),"background-color":"secondary",name:"customer_first_name",required:"","model-value":e(r).customer_first_name,"onUpdate:modelValue":w[0]||(w[0]=Y=>oe("customer_first_name",Y))},null,8,["label","error","success","model-value"]),c(e(ve),{id:"customer_last_name",label:e(j)("last-name"),error:e(k).customer_last_name||E.value.customer_last_name||"",success:e(Z)(e(r).customer_last_name,e(k).customer_last_name||E.value.customer_last_name),name:"customer_last_name","background-color":"secondary",required:"","model-value":e(r).customer_last_name,"onUpdate:modelValue":w[1]||(w[1]=Y=>oe("customer_last_name",Y))},null,8,["label","error","success","model-value"]),t.hasNewFormStyles?v("",!0):(i(),g("h3",Sa,m(e(j)("your-address")),1)),c(e(ve),{id:"user-address",label:e(j)("address"),error:e(k).line_1||E.value.line_1||"",success:e(Z)(e(r).customer_current_address.line_1,e(k).line_1||E.value.line_1),name:"current_address_line_1","background-color":"secondary",required:"","model-value":e(r).customer_current_address.line_1,"onUpdate:modelValue":w[2]||(w[2]=Y=>e(T)("customer_current_address.line_1",Y,"formData"))},null,8,["label","error","success","model-value"]),c(e(ve),{id:"user-town",label:e(j)("town-city"),name:"current_address_town",error:e(k).town||E.value.town||"",success:e(Z)(e(r).customer_current_address.town,e(k).town||E.value.town),"background-color":"secondary",required:"","model-value":e(r).customer_current_address.town,"onUpdate:modelValue":w[3]||(w[3]=Y=>e(T)("customer_current_address.town",Y,"formData"))},null,8,["label","error","success","model-value"]),c(e(ve),{id:"user-postcode",label:e(j)("postcode"),name:"current_address_postcode",error:e(k).postcode||E.value.postcode||"",success:e(Z)(e(r).customer_current_address.postcode,e(k).postcode||E.value.postcode),"background-color":"secondary",required:"","model-value":e(r).customer_current_address.postcode,"onUpdate:modelValue":w[4]||(w[4]=Y=>e(T)("customer_current_address.postcode",Y,"formData"))},null,8,["label","error","success","model-value"]),t.hasNewFormStyles?v("",!0):(i(),g("h3",qa,m(e(j)("how-can-we-contact-you")),1)),c(e(lt),{id:"user-email",label:e(j)("email-address"),"background-color":"secondary",error:e(k).customer_email||E.value.customer_email||"",success:e(Z)(e(r).customer_email,e(k).customer_email||E.value.customer_email),name:"customer_email",required:"","model-value":e(r).customer_email,"onUpdate:modelValue":w[5]||(w[5]=Y=>oe("customer_email",Y))},null,8,["label","error","success","model-value"]),c(e(nt),{id:"user-phone",label:e(j)("contact-number"),error:e(k).customer_telephone||E.value.customer_telephone||"",success:e(Z)(e(r).customer_telephone,e(k).customer_telephone||E.value.customer_telephone),name:"customer_telephone","background-color":"secondary",required:"","model-value":e(r).customer_telephone,"onUpdate:modelValue":w[6]||(w[6]=Y=>oe("customer_telephone",Y))},null,8,["label","error","success","model-value"]),N.value?(i(),g("div",xa,[o("div",ja,[o("p",Na,m(e(j)("move-this-vehicle-closer-to-me")),1),(be=t.vehicle)!=null&&be.site&&typeof t.vehicle.site!="string"&&t.vehicle.site.name?(i(),g("p",Fa,m(e(j)("this-vehicle-is-currently-located-at"))+" "+m(t.vehicle.site.name)+" "+m(e(j)("cho
2ose-to-move")),1)):v("",!0)]),c(e(Bt),{id:"user-organisation",label:"Select a preferred branch",name:"user-organisation","background-color":"secondary",required:N.value,success:e(Z)(e(r).preferred_branch,e(k).preferred_branch||E.value.preferred_branch),error:e(k).preferred_branch||E.value.preferred_branch||"",modelValue:e(r).preferred_branch,"onUpdate:modelValue":[w[7]||(w[7]=Y=>e(r).preferred_branch=Y),w[8]||(w[8]=Y=>oe("preferred_branch",Y))]},null,8,["required","success","error","modelValue"])])):v("",!0),o("h4",$a,m(e(j)("marketing")),1),e(de)("vdp_marketing_preferences")?(i(),g("span",{key:4,onClick:w[9]||(w[9]=(...Y)=>e(me)&&e(me)(...Y)),innerHTML:e(de)("vdp_marketing_preferences")},null,8,Aa)):v("",!0),o("div",Ua,[c(e(Lt),{"model-value":e(r).opt_in,"onUpdate:modelValue":w[10]||(w[10]=Y=>((Se,Le)=>{const Oe={};Oe[Se]=Le,x(Oe)})("opt_in",Y))},null,8,["model-value"])]),c(e(ct),{id:"terms-checkbox",label:`${e(j)("i-have-read-the")} ${e(j)("terms-and-conditions")}`,error:e(k).terms_accepted||E.value.terms_accepted||"",success:e(Z)(e(r).terms_accepted,e(k).terms_accepted||E.value.terms_accepted),name:"termsCheckbox","background-color":"secondary",required:"",checked:!1,"is-link":!0,"model-value":e(r).terms_accepted,"onUpdate:modelValue":w[11]||(w[11]=Y=>oe("terms_accepted",Y))},null,8,["label","error","success","model-value"]),c(e(pe),{type:"button",variant:"primary-solid","width-type":"fill",disabled:te.value||e(A)||K.value,onClick:ae},{default:I(()=>[le(m(e(A)||K.value?e(j)("loading"):e(j)("add-payment-details")),1)]),_:1},8,["disabled"]),t.hasNewFormStyles?v("",!0):(i(),Q(e(pe),{key:5,id:"cancel-button",type:"button",variant:"hyperlink",onClick:w[12]||(w[12]=Y=>ie("back"))},{default:I(()=>[le(m(e(j)("cancel")),1)]),_:1}))],512),[[Re,!e(A)]])])),c(fe,{name:"fade-in"},{default:I(()=>[X.value||he.value!==2?v("",!0):He((i(),g("div",Da,[W.value==="stripe"?(i(),Q(e(l),{key:0,"dealership-id":se.value,"is-reserve-context":!0,"reservation-id":_e.value,vehicle:t.vehicle,onSuccessfulPayment:w[13]||(w[13]=Y=>{return Se=Y,X.value="success",ie("form-submitted"),S({payment_response:Se}),void(_e.value&&h(_e.value).catch(Le=>{var Oe;throw new Error((Oe=Le.data)==null?void 0:Oe.message)}).finally(()=>{z("paid",L.vehicle,ue()),ie("form-submitted"),ie("scroll-to")}));var Se}),onFailedPayment:H,onBack:w[14]||(w[14]=Y=>ie("back"))},null,8,["dealership-id","reservation-id","vehicle"])):W.value==="prommt"?(i(),Q(e($),{key:1,"allow-full-payment-switch":!1,"dealership-id":se.value,"has-new-form-styles":t.hasNewFormStyles,"invoice-guid":Ne.value,"is-reserve-context":!0,"reservation-id":_e.value,vehicle:t.vehicle,onBack:w[15]||(w[15]=Y=>he.value--),onClose:w[16]||(w[16]=Y=>[D(),ie("back",{shouldClose:!0})]),"onUpdate:paymentType":w[17]||(w[17]=Y=>[e(S)({payment_type:Y}),M()]),onSuccessfulPayment:d,onFailedPayment:H},null,8,["dealership-id","has-new-form-styles","invoice-guid","reservation-id","vehicle"])):v("",!0)],512)),[[Re,!e(A)]])]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[X.value==="success"?(i(),Q(Be,{key:0,class:ne(t.hasNewFormStyles?null:X.value),status:"reservation-success",vehicle:t.vehicle,"has-new-form-styles":t.hasNewFormStyles,onBack:a,onToggleEnquiryForm:w[18]||(w[18]=Y=>ie("toggle-enquiry-form"))},null,8,["class","vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[X.value==="fail"?(i(),Q(Be,{key:0,class:ne(t.hasNewFormStyles?null:X.value),status:"reservation-failure",vehicle:t.vehicle,"has-new-form-styles":t.hasNewFormStyles,onBack:a,onToggleEnquiryForm:w[19]||(w[19]=Y=>ie("toggle-enquiry-form"))},null,8,["class","vehicle","has-new-form-styles"])):v("",!0)]),_:1})],64))],2)}}}),[["__scopeId","data-v-082f5d68"]]),Va=xe(qe({__name:"journey-test-drive",props:{componentName:{default:"journey-test-drive"},vehicle:{default:void 0},hasNewFormStyles:{type:Boolean}},emits:["back","scroll-to","form-submitted","close","update:modelValue"],setup(t,{emit:G}){const _=Ye(),{dealStackerConfig:p}=Ge(_),s=t,$=F(()=>{var r,A;return function(b,U,x){var u;const T=b&&ke(b)?(u=b.site)==null?void 0:u.id:void 0;return(T?U==null?void 0:U[String(T)]:void 0)??x??0}(s.vehicle,(r=p.value)==null?void 0:r.test_drive_enquiry_form_ids,(A=p.value)==null?void 0:A.test_drive_enquiry_form_id)}),l=F(()=>s.vehicle&&Pe(s.vehicle)&&Ke(s.vehicle)?"offer_test_drive":s.vehicle&&Pe(s.vehicle)&&mt(s.vehicle)?"test_drive_form_submit_new_vehicle":"test_drive_form_submit_used_vehicle"),C=G,h=F(()=>{var r,A;return!(!s.vehicle||!ke(s.vehicle))&&(((A=(r=s.vehicle)==null?void 0:r.site)==null?void 0:A.id)??!1)}),R=F(()=>{var r;if(s.vehicle&&ke(s.vehicle))return((r=s.vehicle)==null?void 0:r.site)??null});return(r,A)=>(i(),g("div",{class:ne([t.componentName])},[c(e(jt),{"form-id":Number(e($)),"has-header-got-top-padding":!1,"hide-header":!0,"show-return-button":!t.hasNewFormStyles,"input-background-color":t.hasNewFormStyles?"primary":"secondary","organisation-unit":e(R),"additional-data":{enquiry_type:"Test Drive Enquiry"},vehicle:t.vehicle,variant:"transparent","locked-organisation-unit-id":e(h),"none-form-gtm-event":e(l),"submit-button-text":t.hasNewFormStyles?"Let's Do This!":"","field-type-overrides":t.hasNewFormStyles?{message:"textarea"}:void 0,class:ne({"exp-form-test":t.hasNewFormStyles}),onClearForm:A[1]||(A[1]=b=>C("back")),onFormSubmitted:A[2]||(A[2]=b=>{C("scroll-to"),C("form-submitted")})},St({_:2},[t.hasNewFormStyles?{name:"success-content",fn:I(()=>[c(tt,{status:"success",heading:"exp-test-drive-success-heading",body:"exp-test-drive-success-body","next-steps":"exp-test-drive-success-next-steps",onClose:A[0]||(A[0]=b=>C("close"))})]),key:"0"}:void 0]),1032,["form-id","show-return-button","input-background-color","organisation-unit","vehicle","locked-organisation-unit-id","none-form-gtm-event","submit-button-text","field-type-overrides","class"])],2))}}),[["__scopeId","data-v-1d6d0bc0"]]),Ca={class:"row radio"},Ia={key:0},Oa={class:"row full flex-nowrap between items-center postcode-toggle"},Ta={class:"items-end grow-1"},Ba={class:"heading"},La={class:"postcode-lookup-toggle"},Pa={key:1},Ha={class:"w-100"},Ra={class:"w-100"},Ma={key:0,class:"w-100"}
2,Ja={class:"selected-address-details-list"},Ya={key:0},Ga={key:2},Wa={class:"label"},za={class:"row space-between"},bt=xe(qe({__name:"f-address-history-time-at-address",props:{componentName:{default:"f-address-history-time-at-address"},address:{},isPrevious:{type:Boolean},label:{default:"Address History"},formSections:{default:()=>({residentialStatus:{label:"your-residential-status",description:"please-select-an-option-to-proceed",show:!0},address:{label:"your-current-address",labelPrevious:"your-previous-address",description:"",show:!0},timeAtAddress:{label:"how-long-have-you-lived-here",description:"",show:!0}})},required:{type:Boolean,default:!1}},emits:["update:address"],setup(t,{emit:G}){const{financeAppResidentialStatusOptions:_}=st(),{t:p}=je(),s=t,$=G,l=n=>{const S={building:n.building??"",building_name:n.building_name??"",line_1:n.line_1??"",line_2:n.line_2??"",line_3:n.line_3??"",city:n.city??"",county:n.county??"",street:n.street??"",town:n.town??"",country:n.country??"",postcode:n.postcode??""};$("update:address",{...s.address,...S})},C=J(!1),h=J(!0),R=({field:n,value:S})=>{const j={...s.address,[n]:S};$("update:address",j),s.address.years&&(C.value=!0)},r=()=>{h.value=!h.value},A=n=>{const S=parseInt(n,10),j={...s.address,years:S,months:S>=3?0:s.address.months};$("update:address",j)},b=n=>{$("update:address",{...s.address,months:parseInt(n,10)})},U=Array.from({length:11},(n,S)=>({label:`${S+1}`,value:S+1})),x=F(()=>{var n,S,j,B,V,k;return Object.fromEntries(Object.entries({building:(n=s.address)==null?void 0:n.building,line_1:(S=s.address)==null?void 0:S.line_1,city:(j=s.address)==null?void 0:j.city,street:(B=s.address)==null?void 0:B.street,country:(V=s.address)==null?void 0:V.country,postcode:(k=s.address)==null?void 0:k.postcode}).filter(([ee,Z])=>Z!=null&&Z!==""))}),T=[{label:"0",value:0},{label:"1",value:1},{label:"2",value:2},{label:`3 ${p("or-more")}`,value:3}],u=[{key:"building",label:"Building Name/Number",required:!0},{key:"line_1",label:"Address Line 1",required:!0},{key:"line_2",label:"Address Line 2"},{key:"city",label:"City",required:!0},{key:"postcode",label:"Postcode",required:!0},{key:"country",label:"Country",required:!0}],f=F(()=>h.value&&s.address.postcode);return(n,S)=>{var j,B,V,k;return i(),g("div",{class:ne([t.componentName,"mb-s2-5"])},[o("div",Ca,[t.isPrevious&&((j=t.formSections.residentialStatus)!=null&&j.show)?(i(),Q(e(Ve),{key:0,id:`${t.componentName}__residential-status_${t.address.key}`,name:`residential-status-current-address-${t.address.key}`,error:!e(C)||t.address.status!==""&&t.address.status?"":`${e(p)("residential-status")} ${e(p)("is-required")}`,success:!!t.address.status,label:e(p)(t.formSections.residentialStatus.label),items:e(_),"model-value":t.address.status,"onUpdate:modelValue":S[0]||(S[0]=ee=>{return Z=String(ee),void $("update:address",{...s.address,status:Z});var Z})},null,8,["id","name","error","success","label","items","model-value"])):v("",!0)]),(B=t.formSections.address)!=null&&B.show?(i(),g("div",Ia,[o("div",Oa,[o("div",Ta,[o("p",Ba,[o("b",null,[t.address.key?(i(),g(we,{key:1},[le(m(e(p)(String(t.formSections.address.labelPrevious))),1)],64)):(i(),g(we,{key:0}
2,[le(m(e(p)(t.formSections.address.label)),1)],64))])])]),o("div",La,[c(e(pe),{variant:"hyperlink",type:"button","padding-size":"none","font-size":"sub",size:"small",onClick:r},{default:I(()=>[le(m(e(h)?e(p)("enter-manually"):e(p)("postcode-lookup")),1)]),_:1})])])])):v("",!0),(V=t.formSections.address)!=null&&V.description?(i(),g("p",Pa,m(e(p)(t.formSections.address.description)),1)):v("",!0),o("div",Ha,[o("div",Ra,[c(_t,{address:t.address,"hide-selected-address":!0,"input-placeholder":e(p)("start-typing-a-postcode"),"using-postcode-lookup":e(h),"field-override":u,error:!e(C)||t.address.postcode!==""&&t.address.postcode?"":`${e(p)("postcode")} ${e(p)("is-required")}`,success:!!(t.address.postcode!==""||t.address.postcode),"background-color":"secondary","onUpdate:field":R,"onUpdate:postcodeField":l},null,8,["address","input-placeholder","using-postcode-lookup","error","success"])]),e(f)?(i(),g("div",Ma,[o("ul",Ja,[(i(!0),g(we,null,Te(e(x),(ee,Z)=>(i(),g("li",{key:Z,class:ne({highlight:Z==="postcode"})},[e(x)&&Z in e(x)&&e(x)[Z]?(i(),g("span",Ya,m(ee),1)):v("",!0)],2))),128))])])):v("",!0)]),(k=t.formSections.timeAtAddress)!=null&&k.show?(i(),g("div",Ga,[o("p",Wa,m(e(p)(t.formSections.timeAtAddress.label)),1
2),o("div",za,[c(e(Ue),{id:`${t.componentName}-years-${t.address.key}`,name:`${t.componentName}-years-${t.address.key}`,label:e(p)("years"),"default-text":`${e(p)("years")}`,"background-color":"secondary",error:e(C)&&(t.address.years===void 0||t.address.years<0)?`${e(p)("years")} ${e(p)("are-required")}`:"",success:t.address.years!==void 0&&t.address.years>=0,"model-value":String(t.address.years),options:T,required:t.required,"onUpdate:modelValue":A},null,8,["id","name","label","default-text","error","success","model-value","required"]),!t.address.years||t.address.years<3?(i(),Q(e(Ue),{key:0,id:`${t.componentName}-months-${t.address.key}`,name:`${t.componentName}-months-${t.address.key}`,class:"flex-1","background-color":"secondary",error:e(C)&&(t.address.months===void 0||t.address.months<0)?`${e(p)("months")} ${e(p)("are-required")}`:"",success:t.address.months!==void 0&&t.address.months>=0,label:e(p)("months"),"default-text":`${e(p)("months")}`,"model-value":String(t.address.months),options:e(U),required:t.required,"onUpdate:modelValue":b},null,8,["id","name","error","success","label","default-text","model-value","options","required"])):v("",!0)])])):v("",!0)],2)}}}),[["__scopeId","data-v-51a8779d"]]),Qa={class:"row radio mt-s2-5"},Ka={key:0},Za={key:1},Xa={class:"col-12"},es=xe(qe({__name:"f-address-history",props:{componentName:{default:"f-address-history"},customerCurrentAddress:{},customerAddressHistory:{},formSections:{default:()=>({residentialStatus:{label:"your-residential-status",description:"please-select-an-option-to-proceed",show:!0},address:{label:"your-current-address",description:"",show:!0},timeAtAddress:{label:"how-long-have-you-lived-here",description:"",show:!0}})},context:{default:"default"},required:{type:Boolean,default:!1},error:{},success:{type:Boolean}},emits:["update:customerCurrentAddress","update:customerAddressHistory","update:three-years-address-history"],setup(t,{emit:G}){const{t:_}=je(),p=t,s=G,$=J({...p.customerCurrentAddress}),l=J([...p.customerAddressHistory]),C=J(1e3),{financeAppResidentialStatusOptions:h}=st(),R=F(()=>{var f;return!!((f=p.formSections.address)!=null&&f.show&&l.value.length&&A($.value))}),r=f=>12*Number(f.years||0)+Number(f.months||0),A=f=>{const n=Number(f.years),S=Number(f.months);return!isNaN(n)&&n>=0&&!isNaN(S)&&S>=0&&(n>0||S>0)},b=F(()=>{let f=r($.value);for(const n of l.value)f+=r(n);return f>=36}),U=f=>!(f.postcode||f.building||f.city||f.line_1||f.line_2||f.line_3||f.county||f.country||f.months||f.years),x=()=>{if(!A($.value))return;const f=b.value;s("update:three-years-address-history",f);const n=l.value[l.value.length-1];if(f){if(n&&U(n)){const j=l.value.slice(0,-1);s("update:customerAddressHistory",j),l.value=j}return}const S=n&&A(n)&&!U(n);if(!n||S){const j={key:C.value++,building_name:"",street:"",town:"",postcode:"",building:"",city:"",line_1:"",line_2:"",line_3:"",county:"",country:"",months:void 0,years:void 0,status:""},B=[...l.value,j];s("update:customerAddressHistory",B),l.value=B}},T=f=>{$.value=f,s("update:customerCurrentAddress",f),x()},u=(f,n)=>{const S=[...l.value];var j;S[f]=n,j=S,l.value=[...j],s("update:customerAddressHistory",j)};return dt(()=>p.customerCurrentAddress,f=>{$.value={...f}},{immediate:!0}),dt(()=>p.customerAddressHistory,f=>{l.value=[...f],x()},{immediate:!0}),(f,n)=>{var S,j;return i(),g("div",{class:ne([t.componentName,`context-${t.context}`,{"section-is-successful":t.success,"section-has-error":(S=t.error)==null?void 0:S.length}])},[o("div",Qa,[t.formSections.residentialStatus.show?(i(),Q(e(Ve),{key:0,id:`${t.componentName}__residential-status`,name:"residential-status-current-address",label:e(_)(t.formSections.residentialStatus.label),"hide-label":!0,success:t.customerCurrentAddress.status!=="",required:t.required,items:e(h),"model-value":t.customerCurrentAddress.status,"onUpdate:modelValue":n[0]||(n[0]=B=>T({...e($),status:B}))},null,8,["id","label","success","required","items","model-value"])):v("",!0)]),(j=t.formSections.timeAtAddress)!=null&&j.show?(i(),g("fieldset",Ka,[c(e(bt),{address:e($),label:e(_)(t.formSections.address.label),description:e(_)(t.formSections.address.description),required:t.required,"is-
2previous":!1,"onUpdate:address":T},null,8,["address","label","description","required"])])):v("",!0),e(R)?(i(),g("fieldset",Za,[o("div",Xa,[c(e(We),{"prepend-icon-type":e(De).Icon.WarningSolid,variant:"info","has-close":""},{default:I(()=>[o("p",null,m(e(_)("three-years-address-history-required")),1)]),_:1},8,["prepend-icon-type"])]),c(et,{name:"fade-in"},{default:I(()=>[(i(!0),g(we,null,Te(e(l),(B,V)=>(i(),Q(e(bt),{key:B.key||V,address:B,required:t.required,"is-previous":!0,"onUpdate:address":k=>u(V,k)},null,8,["address","required","onUpdate:address"]))),128))]),_:1})])):v("",!0)],2)}}}),[["__scopeId","data-v-69822ae3"]]),ts={key:0,class:"sub-heading"},as={key:1,class:"subtitle"},ss={class:"row radio"},os={class:"row full"},rs={class:"row full"},ls={class:"row full flex-nowrap between items-center postcode-toggle"},ns={class:"items-end grow-1"},cs={class:"heading"},is={class:"postcode-lookup-toggle"},us={class:"w-100"},ds={class:"w-100"},ms={key:0,class:"w-100"},_s={class:"selected-address-details-list"},ps={key:0},vs={class:"row full"},ys={class:"row full"},hs={class:"label"},bs={class:"row space-between"},ft=xe(qe({__name:"employment-section",props:{componentName:{default:"employment-section"},job:{},title:{default:void 0},subtitle:{default:void 0},basisOptions:{},context:{default:"default"}},emits:["update:job"],setup(t,{emit:G}){var j;const _=t,p=G,{t:s}=je(),$=((j=Ct)==null?void 0:j())||`frb-${Math.random().toString(36).slice(2,10)}`,l=F(()=>$),C=J(""),h=J(!1),R=J(!0),r=F(()=>({..._.job,postcode:C.value||_.job.postcode||"",years:typeof _.job.years=="number"?_.job.years:0,months:typeof _.job.months=="number"?_.job.months:0})),A=F(()=>R.value&&_.job.postcode),b=()=>{R.value=!R.value},U=B=>{C.value=B.postcode??"";const V={...B,postcode:B.postcode||C.value||""};p("update:job",{..._.job,...V})},x=({field:B,value:V})=>{if(B in _.job){const k={..._.job,[B]:V};p("update:job",k)}},T=[{key:"building",label:"Building Name/Number",required:!0},{key:"line_1",label:"Address Line 1",required:!0},{key:"line_2",label:"Address Line 2"},{key:"city",label:"City",required:!0},{key:"postcode",label:"Postcode",required:!0},{key:"country",label:"Country",required:!0}],u=[{label:"0 years",value:0},{label:"1 year",value:1},{label:"2 years",value:2},{label:"3 years or more",value:3}],f=F(()=>Object.fromEntries(Object.entries({building:r==null?void 0:r.value.building,line_1:r==null?void 0:r.value.line_1,city:r==null?void 0:r.value.city,town:r==null?void 0:r.value.town,country:r==null?void 0:r.value.country,postcode:r==null?void 0:r.value.postcode}).filter(([B,V])=>V!=null&&V!==""))),n=Array.from({length:12},(B,V)=>({label:`${V} month${V!==1?"s":""}`,value:V})).slice(1);function S(B,V){p("update:job",{..._.job,[B]:V}),_.job.years&&(h.value=!0)}return(B,V)=>(i(),g("div",{class:ne([t.componentName,`context-${t.context}`])},[t.title?(i(),g("h4",ts,[le(m(t.title)+" ",1),V[7]||(V[7]=o("sup",{class:"required-asterisk"},"*",-1))])):v("",!0),t.subtitle?(i(),g("p",as,m(t.subtitle),1)):v("",!0),o("div",ss,[c(e(Ve),{id:`${e(l)}-employment-status`,label:"",error:!e(h)||t.job.type!==""&&t.job.type?"":`${e(s)("employment-status")} ${e(s)("is-required")}`,success:!!(t.job.type!==""&&t.job.type),name:`${e(l)||"employment"}-status`,items:t.basisOptions,"model-value":t.job.type,"onUpdate:modelValue":V[0]||(V[0]=k=>S("type",k))},null,8,["id","error","success","name","items","model-value"])]),o("div",os,[c(e(ve),{id:`${e(l)}-employer_name_${t.title}`,name:`${e(l)}-employer_name_${t.title}`,required:!0,"background-color":"secondary",error:!e(h)||t.job.employer!==""&&t.job.employer?"":`${e(s)("employer-name")} ${e(s)("is-required")}`,success:!!(t.job.employer!==""&&t.job.employer),label:e(s)("employer-name"),type:"text","model-value":t.job.employer,"onUpdate:modelValue":V[1]||(V[1]=k=>S("employer",k))},null,8,["id","name","error","success","label","model-value"])]),o("div",rs,[c(e(ve),{id:`${e(l)}-employer_job_title_${t.title}`,error:!e(h)||t.job.job_title!==""&&t.job.job_title?"":`${e(s)("job-title")} ${e(s)("is-required")}`,success:!!(t.job.job_title!==""&&t.job.job_title),name:`${e(l)}-employer_job_title_${t.title}`,required:!0,"background-color":"secondary",label:e(s)("job-title"),"model-value":t.job.job_title,"onUpdate:modelValue":V[2]||(V[2]=k=>S("job_title",k))},null,8,["id","error","success","name","label","model-value"])]),o("div",ls,[o("div",ns,[o("p",cs,[o("b",null,m(e(s)("employers-address")),1)])]),o("div",is,[c(e(pe),{variant:"hyperlink",type:"button","padding-size":"none","font-size":"sub",size:"small",onClick:b},{default:I(()=>[le(m(e(R)?e(s)("enter-manually"):e(s)("postcode-lookup")),1)]),_:1})])]),o("div",us,[o("div",ds,[c(e(_t),{class:"col-12",address:e(r),"hide-selected-address":!0,error:!e(h)||t.job.postcode!==""&&t.job.postcode?"":`${e(s)("postcode")} ${e(s)("is-required")}`,success:!!(t.job.postcode!==""||t.job.postcode),"field-override":T,"input-placeholder":e(s)("start-typing-a-postcode"),"using-postcode-lookup":e(R),"background-color":"secondary","onUpdate:field":x,"onUpdate:postcodeField":U},null,8,["address","error","success","input-placeholder","using-postcode-lookup"])]),e(A)?(i(),g("div",ms,[o("ul",_s,[(i(!0),g(we,null,Te(e(f),(k,ee)=>(i(),g("li",{key:ee,class:ne({highlight:ee==="postcode"})},[e(f)&&ee in e(f)&&e(f)[ee]?(i(),g("span",ps,m(k),1)):v("",!0)],2))),128))])])):v("",!0)]),o("div",vs,[c(e(ze),{id:`${e(l)}-gross_monthly_income_${t.title}
2`,error:!e(h)||Number(t.job.monthly_income)!==0&&t.job.monthly_income?"":`${e(s)("gross-monthly-income")} ${e(s)("is-required")}`,success:!!(t.job.monthly_income&&Number(t.job.monthly_income)>0),name:`${e(l)}-gross_monthly_income_${t.title}`,required:!0,"background-color":"secondary",label:t.job.key?e(s)("what-was-your-gross-monthly-income-before-tax"):e(s)("what-is-your-gross-monthly-income-before-tax"),type:"text","show-pound-symbol":!0,"model-value":Number(t.job.monthly_income),"onUpdate:modelValue":V[3]||(V[3]=k=>S("monthly_income",k))},null,8,["id","error","success","name","label","model-value"])]),o("div",ys,[c(e(ze),{id:`${e(l)}-monthly_income_${t.title}`,error:!e(h)||Number(t.job.net_monthly_income)!==0&&t.job.net_monthly_income?"":`${e(s)("net-monthly-income")} ${e(s)("is-required")}`,success:!!(t.job.net_monthly_income&&Number(t.job.net_monthly_income)>0),name:`${e(l)}-monthly_income_${t.title}`,required:!0,label:(t.job.key,e(s)("what-is-your-net-monthly-income-after-tax")),"background-color":"secondary",type:"text","show-pound-symbol":!0,"model-value":Number(t.job.net_monthly_income),"onUpdate:modelValue":V[4]||(V[4]=k=>S("net_monthly_income",k))},null,8,["id","error","success","name","label","model-value"])]),o("p",hs,m(e(s)("how-long-have-you-worked-here")),1),o("div",bs,[c(e(Ue),{id:`${e(l)}-employment_years_${t.title}`,name:`${e(l)}-employment_years_${t.title}`,"background-color":"secondary",required:!0,options:u,error:e(h)&&t.job.years===void 0?`${e(s)("years")} ${e(s)("are-required")}`:"",success:t.job.years!==void 0&&t.job.years>=0,"model-value":String(t.job.years),label:e(s)("years"),"hide-label":!0,"default-text":`${e(s)("years")}`,"onUpdate:modelValue":V[5]||(V[5]=k=>function(ee){const Z={..._.job,years:ee,months:ee>=3?0:_.job.months};p("update:job",Z)}(Number(k)))},null,8,["id","name","error","success","model-value","label","default-text"]),!t.job.years||t.job.years<3?(i(),Q(e(Ue),{key:0,id:`${e(l)}-employment_months_${t.title}`,name:`${e(l)}-employment_months_${t.title}`,required:!0,"background-color":"secondary",error:!e(h)||t.job.months!==void 0&&t.job.months?"":`${e(s)("months")} ${e(s)("are-required")}`,success:t.job.months!==void 0&&t.job.months>0,options:e(n),"model-value":String(t.job.months),label:e(s)("months"),"default-text":`${e(s)("years")}`,"hide-label":!0,"onUpdate:modelValue":V[6]||(V[6]=k=>S("months",Number(k)))},null,8,["id","name","error","success","options","model-value","label","default-text"])):v("",!0)])],2))}}),[["__scopeId","data-v-adecc5c5"]]),fs={key:0,class:"previous-work-history"},gs={class:"col-12"},ks=xe(qe({__name:"f-employment-history",props:{componentName:{default:"f-employment-history"},customerCurrentEmployment:{},customerEmploymentHistory:{},basisOptions:{},context:{default:"default"},required:{type:Boolean},error:{},success:{type:Boolean}},emits:["update:customer-current-employment","update:customer-employment-history","update:three-years-work-history","update:form","update:job"],setup(t,{emit:G}){const{t:_}=je(),p=t,s=G,$=R=>{s("update:customer-current-employment",R),h(R,p.customerEmploymentHistory)},l=J(Math.max(0,...p.customerEmploymentHistory.map(R=>R.key||0))+1),C=R=>{var b,U;if(!R)return!1;const r=Number(R.years),A=Number(R.months);return((b=R.employer)==null?void 0:b.trim())&&((U=R.job_title)==null?void 0:U.trim())&&!isNaN(r)&&!isNaN(A)&&(r>0||A>0)},h=(R,r)=>{if(!C(R)||r.some(x=>!!(x.employer||x.job_title||x.years||x.months)&&!C(x)))return void s("update:three-years-work-history",!1);const{isThreeYearsMet:A}=((x,T=[])=>{let u=0,f=0;const n=S=>{if(!S)return;const j=Number(S.years)||0,B=Number(S.months)||0;isNaN(j)||isNaN(B)||!(j>0||B>0)||(u+=B,f+=j)};return n(x),T.forEach(n),f+=Math.floor(u/12),u%=12,{years:f,months:u,isThreeYearsMet:f>=3}})(R,r);if(s("update:three-years-work-history",A),A){const x=[...r];for(;x.length>0&&!C(x[x.length-1]);)x.pop();return void(x.length!==r.length&&s("update:form",{customer_employment_history:x}))}const b=r[r.length-1],U=b&&C(b);if(!b||U){const x={key:l.value++,job_title:"",employer:"",years:void 0,months:void 0,line_1:"",line_2:"",building:"",street:"",town:"",country:"",type:"",monthly_income:"",net_monthly_income:"",postcode:""};s("update:form",{customer_employment_history:[...r,x]})}};return(R,r)=>{var A;return i(),g("fieldset",{class:ne([t.componentName,`context-${t.context}`,{"section-is-successful":t.success,"section-has-error":(A=t.error)==null?void 0:A.length}])},[c(e(ft),{"basis-options":t.basisOptions,context:t.context,required:t.required,job:t.customerCurrentEmployment,title:e(_)("your-current-employment-status"),"onUpdate:job":$},null,8,["basis-options","context","required","job","title"]),t.customerEmploymentHistory.length?(i(),g("div",fs,[o("div",gs,[c(e(We),{"prepend-icon-type":e(De).Icon.WarningSolid,variant:"info","has-close":""},{default:I(()=>[o("p",null,m(e(_)("three-years-employment-history-required")),1)]),_:1}
2,8,["prepend-icon-type"])]),(i(!0),g(we,null,Te(t.customerEmploymentHistory,(b,U)=>(i(),Q(e(ft),{key:`previous-employment-${b.key}`,"basis-options":t.basisOptions,context:t.context,required:t.required,job:b,title:`${e(_)("your-previous-employer")} ${U+1}`,"onUpdate:job":x=>((T,u)=>{const f=[...p.customerEmploymentHistory];f[u]=T,s("update:form",{customer_employment_history:f}),h(p.customerCurrentEmployment,f)})(x,U)},null,8,["basis-options","context","required","job","title","onUpdate:job"]))),128))])):v("",!0)],2)}}}),[["__scopeId","data-v-d5c35423"]]),ws={class:"row"},Ss={class:"col-12"},qs={class:"text-primary"},xs={class:"col-12"},js={key:1,class:"loader-container"},Ns={key:2},Fs={key:"step-1-header"},$s={class:"section-header"},As={class:"question"},Us={class:"step-content"},Ds={class:"step-header"},Es={class:"sub"},Vs={class:"sub"},Cs={class:"estimated-time"},Is={key:"step-1-form",class:"deal-stacker-form row"},Os={class:"form-section-heading"},Ts={class:"question-container border-bottom"},Bs={class:"short-input"},Ls={class:"col-12"},Ps={class:"question-container border-bottom"},Hs={key:"step-2-header"},Rs={class:"section-header"},Ms={class:"question"},Js={class:"step-content"},Ys={class:"step-header"},Gs={class:"sub"},Ws={class:"sub"},zs={class:"estimated-time"},Qs={key:"step-2-form",class:"deal-stacker-form row"},Ks={class:"col-12"},Zs={class:"form-section-heading"},Xs={class:"question-container border-bottom"},eo={class:"question-container border-bottom"},to={class:"question-container border-bottom"},ao={class:"col-12 gap-smaller"},so={class:"label"},oo={class:"legend sub"},ro={class:"question-container border-bottom"},lo={class:"question-container border-bottom"},no={class:"question-container border-bottom"},co={class:"label"},io={class:"question-container border-none"},uo={class:"form-section-heading"},mo={class:"form-section-heading"},_o={class:"form-section-heading"},po={class:"question-container"},vo={class:"question-container"},yo={class:"question-container"},ho={class:"question-container border-none"},bo={class:"question-container border-none"},fo={class:"form-section-heading"},go={class:"question-container border-none"},ko={class:"question-container border-none"},wo={class:"question-container border-none"},So={class:"label"},qo={class:"row space-between gap-smaller"},xo=xe(qe({__name:"journey-autoconvert-application",props:{componentName:{default:"journey-autoconvert-application"},vehicle:{}},emits:["back","scroll-to","setActiveJourney","form-submitted"],setup(t,{emit:G}){const _=$e(()=>Ae(()=>import("./C25kqpX7.js"),__vite__mapDeps([2,1]),import.meta.url)),p=$e({loader:()=>Ae(()=>import("./CgR5oH26.js"),__vite__mapDeps([6,7,1]),import.meta.url)}),{t:s}=je(),{createDeal:$,dealStackerFormData:l,isDealLoading:C,setLoadingState:h,submitFinanceApplication:R,updateDeal:r,updateDealStackerFormData:A}=Me(),{fireGtmEvent:b}=at(),{dealStackerDealItems:U,updateDealStackerDealItems:x}=Je(),{formatPriceTrimZero:T}=qt(),{inlineFieldErrors:u,debouncedValidateSingleField:f,getTouchedState:n,validateZodSchema:S}=it(),{countryOfOriginOptions:j,financeAppDrivingLicenseOptions:B,financeAppMaritalStatusOptions:V,financeAppYesNoOptions:k,financeAppGenderOptions:ee,financeAppEmploymentStatusOptions:Z,financeAppBankAccountTypeOptions:z,financeAppMonthLengthOptions:ue,financeAppYearLengthOptions:re}=st(),{FinanceApplicationStep1Schema:de,FinanceApplicationStep2Schema:me}=ut(),L=t,se=G,K=J(1),E=J(!1),y=J({}),P=J({}),ge=J(!1),ye=F(()=>{var M,d,H,D;return!!(l.value.threeYearsWorkHistory&&((M=l.value.customer_current_employment)!=null&&M.type)&&((d=l.value.customer_current_employment)!=null&&d.line_1)&&((H=l.value.customer_current_employment)!=null&&H.city)&&((D=l.value.customer_current_employment)!=null&&D.country))}),ce=F(()=>{var M,d,H,D;return!!(l.value.threeYearsAddressHistory&&((M=l.value.customer_current_address)!=null&&M.status)&&((d=l.value.customer_current_address)!=null&&d.line_1)&&((H=l.value.customer_current_address)!=null&&H.city)&&((D=l.value.customer_current_address)!=null&&D.country))}),ie=F(()=>{const M=l.value;return!(M.customer_title&&M.customer_first_name&&M.customer_last_name&&M.customer_email&&M.customer_telep
2hone&&M.terms_accepted)}),_e=M=>{E.value=!0,y.value={};const{success:d,errors:H}=S(M,l.value);return d?(E.value=!1,!0):(y.value=H,E.value=!1,!1)},Ne=async()=>{if(!(C.value||E.value)&&_e(de)){E.value=!0;try{l.value.guid?K.value++:(h(!0),await $(l.value,L.vehicle).then(()=>{K.value++}))}catch(M){P.value.createDeal=s("there-was-an-error-creating-your-deal"),Ce(M)}finally{h(!1),E.value=!1,se("scroll-to")}}},he=()=>{P.value={}},X=F(()=>{const M=l.value.customer_circumstance_changes_expected;return M===!0?"yes":M==null?void 0:"no"}),N=F(()=>{const M=l.value.customer_valid_passport;return M===!0?"yes":M==null?void 0:"no"}),W=F(()=>{const M=l.value.customer_replacing_existing_loan;return M===!0?"yes":M==null?void 0:"no"}),Ee=F(()=>{const M=new Date;return M.setFullYear(M.getFullYear()-18),M}),Fe=async()=>{if(C.value||E.value)return;if(!_e(me))return void se("scroll-to");E.value=!0,h(!0);const M=ot(l.value,rt("targeting")),d=M?{enhanced_conversion_data:M}:{};b("dealbuilder_finance_application_submitted",d),r(l.value,U.value,L.vehicle).then(async()=>{const H=await R(l.value,U.value,L.vehicle);H&&typeof H=="object"&&"completed"in H&&(ge.value=!!H.completed,se("form-submitted"),setTimeout(()=>{window==null||window.location.reload()},250))}).catch(H=>{P.value.updateDeal=H.message}).finally(()=>{h(!1),E.value=!1,se("scroll-to"),b("dealbuilder_complete_finance_application",d)})},Ie=()=>{x({paymentMethod:"reserve"}),A({payment_type:"OUTRIGHT_DEPOSIT"}),mt(L.vehicle)?se("setActiveJourney","step-checkout-form"):se("setActiveJourney","step-reserve-form"),se("scroll-to")},ae=(M,d)=>{A({[M]:d}),y.value={},f(M,d)};return(M,d)=>{var D;const H=gt("f-page-loader");return i(),g("div",{id:"payment-container",class:ne([t.componentName])},[o("div",null,[(e(y)&&Object.keys(e(y)).length||(D=e(P))!=null&&D.length)&&!e(C)?(i(),Q(e(_),{key:0,"heading-text":e(s)("error-occurred"),"show-heading":!1,onGoBack:he},{default:I(()=>[c(e(We),{"show-heading":!1,variant:"error","prepend-icon-type":e(De).Icon.NotificationsError},{default:I(()=>[o("div",ws,[o("div",Ss,[o("p",qs,m(e(s)("error-occurred-please-review-submission")),1)]),o("div",xs,[o("ul",null,[(i(!0),g(we,null,Te(e(y),(a,q)=>(i(),g("li",{key:q},[o("p",null,m(a),1)]))),128))])])])]),_:1},8,["prepend-icon-type"])]),_:1},8,["heading-text"])):v("",!0),e(E)&&!e(C)?(i(),g("div",js,[c(H)])):v("",!0),e(ge)?v("",!0):(i(),g("div",Ns,[He(c(et,{name:"fade-in"},{default:I(()=>[e(K)===1?(i(),g(we,{key:0},[o("section",Fs,[o("header",$s,[o("span",As,[c(e(Qe),{icon:e(De).Icon.LightQuestion},null,8,["icon"])]),o("div",Us,[o("div",Ds,[o("p",Es,[o("b",null,m(e(s)("your-finance-application")),1)]),o("p",Vs,m(e(s)("step",{step:e(K),total_steps:2})),1)]),o("p",null,m(e(s)("please-answer-a-few-questions-finance-header")),1),o("small",Cs,[o("i",null,m(e(s)("estimated-time",{time:3})),1)])])])]),o("form",Is,[o("h2",Os,m(e(s)("personal-details")),1),o("h3",null,m(e(s)("about-you")),1),o("fieldset",Ts,[o("div",Bs,[c(e(Ue),{id:"title",name:"customer_title",error:e(u).customer_title||e(y).customer_title||"",success:e(n)(e(l).customer_title,e(u).customer_title||e(y).customer_title),label:e(s)("title"),"background-color":"secondary",options:[{label:e(s)("mr"),value:"mr"},{label:e(s)("mrs"),value:"mrs"},{label:e(s)("miss"),value:"miss"},{label:e(s)("ms"),value:"ms"}],required:"","model-value":e(l).customer_title,"onUpdate:modelValue":d[0]||(d[0]=a=>ae("customer_title",String(a)))},null,8,["error","success","label","options","model-value"])]),c(e(ve),{id:"forename",error:e(u).customer_first_name||e(y).customer_first_name||"",success:e(n)(e(l).customer_first_name,e(u).customer_first_name||e(y).customer_first_name),label:e(s)("first-name"),"background-color":"secondary",name:"forename",required:"","model-value":e(l).customer_first_name,"onUpdate:modelValue":d[1]||(d[1]=a=>ae("customer_first_name",a))},null,8,["error","success","label","model-value"]),c(e(ve),{id:"surname",error:e(u).customer_last_name||e(y).customer_last_name||"",success:e(n)(e(l).customer_last_name,e(u).customer_last_name||e(y).customer_last_name),label:e(s)("last-name"),"background-color":"secondary",name:"surname",required:"","model-value":e(l).
2customer_last_name,"onUpdate:modelValue":d[2]||(d[2]=a=>ae("customer_last_name",a))},null,8,["error","success","label","model-value"])]),o("div",Ls,[o("h3",null,m(e(s)("how-can-we-contact-you")),1)]),o("fieldset",Ps,[c(e(lt),{id:"customer-email",error:e(u).customer_email||e(y).customer_email||"",success:e(n)(e(l).customer_email,e(u).customer_email||e(y).customer_email),label:e(s)("email-address"),name:"customer_email","background-color":"secondary",required:"","model-value":e(l).customer_email,"onUpdate:modelValue":d[3]||(d[3]=a=>ae("customer_email",a))},null,8,["error","success","label","model-value"]),c(e(nt),{id:"customer-phone",error:e(u).customer_telephone||e(y).customer_telephone||"",success:e(n)(e(l).customer_telephone,e(u).customer_telephone||e(y).customer_telephone),label:e(s)("contact-number"),"background-color":"secondary",name:"customer_telephone",required:"","model-value":e(l).customer_telephone,"onUpdate:modelValue":d[4]||(d[4]=a=>ae("customer_telephone",a))},null,8,["error","success","label","model-value"])]),c(e(ct),{id:"terms-checkbox",label:e(s)("terms-and-conditions"),error:e(u).terms_accepted||e(y).terms_accepted||"",success:e(n)(e(l).terms_accepted,e(u).terms_accepted||e(y).terms_accepted),name:"terms-checkbox",required:"",checked:!1,"is-link":!0,"model-value":e(l).terms_accepted,"onUpdate:modelValue":d[5]||(d[5]=a=>ae("terms_accepted",a))},null,8,["label","error","success","model-value"]),c(e(pe),{type:"button",variant:"primary-solid","width-type":"fill",disabled:e(ie)||e(C)||e(E),onClick:Ne},{default:I(()=>[le(m(e(s)("continue")),1)]),_:1},8,["disabled"]),c(e(Nt),{text:e(s)("or"),"line-colour":"var(--border)","margin-size":"none"},null,8,["text"]),c(e(pe),{type:"button",variant:"reserve","icon-type":e(De).Icon.Lock,"icon-position":"prepend","width-type":"fill",onClick:Ie},{default:I(()=>[le(m(e(s)("reserve-for"))+" "+m(e(T)(String(e(U).deposit_fee))),1)]),_:1},8,["icon-type"]),c(e(p))])],64)):v("",!0)]),_:1},512),[[Re,!e(C)]]),c(et,{name:"fade-in"},{default:I(()=>[e(K)===2?(i(),g(we,{key:0},[o("section",Hs,[o("header",Rs,[o("span",Ms,[c(e(Qe),{icon:e(De).Icon.LightQuestion},null,8,["icon"])]),o("div",Js,[o("div",Ys,[o("p",Gs,[o("b",null,m(e(s)("your-finance-application")),1)]),o("p",Ws,m(e(s)("step",{step:e(K),total_steps:2})),1)]),o("p",null,m(e(s)("please-answer-a-few-questions-finance-header")),1),o("small",zs,[o("i",null,m(e(s)("estimated-time",{time:5})),1)])])])]),o("form",Qs,[o("div",Ks,[o("h3",Zs,m(e(s)("about-you")),1),o("fieldset",Xs,[c(e(Ve),{id:"driving-license-type",label:e(s)("driving-license-type"),error:e(u).customer_driving_license||e(y).customer_driving_license||"",success:e(n)(e(l).customer_driving_license,e(u).customer_driving_license||e(y).customer_driving_license),name:"driving_license_type",items:e(B),required:!0,"label-font-weight":"bold","label-color":"primary","label-margin":"small","model-value":e(l).customer_driving_license,"onUpdate:modelValue":d[6]||(d[6]=a=>ae("customer_driving_license",String(a)))},null,8,["label","error","success","items","model-value"])]),o("fieldset",eo,[c(e(Ve),{id:"marital-status",label:e(s)("marital-status"),error:e(u).customer_marital_status||e(y).customer_marital_status||"",success:e(n)(e(l).customer_marital_status,e(u).customer_marital_status||e(y).customer_marital_status),name:"marital_status",items:e(V),required:!0,"label-font-weight":"bold","label-color":"primary","label-margin":"small","model-value":e(l).customer_marital_status,"onUpdate:modelValue":d[7]||(d[7]=a=>ae("customer_marital_status",String(a)))},null,8,["label","error","success","items","model-value"])]),o("fieldset",to,[c(e(Ve),{id:"has-passport",label:e(s)("do-you-have-a-passport"),error:e(u).customer_valid_passport||e(y).customer_valid_passport||"",success:e(n)(e(l).customer_valid_passport||!1,e(u).customer_valid_passport||e(y).customer_valid_passport),name:"has_passport",items:e(k),"model-value":e(N),"label-font-weight":"bold","label-color":"primary","label-margin":"small",required:!0,"onUpdate:modelValue":d[8]||(d[8]=a=>ae("customer_valid_passport",a==="yes"))},null,8,["label","error","success","items","model-value"])])]),o("div",ao,[o("p",so,[le(m(e(s)("what-is-your-date-of-birth"))+" ",1),d[36]||(d[36]=o("sup",{class:"required-asterisk"},"*",-1))]),o("p",oo,m(e(s)("you-must-be-18-or-over-to-be-elligible")),1),o("fieldset",ro,[c(Mt,{id:"customer_date_of_birth",error:e(u).customer_date_of_birth||e(y).customer_date_of_birth||"",success:e(n)(e(l).customer_date_of_birth,e(u).customer_date_of_birth||e(y).customer_date_of_birth),"background-color":"secondary","width-type":"fill",label:e(s)("enter-date-of-birth"),"hide-label":!0,"date-format":"yyyy-MM-dd","display-format":"dd/MM/yyyy","max-date":e(Ee),"start-date":e(Ee),required:"","model-value":e(l).
2customer_date_of_birth,"onUpdate:modelValue":d[9]||(d[9]=a=>ae("customer_date_of_birth",String(a)))},null,8,["error","success","label","max-date","start-date","model-value"])]),o("fieldset",lo,[c(e(Ue),{id:"gender",name:"customer_gender",error:e(u).customer_gender||e(y).customer_gender||"",success:e(n)(e(l).customer_gender,e(u).customer_gender||e(y).customer_gender),label:e(s)("gender"),"default-text":`${e(s)("select")} ${e(s)("gender")}`,"background-color":"secondary",options:e(ee),required:"","model-value":e(l).customer_gender,"onUpdate:modelValue":d[10]||(d[10]=a=>ae("customer_gender",String(a)))},null,8,["error","success","label","default-text","options","model-value"])]),o("fieldset",no,[o("p",co,[le(m(e(s)("nationality"))+" ",1),d[37]||(d[37]=o("sup",{class:"required-asterisk"},"*",-1))]),c(e(Ue),{id:"customer_nationality",name:"customer_nationality",error:e(u).customer_nationality||e(y).customer_nationality||"",success:e(n)(e(l).customer_nationality,e(u).customer_nationality||e(y).customer_nationality),label:e(s)("nationality"),"hide-label":!0,"background-color":"secondary",options:e(j),"default-text":`${e(s)("select")} ${e(s)("nationality")}`,required:!0,"model-value":String(e(l).customer_nationality),"onUpdate:modelValue":d[11]||(d[11]=a=>ae("customer_nationality",String(a)))},null,8,["error","success","label","options","default-text","model-value"])]),o("fieldset",io,[c(e(Jt),{id:"financial-dependants",label:e(s)("financial-dependants"),error:e(u).customer_dependants||e(y).customer_dependants||"",success:e(n)(e(l).customer_dependants||e(l).customer_dependants===0,e(u).customer_dependants||e(y).customer_dependants),"background-color":"secondary",name:"financial_dependants",type:"number",required:!0,"model-value":Number(e(l).customer_dependants),"onUpdate:modelValue":d[12]||(d[12]=a=>ae("customer_dependants",a))},null,8,["label","error","success","model-value"])]),o("h3",uo,m(e(s)("employment-history")),1),c(e(ks),{"basis-options":e(Z),context:"deal-stacker",error:e(ye)?"":e(u).threeYearsWorkHistory||e(y).threeYearsWorkHistory||"",success:!!e(ye)&&e(n)(e(l).threeYearsWorkHistory,e(u).threeYearsWorkHistory||e(y).threeYearsWorkHistory),"customer-current-employment":e(l).customer_current_employment,"customer-employment-history":e(l).customer_employment_history,required:!0,"onUpdate:form":d[13]||(d[13]=a=>e(A)(a)),"onUpdate:customerCurrentEmployment":d[14]||(d[14]=a=>e(A)({customer_current_employment:a})),"onUpdate:customerEmploymentHistory":d[15]||(d[15]=a=>e(A)({customer_employment_history:a})),"onUpdate:threeYearsWorkHistory":d[16]||(d[16]=a=>e(A)({threeYearsWorkHistory:a}))},null,8,["basis-options","error","success","customer-current-employment","customer-employment-history"]),o("h3",mo,m(e(s)("address-history")),1),c(e(es),{context:"deal-stacker","customer-current-address":e(l).customer_current_address,"customer-address-history":e(l).customer_address_history,error:e(ce)?"":e(u).threeYearsAddressHistory||e(y).threeYearsAddressHistory||"",success:!!e(ce)&&e(n)(e(l).threeYearsAddressHistory,e(u).threeYearsAddressHistory||e(y).threeYearsAddressHistory),required:!0,"onUpdate:form":d[17]||(d[17]=a=>e(A)(a)),"onUpdate:customerCurrentAddress":d[18]||(d[18]=a=>e(A)({customer_current_address:a})),"onUpdate:customerAddressHistory":d[19]||(d[19]=a=>e(A)({customer_address_history:a})),"onUpdate:threeYearsAddressHistory":d[20]||(d[20]=a=>e(A)({threeYearsAddressHistory:a}))},null,8,["customer-current-address","customer-address-history","error","success"]),o("h3",_o,m(e(s)("other")),1),o("fieldset",po,[c(e(ze),{id:"rent-or-mortgage",label:e(s)("rent-or-mortgage"),error:e(u).customer_total_rent_or_mortgage||e(y).customer_total_rent_or_mortgage||"",success:e(n)(e(l).customer_total_rent_or_mortgage,e(u).customer_total_rent_or_mortgage||e(y).customer_total_rent_or_mortgage),"background-color":"secondary",name:"customer_total_rent_or_mortgage",type:"number",required:!0,"model-value":e(l).customer_total_rent_or_mortgage&&e(l).customer_total_rent_or_mortgage!==void 0?Number(e(l).customer_total_rent_or_mortgage):void 0,"onUpdate:modelValue":d[21]||(d[21]=a=>ae("customer_total_rent_or_mortgage",a))},null,8,["label","error","success","model-value"])]),o("fieldset",vo,[c(e(ze),{id:"childcare-payment",label:e(s)("monthly-childcare-payment"),error:e(u).customer_childcare_costs||e(y).customer_childcare_costs||"",success:e(n)(e(l).customer_childcare_costs,e(u).customer_childcare_costs||e(y).customer_childcare_costs),"background-color":"secondary",name:"childcare_payment",type:"number",required:!0,"model-value":e(l).
2customer_childcare_costs&&e(l).customer_childcare_costs!==void 0?Number(e(l).customer_childcare_costs):void 0,"onUpdate:modelValue":d[22]||(d[22]=a=>ae("customer_childcare_costs",a))},null,8,["label","error","success","model-value"])]),o("fieldset",yo,[c(e(ze),{id:"other-monthly-income",label:e(s)("other-monthly-income"),error:e(u).customer_other_income||e(y).customer_other_income||"",success:e(n)(e(l).customer_other_income,e(u).customer_other_income||e(y).customer_other_income),name:"other_monthly_income","background-color":"secondary",type:"number",required:!0,"model-value":e(l).customer_other_income&&e(l).customer_other_income!==void 0?Number(e(l).customer_other_income):void 0,"onUpdate:modelValue":d[23]||(d[23]=a=>ae("customer_other_income",a))},null,8,["label","error","success","model-value"])]),o("fieldset",ho,[c(e(Ve),{id:"replacing-loan",error:e(u).customer_replacing_existing_loan||e(y).customer_replacing_existing_loan||"",success:e(n)(e(l).customer_replacing_existing_loan,e(u).customer_replacing_existing_loan||e(y).customer_replacing_existing_loan),label:e(s)("are-you-replacing-a-loan"),name:"replacing_loan",items:e(k),required:!0,"label-font-weight":"bold","label-color":"primary","label-margin":"small","model-value":e(W),"onUpdate:modelValue":d[24]||(d[24]=a=>ae("customer_replacing_existing_loan",a==="yes"))},null,8,["error","success","label","items","model-value"])]),o("fieldset",bo,[c(e(Ve),{id:"future-circumstances",error:e(u).customer_circumstance_changes_expected||e(y).customer_circumstance_changes_expected||"",success:e(n)(e(l).customer_circumstance_changes_expected,e(u).customer_circumstance_changes_expected||e(y).customer_replacing_existing_loan),label:e(s)("future-change-in-circumstances"),name:"future_circumstances",items:e(k),required:!0,"label-font-weight":"bold","label-color":"primary","label-margin":"small","model-value":e(X),"onUpdate:modelValue":d[25]||(d[25]=a=>ae("customer_circumstance_changes_expected",a==="yes"))},null,8,["error","success","label","items","model-value"])]),o("h3",fo,m(e(s)("bank-details")),1),o("fieldset",go,[c(e(ve),{id:"bank-account-name",error:e(u).customer_bank_account_account_name||e(y).customer_bank_account_account_name||"",success:e(n)(e(l).customer_bank_account_account_name,e(u).customer_bank_account_account_name||e(y).customer_bank_account_account_name),label:e(s)("account-name"),"background-color":"secondary",name:"bank_account_name",required:!0,"model-value":e(l).customer_bank_account_account_name,"onUpdate:modelValue":d[26]||(d[26]=a=>ae("customer_bank_account_account_name",a))},null,8,["error","success","label","model-value"])]),o("fieldset",ko,[c(e(Ve),{id:"bank-account-type",label:e(s)("account-type"),error:e(u).customer_bank_account_account_type||e(y).customer_bank_account_account_type||"",success:e(n)(e(l).customer_bank_account_account_type,e(u).customer_bank_account_account_type||e(y).customer_bank_account_account_type),name:"bank_account_type",items:e(z),"label-font-weight":"bold","label-color":"primary","label-margin":"small","onUpdate:modelValue":d[27]||(d[27]=a=>ae("customer_bank_account_account_type",String(a)))},null,8,["label","error","success","items"])]),o("fieldset",wo,[c(e(ve),{id:"bank-account-number",error:e(u).customer_bank_account_number||e(y).customer_bank_account_number||"",success:e(n)(e(l).customer_bank_account_number,e(u).customer_bank_account_number||e(y).customer_bank_account_number),label:e(s)("account-number"),"background-color":"secondary",name:"bank_account_number",pattern:"d{8}","input-mode":"numeric",required:!0,"model-value":String(e(l).customer_bank_account_number),"onUpdate:modelValue":d[28]||(d[28]=a=>ae("customer_bank_account_number",a))},null,8,["error","success","label","model-value"]),c(e(ve),{id:"bank-sort-code",error:e(u).customer_bank_account_sortcode||e(y).customer_bank_account_sortcode||"",success:e(n)(e(l).customer_bank_account_sortcode,e(u).customer_bank_account_sortcode||e(y).customer_bank_account_sortcode),label:e(s)("sort-code"),"background-color":"secondary",name:"bank_sort_code",required:!0,"model-value":e(l).
2customer_bank_account_sortcode,"onUpdate:modelValue":d[29]||(d[29]=a=>ae("customer_bank_account_sortcode",a))},null,8,["error","success","label","model-value"]),c(e(ve),{id:"bank-branch-name",error:e(u).customer_bank_account_branch_name||e(y).customer_bank_account_branch_name||"",success:e(n)(e(l).customer_bank_account_branch_name,e(u).customer_bank_account_branch_name||e(y).customer_bank_account_branch_name),label:e(s)("branch-name"),"background-color":"secondary",name:"bank_branch_name","model-value":e(l).customer_bank_account_branch_name,"onUpdate:modelValue":d[30]||(d[30]=a=>ae("customer_bank_account_branch_name",a))},null,8,["error","success","label","model-value"]),c(e(ve),{id:"bank-address",error:e(u).customer_bank_account_branch_address||e(y).customer_bank_account_branch_address||"",success:e(n)(String(e(l).customer_bank_account_branch_address),e(u).customer_bank_account_branch_address||e(y).customer_bank_account_branch_address),label:e(s)("bank-address"),"background-color":"secondary",name:"bank_address","model-value":e(l).customer_bank_account_branch_address,"onUpdate:modelValue":d[31]||(d[31]=a=>ae("customer_bank_account_branch_address",a))},null,8,["error","success","label","model-value"]),o("p",So,[le(m(e(s)("time-with-bank"))+" ",1),d[38]||(d[38]=o("sup",{class:"required-asterisk"},"*",-1))]),o("div",qo,[c(e(Ue),{id:"finance-app-years-at-bank",name:"customer_bank_account_years_at_bank",error:e(u).customer_bank_account_years_at_bank||e(y).customer_bank_account_years_at_bank||"",success:e(n)(String(e(l).customer_bank_account_years_at_bank),e(u).customer_bank_account_years_at_bank||e(y).customer_bank_account_years_at_bank),label:e(s)("years-with-bank"),"hide-label":!0,"background-color":"secondary",options:e(re),"default-text":e(s)("select-years"),required:!0,"model-value":String(e(l).customer_bank_account_years_at_bank),"onUpdate:modelValue":d[32]||(d[32]=a=>ae("customer_bank_account_years_at_bank",String(a)))},null,8,["error","success","label","options","default-text","model-value"]),c(e(Ue),{id:"finance-app-months-at-bank",name:"customer_bank_account_years_at_bank",error:e(u).customer_bank_account_months_at_bank||e(y).customer_bank_account_months_at_bank||"",success:e(n)(String(e(l).customer_bank_account_months_at_bank),e(u).customer_bank_account_months_at_bank||e(y).customer_bank_account_months_at_bank),label:e(s)("months-with-bank"),"background-color":"secondary",options:e(ue),"default-text":e(s)("select-months"),"hide-label":!0,required:!0,"model-value":String(e(l).customer_bank_account_months_at_bank),"onUpdate:modelValue":d[33]||(d[33]=a=>ae("customer_bank_account_months_at_bank",String(a)))},null,8,["error","success","label","options","default-text","model-value"])]),c(e(Rt),{id:"additional-notes",label:e(s)("additional-notes"),name:"additional_notes",caption:e(s)("please-enter-anything-else"),"background-color":"secondary","model-value":String(e(l).additional_notes),"onUpdate:modelValue":d[34]||(d[34]=a=>ae("additional_notes",a))},null,8,["label","caption","model-value"])])]),c(e(pe),{type:"submit",variant:"primary-solid","width-type":"fill",onClick:xt(Fe,["prevent"])},{default:I(()=>[le(m(e(s)("send-your-application")),1)]),_:1})])],64)):v("",!0)]),_:1})])),c(fe,{name:"fade-in"},{default:I(()=>[e(ge)?(i(),Q(Be,{key:0,class:"success",vehicle:t.vehicle,onBack:d[35]||(d[35]=a=>se("back"))},null,8,["vehicle"])):v("",!0)]),_:1})])],2)}}}),[["__scopeId","data-v-aef2fe1c"]]),jo={class:"ctas"},No={class:"row"},Fo={class:"col-12"},$o={class:"col-12"},Ao=xe(qe({__name:"journey-finance-intermediary",props:{componentName:{default:"journey-finance-intermediary"},vehicle:{default:void 0}},emits:["back","toggle-reserve-form"],setup(t,{emit:G}){const{t:_}=je(),p=G,s=F(()=>_("finance-intermediary-heading")),$=F(()=>_("finance-intermediary-main-text"));return(l,C)=>(i(),g("div",{class:ne([t.componentName])},[c(Yt,{"show-back-button":!1,"sub-heading":e(s),"main-text":e($)},null,8,["sub-heading","main-text"]),o("div",jo,[o("div",No,[o("div",Fo,[c(e(pe),{"width-type":"fill",title:e(_)("cancel"),variant:"primary-solid",onClick:C[0]||(C[0]=h=>p("toggle-reserve-form"))},{default:I(()=>[le(m(e(_)("reserve")),1)]),_:1},8,["title"])]),o("div",$o,[c(e(pe),{class:"cta-back","width-type":"fill",title:e(_)("cancel"),variant:"hyperlink",onClick:C[1]||(C[1]=h=>p("back"))},{default:I(()=>[le(m(e(_)("return-to-vehicle-summary")),1)]),_:1},8,["title"])])])])],2))}}),[["__scopeId","data-v-18448c3a"]]),Uo={class:"row"},Do={class:"col-12"},Eo={class:"text-primary"},Vo={class:"col-12"},Co={key:1,class:"loader-container"},Io={key:0,class:"finance-application-form"},Oo={key:"step-1-header"},To={class:"section-header"},Bo={class:"question"},Lo={class:"step-content"},Po={class:"step-header"},Ho={class:"sub"},Ro={class:"sub"},Mo={class:"estimated-time"},Jo={class:"form-section-heading"},Yo={class:"question-container border-bottom"},Go={class:"short-input"},Wo={class:"col-12"},zo={class:"question-container border-bottom"},Qo={key:0,id:"finance-plugin",class:"finance-plugin"},Ko=xe(qe({__name:"journey-codeweavers-application",props:{componentName:{default:"journey-codeweavers-application"},vehicle:{}},emits:["back","scroll-to","setActiveJourney","finance-changed","setOrder","form-submitted"],setup(t,{emit:G}){const _=$e({loader:()=>Ae(()=>import("./CgR5oH26.js"),__vite__mapDeps([6,7,1]),import.meta.url)}),p=$e(()=>Ae(()=>import("./C25kqpX7.js"),__vite__mapDeps([2,1]),import.meta.url)),s=$e(()=>Ae(()=>import("./C_CL4Z4N.js"),__vite__mapDeps([3,1,4]),import.meta.url)),$=t,{formatPriceTrimZero:l}=qt(),{fireGtmEvent:C}=at(),{inlineFieldErrors:h,debouncedValidateSingleField:R,getTouchedState:r}=it(),A=Ye(),{dealStackerConfig:b}=Ge(A),U=J({}),x=J({}),T=F(()=>({...U.value,...x.value})),{t:u}=je(),{activeFinance:f,dealStackerFormData:n,initialiseFinanceApplication:S,isDealLoading:j,setLoadingState:B,updateDeal:V,updateDealStackerFormData:k}=Me(),{dealStackerDealItems:ee,updateDealStackerDealItems:Z}=Je(),{FinanceApplicationStep1Schema:z}=ut(),ue=G,re=J(1),de=J(null),me=J(!1),L=J(null),se=J(null),K=J(null),E=J(!1),y=J(!1),P=J(!1),ge=J(!1),ye=J(!1),ce=J(null),ie=F(()=>$.vehicle&&ke($.vehicle)?$.vehicle.site.cw_dealer_id:null),_e=F(()=>{try{return f?f.value.QuoteReference??null:null}catch{return null}}),Ne=F(()=>{const H=n.value;return!(H.customer_title&&H.customer_first_name&&H.customer_last_name&&H.customer_email&&H.customer_telep
2hone&&H.terms_accepted)}),he=async()=>{if(!(j.value||P.value)&&(H=>{P.value=!0,U.value={};const D=H.safeParse(n.value);if(!D.success){const a={};for(const q of D.error.issues)a[q.path.join(".")]=q.message;return U.value=a,P.value=!1,!1}return P.value=!1,!0})(z)){P.value=!0,x.value={};try{n.value.guid?re.value++:(B(!0),await async function(){var q;if(!W.value)return void Ce("Missing dealer key or quote reference for Codeweavers finance application","Codeweavers finance application",!0);const H=X.value?"":ie.value,D={api_key:(b==null?void 0:b.value.codeweavers_api_key)||"",organisation_identifier:{Type:"AssociatedDealerKey",Value:H},quote_reference:_e.value||((q=f==null?void 0:f.value.QuoteActions)==null?void 0:q.Apply)||"",...n.value.guid?{invoice_guid:n.value.guid}:{},...n.value},a=await S(D,ee.value,$.vehicle);try{se.value=a.ProposalReference,de.value=a.SessionToken,L.value=a.UserToken,k({finance_proposal_reference:a.ProposalReference,finance_session_token:a.SessionToken,finance_user_token:a.UserToken,guid:a.Order.guid,order:a.Order.guid});const oe=ot(n.value,rt("targeting"));C("dealstacker_monthly_finance_details",oe?{enhanced_conversion_data:oe}:{}),function(){var O;const te=document.createElement("script");te.async=!0,te.onload=Ee,te.src=((O=b.value)==null?void 0:O.codeweavers_script_url)||"https://forms.codeweavers.app/plugin/v1/main.min.js",document.head.appendChild(te)}(),he()}catch(oe){Ce(oe)}}().then(()=>{re.value++}).catch(H=>{throw H}))}catch(H){x.value.createDeal=u("there-was-an-error-creating-your-deal"),Ce(H)}finally{B(!1),P.value=!1,ue("scroll-to")}}},X=F(()=>b==null?void 0:b.value.allow_blank_dealer_key);function N(){U.value={},x.value={}}const W=F(()=>(ie.value||X.value)&&_e.value&&(b==null?void 0:b.value.codeweavers_api_key));function Ee(){var H;if(window&&"codeweavers"in window){const D=window.codeweavers;if(!((H=D==null?void 0:D.forms)!=null&&H.main))return void Ce("Codeweavers forms not loaded yet");D.forms.main({formType:"CustomerFinanceApplication",pluginContentDivId:"finance-plugin",sessionToken:de.value,proposalReference:se.value,developerMode:!0,OrganisationIdentifier:{Type:"AssociatedDealerKey",Value:ie.value},onDomainEvent:M,onUserEvent:M})}}const Fe=F(()=>ke($.vehicle)?$.vehicle.site.id:"default"),Ie=()=>{ce.value="failure",ye.value=!0};async function ae(){const H=(b==null?void 0:b.value.default_checkout_type)||"OUTRIGHT_DEPOSIT",D={payment_type:H};ee.value.pay_in_full===!1&&(Number.parseInt(String(ee==null?void 0:ee.value.deposit_fee)),D.payment_type="OUTRIGHT_DEPOSIT"),Z(D),k({payment_type:H}),ge.value=!0,ue("scroll-to")}async function M(H,D){switch(H){case"form.reference":K.value=D;break;case"form.successful-submission":D&&(re.value++,me.value=!0,E.value=!0,y.value=!0,C("dealstacker_monthly_finance_application_success"),ue("form-submitted"),ue("scroll-to"))}}const d=(H,D)=>{k({[H]:D}),U.value={},R(H,D)};return(H,D)=>(i(),g("article",{class:ne(t.componentName)},[Object.keys(e(T)).length&&!e(j)?(i(),Q(e(p),{key:0,"heading-text":e(u)("error-occurred"),"show-heading":!1,onGoBack:N},{default:I(()=>[c(e(We),{"show-heading":!1,variant:"error","prepend-icon-type":e(De).Icon.NotificationsError},{default:I(()=>[o("div",Uo,[o("div",Do,[o("p",Eo,m(e(u)("error-occurred-please-review-submission")),1)]),o("div",Vo,[o("ul",null,[(i(!0),g(we,null,Te(e(T),(a,q)=>(i(),g("li",{key:q},[o("p",null,m(a),1)]))),128))])])])]),_:1},8,["prepend-icon-type"])]),_:1},8,["heading-text"])):v("",!0),e(P)&&!e(j)?(i(),g("div",Co,[c(e(Gt))])):v("",!0),e(P)?v("",!0):(i(),Q(fe,{key:2,name:"fade-in"},{default:I(()=>[e(re)!==1||e(me)?v("",!0):He((i(),g("div",Io,[o("section",Oo,[o("header",To,[o("span",Bo,[c(e(Qe),{icon:e(De).Icon.LightQuestion},null,8,["icon"])]),o("div",Lo,[o("div",Po,[o("p",Ho,[o("b",null,m(e(u)("your-finance-application")),1)]),o("p",Ro,m(e(u)("step",{step:e(re),total_steps:2})),1)]),o("p",null,m(e(u)("please-answer-a-few-questions-finance-header")),1),o("small",Mo,[o("i",null,m(e(u)("estimated-time",{time:3})),1)])])])]),o("form",{key:"step-1-form",class:"deal-stacker-form row",onSubmit:xt(he,["prevent"])},[o("h2",Jo,m(e(u)("personal-details")),1),o("h3",null,m(e(u)("about-you")),1),o("fieldset",Yo,[o("div",Go,[c(e(Ue),{id:"title",name:"customer_title",error:e(h).customer_title||e(U).customer_title||"",success:e(r)(e(n).customer_title,e(h).customer_title||e(U).customer_title),label:e(u)("title"),"background-color":"secondary",options:[{label:e(u)("mr"),value:"mr"},{label:e(u)("mrs"),value:"mrs"},{label:e(u)("miss"),value:"miss"},{label:e(u)("ms"),value:"ms"}],required:"","model-value":e(n).customer_title,"onUpdate:modelValue":D[0]||(D[0]=a=>d("customer_title",String(a)))},null,8,["error","success","label","options","model-value"])]),c(e(ve),{id:"forename",error:e(h).customer_first_name||e(U).customer_first_name||"",success:e(r)(e(n).customer_first_name,e(h).customer_first_name||e(U).customer_first_name),label:e(u)("first-name"),"background-color":"secondary",name:"forename",required:"","model-value":e(n).customer_first_name,"onUpdate:modelValue":D[1]||(D[1]=a=>d("customer_first_name",a))},null,8,["error","success","label","model-value"]),c(e(ve),{id:"surname",error:e(h).customer_last_name||e(U).customer_last_name||"",success:e(r)(e(n).customer_last_name,e(h).customer_last_name||e(U).customer_last_name),label:e(u)("last-name"),"background-color":"secondary",name:"surname",required:"","model-value":e(n).customer_last_name,"onUpdate:modelValue":D[2]||(D[2]=a=>d("customer_last_name",a))},null,8,["error","success","label","model-value"])]),o("div",Wo,[o("h3",null,m(e(u)("how-can-we-contact-you")),1)]),o("fieldset",zo,[c(e(lt),{id:"customer-email",error:e(h).customer_email||e(U).customer_email||"",success:e(r)(e(n).customer_email,e(h).customer_email||e(U).customer_email),label:e(u)("email-address"),name:"customer_email","background-color":"secondary",required:"","model-value":e(n).customer_email,"onUpdate:modelValue":D[3]||(D[3]=a=>d("customer_email",a))},null,8,["error","success","label","model-value"]),c(e(nt),{id:"customer-phone",error:e(h).customer_telep
2hone||e(U).customer_telephone||"",success:e(r)(e(n).customer_telephone,e(h).customer_telephone||e(U).customer_telephone),label:e(u)("contact-number"),"background-color":"secondary",name:"customer_telephone",required:"","model-value":e(n).customer_telephone,"onUpdate:modelValue":D[4]||(D[4]=a=>d("customer_telephone",a))},null,8,["error","success","label","model-value"])]),c(e(ct),{id:"terms-checkbox",label:e(u)("terms-and-conditions"),error:e(h).terms_accepted||e(U).terms_accepted||"",success:e(r)(e(n).terms_accepted,e(h).terms_accepted||e(U).terms_accepted),name:"terms-checkbox",required:"",checked:!1,"is-link":!0,"model-value":e(n).terms_accepted,"onUpdate:modelValue":D[5]||(D[5]=a=>d("terms_accepted",a))},null,8,["label","error","success","model-value"]),c(e(pe),{type:"button",variant:"primary-solid","width-type":"fill",disabled:e(Ne)||e(j)||e(P),onClick:he},{default:I(()=>[le(m(e(u)("continue")),1)]),_:1},8,["disabled"]),c(e(Nt),{text:e(u)("or"),"line-colour":"var(--border)","margin-size":"none"},null,8,["text"]),c(e(pe),{type:"button",variant:"reserve","icon-type":e(De).Icon.Lock,"icon-position":"prepend","width-type":"fill",onClick:D[6]||(D[6]=a=>ue("setActiveJourney","step-checkout-form"))},{default:I(()=>[le(m(e(u)("reserve-for"))+" "+m(e(l)(String(e(ee).deposit_fee))),1)]),_:1},8,["icon-type"]),c(e(_))],32)],512)),[[Re,!e(j)]])]),_:1})),c(fe,{name:"fade-in"},{default:I(()=>[e(n).terms_accepted&&e(re)===2&&!e(me)?(i(),g("div",Qo)):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(ge)&&!e(ye)?(i(),Q(e(s),{key:0,"allow-full-payment-switch":!0,"dealership-id":e(Fe),vehicle:t.vehicle,onSuccessfulPayment:D[7]||(D[7]=a=>(async q=>{ce.value="success",ye.value=!0,Z({payment_response:q}),await V(n.value,ee.value,$.vehicle,!0).then(()=>{me.value=!0,E.value=!0,y.value=!0,re.value=3,ue("form-submitted")}).catch(oe=>{x.value.completeDeal=u("there-was-an-error-creating-your-deal"),Ce(oe)}).finally(()=>{setTimeout(()=>{window==null||window.location.reload()},250)})})(a)),onFailedPayment:Ie,onBack:D[8]||(D[8]=a=>ue("back"))},null,8,["dealership-id","vehicle"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(me)&&e(re)===3&&!e(ge)?(i(),Q(Ao,{key:0,class:"intermediary",vehicle:t.vehicle,onBack:D[9]||(D[9]=a=>ue("back")),onToggleReserveForm:ae},null,8,["vehicle"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(ce)==="success"&&e(ye)?(i(),Q(Be,{key:0,class:ne(e(ce)),status:"reservation-success",vehicle:t.vehicle,onBack:D[10]||(D[10]=a=>ue("back"))},null,8,["class","vehicle"])):v("",!0)]),_:1}),c(fe,{name:"fade-in"},{default:I(()=>[e(ce)==="failure"&&e(ye)?(i(),Q(Be,{key:0,class:ne(e(ce)),status:"reservation-failure",vehicle:t.vehicle,onBack:D[11]||(D[11]=a=>ue("back"))},null,8,["class","vehicle"])):v("",!0)]),_:1})],2))}}),[["__scopeId","data-v-b30007b2"]]),Zo={key:1,class:"header-container__left"},Xo={class:"test-variant-subtitle"},er={key:3},tr={key:1,class:"heading-separator"},ar=xe(qe({__name:"journey-wrapper",props:{componentName:{default:"journey-wrapper"},buttonLabel:{default:void 0},activeJourney:{},vehicle:{},isAvailable:{type:Boolean,default:void 0},isOpen:{type:Boolean,default:!0}},emits:["back","scroll-to","form-submitted","set-active-journey"],setup(t,{emit:G}){var ye,ce,ie,_e,Ne,he;const{t:_}=je(),{Breakpoint:p}=It(),s=p.smallerOrEqual("medium"),$=p.smaller("large"),l=Ye(),{dealStackerConfig:C,dealStackerComponentList:h,siteConfig:R}=Ge(l),{isExperimentActive:r,isTestVariant:A}=zt(),b=F(()=>{var X;return $.value&&(!!((X=C.value)!=null&&X.new_form_styles)||r.value&&A.value)}),{isDealLoading:U,dealStackerFormData:x,updateDealStackerFormData:T}=Me(),{dealStackerDealItems:u,updateDealStackerDealItems:f}=Je(),n=t,S=F(()=>{var X;return String(h==null?void 0:h.value.finance_application_provider_codeweavers)&&((X=C==null?void 0:C.value)==null?void 0:X.codeweavers_api_key)}),j=F(()=>String(h==null?void 0:h.value.finance_application_provider_autoconvert)&&!S.value),B=F(()=>n.buttonLabel??_("back")),V=["step-enquiry-form","step-test-drive-form"],k=G,ee=J(!1);function Z(X){b.value&&(ee.value=!0),k("form-submitted",X)}function z(X){if(n.activeJourney==="step-reserve-form"){const W={paymentMethod:"cash",payment_type:u.value.pay_in_full?"OUTRIGHT_FULL":"OUTRIGHT_DEPOSIT"};f(W),T({customer_first_name:"",customer_last_name:"",customer_current_address:{...x.value.customer_current_address,line_1:"",town:"",postcode:""}
2,customer_email:"",customer_telephone:"",preferred_branch:"",opt_in:{},terms_accepted:!1})}n.activeJourney==="step-checkout-form"&&T({customer_title:"",customer_first_name:"",customer_last_name:"",customer_current_address:{...x.value.customer_current_address,line_1:"",town:"",postcode:""},customer_email:"",customer_telephone:"",opt_in:{},terms_accepted:!1});const N=!!b.value||(X==null?void 0:X.shouldClose);k("back",{shouldClose:N}),s.value||k("scroll-to")}const ue=F(()=>(u.value.canOrder!==!1||n.activeJourney!=="step-enquiry-form")&&(Ke(n.vehicle)?n.isAvailable===!0&&V.includes(n.activeJourney):!["step-reserve-form","step-checkout-form"].includes(n.activeJourney))),re=F(()=>Ot(n.vehicle,{useRangeOnly:!0})),de={"step-reserve-form":{title:`${_("reserve-this")} ${(ye=n.vehicle)==null?void 0:ye.make} ${re.value}`,copy:"reserve-copy"},"step-checkout-form":{title:u.value.pay_in_full&&u.value.payment_type==="OUTRIGHT_FULL"?`${_("buy-this")} ${(ce=n.vehicle)==null?void 0:ce.make} ${re.value}`:`${_("reserve-this")} ${(ie=n.vehicle)==null?void 0:ie.make} ${re.value}`,copy:"checkout-copy"},"step-test-drive-form":{title:_("request-a-test-drive"),copy:"test-drive-copy"},"step-enquiry-form":{title:(Ne=(_e=R.value)==null?void 0:_e.vdp_config)!=null&&Ne.sold_vehicle_replace_contact_us_text&&((he=n.vehicle)==null?void 0:he.status)==="SOLD"?_("contact-us-for-similar-options"):`${_("contact-us")} ${_("about-this")} ${n.vehicle.make} ${re.value}`,copy:"enquiry-copy"},"step-finance-application":{title:"finance-title",copy:"finance-copy"}},me=F(()=>{var X;return((X=de[n.activeJourney])==null?void 0:X.title)||"reserve-title"}),L=J(null),se=["step-test-drive-form","step-reserve-form","step-enquiry-form","step-checkout-form"];let K=null,E=null;function y(){K==null||K.disconnect(),K=null,E&&(clearTimeout(E),E=null)}function P(){if(!b.value||!n.isOpen)return;y();function X(){if(!n.isOpen)return!1;const N=document.querySelector('.exp-form-test input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]), .exp-form-test textarea');return!!N&&(N.focus(),document.activeElement===N)}X()||(K=new MutationObserver(()=>{X()&&y()}),K.observe(document.body,{childList:!0,subtree:!0,attributes:!0}),E=setTimeout(y,6e3))}Tt(y),dt([()=>n.activeJourney,b],([X,N])=>{ee.value=!1,N&&se.includes(X)&&P()},{immediate:!0});const ge=F(()=>{switch(n.activeJourney){case"step-test-drive-form":return _("test-drive");case"step-enquiry-form":return _("general-enquiry");case"step-reserve-form":return _("reserve");case"step-checkout-form":return _("checkout");default:return""}});return(X,N)=>(i(),g("div",{ref_key:"wrapperEl",ref:L,class:ne([t.componentName,{"remove-border":e(Ke)(t.vehicle)||e(Ze)(t.vehicle)||t.isAvailable===!1,"exp-form-test":e(b)}])},[e(U)||e(b)&&e(ee)?v("",!0):(i(),g("div",{key:e(me),class:ne(["header-container",{"header-container--experiment":e(b)}])},[e(ue)&&!e(b)?(i(),Q(e(Wt),{key:0,"f-button-props-passthrough":{textAlign:"left"},label:e(B),"font-size":"sub",onBack:z},null,8,["label"])):v("",!0),e(b)?(i(),g("div",Zo,[o("p",Xo,m(e(_)("you-selected"))+" "+m(e(ge)),1),o("h3",null,m(e(_)("please-confirm-your-details")),1)])):v("",!0),e(b)?(i(),Q(e(pe),{key:2,variant:"hyperlink","padding-size":"none",type:"button",class:"header-container__cancel",onClick:N[0]||(N[0]=W=>z({shouldClose:!0}))},{default:I(()=>[le(m(e(_)("cancel")),1)]),_:1})):v("",!0),e(b)?v("",!0):(i(),g("h3",er,m(e(_)(e(me))),1))],2)),e(U)||e(b)?v("",!0):(i(),g("div",tr)),c(fe,{name:"fade-in",onAfterEnter:P},{default:I(()=>[t.activeJourney==="step-reserve-form"?(i(),Q(Ea,{key:0,vehicle:t.vehicle,"has-new-form-styles":e(b),onBack:N[1]||(N[1]=W=>z(W)),onFormSubmitted:N[2]||(N[2]=W=>Z("reserve")),onScrollTo:N[3]||(N[3]=W=>k("scroll-to")),onToggleEnquiryForm:N[4]||(N[4]=W=>k("set-active-journey","step-enquiry-form"))},null,8,["vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in",onAfterEnter:P},{default:I(()=>[t.activeJourney==="step-test-drive-form"?(i(),Q(Va,{key:0,vehicle:t.vehicle,"has-new-form-styles":e(b),onBack:N[5]||(N[5]=W=>z(W)),onScrollTo:N[6]||(N[6]=W=>k("scroll-to")),onFormSubmitted:N[7]||(N[7]=W=>Z("test-drive")),onClose:N[8]||(N[8]=W=>z({shouldClose:!0}))},null,8,["vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in",onAfterEnter:P},{default:I(()=>[t.activeJourney==="step-enquiry-form"?(i(),Q(ba,{key:0,vehicle:t.vehicle,"has-new-form-styles":e(b),onBack:N[9]||(N[9]=W=>z(W)),onFormSubmitted:N[10]||(N[10]=W=>Z("enquiry")),onScrollTo:N[11]||(N[11]=W=>k("scroll-to")),onClose:N[12]||(N[12]=W=>z({shouldClose:!0}))},null,8,["vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(fe,{name:"fade-in",onAfterEnter:P},{default:I(()=>[t.activeJourney==="step-checkout-form"?(i(),Q(_a,{key:0,vehicle:t.vehicle,"has-new-form-styles":e(b),onBack:N[13]||(N[13]=W=>z(W)),onFormSubmitted:N[14]||(N[14]=W=>Z("checkout")),onScrollTo:N[15]||(N[15]=W=>k("scroll-to"))},null,8,["vehicle","has-new-form-styles"])):v("",!0)]),_:1}),c(et,{name:"fade-in"},{default:I(()=>[t.activeJourney==="step-finance-application"?(i(),g(we,{key:0},[e(j)?(i(),Q(xo,{key:"auto-convert-application",vehicle:t.vehicle,onBack:z,onFormSubmitted:N[16]||(N[16]=W=>k("form-submitted","finance")),onScrollTo:N[17]||(N[17]=W=>k("scroll-to")),onSetActiveJourney:N[18]||(N[18]=W=>k("set-active-journey",W))},null,8,["vehicle"])):v("",!0),e(S)?(i(),Q(Ko,{key:"codeweavers-application",vehicle:t.vehicle,onBack:z,onFormSubmitted:N[19]||(N[19]=W=>k("form-submitted","finance")),onScrollTo:N[20]||(N[20]=W=>k("scroll-to")),onSetActiveJourney:N[21]||(N[21]=W=>k("set-active-journey",W))},null,8,["vehicle"])):v("",!0)],64)):v("",!0)]),_:1})],2))}}),[["__scopeId","data-v-835b30ca"]]),jr=Object.freeze(Object.defineProperty({__proto__:null,default:ar},Symbol.toStringTag,{value:"Module"}));
2export{Sr as a,qr as b,pa as c,xr as g,jr as j};
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.