PageSourceSearch

https://brand142-jaecoo-moss-vale.netlify.app/2019-8e8287f91a9fa02f97c1.js

js brand142-jaecoo-moss-vale.netlify.app collected 2026-10-03 10:33:25 UTC 14,994 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2019],{2019:function(e,o,t){t.r(o),t.d(o,{FormBookTestDrive:function(){return oe}});var a=t(68102),r=t(94300),s=t(63696),i=t(23224),n=t(51149),l=t(21698),d=t(10898),c=t(72407),m=t(74459),u=t(17972),p=t(97074),g=t(38991),h=t(2290),f=t(74447),v=t(79124),T=t(84741),b=t(51089),C=t(13276),S=t(79511),y=t(6095),I=t(8593),k=t(40675),M=t(34995),D=t(95766),x=t(52466),L=t(65788),N=t(89941),F=t(90287),Y=t(50213),B=t(3974);const P=(e,o)=>{const t=(0,Y.v)(),a=(0,B.j)(),{testDriveBookingDaysInAdvance:r}=a.bookingSettings||{},{0:i,1:n}=(0,s.useState)(null),{0:l,1:c}=(0,s.useState)(null),{0:m,1:u}=(0,s.useState)(""),{0:p,1:g}=(0,s.useState)({openTime:"",closeTime:""}),h=t.find((e=>e.info.isPrimary)),f=t.filter((e=>e.departments.some((e=>"Sales"===e.departmentType)))),{location:v}=e||{},{id:T,name:b}=v||{},C=!!(v&&T&&b),S=!C&&(0,d.uG)(f),y=!C&&!S&&!!h,I=!C&&!S&&!y&&(0,d.uG)(t),k=(0,F.U5)(C?[{info:{id:T,name:b}}]:S?f:y?[h]:I?t:[]),M=S?k.map((e=>Object.assign({},e,{text:e.text+" (Sales Department)"}))):k,{operatingWeek:D,operatingWeekExceptions:x}=i||{},{isOpenSunday:P,isOpenMonday:w,isOpenTuesday:A,isOpenWednesday:O,isOpenThursday:R,isOpenFriday:G,isOpenSaturday:H,openTimeSunday:q,openTimeMonday:E,openTimeTuesday:j,openTimeWednesday:V,openTimeThursday:W,openTimeFriday:_,openTimeSaturday:z,closeTimeSunday:U,closeTimeMonday:K,closeTimeTuesday:$,closeTimeWednesday:J,closeTimeThursday:Q,closeTimeFriday:X,closeTimeSaturday:Z}=D||{},ee=i?[P,w,A,O,R,G,H].map((e=>!!e)):[],oe=i?[q,E,j,V,W,_,z]:[],te=i?[U,K,$,J,Q,X,Z]:[],ae=e=>null==x?void 0:x.find((o=>new Date(o.date+"T00:00:00").getTime()===e.getTime()));return{locationNamesIds:M,datePickerSettings:{filterDate:e=>{const o=ae(e);if(o)return!!o.isOpen;const t=e.getDay();return(0,d.VP)(ee)||ee[t]},minDate:(0,N.fi)(new Date,null!=r?r:1),maxDate:(0,N.PS)(new Date,6),showDisabledMonthNavigation:!0,showTimeSelect:!1,dateFormat:(0,L.q)(o)},preferredDate:l,businessHourOnPreferredDate:p,preferredTime:m,handleLocationChange:o=>{if(C&&n(null==e?void 0:e.location),S){const e=f.find((e=>e.info.id===o)),t=null==e?void 0:e.departments.find((e=>"Sales"===e.departmentType));n(t)}if(y&&n(h),I){const e=t.find((e=>e.info.id===o));n(e)}},handlePreferredDateChange:e=>{c(e),(e=>{if(!e)return void g({openTime:"",closeTime:""});const o=ae(e);g(o?{openTime:o.openTime||"00:00",closeTime:o.closeTime||"23:59"}:{openTime:oe[e.getDay()]||"00:00",closeTime:te[e.getDay()]||"23:59"})})(e),u("")},handlePreferredTimeChange:e=>{"string"==typeof e&&u(e)}}};var w=t(62741),A=t(4740),O=t(41129),R=t(48136),G=t(7226),H=t(37771),q=t(83006),E=t(26443),j=t(78887),V=t(98335),W=t(21072),_=t(53974),z=t(19951),U=t(72418),K=t(32120),$=t(52654),J=t(30913),Q=t(770),X=t(19023),Z=t(4575),ee=t(91785);const oe=e=>{let{closeFormModal:o,formOnModal:t=!1,showLocations:L=!0,formId:N,hideModelList:F=!1,imFormBackgroun
1dWrapperCustom:Y,imFormHeadingCustom:oe,imFormWrapperCustom:te,imFormItemCustom:ae,imFormInputRowCustom:re,stockDetails:se,stockDetailsSlug:ie,preSelectedModel:ne,specialsReferenceCode:le="",specialTitle:de="",specialSlug:ce="",specialId:me="",formHeading:ue="",dealerLocatorId:pe="",dealerLocatorCode:ge="",additionalFormData:he,isStockDetailsDynamic:fe}=e;const{i18n:ve}=(0,i.Bd)(),{addressTypes:Te,formBookTestDrive:be,messages:Ce}=u.U,Se=(0,G.b)(),ye=(0,d.uG)(Se),{siteType:Ie}=(0,B.j)(),ke=Ie===h.D.oem,Me=Ie===h.D.dealer,De=Ie===h.D.group,xe=(m.t.dealerPickerSettings.enabled&&ke||De)&&(null!=L?L:be.isLocations),Le=!t,Ne=Le?V.Y_:E.v,{locationNamesIds:Fe,datePickerSettings:Ye,preferredDate:Be,businessHourOnPreferredDate:Pe,preferredTime:we,handleLocationChange:Ae,handlePreferredDateChange:Oe,handlePreferredTimeChange:Re}=P(se,ve.language),Ge=!!we&&(we<Pe.openTime||we>Pe.closeTime),He=se?"Stock Book a Test Drive Enquiry":"Book a Test Drive Enquiry",qe=ce?(0,k.b)(ce):"",Ee=ie?(0,k.b)(ie):"",{0:je,1:Ve}=(0,s.useState)(""),We=p.ec.FormBookTestDrive,{heading:_e,formShortName:ze}=We,{handleFormOpen:Ue,handleFormInteracted:Ke}=(0,x.Y)(ze),{0:$e,1:Je}=(0,s.useState)({}),{0:Qe,1:Xe}=(0,s.useState)(!1),{0:Ze,1:eo}=(0,s.useState)(!1),oo=Object.assign({},ke&&{addressType:Te.private.value},{comments:""},be.isMarketing&&{marketing:be.isMarketingChecked},be.isTerms&&{terms:be.isTermsChecked}),{0:to,1:ao}=(0,s.useState)(!1),{isDealerPayload:ro,preferredDealerPayload:so}=(0,w.h)(),[io,no]=(0,O.Mj)(f.fD,{}),{0:lo,1:co}=(0,s.useState)(Object.assign({},oo)),{0:mo,1:uo}=(0,s.useState)([]),po=Se.filter((e=>mo.includes(e.displayName))).map((e=>e.vehicleType)),go=e=>{"string"!=typeof e&&(no((o=>Object.assign({},o,e))),Ke())},ho=e=>{"object"==typeof e&&null!==e&&(co(Object.assign({},lo,e)),Ke(),"dealerLocation"in e&&"string"==typeof e.dealerLocation&&(Ae(e.dealerLocation),Oe(null),Re("")))},fo=()=>{const e=Object.assign({formId:parseInt(N,10)},pe&&{dealerLocatorId:pe},ge&&{dealerLocatorCode:ge},{specialsReferenceCode:le,specialTitle:de,specialUrl:qe,specialId:me,firstName:null==io?void 0:io.firstName,lastName:null==io?void 0:io.lastName,phone:null==io?void 0:io.phone,email:null==io?void 0:io.email},ro&&so,(0,d.uG)(mo)&&{vehiclesSelected:mo},(0,d.uG)(po)&&{vehicleType:(0,D.e)(po).join(", ")},be.isPreferredDateTime&&{testDriveDate:(0,I.zU)(Be,ve.language),testDriveTime:(0,I.cj)(we)},se&&{make:se.make,model:se.model,badge:se.variations,year:se.year,stockId:se.id,stockUrl:Ee},lo,he);return(0,n.z)(e,d.Po)},{0:vo,1:To}=(0,s.useState)(!1),bo=()=>{Le?To(!1):null==o||o(),eo(!1),uo([]),co(Object.assign({},oo)),Oe(null)},Co=(0,y._)(mo,", "),So={componentName:g.k$.form,dealerName:null==so?void 0:so.dealerName,modelName:Co},{handleSubmitWithReCaptcha:yo,recaptchaReady:Io,isLoading:ko}=(0,A.T)({handleSubmit:async()=>{await(0,C.M)(io,no),(0,v.$)("Hard Lead",He),(0,M.t)({formId:parseInt(N,10),formShortName:ze,variableData:So}),(0,S.JP)(se),se&&(0,S.tZ)(se),Le?To(!0):ao(!0)},errors:$e,setFormErrorStatus:Xe,setSubmitted:eo});(0,s.useEffect)((()=>{(0,s.startTransition)((()=>{Ve((0,l.A)()),Me&&1===Fe.length&&ho({dealerLocation:Fe[0].value})}))}),[]);const Mo=(0,R.S)((()=>{(0,b.Q)({eventName:c.R.formOpen,eventInfo:{form_name:ze,form_category:"lead_aftersales",form_type:t?"modal":"embedded",form_step_name:"start",form_step_number:"step-0"}}),Ue()}));return(0,ee.Y)(s.Fragment,null,!to&&(0,ee.Y)("div",{ref:Mo,className:"classStandardComponent classStandardForm",css:[Ne,Y,""]},(0,ee.Y)("div",{css:[V.cU,te,""]},(0,ee.Y)("form",{css:[V.ao,ae,""],id:ze,name:ze,acceptCharset:"utf-8",onSubmit:yo},(0,ee.Y)(X.h,{formOnPage:Le,isSubmitted:Ze,isFormErrorStatus:Qe,imFormHeadingCustom:oe},ue||_e),(0,ee.Y)("div",{css:j.uf},(0,ee.Y)("div",{className:"classImFormCol",css:j.hL},(0,ee.Y)(J.o,{formShortName:ze,uniqueId:je,userInfo:io,handleUserInfoChange:go,getFormErrorClassName:e=>Qe&&$e[e]?"classFormError":"",setErrors:Je,otherInfo:lo,handleOtherInfoChange:ho,showAddressType:ke,isPostcode:be.isPostcode})),(0,ee.Y)("div",{className:"classImFormCol",css:j.hL},!F&&ye&&be.isPreferredDateTime&&(0,ee.Y)(Z.FormSectionHeading,null,"Test Drive Details"),!De&&!F&&ye&&(0,ee.Y)(W.CheckboxLabelGroupSelection,{selectedGroup:"vehicle",formShort
1Name:ze,uniqueId:je,isError:!(null==$e||!$e.dealerLocator),checkboxGroupValue:mo,handleChange:e=>{Array.isArray(e)&&(uo(e),Ke())},handleErrors:Je,preSelectedValue:ne}),Me&&L&&(0,ee.Y)(s.Fragment,null,Fe.length>1&&(0,ee.Y)("div",{className:"classImFormInputRow",css:j.lp},(0,ee.Y)(U.SelectLabelNestedControlled,{idName:ze+"Location-"+je,isRequired:!0,options:[{value:"",text:"Please Select"}].concat((0,r.A)(Fe)),selectValueKey:"dealerLocation",selectValue:lo.dealerLocation||"",handleChange:ho},"Please choose a preferred location")),1===Fe.length&&(0,ee.Y)(Z.FormSectionHeading,{formSectionHeadingCustom:q.KI},"Location: "+Fe[0].text)),be.isPreferredDateTime&&(0,ee.Y)(s.Fragment,null,(0,ee.Y)("div",{className:"classImFormInputRow",css:[j.lp,re,""]},(0,ee.Y)(_.DatePickerLabelNested,(0,a.A)({isRequired:!0,idName:ze+"Date-"+je,selected:Be,onChange:Oe,placeholderText:"Please Pick a Date",showDisabledMonthNavigation:!0,disabled:L&&Me&&(0,d.uG)(Fe)&&!lo.dealerLocation},Ye),"Preferred Date")),(0,ee.Y)("div",{className:"classImFormInputRow",css:[j.lp,re,""]},(0,ee.Y)(z.InputLabelNestedControlled,{isRequired:!0,idName:ze+"PreferredTime-"+je,typeName:"time",inputValue:we,handleChange:Re,min:Pe.openTime,max:Pe.closeTime,disabled:!Pe.openTime||!Pe.closeTime},"Preferred Time")),Ge&&(0,ee.Y)("span",{css:[$.wl,$.EY,""]},"The opening hours on your preferred date are "+(0,T.c)(Pe.openTime)+" - "+(0,T.c)(Pe.closeTime)+". Please change your preferred time.")),(0,ee.Y)(Q.v,{currentForm:We,uniqueId:je,otherInfo:lo,handleOtherInfoChange:ho,userInfo:io,handleUserInfoChange:go,handleErrors:Je,isSubmitted:Ze,checkboxGroupVehicles:mo,isComments:be.isComments,isLocations:xe,isGroupModel:be.isGroupModel,isFooterLegalHeading:be.isFooterLegalHeading,isMarketing:be.isMarketing,isMarketingRequired:be.isMarketingRequired,isTerms:be.isTerms,isTermsRequired:be.isTermsRequired,isAlternativeLegalText:be.isAlternativeLegalText,isSubmitDisabled:ko||!1===Io,isStockDetailsDynamic:fe}))))),vo&&(0,ee.Y)(H.a,{modalWrapperCustom:E.Du,modalContentCustom:E.pW,modalShowed:vo,closeModal:bo},(0,ee.Y)(K.C,{formShortName:ze,getFormData:fo,closeMessage:bo,fmSuccessText:Ce.successTextCustom}))),to&&(0,ee.Y)(K.C,{formShortName:ze,getFormData:fo,closeMessage:bo,fmSuccessText:Ce.successTextCustom}))}},21072:function(e,o,t){t.r(o),t.d(o,{CheckboxLabelGroupSelection:function(){return Y}});var a=t(94300),r=t(63696),s=t(74122),i=t(10898),n=t(4507),l=t(2290),d=t(71048),c=t(90287),m=t(73011),u=t(26885);var p=t(3974),g=t(55697),h=t(38056),f=t(78887),v=t(72418),T=t(29197),b=t(91785),C=t(5826),S=t(650),y=t(85437),I=t(57095);const k=(0,b.AH)("flex-direction:column;gap:",y.c.gapSmall,";width:100%;",""),M=(0,b.AH)("gap:",y.c.gapSmall,";",""),D=(0,b.AH)("display:flex;flex-wrap:wrap;gap:",y.c.gapSmall,";",""),x=(0,b.AH)("display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:",I.M.scrListItemGap,";padding:",I.M.scrListItemPadding,";background-color:",I.M.scrListItemBgCol,";border:",I.M.scrListItemBorder,";border-radius:",I.M.scrListItemRadius,";",""),L=(0,b.AH)("display:flex;align-items:center;gap:",I.M.scrBtnGap,";background-color:",I.M.scrBtnBgCol,";padding:8px;border:",I.M.scrBtnBorder,";border-radius:",I.M.scrBtnRadius,";transition:",I.M.scrBtnTransition,";text-transform:",I.M.scrBtnTransform,";cursor:pointer;",(0,C.HG)(S.f.lg),"{padding:8px;}@media (hover: hover){&:hover{background-color:",I.M.scrBtnHoverBgCol,";}}",""),N=(0,b.AH)(I.M.scrBtnLabelFontStack,"font-size:",I.M.scrBtnLabelSizeMobile,";line-height:",I.M.scrBtnLabelLineHeightMobile,";text-transform:",I.M.scrBtnLabelTextTransform,";letter-spacing:",I.M.scrBtnLabelLetterSpacing,";color:",I.M.scrBtnLabelTextCol,";",(0,C.HG)(S.f.lg),"{font-size:",I.M.scrBtnLabelSizeDesktop,";line-height:",I.M.scrBtnLabelLineHeightDesktop,";}@media (hover: hover){.classRefinementButton:hover &{color:",I.M.scrBtnLabelHoverTextCol,";}}",""),F=(0,b.AH)("height:",I.M.scrBtnCloseIconSize,";width:",I.M.scrBtnCloseIconSize,";margin-top:",I.M.scrBtnCloseIconMarginTop,";fill:",I.M.scrBtnCloseIconFill,";@media (hover: hover){.classRefinementButton:hover &{fill:",I.M.scrBtnCloseIconHoverFill,";}}",""),Y=e=>{let{children:o,selectedGroup:t,excludedModelIds:C,isRequired:S=!0,formShort
1Name:y,uniqueId:I,checkboxGroupValue:Y,handleChange:B,handleValidityChange:P,handleErrors:w,preSelectedValue:A,isError:O}=e;const R=(0,m.P)(C),G=(0,g.b)(),H=(0,h.T)(),{categorizedModelsArray:q,sortedModelCategories:E,hasOneCategoryAssociation:j,hasSubCategoryAssociations:V,subCategoriesByCategory:W}=(0,r.useMemo)((()=>(0,d.eg)(G,R,H)),[G,R,H]),_=(0,r.useMemo)((()=>{if("vehicle"!==t||!A)return null;const e=R.find((e=>e.remoteId===A));if(!e)return null;const o=E.findIndex(((o,t)=>(0,i.uG)(q[t])&&e.modelsCategories.some((e=>e.id===o.remoteId))));if(-1===o)return null;const a=((null==W?void 0:W[o])||[]).find((o=>{var t;return null===(t=e.modelsSubCategories)||void 0===t?void 0:t.some((e=>(null==e?void 0:e.id)===o.id||(null==e?void 0:e.id)===o.remoteId))}));let r="All";if(a){var s,n,l;const o=null===(s=e.modelsSubCategories)||void 0===s?void 0:s.find((e=>(null==e?void 0:e.id)===a.id||(null==e?void 0:e.id)===a.remoteId));r=null!==(n=null!==(l=null==o?void 0:o.id)&&void 0!==l?l:a.remoteId)&&void 0!==n?n:a.id}return{categoryIndex:o,subCategoryId:r}}),[t,A,R,E,q,W]),{0:z,1:U}=(0,r.useState)((()=>_?_.categoryIndex:j?E.length-1:q.findIndex((e=>(0,i.uG)(e))))),K=E[z],$=E.map(((e,o)=>(0,i.uG)(q[o])?{value:o,text:e.name}:null)).filter(s.T),{0:J,1:Q}=(0,r.useState)((()=>{var e;return null!==(e=null==_?void 0:_.subCategoryId)&&void 0!==e?e:"All"})),X=((null==W?void 0:W[z])||[]).map((e=>{var o;return{value:null!==(o=e.remoteId)&&void 0!==o?o:e.id,text:e.name}})),Z=[{value:"All",text:"All Models"}].concat((0,a.A)(X)),{siteType:ee}=(0,p.j)(),oe=ee===l.D.dealer,{checkboxOptions:te,groupName:ae}=(()=>{switch(t){case"vehicle":return{checkboxOptions:R.filter((e=>{var o;return e.modelsCategories.some((e=>!V||e.id===(null==K?void 0:K.remoteId)))&&("All"===J||(null===(o=e.modelsSubCategories)||void 0===o?void 0:o.some((e=>e.id===J))))})).map((e=>({id:e.id+"-"+I,value:e.name,text:e.displayName,checked:A===e.remoteId||Y.includes(e.name)}))),groupName:"vehicleCheckbox"};case"product":return{checkboxOptions:(0,u.GR)("2537555041").allCmsProduct.nodes.filter((e=>!e.comingSoonProduct&&(0,i.uG)(e.productCategories))).map((e=>({id:e.id+"-"+I,value:e.name,text:e.name,checked:A===e.remoteId||Y.includes(e.name)}))),groupName:"productCheckbox"};default:return{checkboxOptions:[],groupName:""}}})(),re=(0,c.X6)(te),se=oe?B:e=>{if(!e.length)return B([]);if("string"==typeof e)return B([e]);if(Array.isArray(e)){const o=e[e.length-1];return B([o])}return B(e)};(0,r.useEffect)((()=>{B((0,a.A)(re))}),[]);const ie=O?"classCheckboxSelectionIncompatible":"";return(0,i.uG)(te)?(0,b.Y)("div",{className:"classImFormInputRow",css:[f.lp,k,""]},V&&(0,b.Y)(r.Fragment,null,"vehicle"===t&&(0,b.Y)("div",{className:"classImFormInputRow",css:[f.lp,M,""]},(0,b.Y)(v.SelectLabelNestedControlled,{idName:y+"ModelCategory-"+I,isRequired:!0,options:$,selectValue:z,handleChange:e=>{if("object"==typeof e)return;const o=Number(e);U(o),Q("All")}},"Category"),(0,b.Y)(v.SelectLabelNestedControlled,{idName:y+"ModelSubCategory-"+I,isRequired:!0,options:Z,selectValue:J,handleChange:e=>{"object"!=typeof e&&Q(String(e))}},"Sub Category")),(0,i.uG)(Y)&&(0,b.Y)("div",{css:D},Y.map((e=>(0,b.Y)("li",{css:x,key:e},(0,b.Y)("button",{className:"classRefinementButton",css:L,type:"button",onClick:()=>(e=>{const o=Y.filter((o=>o!==e));B(o)})(e)},(0,b.Y)("span",{css:N},e),(0,b.Y)(n.K,{css:F,name:"iconCloseHeavy"}))))))),(0,b.Y)(T.CheckboxLabelGroupNested,{className:"classIsRequired "+ie,groupName:ae,isRequired:S,checkboxGroupValue:Y,handleChange:se,handleValidityChange:P,checkboxOptions:te,handleErrors:w},V&&"vehicle"===t?null:o)):null}}}]);

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.