(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5759],{11417:function(e,t,i){"use strict";i.d(t,{Z:function(){return C}});var a=i(85893),r=i(67294),s=i(87536),n=i(39332),l=i(1557),c=i(27763),d=i(39521),o=i(70656),h=i(39870),m=i(79936),u=i(41132),x=i(59419),p=i(13215),g=i(94605),f=i(69741);let _=e=>{let{title:t,text:i,Icon:r,wrapperClassName:s,dark:n}=e;return(0,a.jsxs)("div",{className:"d-flex "+s,children:[(0,a.jsx)(r,{className:"text-primary mr-3",size:25,style:{minWidth:"10%"}}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:(0,u.cn)("m-0",g.okV?"text-white":"text-primary"),children:t}),(0,a.jsx)("span",{className:n?"text-white-50":"text-muted",children:i})]})]})},w={1:{Icon:p.wO,text:g.yZH?"Apply online in minutes!":"Apply online in 5 minutes!"},2:{Icon:p.fSQ,text:"Get ".concat((0,h.NM)("pre-approved").toLowerCase()," with your own personalised finance rate")},3:{Icon:p.BYR,text:g.yZH?"Purchase your dream asset":g.okV?"Purchase your off road camper":"Purchase your dream car"}};var y=e=>{let{dark:t}=e;if(c.Z.financePageHideRightSteps||(0,h.hF)())return null;let i=(0,f.R)(w).map(e=>{let t="STEP ".concat(e);return c.Z.finance.customSteps&&c.Z.finance.customSteps[e]?{...c.Z.finance.customSteps[e],title:t}:{...w[e],title:t}});return(0,a.jsx)("div",{className:(0,u.cn)("rounded p-4 d-none d-lg-block",t?"bg-dark border":"bg-white"),children:i.map((e,r)=>(0,a.jsx)(_,{title:e.title,wrapperClassName:(0,u.cn)(r<i.length-1&&"mb-3"),Icon:e.Icon,text:e.text,dark:t},"Car-Step-".concat(r)))})},b=i(25383),j=i.n(b);let k=e=>{let{children:t,dark:i}=e;return(0,a.jsx)("div",{className:(0,u.cn)(j().Column,"col-md-6 col-lg-4 mb-3 mb-lg-0 order-1 order-lg-2"),children:(0,a.jsx)("div",{className:j().sticky,children:(0,a.jsx)(d.Zb,{className:(0,u.cn)(j().carCard,"mb-3",i?" border bg-dark":" box-shadow bg-white"),children:t})})})},v=e=>{let{car:t}=e,{setValue:i}=(0,s.Gc)();return(0,r.useEffect)(()=>{i("car_year",t.year),i("car_description","".concat(t.make," ").concat(t.model))},[t,i]),(0,a.jsx)("div",{className:"d-none"})},N=e=>{let{carId:t,dark:i,isTaurus:s,subscription:n}=e,c=(0,r.use)((0,x.VX)(t));return c?(0,a.jsxs)(k,{dark:i,children:[(0,a.jsx)(m.Z,{href:"/cars/"+c.slug,className:"unstyled position-relative mb-2",children:(0,a.jsx)(d.xu,{src:c.primary_image_url,height:400,width:600,alt:c.name,unoptimized:!0})}),(0,a.jsxs)(d.Ol,{className:"py-0 my-2",children:[(0,a.jsx)(d.ll,{className:(0,u.cn)(i&&"text-white"),children:c.name}),(0,a.jsx)("h5",{className:"mb-0 font-weight-bold",children:(0,a.jsx)(l.VP,{car:c})}),(0,a.jsx)(d.SZ,{className:(0,u.cn)(i?"text-white-50":"text-muted","mb-2"),children:n?"/week":c.price_type})]}),s&&(0,a.jsx)(v,{car:c})]}):null};var C=e=>{let{hideCta:t=!1,subscription:i=!1}=e,s=(0,n.useSearchParams)(),l=c.Z.darkMode,m=s.get("car_id");return((null==m?void 0:m.includes("?"))&&(m=m.split("?")[0]),m)?(0,a.jsx)(r.Suspense,{fallback:(0,a.jsxs)(k,{dark:l,children:[(0,a.jsxs)("div",{className:"position-relative",children:[(0,a.jsx)(o.O,{className:"w-full",style:{height:300}}),(0,a.jsx)("div",{className:j().FavouriteSkeleton,children:(0,a.jsx)(o.O,{className:j().switch})})]}),(0,a.jsxs)(d.Ol,{children:[(0,a.jsx)(d.ll,{children:(0,a.jsx)(o.O,{style:{height:"2rem",width:"15rem"}})}),(0,a.jsx)(o.O,{style:{height:"1rem",width:"9rem"}})]})]}),children:(0,a.jsx)(N,{carId:m,dark:l,subscription:i})}):t||(0,h.hF)()?null:(0,a.jsx)(k,{dark:l,children:(0,a.jsx)(y,{dark:l})})}},75759:function(e,t,i){"use strict";i.d(t,{Y:function(){return m},s:function(){return u}});var a=i(85893),r=i(67294),s=i(27763),n=i(39521),l=i(41132),c=i(94605),d=i(11417),o=i(11037),h=i.n(o);let m=e=>{let{children:t,bg:i=s.Z.darkMode?"bg-dark":"bg-light"}=e;return(0,a.jsx)("div",{className:(0,l.cn)(h().OverflowHiddenSm,i,c.$_Y&&h().CasboltsMotorcyclesBg,c.mCK&&h().RightChoiceAutoBG),children:(0,a.jsx)("div",{className:(0,l.cn)("container py-5",c.mCK&&"bg-white"),children:(0,a.jsx)("div",{className:"row justify-content-center",children:t})})})},u=e=>{let{children:t,noCard:i=!1,hideCta:c,subscription:o}=e,h=!s.Z.halfDarkMode&&s.Z.darkMode;return(0,a.jsxs)(m,{children:[(0,a.jsx)("div",{id:"finance-form",className:"col-lg-8 order-2 order-lg-1",children:i?t:(0,a.jsx)(n.Zb,{children:(0,a.jsx)(n.aY,{className:(0,l.cn)("pt-4",h?"bg-dark border":"bg-white"),children:t})})}),(0,a.jsx)(r.Suspense,{fallback:null,children:(0,a.jsx)(d.Z,{hideCta:s.Z.financePageHideRightSteps||c,subscription:o})})]})}},59419:function(e,t,i){"use strict";i.d(t,{VX:function(){return g},bX:function(){return p},sY:function(){return x},A:function(){return m},HQ:function(){return u}});var a=i(83346);i(94605);var r=i(41132);let s={status:"status",badge:"badge",car_type:"car_type",categories:"categories",city:"city",colour:"colour",dealership_name:"dealership_name",filtered_features:"filtered_features",item_type:"item_type",km:"km",location_name:"location_name",make:"make",make_model:"make_model",model:"model",price:"price",price_range:"price_range",subscription_price:"subscription_price",seats:"seats",simple_body:"body",simple_drive:"drive",simple_fuel:"fuel",simple_transmission:"transmission",state:"state",tag:"tag",weekly_price_range:"weekly_price_range",year:"year"},n=(0,r.RR)(s);(0,r.Cg)(s);let l={"manufacturer.name":"make","model.name":"model","model.body":"body"};async function c(e){return await x({...e,indexUid:a.Bq,facets:n})}(0,r.RR)(l),(0,r.Cg)(l),[...(0,r.KX)(s),...(0,r.KX)(s)];var d=i(37496),o=i(69741);"".concat(a.Bq,":").concat("created_at_timestamp:desc");let h=(0,r.S)(["(".concat(d.default.search_filters,")"),"(status=in_stock OR status=coming_soon OR sold_date_timestamp>".concat(new Date(Date.now()-2592e5).getTime()/1e3,") AND show_on_dealer_website:true"),(0,r.e2)(null===d.default||void 0===d.default?void 0:d.default.manufacturer)].filter(e=>e).join(" AND ")),m={Authorization:"Bearer ".concat(a.AK),"Content-Type":"application/json"},u="".concat(a.gk,"multi-search");async function x(e){let{filters:t={},facetKeys:i=[],query:a="",limit:s=100,offset:n=0,sort:l=[],search_filters:c,indexUid:d,facets:h,customUrl:x,customHeaders:p}=e,g=[],f=i.length>0?i:(0,o.R)(t);f.forEach(e=>{let i=t[e];if("string"==typeof i)g.push("".concat(e,'="').concat(i,'"'));else if(Array.isArray(i)){let t=[];i.forEach(i=>{i.includes("<")||i.includes(">")?g.push(i):t.push("".concat(e,'="').concat(i,'"'))}),t.length>0&&g.push(t)}}),c&&g.push(c);let _={indexUid:d,facets:h,attributesToHighlight:["*"],highlightPreTag:"<ais-highlight-0000000000>",highlightPostTag:"</ais-highlight-0000000000>",limit:s,offset:n,filter:g,sort:l.length>0?l:[],q:a},w=f.map(e=>({..._,limit:1,offset:0,facets:[e],filter:g.filter(t=>{var i;return t===c||("string"==typeof t?!(null==t?void 0:t.includes(e)):!(null===(i=t[0])||void 0===i?void 0:i.includes(e)))})})),y={queries:[_,...w]},b=await fetch(null!=x?x:u,{method:"POST",headers:null!=p?p:m,body:JSON.stringify(y)});return await (0,r.pd)(b)}async function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t="".concat(a.gk,"multi-search"),i=await fetch(t,{method:"POST",headers:m,body:JSON.stringify({queries:[{indexUid:"Car_production",facets:n,attributesToHighlight:["*"],highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__",filter:[e],limit:1,sort:[]}]})});return await (0,r.pd)(i)}let g=async e=>{var t;let i=await c({search_filters:d.default.search_filters+" AND id=".concat(e),limit:1});return(null==i?void 0:i.results)?null==i?void 0:null===(t=i.results[0])||void 0===t?void 0:t.hits[0]:null}},25383:function(e){e.exports={xs:"min-width: 400px",sm:"min-width: 576px","sm-down":"max-width: 576px",md:"min-width: 768px","md-down":"max-width: 768px",lg:"min-width: 992px","lg-down":"max-width: 992px",xl:"min-width: 1200px","xl-down":"max-width: 1200px",xxl:"min-width: 1400px",Column:"CarSidebar_Column__0qBDQ",sticky:"CarSidebar_sticky__aL_71",carCard:"CarSidebar_carCard__DiIf8"}},11037:function(e){e.exports={xs:"min-width: 400px",sm:"min-width: 576px","sm-down":"max-width: 576px",md:"min-width: 768px","md-down":"max-width: 768px",lg:"min-width: 992px","lg-down":"max-width: 992px",xl:"min-width: 1200px","xl-down":"max-width: 1200px",xxl:"min-width: 1400px",OverflowHiddenSm:"FormContainer_OverflowHiddenSm__Vh7M5",RightChoiceAutoBG:"FormContainer_RightChoiceAutoBG__2Yeob",CasboltsMotorcyclesBg:"FormContainer_CasboltsMotorcyclesBg__6off6"}}}]);