PageSourceSearch

https://www.ppq.com.au/_next/static/chunks/pages/member/layby/detail-df0863924cdcb52c.js

js ppq.com.au collected 2026-10-02 11:26:19 UTC 42,225 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4243],{54973:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/member/layby/detail",function(){return t(3114)}])},3114:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSP:function(){return V},default:function(){return Y}});var s=t(85893),i=t(13543),n=t(93967),l=t.n(n),r=t(67294),d=t(64319),o=t(68220),c=t(99152),m=t(60824),u=t(80044),y=t(74231),h=t(97386),p=t(55912),x=t(33312);function b(e){let{layby:a,laybyCompleted:t,laybyStatus:i,deliveryAddress:n,setDeliveryAddress:l,api_token:d}=e,[o,m]=(0,r.useState)(!1),b=(0,u.TA)({initialValues:{deliveryAttn:"",deliveryBusinessName:""},onSubmit:async e=>{},validationSchema:y.Ry({deliveryAttn:y.Z_().trim().max(50).required("Please enter your name"),deliveryBusinessName:y.Z_().trim().max(50)})}),j=(0,c.gS)("deliveryAddress",e=>{}),[v,f]=(0,r.useState)(""),[g,N]=(0,r.useState)([]),[S,w]=(0,r.useState)(""),[C,F]=(0,r.useState)([]),[P,k]=(0,r.useState)(""),[A,I]=(0,r.useState)([]),[z,R]=(0,r.useState)(""),[T,B]=(0,r.useState)([]);function D(){n&&(b.setFieldValue("deliveryAttn",n.Attention,!0),b.setFieldValue("deliveryBusinessName",n.BusinessName,!0),f([[n.StreetNo,n.StreetName,n.StreetType].filter(e=>e&&""!==e).join(" "),n.Suburb,[n.State,n.PostCode].filter(e=>e&&""!==e).join(" ")].filter(e=>e&&""!==e).join(", ")))}(0,r.useEffect)(()=>{D()},[n]),(0,r.useEffect)(()=>{o&&(b.resetForm(),j.resetForm(),D(),Z(void 0),O(!0))},[o]);let[L,_]=(0,r.useState)(!1),[E,O]=(0,r.useState)(!0),[V,Y]=(0,r.useState)(!1),[M,U]=(0,r.useState)({isValid:!1,reason:""}),[q,Z]=(0,r.useState)();async function Q(){if(await (0,c.hF)({formikDelivery:b,formikDeliveryAddress:j,setDeliveryAddressValidity:U})&&a){Y(!0),Z(void 0);let{values:e}=j,t=(0,p.Dk)(e.deliveryAddressType),i=(0,p.V_)(t),n={Type:t,Attention:b.values.deliveryAttn,Building:e.deliveryAddressBuildingName,Floor:e.deliveryAddressLevel,Unit:e.deliveryAddressUnit,BoxNumber:i.showBoxNumber?e.deliveryAddressBoxNumber:"",StreetNo:e.deliveryAddressStreetNumber,StreetName:e.deliveryAddressStreetName,StreetType:e.deliveryAddressStreetType,Suburb:e.deliveryAddressSuburb,State:e.deliveryAddressState,PostCode:e.deliveryAddressPostcode,Comments:"",BusinessName:b.values.deliveryBusinessName,Country:"AUSTRALIA"};if((await (0,x.eY)(a.laybyId,n,d)).success){let e=await (0,x.hN)(a.laybyId,d);e.success&&e.data&&(l(e.data.DeliveryDetails),O(!1)),Z({result:"success",title:"Delivery address updated"})}else Z({result:"incomplete",title:"Unable to update delivery address",description:(0,s.jsxs)(s.Fragment,{children:["An error occurred while updating your delivery address. Please try again shortly, or"," ",(0,s.jsx)(h.hh,{href:"/contact-us",children:"contact us"})," for assistance."]})});Y(!1)}}return(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Delivery details"})}),cardBody:(0,s.jsx)("div",{className:"-mt-2 pb-2",children:n&&(0,s.jsxs)(c.Ff,{children:[(0,s.jsx)(c.Bm,{name:"Attention",children:n.Attention}),n.Unit&&(0,s.jsx)(c.Bm,{name:"Unit",children:n.Unit}),n.Floor&&(0,s.jsx)(c.Bm,{name:"Level",children:n.Floor}),(0,s.jsx)(c.Bm,{name:"Street",children:[n.StreetNo,n.StreetName,n.StreetType].filter(e=>e).join(" ")}),(0,s.jsx)(c.Bm,{name:"Suburb",children:n.Suburb}),(0,s.jsx)(c.Bm,{name:"Postcode",children:n.PostCode}),(0,s.jsx)(c.Bm,{name:"State",children:n.State})]})}),cardFooter:a&&t&&i<x.R$.CancelledPPQ?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.zx,{genre:"secondary",size:"medium",label:"Edit",icon:"pencil",iconLocation:"left",onClick:()=>m(!0)}),(0,s.jsx)(h.u_,{modalTitle:"Update delivery address",modalSize:"large",setShowState:m,modalShowState:o,children:(0,s.jsxs)("div",{className:"divide-y divide-neutral-300",children:[E&&(0,s.jsxs)("div",{className:"p-4 md:px-6",children:[(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(h.Jr,{label:"Attention",labelSize:"medium",type:"text",name:"deliveryAttn",form:b,autocomplete:"name",disabled:V,optional:!0,maxLength:50})}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(h.Jr,{label:"Business name",labelSize:"medium",type:"text",name:"deliveryBusinessName",form:b,autocomplete:"organisation",disabled:V,optional:!0,maxLength:50})}),(0,s.jsx)(c.kS,{formName:"deliveryAddress",formikForm:j,addressQuery:v,setAddressQuery:f,addressResults:g,setAddressResults:N,streetTypeQuery:S,setStreetTypeQuery:w,streetTypeResults:C,setStreetTypeResults:F,levelTypeQuery:P,setLevelTypeQuery:k,levelTypeResults:A,setLevelTypeResults:I,unitTypeQuery:z,setUnitTypeQuery:R,unitTypeResults:T,setUnitTypeResults:B,deliveryAddressManual:L,setDeliveryAddressManual:_,setAddressValidity:U,disabled:V,error:M.isValid?void 0:M.reason})]}),q&&""!==q.title&&(0,s.jsx)("div",{className:"p-4 md:px-6 md:py-4",children:(0,s.jsx)(h.kO,{result:q.result,title:null==q?void 0:q.title,children:null==q?void 0:q.description})}),(0,s.jsxs)("div",{className:"flex flex-wrap space-x-4 p-4 md:px-6 md:py-4",children:[E&&(0,s.jsx)(h.zx,{size:"medium",genre:"primary",label:V?"Please wait...":"Submit",disabled:V,onClick:()=>{Q()}}),(0,s.jsx)(h.zx,{size:"medium",genre:"secondary",label:E?"Cancel":"Close",disabled:V,onClick:()=>m(!1)})]})]})})]}):void 0})}var j=t(66443);function v(e){let{layby:a,laybyCompleted:t,laybyStatus:i,owners:n,setOwners:l,checkoutAlternateIds:d,checkoutMessageAtypicalName:o,api_token:m}=e,[u,y]=(0,r.useState)(!1),[p,b]=(0,r.useState)(j.wy.Individual),[v,f]=(0,r.useState)(!1),g="ownerIndividual",N=(0,c.Ue)(g,e=>{}),S="ownerSecondary",w=(0,c.Ue)(S,e=>{},!0),C="ownerCompany",F=(0,c.xb)(C,e=>{});function P(){if(n){N.resetForm(),w.resetForm(),F.resetForm();let e=!1,a=!1;
1n.forEach(t=>{switch(t.OwnerType){case x.jc.Personal:let s=e?w:N,i=e?S:g,n=""!==t.FirstName.trim()?t.FirstName.trim():t.Name.trim();s.setFieldValue("".concat(i,"GivenName"),n,!0),s.setFieldValue("".concat(i,"FamilyName"),t.LastName.trim(),!0),s.setFieldValue("".concat(i,"CRN"),t.CRN.trim(),!0),e?a=!0:e=!0;break;case x.jc.Company:F.setFieldValue("".concat(C,"Name"),t.Name,!0),F.setFieldValue("".concat(C,"CRN"),t.CRN,!0)}f(a)})}}(0,r.useEffect)(()=>{P()},[n]),(0,r.useEffect)(()=>{u&&(P(),U(void 0),D(!0))},[u]);let[k,A]=(0,r.useState)([{name:"For myself",id:"individual",href:"#",current:(0,j.v5)(p)},{name:"For a company",id:"business",href:"#",current:"C"===p}]),[I,z]=(0,r.useState)("");(0,r.useEffect)(()=>{var e;z((null===(e=k.find(e=>e.current))||void 0===e?void 0:e.id)||"")},[k]);let[R,T]=(0,r.useState)([{name:"I will be the only owner of these plates",value:!1,checked:!v},{name:"Add a second owner",description:"For example: A spouse, child, or business partner",value:!0,checked:v}]);(0,r.useEffect)(()=>{var e;f(null===(e=(0,h.iq)({items:R,where:"checked",is:!0}))||void 0===e?void 0:e.value)},[R,I]),(0,r.useEffect)(()=>{b("business"===I?j.wy.Company:v?j.wy.Secondary:j.wy.Individual)},[I,v]);let[B,D]=(0,r.useState)(!0),[L,_]=(0,r.useState)(!1),[E,O]=(0,r.useState)(!1),[V,Y]=(0,r.useState)({...c.Xy}),[M,U]=(0,r.useState)();async function q(){if(await (0,c.NN)({ownerType:p,formikOwnerIndividual:N,formikOwnerSecondary:w,formikOwnerCompany:F,dealershipSelected:!1,ownershipValidity:V,setOwnershipValidity:Y,setAtypicalName:O})&&a){_(!0),U(void 0);let i=N.values,n=w.values,r=F.values,d={Primary:null,Secondary:null,Company:null};if([j.wy.Individual,j.wy.Secondary].includes(p)&&(d.Primary={Name:"".concat(i["".concat(g,"GivenName")]," ").concat(i["".concat(g,"FamilyName")]),FirstName:i["".concat(g,"GivenName")],LastName:i["".concat(g,"FamilyName")],CRN:i["".concat(g,"CRN")],OwnerType:x.jc.Personal}),p===j.wy.Secondary&&(d.Secondary={Name:"".concat(n["".concat(S,"GivenName")]," ").concat(n["".concat(S,"FamilyName")]),FirstName:n["".concat(S,"GivenName")],LastName:n["".concat(S,"FamilyName")],CRN:n["".concat(S,"CRN")],OwnerType:x.jc.Personal}),"C"===p&&(d.Company={Name:r["".concat(g,"Name")],FirstName:"",LastName:"",CRN:r["".concat(g,"CRN")],OwnerType:x.jc.Company}),(await (0,x.um)(a.laybyId,d,m)).success){let s=await (0,x.hN)(a.laybyId,m);if(s.success&&s.data){var e,t;l(null!==(t=null===(e=s.data.OwnershipDetails)||void 0===e?void 0:e.Owners)&&void 0!==t?t:[]),D(!1)}U({result:"success",title:"Ownership details updated"})}else U({result:"incomplete",title:"Unable to update ownership details",description:(0,s.jsxs)(s.Fragment,{children:["An error occurred while updating your ownership details. Please try again shortly, or"," ",(0,s.jsx)(h.hh,{href:"/contact-us",children:"contact us"})," for assistance."]})});_(!1)}}return(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Rights holder"})}),cardBody:(0,s.jsx)("div",{className:"-mt-2 space-y-4 divide-y divide-brand-utility-border pb-2",children:null==n?void 0:n.map(e=>(0,s.jsxs)(c.Ff,{children:[(0,s.jsx)(c.Bm,{name:"CRN",children:(0,s.jsx)(h.KY,{children:e.CRN})}),e.OwnerType===x.jc.Personal&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.Bm,{name:"First name",children:e.FirstName}),(0,s.jsx)(c.Bm,{name:"Last name",children:e.LastName})]}),e.OwnerType===x.jc.Company&&(0,s.jsx)(c.Bm,{name:"Company name",children:e.Name})]},e.CRN))}),cardFooter:a&&!t&&i<x.R$.CancelledPPQ?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.zx,{genre:"secondary",size:"medium",label:"Edit",icon:"pencil",iconLocation:"left",onClick:()=>y(!0)}),(0,s.jsx)(h.u_,{modalTitle:"Update ownership details",modalSize:"large",setShowState:y,modalShowState:u,children:(0,s.jsxs)("div",{className:"divide-y divide-neutral-300",children:[B&&(0,s.jsxs)("div",{className:"space-y-6 divide-y divide-brand-utility-border p-4 md:px-6",children:[(0,s.jsx)("div",{children:(0,s.jsx)(h.yA,{tabs:k,setTabsState:A,id:"ownershipTabs",label:(0,s.jsx)(s.Fragment,{children:"I'm buying these plates—"}),align:"left",size:"medium",inactive:"light"})}),(0,j.v5)(p)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"pt-6",children:[(0,s.jsx)("h3",{className:"text-2xl font-medium",children:"My details"}),(0,s.jsx)(c.Ub,{formName:"ownerIndividual",formikForm:N,error:!V.I.isValid&&
1(0,j.v5)(p)?V.I.reason:void 0,disabled:L,alternateIds:d,atypicalNameMessage:o,atypicalName:E})]}),(0,s.jsxs)("div",{className:"pt-6",children:[(0,s.jsx)(h.MR,{id:"hasSecondaryOwner",label:"Who will also own these plates?",description:"A Secondary Rights Holder will also own the plates. They will have the right to request a replacement, restyle, transfer, attach to a vehicle or enquire about the details of the plates.",items:R,setRadioListState:T,disabled:L}),(0,s.jsx)(h.zF,{open:v,children:(0,s.jsx)("div",{className:"pt-4",children:(0,s.jsx)(c.Ub,{formName:"ownerSecondary",formikForm:w,isSecondaryOwner:!0,error:V.S.isValid||p!==j.wy.Secondary?void 0:V.S.reason,disabled:L})})})]})]}),"C"===p&&(0,s.jsxs)("div",{className:"pt-6",children:[(0,s.jsx)("h3",{className:"text-2xl font-medium",children:"Business details"}),(0,s.jsx)(c.$_,{formName:"ownerCompany",formikForm:F,error:V.C.isValid||"C"!==p?void 0:V.C.reason,disabled:L})]})]}),M&&""!==M.title&&(0,s.jsx)("div",{className:"p-4 md:px-6 md:py-4",children:(0,s.jsx)(h.kO,{result:M.result,title:null==M?void 0:M.title,children:null==M?void 0:M.description})}),(0,s.jsxs)("div",{className:"flex flex-wrap space-x-4 p-4 md:px-6 md:py-4",children:[B&&(0,s.jsx)(h.zx,{size:"medium",genre:"primary",label:L?"Please wait...":"Submit",disabled:L,onClick:()=>{q()}}),(0,s.jsx)(h.zx,{size:"medium",genre:"secondary",label:B?"Cancel":"Close",disabled:L,onClick:()=>y(!1)})]})]})})]}):void 0})}var f=t(33299),g=t(11163),N=t(65759),S=t(50552),w=t(3585),C=t(35923),F=t(12449),P=t(41676);function k(e){var a;let t,{layby:i,laybyOnlinePaymentEnabled:n,laybyOnlinePaymentDisabledMessage:l,tokens:d,set
1Layby:o,api_token:m,automatedLaybyPayments:p}=e,b=(0,f.useSession)(),[j,v]=(0,r.useState)((null==d?void 0:d.length)>0?"token":"creditcard"),k={name:"Stored credit card",id:"token",href:"#"},A=[{name:"Credit card",id:"creditcard",href:"#",current:"creditcard"===j},{name:"Gift voucher",id:"giftvoucher",href:"#",current:"giftvoucher"===j}],[I,z]=(0,r.useState)([...(t=[],(null==d?void 0:d.length)>0?(p&&t.push({name:"Automated payments",id:"automated_payments",href:"#",current:!0}),t=t.concat([{...k,current:!p},...A.map(e=>({...e,current:!1}))])):t=[...A],t)]),[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d.length>0&&!I.find(e=>"token"===e.id)&&z([{...k},...A])},[d]),(0,r.useEffect)(()=>{var e;let a=null===(e=I.find(e=>e.current))||void 0===e?void 0:e.id;a&&["token","creditcard","giftvoucher","automated_payments"].includes(a)&&v(a)},[I]);let[B,D]=(0,r.useState)([]),[L,_]=(0,r.useState)(),[E,O]=(0,r.useState)();(0,r.useEffect)(()=>{(null==d?void 0:d.length)>0&&(p?v("automated_payments"):v("token"),D(d),_(d[0].TokenId))},[p,d]);let[V,Y]=(0,r.useState)(),[M,U]=(0,r.useState)();(0,r.useEffect)(()=>{if(i){null!==i.AutoPaymentsToken&&(T(!0),O(i.AutoPaymentsToken));let e=i.Status===x.R$.DepositPending?i.DepositAmount:Math.min(i.MinimumPaymentAmount,i.Owing),a=i.Owing;Y(e),U(a);let t=Z.values["".concat(q,"Amount")],s=isNaN(parseFloat(t))?null:parseFloat(t),n=s;n="number"==typeof s?Math.max(e,Math.min(s,a)):e,Z.setFieldValue("".concat(q,"Amount"),n.toFixed(2),!0)}},[i]);let q="payment",Z=(0,u.TA)({initialValues:{["".concat(q,"Amount")]:""},onSubmit:e=>{},validationSchema:y.Ry({["".concat(q,"Amount")]:y.Rx().required("Please enter a payment amount").typeError("Please enter a valid amount").positive("Please enter a valid amount").test({message:()=>{let e=Z.values["".concat(q,"Amount")],a=isNaN(parseFloat(e))?null:parseFloat(e);if("number"==typeof a){if("number"==typeof V&&V>0&&a<V)return"Your payment amount must be at least ".concat((0,P.j3)(V,!0));if("number"==typeof M&&M>0&&a>M)return"Your payment amount must be no more than ".concat((0,P.j3)(M,!0))}},test:e=>{let a=Z.values["".concat(q,"Amount")],t=isNaN(parseFloat(a))?null:parseFloat(a);if("number"==typeof t){let e="number"!=typeof V||V<=0||t>=V,a="number"!=typeof M||M<=0||t<=M;return e&&a}return!0}})})}),[Q,$]=(0,r.useState)({...c.Lc}),H=(0,c.UJ)("giftVoucher",e=>{}),[G,W]=(0,r.useState)(!1),J=(0,s.jsx)(s.Fragment,{children:"Your layby payment was processed successfully. A receipt for your layby payment will arrive in your email shortly."}),X=(0,s.jsxs)(s.Fragment,{children:["An error occurred while processing your layby payment. Please try again shortly, or ",(0,s.jsx)(h.hh,{href:"/contact-us",children:"contact us"})," for assistance."]}),[K,ee]=(0,r.useState)(),ea=async()=>{W(!0),ee(void 0),await Z.handleSubmit(),Z.setSubmitting(!0);let e=await Z.validateForm();if(i&&Z.isValid&&0===Object.keys(e).length){let e=parseFloat(Z.values["".concat(q,"Amount")]);if("token"===j&&L){let a=await (0,x.lq)(i.Id,e,L,m);Z.setSubmitting(!1),a.success?(ee({result:"success",title:"Payment successful",description:J}),er(!1),Z.resetForm(),en(!0)):ee({result:"incomplete",title:"Payment failed to process",description:X});let t=await (0,x.hN)(i.Id,m);t.success&&t.data&&o(t.data.Layby),W(!1)}if("creditcard"===j){let a=await (0,x.eE)(i.Id,e,m);a.success?setTimeout(()=>{"string"==typeof a.data&&(window.location.href=a.data)},500):(Z.setSubmitting(!1),ee({result:"incomplete",title:"Payment failed to process",description:X}),W(!1))}}},et=async()=>{if(i&&Q.isValid){W(!0),ee(void 0),er(!1);let e={Number:Q.number,Code:Q.code};if((await (0,x.P3)(i.Id,Q.value,e,m)).success){ee({result:"success",title:"Payment successful",description:J}),Z.resetForm(),en(!0);let e=await (0,x.hN)(i.Id,m);e.success&&e.data&&o(e.data.Layby)}else ee({result:"incomplete",title:"Payment failed to process",description:X});W(!1)}},{isReady:es,query:ei}=(0,g.useRouter)();(0,r.useEffect)(()=>{es&&i&&"string"==typeof ei.success&&void 0!==b.data&&en(["true","1"].includes(ei.success.toLowerCase()))},[es,i,b]);let en=e=>{i&&(0,C.Tw)(i.TransactionId,i.Combination,1,e).then(a=>{e?(ee({result:"success",title:"Payment successful",description:J}),a.data&&ed(a.data)):ee({result:"incomplete",title:"Payment failed to process",description:X})})},[el,er]=(0,r.useState)(!1),ed=e=>{i&&!el&&(er(!0),(0,S.uh)(e,b.data))},[eo,ec]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{ec("")},[R]),(0,s.jsx)(s.Fragment,{children:(i&&!i.laybyCompleted&&i.Owing>
10||K&&""!==K.title)&&(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Online payment"})}),cardBody:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"grid grid-cols-5 lg:grid-cols-6",children:(0,s.jsxs)("div",{className:"col-span-5 space-y-2 pb-2",children:[K&&""!==K.title&&(0,s.jsx)(h.kO,{result:K.result,title:null==K?void 0:K.title,children:null==K?void 0:K.description}),n&&i&&!i.UnderReview&&!i.laybyCompleted&&i.Owing>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.yA,{tabs:I,setTabsState:z,id:"ownershipTabs",label:(0,s.jsx)(s.Fragment,{children:"Payment method"}),align:"left",size:"medium",inactive:"light",disabled:G,customLabelClasses:"mb-2"}),["token","creditcard","automated_payments"].includes(j)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-6 grid grid-cols-3 space-y-3 lg:grid-cols-5 lg:space-x-3 lg:space-y-0",children:["token"===j&&B.length>0&&(0,s.jsx)("div",{className:"col-span-3 sm:col-span-2",children:(0,s.jsx)(h.SA,{id:"storedCard_token",label:"Stored card",labelSize:"medium",placeholder:"Select a stored card",value:L,disabled:G,options:B.map(e=>({value:e.TokenId,label:"".concat(e.CardType," ").concat(e.MaskedCardNumber)})),onSelect:e=>{e&&e.value&&_(e.value)}})}),"automated_payments"===j&&B.length>0&&(0,s.jsx)("div",{className:"col-span-3 sm:col-span-2",children:(0,s.jsx)(h.SA,{id:"storedCard_automatedPayments",label:"Stored card",labelSize:"medium",placeholder:"Select a stored card",value:E,disabled:G||!R,options:B.map(e=>({value:e.TokenId,label:"".concat(e.CardType," ").concat(e.MaskedCardNumber)})),onSelect:e=>{e&&e.value&&O(e.value)}})}),"automated_payments"!==j&&(0,s.jsx)("div",{className:"col-span-3 sm:col-span-2",children:(0,s.jsx)(h.Jr,{label:"Amount",labelSize:"medium",type:"number",name:"".concat(q,"Amount"),describedBy:"amountMinMax",form:Z,icon:"dollar",currency:!0,customInputClasses:"min-h-[50px]",disabled:G})}),"automated_payments"===j&&(0,s.jsx)("div",{className:"col-span-3 pt-8",children:(0,s.jsx)(h.XZ,{required:!1,inputClasses:"h-6 w-6 mt-3 disabled:border-gray-400 disabled:bg-gray-100",labelClasses:"text-blue-800 text-sm ml-4",id:"automated_payments_checkbox",value:R,checked:R,disabled:![30,40,50].includes(null!==(a=null==i?void 0:i.Status)&&void 0!==a?a:0),name:"automated_payments",labelText:"I would like my stored credit card to be charged automatically to make layby installment payments",onChange:async e=>{T(e.target.checked)}})}),(V||M||i.Status===x.R$.DepositPending)&&"automated_payments"!==j&&(0,s.jsxs)("div",{className:"col-span-2 pt-1 text-sm sm:col-span-1 sm:pl-3 sm:pt-7 lg:pl-0 lg:pt-7",children:[i.Status!==x.R$.DepositPending&&V&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{"aria-label":"Minimum",children:"Min."})," ",(0,P.j3)(V),M&&(0,s.jsx)("br",{})]}),i.Status!==x.R$.DepositPending&&M&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{"aria-label":"Maximum",children:"Max."})," ",(0,P.j3)(M)]}),i.Status===x.R$.DepositPending&&(0,s.jsxs)(s.Fragment,{children:["Deposit amount:",(0,s.jsx)("br",{}),(0,P.j3)(i.DepositAmount)]})]})]}),(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[eo&&(0,s.jsx)(h.bZ,{genre:R?"success":"warning",title:"Auto payments",children:(0,s.jsx)("p",{children:eo})}),(0,s.jsx)("p",{children:"Payment will be completed through the Commonwealth Bank of Australia BPoint Service."}),(0,s.jsx)("p",{children:(0,s.jsx)("strong",{children:"Be aware that if your Layby is currently overdue, PPQ will not process an automated payment until your account is up to date."})}),"automated_payments"===j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-blue-800",children:"By opting in to automatic payments you agree that automatic payments are subject to the following terms and conditions, which are incorporated by reference into the Layby Agreement:"}),(0,s.jsx)("div",{className:"ml-8",children:(0,s.jsxs)("ul",{className:"list-decimal space-y-2 text-sm text-blue-800",children:[(0,s.jsx)("li",{children:"You hereby expressly authorise and instruct PPQ to deduct the minimum repayment amount for your Layby every 28 days from when your Layby commenced. These automated payments will be deducted from the nominated payment method via the PPQ dashboard (your PPQ account) until your Layby order is paid in full."}),(0,s.jsx)("li",{children:"PPQ will attempt to send communications both 3 days and 1 day prior to the automated Layby payment date. Upon successful automated payment, you will receive confirmation of this transaction to your nominated email address."}
1),(0,s.jsx)("li",{children:"It is your responsibility to ensure sufficient funds are available in the nominated payment method to avoid payment failures or disruptions to the automated payment process."}),(0,s.jsx)("li",{children:"If a payment is unsuccessful, you remain opted-in; however, no further automated Layby payments will be attempted UNTIL the order has been manually brought up to date. If you fail to make a payment manually by the specified time, Items 6 – 8 may apply."}),(0,s.jsx)("li",{children:"Once a manual payment has been made, the next automated Layby payment date will be based on your original Layby payment plan."}),(0,s.jsx)("li",{children:"If you ever wish to opt-out of automated Layby payments, you can do so via your PPQ Account or through the PPQ Customer Service Centre on 136 356."})]})})]}),"token"===j&&(0,s.jsx)("p",{children:"When you click on “Pay layby”, your stored credit card will be used to process a layby payment in the amount that you have nominated."}),"creditcard"===j&&(0,s.jsx)("p",{children:"When you click on “Proceed to payment”, you will be redirected to the CBA payment page to enter credit card details."})]})]}),"giftvoucher"===j&&(0,s.jsxs)("div",{className:"mt-6 space-y-6 divide-y divide-brand-utility-border",children:[(0,s.jsx)("p",{children:"Got a PPQ gift voucher? Redeem it here and put it towards your current Layby."}),(0,s.jsx)("div",{className:"pt-5",children:(0,s.jsx)("div",{className:"grid grid-cols-3 lg:grid-cols-5",children:(0,s.jsx)("div",{className:"col-span-3",children:(0,s.jsx)(c.IW,{formName:"giftVoucher",formikForm:H,disabled:G,buttonLabel:"Confirm gift voucher details",error:Q.isValid||""==Q.reason?void 0:Q.reason,giftVoucher:Q,setGiftVoucher:$})})})}),(0,s.jsx)("div",{className:"space-y-4 pt-6",children:(0,s.jsxs)("p",{children:[Q.isValid?"Now just":"Simply enter and confirm your voucher details. Then"," ","click Redeem, and your gift voucher will be applied to the Layby."]})})]})]}),n&&i&&i.UnderReview&&(0,s.jsx)(h.bZ,{title:"Your plate content is pending approval",genre:"info",children:(0,s.jsx)("p",{children:"You can make payments here after your plate content is approved."})}),!n&&(0,s.jsx)(h.bZ,{title:"Online payment unavailable",genre:"warning",children:(0,s.jsx)(N.Uz,{content:l})})]})})}),cardFooter:n&&i&&!i.UnderReview&&!i.laybyCompleted?(0,s.jsxs)(s.Fragment,{children:[["token","creditcard","automated_payments"].includes(j)&&(0,s.jsx)(h.zx,{genre:"primary",size:"medium",label:G?"Please wait...":"creditcard"===j?"Proceed to payment":"automated_payments"===j?"Update":"Pay layby",disabled:G||"automated_payments"===j&&!E,onClick:async()=>{if("automated_payments"===j){W(!0);let e=await (0,f.getSession)();await (0,w.sg)("/api/account/layby",{tokenId:R?E:null,api_token:(0,F.VV)(e),laybyId:i.Id}),ec(R?"You have now successfully opt-ed in for Automated payments. We will deduct the minimum amount on your next payment due date.":"You have now successfully opt-ed out for Automated payments. You will need to manually make payment prior to your next payment date. "),W(!1)}else ea()}}),"giftvoucher"===j&&(0,s.jsx)(h.zx,{genre:"primary",size:"medium",label:G?"Please wait...":"Redeem",disabled:G||!Q.isValid,onClick:()=>{et()}})]}):void 0})})}var A=t(30381),I=t.n(A),z=t(57851),R=t(89881),T=e=>{let{paymentDate:a,status:t,amount:i,method:n,reference:r,downloadReceipt:d}=e,o="text-left font-medium",c="text-sm font-base text-right",m="flex justify-between mb-1";return(0,s.jsx)(h.Zb,{customClasses:"m-0 mb-6 mt-3",cardBody:(0,s.jsxs)("div",{className:"whitespace-nowrap",children:[(0,s.jsxs)("div",{className:m,children:[(0,s.jsx)("div",{className:o,children:"Payment date"}),(0,s.jsx)("div",{className:c,children:I()(a).format("DD-MM-YYYY")})]}),(0,s.jsxs)("div",{className:m,children:[(0,s.jsx)("div",{className:o,children:"Status"}),(0,s.jsx)("div",{className:(0,z.m)(c,l()({"font-medium":!0,"text-green-600":t,"text-red-600":!t})),children:t?"Success":"Fail"})]}),(0,s.jsxs)("div",{className:m,children:[(0,s.jsx)("div",{className:o,children:"Amount"}),(0,s.jsx)("div",{className:c,children:(0,P.j3)(i)})]}),(0,s.jsxs)("div",{className:m,children:[(0,s.jsx)("div",{className:o,children:"Method"}),(0,s.jsx)("div",{className:c,children:n})]}),(0,s.jsxs)("div",{className:m,children:[(0,s.jsx)("div",{className:o,children:"Reference"}),(0,s.jsx)("div",{className:c,children:r})]}),!0===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"my-2 h-px border-0 bg-gray-200 dark:bg-gray-700"}),(0,s.jsx)("div",{className:"text-right font-medium text-blue-700",children:(0,s.jsx)(h.zx,{size:"small",label:"Download receipt",customClasses:"float-right -mr-3",onClick:d})})]})]})})};function B(e){let{layby:a,paymentHistory:t,laybyStarted:i,laybyCompleted:n,amountOwing:d,paidToDate:o,api_token:u}=e,y="px-3 py-2",p="px-3 py-2.5 text-sm font-base",[b,j]=(0,r.useState)(!1),v=async(e,a,t)=>{if(!b){j(!0);try{let s=await (0,x.VC)(e,a,t,u);setTimeout(()=>{j(!1)},1e3),s&&(window.location.href=s)}catch(e){console.error("Error fetching layby payment receipt:",e),j(!1)}}};
1return(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Payment"})}),cardBody:(0,s.jsx)(s.Fragment,{children:a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-4 lg:grid-cols-5",children:(0,s.jsx)("div",{className:"col-span-4 -mt-2 pb-2",children:(0,s.jsxs)(c.Ff,{children:[i&&!n&&void 0!==o&&(0,s.jsx)(R.E,{name:"Amount paid to date",children:(0,P.j3)(o)}),!n&&(0,s.jsx)(R.E,{name:"Amount remaining",children:(0,P.j3)(d)}),(0,s.jsx)(R.E,{name:"Payment history"})]})})}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"hidden overflow-x-scroll sm:block xl:overflow-visible",children:(0,s.jsxs)("table",{className:"divide-y divide-gray-300 xl:min-w-full",children:[(0,s.jsx)("thead",{className:"font-semibold text-left text-sm text-gray-900 ",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",className:y,children:"Date"}),(0,s.jsx)("th",{scope:"col",className:y,children:"Amount"}),(0,s.jsx)("th",{scope:"col",className:y,children:"Reference"}),(0,s.jsx)("th",{scope:"col",className:y,children:"Method"}),(0,s.jsx)("th",{scope:"col",className:y,children:"Successful"}),(0,s.jsx)("th",{scope:"col",className:"".concat(y," text-right"),children:"Receipt"})]})}),(0,s.jsx)("tbody",{children:t.map((e,t)=>(0,s.jsxs)("tr",{className:t%2==0?void 0:m.fw,children:[(0,s.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-3",children:I()(e.Date).format("DD-MM-YYYY")}),(0,s.jsx)("td",{className:p,children:(0,P.j3)(e.Amount)}),(0,s.jsx)("td",{className:p,children:e.Reference}),(0,s.jsx)("td",{className:p,children:e.Method}),(0,s.jsx)("td",{className:(0,z.m)(p,l()({"font-medium":!0,"text-green-600":e.Successful,"text-red-600":!e.Successful})),children:e.Successful?"Yes":"No"}),e.Successful&&(0,s.jsx)("td",{className:"".concat(p," text-right"),children:(0,s.jsx)(h.zx,{size:"x-small",label:"View",genre:"secondary",icon:"document",iconLocation:"left",customClasses:"inline-flex",disabled:b,onClick:()=>v(a.laybyId,e.PaymentId,a.combination)})})]},e.PaymentId))})]})}),(0,s.jsx)("div",{className:"sm:hidden",children:t.map(e=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(T,{paymentDate:e.Date,status:e.Successful,amount:e.Amount,method:e.Method,reference:e.Reference,downloadReceipt:()=>v(a.laybyId,e.PaymentId,a.combination)})}))})]})]})})})}var D=t(98163),L=t(46539);function _(e){var a;let{layby:t,laybyCompleted:i,laybyStatus:n,plate:l,plateDesign:d,api_token:o}=e;(0,r.useEffect)(()=>{l&&(l.VehicleTypeId&&(0,D.wc)(l.VehicleTypeId).then(e=>{e.success&&e.data&&p(e.data)}),l.ForegroundColourId&&(0,D.GN)(l.ForegroundColourId).then(e=>{e.success&&e.data&&j(e.data)}),l.FrontPlateSizeId&&(0,L.Kw)(l.FrontPlateSizeId).then(e=>{e.success&&e.data&&f(e.data)}),l.RearPlateSizeId&&(0,L.Kw)(l.RearPlateSizeId).then(e=>{e.success&&e.data&&N(e.data)}))},[l]);let[m,p]=(0,r.useState)(),[b,j]=(0,r.useState)(),[v,f]=(0,r.useState)(),[g,N]=(0,r.useState)(),[S,w]=(0,r.useState)(!1),C="changeRequest",F=(0,u.TA)({initialValues:{["".concat(C,"Details")]:""},onSubmit:e=>{},validationSchema:y.Ry({["".concat(C,"Details")]:y.Z_().trim().required("Please describe the changes that you'd like to make")})});(0,r.useEffect)(()=>{S&&(F.resetForm(),_(void 0),k(!0))},[S]);let[P,k]=(0,r.useState)(!0),[A,I]=(0,r.useState)(!1),z=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:"Your request for a change to your layby has been submitted."}),(0,s.jsx)("p",{children:"You will receive a confirmation receipt of the changes by email within 24 hours. Be sure to check this receipt, as all sales are final; once your final payment is made, further changes will attract a manufacturing fee."})]}),T=(0,s.jsxs)(s.Fragment,{children:["An error occurred while submitting your request for a change to your layby. Please try again shortly, or"," ",(0,s.jsx)(h.hh,{href:"/contact-us",children:"contact us"})," for assistance."]}),[B,_]=(0,r.useState)(),E=async()=>{I(!0),_(void 0),await F.handleSubmit(),F.setSubmitting(!0);let e=await F.validateForm();if(t&&F.isValid&&0===Object.keys(e).length){let e=await (0,x.L7)(t.laybyId,F.values["".concat(C,"Details")],o);e.success&&e.data?(k(!1),_({result:"success",title:"Request submission successful",description:z})):_({result:"incomplete",title:"Unable to submit request",description:T})}F.setSubmitting(!1),I(!1)};
1return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Plate details"})}),cardBody:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"grid grid-cols-4 lg:grid-cols-5",children:(0,s.jsx)("div",{className:"col-span-4 -mt-2 pb-2",children:(0,s.jsxs)(c.Ff,{children:[(l||t)&&(0,s.jsx)(R.E,{name:"Combination",children:null!==(a=null==l?void 0:l.Combination)&&void 0!==a?a:null==t?void 0:t.combination}),m&&(0,s.jsx)(R.E,{name:"Vehicle type",children:m.Name}),(null==d?void 0:d.Name)&&(0,s.jsx)(R.E,{name:"Design",children:d.Name}),b&&(0,s.jsx)(R.E,{name:"Foreground colour",children:b.Name}),v&&(0,s.jsx)(R.E,{name:"First plate size",children:v.Name}),g&&(0,s.jsx)(R.E,{name:"Second plate size",children:g.Name}),l&&(0,s.jsx)(R.E,{name:"Accessory included",children:l.HasAccessoryPlate?"Yes":"No"}),l?(0,s.jsxs)(s.Fragment,{children:[l.FrontPlateSizeId>0&&(0,s.jsx)(R.E,{name:"First plate",children:l.PlateDesignId&&""!==l.Combination&&l.ForegroundColourId>0&&l.FrontPlateSizeId>0?(0,s.jsx)(c.Z$,{name:"plate",design:(null==d?void 0:d.Name)||"",plate:{designId:l.PlateDesignId,combination:l.Combination,sizeId:l.FrontPlateSizeId,foregroundColourId:l.ForegroundColourId,encodedCaption:l.CaptionEncoded||""},imageWidth:512}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mx-4 rounded-lg border-2 border-blue-300 bg-blue-200 py-3 text-center text-3xl","aria-hidden":"true",children:l.Combination}),(0,s.jsx)("div",{className:"text-center text-xs",children:"Preview Not Available"})]})}),l.RearPlateSizeId&&l.RearPlateSizeId>0&&(0,s.jsx)(R.E,{name:"Second plate",children:l.PlateDesignId&&""!==l.Combination&&l.ForegroundColourId>0&&l.RearPlateSizeId>0?(0,s.jsx)(c.Z$,{name:"plate",design:(null==d?void 0:d.Name)||"",plate:{designId:l.PlateDesignId,combination:l.Combination,sizeId:l.RearPlateSizeId,foregroundColourId:l.ForegroundColourId,encodedCaption:l.CaptionEncoded||""},imageWidth:512}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mx-4 rounded-lg border-2 border-blue-300 bg-blue-200 py-3 text-center text-3xl","aria-hidden":"true",children:l.Combination}),(0,s.jsx)("div",{className:"text-center text-xs",children:"Preview Not Available"})]})})]}):t?(0,s.jsx)(R.E,{name:"Plate",children:(0,s.jsxs)("div",{className:"inline-block rounded-lg bg-blue-50 p-4 pt-6",children:[(0,s.jsx)("div",{className:"mx-4 rounded-lg border-2 border-blue-300 bg-blue-200 p-6 text-center text-5xl","aria-hidden":"true",children:t.combination}),(0,s.jsx)("div",{className:"mt-2 text-center text-xs",children:"Preview Not Available"})]})}):null]})})})}),cardFooter:t&&i&&n<x.R$.Complete?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.zx,{genre:"secondary",size:"medium",label:"Edit",icon:"pencil",iconLocation:"left",onClick:()=>w(!0)}),(0,s.jsx)(h.u_,{modalTitle:"Change plate details request",modalSize:"large",setShowState:w,modalShowState:S,children:(0,s.jsxs)("div",{className:"divide-y divide-neutral-300",children:[P&&(0,s.jsxs)("div",{className:"space-y-6 p-4 md:px-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{children:"Describe the change you'd like to make on your layby below, and it will be sent to the PPQ team. Within 24 hours a confirmation receipt of the changes will be emailed to you."}),(0,s.jsx)("p",{children:"Be sure to check this receipt, as all sales are final; once your final payment is made, further changes will attract a manufacturing fee."})]}),(0,s.jsx)(h.Jr,{label:(0,s.jsx)(s.Fragment,{children:"Describe the changes that you'd like to make to your layby"}),type:"textarea",name:"".concat(C,"Details"),form:F,disabled:A||!P})]}),B&&""!==B.title&&(0,s.jsx)("div",{className:"p-4 md:px-6 md:py-4",children:(0,s.jsx)(h.kO,{result:B.result,title:null==B?void 0:B.title,children:null==B?void 0:B.description})}),(0,s.jsxs)("div",{className:"flex flex-wrap space-x-4 p-4 md:px-6 md:py-4",children:[P&&(0,s.jsx)(h.zx,{size:"medium",genre:"primary",label:A?"Please wait...":"Submit",disabled:A,onClick:()=>{E()}}),(0,s.jsx)(h.zx,{size:"medium",genre:"secondary",label:P?"Cancel":"Close",disabled:A,onClick:()=>w(!1)})]})]})})]}):void 0})})}function E(e){var a;let{layby:t,laybyStatus:i,laybyStatusName:n,statusClassName:l,api_token:d,laybyStarted:o,laybyCompleted:m,expectedCompletionDate:p,paidToDate:b,amountO
1wing:j,laybyDurationDays:v}=e,[f,g]=(0,r.useState)(!1),[N,S]=(0,r.useState)(!1),w="cancel",C=(0,u.TA)({initialValues:{["".concat(w,"Reason")]:"",["".concat(w,"Terms")]:!1},onSubmit:e=>{},validationSchema:y.Ry({["".concat(w,"Reason")]:y.Z_().trim().required("Please describe the reason for cancelling your layby."),["".concat(w,"Terms")]:y.O7().oneOf([!0],"You must acknowledge Item 6 of the Layby Agreement to proceed.")})});(0,r.useEffect)(()=>{f&&(C.resetForm(),L(void 0),k(!0))},[f]);let[F,k]=(0,r.useState)(!0),[A,R]=(0,r.useState)(!1),T=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:"Thank you. Your request to cancel your layby has been submitted."}),(0,s.jsx)("p",{children:"A PPQ team member will update your order and confirm the cancellation."})]}),B=(0,s.jsxs)(s.Fragment,{children:["An error occurred while submitting your request to cancel your layby. Please try again shortly, or"," ",(0,s.jsx)(h.hh,{href:"/contact-us",children:"contact us"})," for assistance."]}),[D,L]=(0,r.useState)(),_=async()=>{R(!0),L(void 0),await C.handleSubmit(),C.setSubmitting(!0);let e=await C.validateForm();if(t&&C.isValid&&0===Object.keys(e).length){let e=await (0,x.Fi)(t.laybyId,C.values["".concat(w,"Reason")],d);e.success&&e.data?(k(!1),L({result:"success",title:"Cancellation request successful",description:T})):L({result:"incomplete",title:"Unable to submit request",description:B})}C.setSubmitting(!1),R(!1)};return(0,s.jsx)(s.Fragment,{children:t&&(0,s.jsx)(h.Zb,{cardHeader:(0,s.jsx)("div",{className:"text-lg font-bold",children:(0,s.jsx)("h2",{children:"Layby details"})}),cardBody:(0,s.jsxs)("div",{className:"-mt-2 space-y-4 divide-y divide-brand-utility-border pb-2",children:[(0,s.jsxs)(c.Ff,{children:[(0,s.jsxs)(c.Bm,{name:"Layby Agreement",children:["#",t.laybyId]}),(0,s.jsx)(c.Bm,{name:"Status",children:(0,s.jsx)("span",{className:(0,z.m)("font-medium",l),children:n})})]}),(0,s.jsxs)(c.Ff,{children:[o&&t.applicationDate&&(0,s.jsx)(c.Bm,{name:"Start date",children:I()(t.applicationDate).format("DD-MM-YYYY")}),o&&p&&(0,s.jsx)(c.Bm,{name:"Agreement end date",children:I()(p).format("DD-MM-YYYY")}),v&&(0,s.jsxs)(c.Bm,{name:"Agreement duration",children:[v," days"]})]}),(0,s.jsxs)(c.Ff,{children:[(0,s.jsx)(c.Bm,{name:"Layby amount",children:(0,P.j3)(t.laybyAmount)}),o&&!m&&void 0!==b&&(0,s.jsx)(c.Bm,{name:"Amount paid to date",children:(0,P.j3)(b)}),!m&&(0,s.jsx)(c.Bm,{name:"Amount remaining",children:(0,P.j3)(j)})]}),(0,s.jsx)(c.Ff,{children:(0,s.jsx)(c.Bm,{name:"Layby agreement",children:(0,s.jsx)(h.zx,{size:"medium",genre:"secondary",label:"View",icon:"document",iconLocation:"left",disabled:N,onClick:()=>{N||(S(!0),(0,x.IL)(t.laybyId,t.combination,d).then(e=>{setTimeout(()=>{S(!1)},1e3),e&&(window.location.href=e)}))}})})})]}),cardFooter:i!==x.R$.Uninitialised&&i<x.R$.CancelledPPQ&&!m?(0,s.jsx)(s.Fragment,{children:t&&i>x.R$.Uninitialised&&i<x.R$.CancelledPPQ&&!m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.zx,{genre:"destructive",size:"medium",label:"Cancel layby",onClick:()=>g(!0)}),(0,s.jsx)(h.u_,{modalTitle:"Change plate details request",setShowState:g,modalShowState:f,children:(0,s.jsxs)("div",{className:"divide-y divide-neutral-300",children:[F&&(0,s.jsxs)("div",{className:"space-y-6 p-4 md:px-6",children:[(0,s.jsx)("p",{children:"If you wish to cancel your layby, please let us know why in the box below and a staff member will update your order and confirm the cancellation."}),(0,s.jsx)(h.Jr,{label:"Layby cancellation reason",type:"textarea",name:"".concat(w,"Reason"),form:C,disabled:A||!F}),(0,s.jsx)(h.XZ,{id:"cancelTerms",name:"cancelTerms",labelText:"I understand that cancelling my layby will incur a cancellation fee",description:(0,s.jsx)("p",{children:"As per Item 6 of the PPQ Layby Agreement, you acknowledge that cancelling this layby will result in a $100 cancellation fee, deducted from your layby refund"}),required:!0,value:"boolean"==typeof C.values["".concat(w,"Terms")]?!!C.values["".concat(w,"Terms")]:"true"===C.values["".concat(w,"Terms")],error:C.errors["".concat(w,"Terms")]?null===(a=C.errors["".concat(w,"Terms")])||void 0===a?void 0:a.toString():"",onCh
1ange:C.handleChange,onBlur:C.handleBlur})]}),D&&""!==D.title&&(0,s.jsx)("div",{className:"p-4 md:px-6 md:py-4",children:(0,s.jsx)(h.kO,{result:D.result,title:null==D?void 0:D.title,children:null==D?void 0:D.description})}),(0,s.jsxs)("div",{className:"flex flex-wrap space-x-4 p-4 md:px-6 md:py-4",children:[F&&(0,s.jsx)(h.zx,{size:"medium",genre:"primary",label:A?"Please wait...":"Submit",disabled:A,onClick:()=>{_()}}),(0,s.jsx)(h.zx,{size:"medium",genre:"secondary",label:F?"Cancel":"Close",disabled:A,onClick:()=>g(!1)})]})]})})]})}):void 0})})}function O(e){var a;let{layby:t,plateDetails:i,paymentHistory:n,deliveryDetails:c,ownershipDetails:u,plateDesignDetails:y,laybyOnlinePaymentEnabled:h,laybyOnlinePaymentDisabledMessage:p,checkoutAlternateIds:x,checkoutMessageAtypicalName:j,api_token:f,automatedLaybyPayments:g,tokens:N}=e,[S,w]=(0,r.useState)(t),[C,F]=(0,r.useState)(i),[P,A]=(0,r.useState)(y),[I,z]=(0,r.useState)(c),[R,T]=(0,r.useState)(null!==(a=null==u?void 0:u.owners)&&void 0!==a?a:[]),D=[{name:"PPQ",item:"/",current:!1},{name:"Member Dashboard",item:"/account",current:!1},{name:"Laybys",item:"/account/laybys",current:!1},{name:"Layby Detail",item:"",current:!0}].filter(e=>e);return(0,s.jsx)("div",{className:l()("w-full py-4",m.fw),children:S&&(0,s.jsxs)("div",{className:"container mx-auto grid grid-cols-3",children:[(0,s.jsx)("div",{className:"col-span-3 m-6",children:(0,s.jsx)(o.yI,{pages:D})}),(0,s.jsxs)("div",{className:"col-span-3 lg:col-span-2",children:[(0,s.jsx)(_,{laybyInState:S,laybyCompleted:!1,laybyStatus:(0,d.laybyStatus)(S),plate:C,plateDesign:P,api_token:f}),(0,s.jsx)(k,{laybyInState:S,laybyOnlinePaymentEnabled:h,laybyOnlinePaymentDisabledMessage:p,setLayby:w,api_token:f,automatedLaybyPayments:g,tokens:null!=N?N:[]}),(0,s.jsx)(B,{laybyStarted:!1,laybyCompleted:!1,paidToDate:S.laybyAmount-(0,d.amountOwing)(S),amountOwing:(0,d.amountOwing)(S),layby:S,api_token:f,paymentHistory:null!=n?n:[]})]}),(0,s.jsxs)("div",{className:"col-span-3 row-span-2 lg:col-span-1",children:[(0,s.jsx)(E,{laybyStatus:(0,d.laybyStatus)(t),laybyStatusName:(0,d.statusName)(t),statusClassName:(0,d.statusClassname)(t),laybyStarted:!1,laybyCompleted:!1,expectedCompletionDate:"",paidToDate:S.laybyAmount-(0,d.amountOwing)(S),amountOwing:(0,d.amountOwing)(S),laybyDurationDays:10,layby:S,api_token:f}),(0,s.jsx)(b,{laybyCompleted:!1,laybyStatus:(0,d.laybyStatus)(S),layby:S,deliveryAddress:I,setDeliveryAddress:z,api_token:f}),(0,s.jsx)(v,{laybyCompleted:!1,laybyStatus:(0,d.laybyStatus)(S),layby:S,owners:R,setOwners:T,checkoutAlternateIds:x,checkoutMessageAtypicalName:j,api_token:f})]})]})})}var V=!0;function Y(e){let{seo:a,title:t,layby:n,plateDetails:l,plateDesignDetails:r,paymentHistory:d,ownershipDetails:o,deliveryDetails:c,laybyOnlinePaymentEnabled:m,laybyOnlinePaymentDisabledMessage:u,checkoutAlternateIds:y,checkoutMessageAtypicalName:h,api_token:p,automatedLaybyPayments:x}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{navbarHeader:null!=t?t:"Layby Detail"}),(0,s.jsx)(O,{plateDesignDetails:r,pendingPayment:!1,tokens:[],layby:n,paymentHistory:d,plateDetails:l,ownershipDetails:o,deliveryDetails:c,laybyOnlinePaymentEnabled:m,laybyOnlinePaymentDisabledMessage:u,checkoutAlternateIds:y,checkoutMessageAtypicalName:h,api_token:p,seo:a,automatedLaybyPayments:x})]})}}},function(e){e.O(0,[5343,1421,4319,9774,2888,179],function(){return e(e.s=54973)}),_N_E=e.O()}]);

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.