geno/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/checkout-blocks/actions-frontend.js

1 line
24 KiB
JavaScript
Raw Normal View History

2024-02-01 17:24:18 +05:30
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[9644],{8184:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9196),o=n(444);const i=(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},4877:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9196),o=n(9685),i=n(4184),s=n.n(i),c=(n(5482),n(4705));const l=({className:e,showSpinner:t=!1,children:n,variant:i="contained",...l})=>{const a=s()("wc-block-components-button","wp-element-button",e,i,{"wc-block-components-button--loading":t});return(0,r.createElement)(o.Z,{className:a,...l},t&&(0,r.createElement)(c.Z,null),(0,r.createElement)("span",{className:"wc-block-components-button__text"},n))}},9576:(e,t,n)=>{"use strict";n.d(t,{E:()=>l,X:()=>a});var r=n(9075),o=n(4613),i=n(9818),s=n(4801);const c=(e=!1)=>{const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:n,availablePaymentMethods:c,availableExpressPaymentMethods:l}=(0,i.useSelect)((e=>{const t=e(s.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),a=Object.values(c).map((({name:e})=>e)),u=Object.values(l).map((({name:e})=>e)),d=(0,o.getPaymentMethods)(),p=(0,o.getExpressPaymentMethods)(),m=Object.keys(d).reduce(((e,t)=>(a.includes(t)&&(e[t]=d[t]),e)),{}),f=Object.keys(p).reduce(((e,t)=>(u.includes(t)&&(e[t]=p[t]),e)),{}),h=(0,r.s)(m),g=(0,r.s)(f);return{paymentMethods:e?g:h,isInitialized:e?n:t}},l=()=>c(!1),a=()=>c(!0)},5390:(e,t,n)=>{"use strict";n.d(t,{P:()=>c});var r=n(4801),o=n(9818),i=n(5999),s=n(9576);const c=()=>{const{isCalculating:e,isBeforeProcessing:t,isProcessing:n,isAfterProcessing:c,isComplete:l,hasError:a}=(0,o.useSelect)((e=>{const t=e(r.CHECKOUT_STORE_KEY);return{isCalculating:t.isCalculating(),isBeforeProcessing:t.isBeforeProcessing(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),{activePaymentMethod:u,isExpressPaymentMethodActive:d}=(0,o.useSelect)((e=>{const t=e(r.PAYMENT_STORE_KEY);return{activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive()}})),{onSubmit:p}=(0,i.U)(),{paymentMethods:m={}}=(0,s.E)(),f=n||c||t,h=l&&!a;return{paymentMethodButtonLabel:(m[u]||{}).placeOrderButtonLabel,onSubmit:p,isCalculating:e,isDisabled:n||d,waitingForProcessing:f,waitingForRedirect:h}}},9075:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(9307),o=n(9127),i=n.n(o);function s(e){const t=(0,r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},3358:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var r=n(721),o=n(9196),i=n(4184),s=n.n(i),c=n(4617),l=n(5736),a=n(5271),u=n(1984),d=n(444);const p=(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(d.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));n(6701);const m=({link:e})=>{const t=e||a.fh;return t?(0,o.createElement)("a",{href:t,className:"wc-block-components-checkout-return-to-cart-button"},(0,o.createElement)(u.Z,{icon:p}),(0,l.__)("Return to Cart","woocommerce")):null};var f=n(5390),h=n(8184),g=n(4877);const v=({label:e,fullWidth:t=!1})=>{const{onSubmit:n,isCalculating:r,isDisabled:i,waitingForProcessing:c,waitingForRedirect:l}=(0,f.P)();return(0,o.createElement)(g.Z,{className:s()("wc-block-components-checkout-place-order-button",{"wc-block-components-checkout-place-order-button--full-width":t}),onClick:n,disabled:r||i||c||l,showSpinner:c},l?(0,o.createElement)(u.Z,{icon:h.Z}):e)};var b=n(6423),w=n(711),E=n(3554);const y=(0,l.__)("Place Order","woocommerce");n(1337);const S={cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}},placeOrderButtonLabel:{type: