"use strict";(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[4654],{6379:(e,t,s)=>{s.d(t,{m:()=>c,u:()=>l});var a=s(1573),n=s(4083),r=s(7143),o=s(7594);const i=(e=!1)=>{const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:s,availablePaymentMethods:i,availableExpressPaymentMethods:c}=(0,r.useSelect)((e=>{const t=e(o.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),l=Object.values(i).map((({name:e})=>e)),d=Object.values(c).map((({name:e})=>e)),m=(0,n.getPaymentMethods)(),u=(0,n.getExpressPaymentMethods)(),h=Object.keys(m).reduce(((e,t)=>(l.includes(t)&&(e[t]=m[t]),e)),{}),p=Object.keys(u).reduce(((e,t)=>(d.includes(t)&&(e[t]=u[t]),e)),{}),_=(0,a.c)(h),y=(0,a.c)(p);return{paymentMethods:e?y:_,isInitialized:e?s:t}},c=()=>i(!1),l=()=>i(!0)},6777:(e,t,s)=>{s.d(t,{w:()=>i});var a=s(7594),n=s(7143),r=s(1614),o=s(6379);const i=()=>{const{isCalculating:e,isBeforeProcessing:t,isProcessing:s,isAfterProcessing:i,isComplete:c,hasError:l}=(0,n.useSelect)((e=>{const t=e(a.CHECKOUT_STORE_KEY);return{isCalculating:t.isCalculating(),isBeforeProcessing:t.isBeforeProcessing(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),{activePaymentMethod:d,isExpressPaymentMethodActive:m}=(0,n.useSelect)((e=>{const t=e(a.PAYMENT_STORE_KEY);return{activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive()}})),{onSubmit:u}=(0,r.E)(),{paymentMethods:h={}}=(0,o.m)(),p=s||i||t,_=c&&!l;return{paymentMethodButtonLabel:(h[d]||{}).placeOrderButtonLabel,onSubmit:u,isCalculating:e,isDisabled:s||m,waitingForProcessing:p,waitingForRedirect:_}}},1573:(e,t,s)=>{s.d(t,{c:()=>o});var a=s(6087),n=s(923),r=s.n(n);function o(e){const t=(0,a.useRef)(e);return r()(e,t.current)||(t.current=e),t.current}},6564:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var a=s(1609),n=s(7723),r=s(851),o=s(6087),i=s(4656),c=s(6777),l=s(9491),d=s(7143),m=s(7594),u=s(812);const h=u.gu?`<a href="${u.gu}" target="_blank">${(0,n.__)("Terms and Conditions","woocommerce")}</a>`:(0,n.__)("Terms and Conditions","woocommerce"),p=u.pk?`<a href="${u.pk}" target="_blank">${(0,n.__)("Privacy Policy","woocommerce")}</a>`:(0,n.__)("Privacy Policy","woocommerce"),_=(0,n.sprintf)(/* translators: %1$s terms page link, %2$s privacy page link. */ /* translators: %1$s terms page link, %2$s privacy page link. */
(0,n.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woocommerce"),h,p),y=(0,n.sprintf)(/* translators: %1$s terms page link, %2$s privacy page link. */ /* translators: %1$s terms page link, %2$s privacy page link. */
(0,n.__)("You must accept our %1$s and %2$s to continue with your purchase.","woocommerce"),h,p),g=(0,l.withInstanceId)((({text:e,checkbox:t,instanceId:s,className:l,showSeparator:u})=>{const[h,p]=(0,o.useState)(!1),{isDisabled:g}=(0,c.w)(),E="terms-and-conditions-"+s,{setValidationErrors:P,clearValidationError:b}=(0,d.useDispatch)(m.VALIDATION_STORE_KEY),M=(0,d.useSelect)((e=>e(m.VALIDATION_STORE_KEY).getValidationError(E))),k=!(null==M||!M.message||null!=M&&M.hidden);return(0,o.useEffect)((()=>{if(t)return h?b(E):P({[E]:{message:(0,n.__)("Please read and accept the terms and conditions.","woocommerce"),hidden:!0}}),()=>{b(E)}}),[t,h,E,b,P]),(0,a.createElement)("div",{className:(0,r.A)("wc-block-checkout__terms",{"wc-block-checkout__terms--disabled":g,"wc-block-checkout__terms--with-separator":"false"!==u&&!1!==u},l)},t?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.CheckboxControl,{id:"terms-and-conditions",checked:h,onChange:()=>p((e=>!e)),hasError:k,disabled:g},(0,a.createElement)("span",{dangerouslySetInnerHTML:{__html:e||y}}))):(0,a.createElement)("span",{dangerouslySetInnerHTML:{__html:e||_}}))}))}}]);