PageSourceSearch

https://www.powerforcemidland.com.au/2019-89ee49dcbf1bcd7a787a.js

js powerforcemidland.com.au collected 2026-10-09 17:16:42 UTC 14,959 bytes, 1 lines download raw bytes

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