File "billing-address-frontend.js"

Full Path: /home/warrior1/public_html/plugins/woocommerce/packages/woocommerce-blocks/build/checkout-blocks/billing-address-frontend.js
File size: 1.84 KB
MIME-type: text/plain
Charset: utf-8

(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[30],{447:function(e,t,i){"use strict";i.r(t);var l=i(0),s=i(4),n=i.n(s),o=i(123),d=i(302),c=i(36),r=i(343),a=i(59),b=i(29),u=i(400),h=i(344),p=i(345),m=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:s=!1,requireCompanyField:n=!1,requirePhoneField:o=!1}=e;const{defaultAddressFields:d,billingAddress:c,setBillingAddress:m,setBillingPhone:g}=Object(r.a)(),{dispatchCheckoutEvent:w}=Object(a.a)(),{isEditor:j}=Object(b.a)();Object(l.useEffect)(()=>{s||g("")},[s,g]);const F=Object(l.useMemo)(()=>({company:{hidden:!t,required:n},address_2:{hidden:!i}}),[t,n,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),w("set-billing-address")},values:c,fields:Object.keys(d),fieldConfig:F}),s&&Object(l.createElement)(p.a,{isRequired:o,value:c.phone,onChange:e=>{g(e),w("set-phone-number",{step:"billing"})}}))},g=i(1),w=i(283),j={...Object(w.a)({defaultTitle:Object(g.__)("Billing address","woocommerce"),defaultDescription:Object(g.__)("Enter the billing address that matches your payment method.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},F=i(142);t.default=Object(o.withFilteredAttributes)(j)(e=>{let{title:t,description:i,showStepNumber:s,children:o,className:a}=e;const{isProcessing:b}=Object(c.b)(),{requireCompanyField:u,requirePhoneField:h,showApartmentField:p,showCompanyField:g,showPhoneField:w}=Object(F.b)(),{showBillingFields:j}=Object(r.a)();return j?Object(l.createElement)(d.a,{id:"billing-fields",disabled:b,className:n()("wc-block-checkout__billing-fields",a),title:t,description:i,showStepNumber:s},Object(l.createElement)(m,{requireCompanyField:u,showApartmentField:p,showCompanyField:g,showPhoneField:w,requirePhoneField:h}),o):null})}}]);