(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[30],{440:function(e,t,i){"use strict";i.r(t);var l=i(0),n=i(4),s=i.n(n),o=i(120),d=i(290),a=i(34),c=i(332),r=i(56),b=i(27),u=i(393),h=i(333),p=i(334),m=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:n=!1,requireCompanyField:s=!1,requirePhoneField:o=!1}=e;const{defaultAddressFields:d,billingData:a,setBillingData:m,setBillingPhone:w}=Object(c.a)(),{dispatchCheckoutEvent:g}=Object(r.a)(),{isEditor:j}=Object(b.a)();Object(l.useEffect)(()=>{n||w("")},[n,w]);const F=Object(l.useMemo)(()=>({company:{hidden:!t,required:s},address_2:{hidden:!i}}),[t,s,i]),O=j?h.a:l.Fragment;return Object(l.createElement)(O,null,Object(l.createElement)(u.a,{id:"billing",type:"billing",onChange:e=>{m(e),g("set-billing-address")},values:a,fields:Object.keys(d),fieldConfig:F}),n&&Object(l.createElement)(p.a,{isRequired:o,value:a.phone,onChange:e=>{w(e),g("set-phone-number",{step:"billing"})}}))},w=i(1),g=i(270),j={...Object(g.a)({defaultTitle:Object(w.__)("Billing address","woocommerce"),defaultDescription:Object(w.__)("Enter the address that matches your card or payment method.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},F=i(140);t.default=Object(o.withFilteredAttributes)(j)(e=>{let{title:t,description:i,showStepNumber:n,children:o,className:r}=e;const{isProcessing:b}=Object(a.b)(),{requireCompanyField:u,requirePhoneField:h,showApartmentField:p,showCompanyField:w,showPhoneField:g}=Object(F.b)(),{showBillingFields:j}=Object(c.a)();return j?Object(l.createElement)(d.a,{id:"billing-fields",disabled:b,className:s()("wc-block-checkout__billing-fields",r),title:t,description:i,showStepNumber:n},Object(l.createElement)(m,{requireCompanyField:u,showApartmentField:p,showCompanyField:w,showPhoneField:g,requirePhoneField:h}),o):null})}}]);