1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1215],{11215:function(e,a,r){r.r(a),r.d(a,{FormMakeOffer:function(){return P}});var s=r(63696),t=r(51149),o=r(21698),i=r(10898),m=r(72407),n=r(17546),l=r(97074),d=r(2290),c=r(74447),u=r(79124),f=r(51089),p=r(13276),h=r(79511),g=r(40675),C=r(34995),S=r(52466),k=r(4740),F=r(41129),I=r(48136),v=r(3974),b=r(37771),y=r(26443),M=r(78887),N=r(98335),Y=r(19951),T=r(32120),O=r(30913),R=r(20140),D=r(19023),L=r(4575),w=r(91785);const P=({closeFormModal:e,formHeading:a="",formId:r,formOnModal:P=!1,imFormBackgroundWrapperCustom:_,imFormHeadingCustom:q,imFormItemCustom:E,imFormInputRowCustom:H,imFormWrapperCustom:U,specialId:A="",specialSlug:W="",specialTitle:$="",specialsReferenceCode:j="",stockDetails:x,stockDetailsSlug:V,isStockDetailsDynamic:z})=>{const{addressTypes:B,formMakeOffer:J}=n.U,{siteType:K}=(0,v.j)(),Q=K===d.D.oem,Z=!P,G=Z?N.Y_:y.v,X=W?(0,g.b)(W):"",ee=V?(0,g.b)(V):"",{0:ae,1:re}=(0,s.useState)(""),se=l.ec.FormMakeOffer,{heading:te,formShortName:oe}=se,{handleFormOpen:ie,handleFormInteracted:me}=(0,S.Y)(oe);(0,s.useEffect)((()=>{(0,s.startTransition)((()=>re((0,o.A)())))}),[]);const ne=(0,I.S)((()=>{(0,f.QY)({eventName:m.R.formOpen,eventInfo:{form_name:oe,form_category:"lead_aftersales",form_type:P?"modal":"embedded",form_step_name:"start",form_step_number:"step-0"}}),ie()})),{0:le,1:de}=(0,s.useState)({}),{0:ce,1:ue}=(0,s.useState)(!1),{0:fe,1:pe}=(0,s.useState)(!1),[he,ge]=(0,F.Mj)(c.fD,{}),Ce={...Q&&{addressType:B.private.value},offerPrice:"",comments:"",...J.isMarketing&&{marketing:J.isMarketingChecked},...J.isTerms&&{terms:J.isTermsChecked}},{0:Se,1:ke}=(0,s.useState)({...Ce}),{0:Fe,1:Ie}=(0,s.useState)(!1),ve=e=>{"string"!=typeof e&&(ge((a=>({...a,...e}))),me())},be=e=>{"object"==typeof e&&(ke({...Se,...e}),me())},ye=e=>ce&&le[e]?"classFormError":"",Me=()=>{const e={formId:parseInt(r,10),specialsReferenceCode:j,specialTitle:$,specialUrl:X,specialId:A,firstName:null==he?void 0:he.firstName,lastName:null==he?void 0:he.lastName,phone:null==he?void 0:he.phone,email:null==he?void 0:he.email,...x&&{make:x.make,model:x.model,badge:x.variations,year:x.year,stockId:x.id,stockUrl:ee},...Se};return(0,t.z)(e,i.Po)},{0:Ne,1:Ye}=(0,s.useState)(!1),Te=()=>{Ye(!1),pe(!1),ke({...Ce})},{handleSubmitWithReCaptcha:Oe,recaptchaReady:Re,isLoading:De}=(0,k.T)({handleSubmit:async()=>{await(0,p.M)(he,ge),(0,u.$)("Hard Lead","Stock Make An Offer"),(0,C.t)({formId:parseInt(r,10),formShortName:oe}),(0,h.JP)(x),x&&(0,h.tZ)(x),Z&&Ye(!0),Z||Ie(!0)},errors:le,setFormErrorStatus:ue,setSubmitted:pe});return(0,w.Y)(s.Fragment,null,!Fe&&(0,w.Y)("div",{ref:ne,className:"classStandardComponent classStandardForm",css:[G,_,""]},(0,w.Y)("div",{css:[N.cU,U,""]},(0,w.Y)("form",{css:[N.ao,E,""],id:oe,name:oe,acceptCharset:"utf-8",onSubmit:Oe},(0,w.Y)(D.h,{formOnPage:Z,isSubmitted:fe,isFormErrorStatus:ce,imFormHeadingCustom:q},a||te),(0,w.Y)("div",{css:M.uf},(0,w.Y)("div",{className:"classImFormCol",css:M.hL},(0,w.Y)(L.FormSectionHeading,null,"This is my Offer"),(0,w.Y)("div",{className:"classImFormInputRow",css:[M.lp,H,""]},(0,w.Y)(Y.InputLabelNestedControlled,{isRequired:!0,className:ye("offerPrice"),idName:`${oe}Price-${ae}`,typeName:"number",placeholder:"My Offer",inputValue:Se.offerPrice,inputValueKey:"offerPrice",handleChange:be,validationRequired:!0,validateFieldType:"offerPrice",handleErrors:de},"My Offer $"))),(0,w.Y)("div",{className:"classImFormCol",css:M.hL},(0,w.Y)(O.o,{formShortName:oe,uniqueId:ae,userInfo:he,handleUserInfoChange:ve,getFormErrorClassName:ye,setErrors:de,otherInfo:Se,handleOtherInfoChange:be,showAddressType:Q}),(0,w.Y)(R.v,{currentForm:se,stockLocation:null==x?void 0:x.location,uniqueId:ae,otherInfo:Se,handleOtherInfoChange:be,handleErrors:de,userInfo:he,handleUserInfoChange:ve,isSubmitted:fe,isComments:J.isComments,isFooterLegalHeading:J.isFooterLegalHeading,isMarketing:J.isMarketing,isMarketingRequired:J.isMarketingRequired,isTerms:J.isTerms,isTermsRequired:J.isTermsRequired,isAlternativeLegalText:J.isAlternativeLegalText,isSubmitDisabled:De||!1===Re,isStockDetail
1sDynamic:z}))))),Ne&&(0,w.Y)(b.a,{modalWrapperCustom:y.Du,modalContentCustom:y.pW,modalShowed:Ne,closeModal:Te},(0,w.Y)(T.C,{formShortName:oe,getFormData:Me,closeMessage:Te}))),Fe&&(0,w.Y)(T.C,{formShortName:oe,getFormData:Me,closeMessage:e}))}}}]);
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.