Version Description
- 2021-06-22 =
Enhancements
- Made script and style handles consistent. (4324)
- Show loading state in the express payments area whilst payment is processing or the page is redirecting. (4228)
Bug Fixes
- Fix a warning shown when fees are included in the order. (4360)
- Prevent PHP notice for variable products without enabled variations. (4317)
Various
- Allow products to be added by SKU in the Hand-Picked Products block. (4366)
- Add Slot in the Discounts section of the Checkout sidebar to allow third party extensions to render their own components there. (4310)
Download this release
Release Info
Developer | automattic |
Plugin | WooCommerce Gutenberg Products Block |
Version | 5.4.0 |
Comparing to | |
See all releases |
Code changes from version 5.3.1 to 5.4.0
- assets/js/atomic/utils/index.js +4 -5
- assets/js/atomic/utils/render-inner-blocks.js +0 -69
- assets/js/atomic/utils/render-parent-block.js +0 -41
- assets/js/atomic/utils/render-parent-block.tsx +126 -0
- assets/js/base/components/cart-checkout/address-form/{address-form.js → address-form.tsx} +34 -13
- assets/js/base/components/cart-checkout/address-form/{index.js → index.ts} +0 -0
- assets/js/base/components/cart-checkout/address-form/{prepare-address-fields.js → prepare-address-fields.ts} +34 -10
- assets/js/base/components/cart-checkout/place-order-button/index.js +5 -1
- assets/js/base/components/cart-checkout/totals/coupon/index.js +0 -1
- assets/js/base/components/cart-checkout/totals/coupon/style.scss +4 -0
- assets/js/base/components/chip/stories/index.js +42 -0
- assets/js/base/components/country-input/CountryInputProps.ts +15 -0
- assets/js/base/components/country-input/billing-country-input.js +0 -28
- assets/js/base/components/country-input/billing-country-input.tsx +16 -0
- assets/js/base/components/country-input/{country-input.js → country-input.tsx} +2 -14
- assets/js/base/components/country-input/{index.js → index.ts} +0 -0
- assets/js/base/components/country-input/shipping-country-input.js +0 -28
- assets/js/base/components/country-input/shipping-country-input.tsx +16 -0
- assets/js/base/components/loading-mask/index.js +16 -17
- assets/js/base/components/loading-mask/style.scss +4 -3
- assets/js/base/components/spinner/index.tsx +10 -0
- assets/js/base/components/spinner/style.scss +37 -0
- assets/js/base/components/state-input/StateInputProps.ts +15 -0
- assets/js/base/components/state-input/billing-state-input.js +0 -25
- assets/js/base/components/state-input/billing-state-input.tsx +16 -0
- assets/js/base/components/state-input/{index.js → index.ts} +0 -0
- assets/js/base/components/state-input/shipping-state-input.js +0 -28
- assets/js/base/components/state-input/shipping-state-input.tsx +16 -0
- assets/js/base/components/state-input/{state-input.js → state-input.tsx} +2 -18
- assets/js/base/components/text-input/text-input.tsx +3 -37
- assets/js/base/components/text-input/validated-text-input.tsx +4 -1
- assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts +19 -2
- assets/js/base/context/hooks/payment-methods/use-payment-methods.js +19 -6
- assets/js/base/context/hooks/test/use-checkout-submit.js +6 -1
- assets/js/base/context/hooks/use-checkout-submit.js +10 -4
- assets/js/base/context/hooks/use-store-events.ts +10 -3
- assets/js/base/context/providers/cart-checkout/checkout/processor/index.js +9 -11
- assets/js/base/context/providers/cart-checkout/payment-methods/actions.ts +63 -92
- assets/js/base/context/providers/cart-checkout/payment-methods/constants.ts +3 -0
- assets/js/base/context/providers/cart-checkout/payment-methods/payment-method-data-context.tsx +88 -196
- assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts +8 -11
- assets/js/base/context/providers/cart-checkout/payment-methods/types.ts +12 -3
- assets/js/base/context/providers/cart-checkout/payment-methods/use-active-payment-method.ts +38 -0
- assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-dispatchers.ts +105 -0
- assets/js/base/context/providers/cart-checkout/payment-methods/utils.ts +3 -0
- assets/js/base/context/providers/validation/components/validation-input-error/index.js +2 -1
- assets/js/base/hooks/use-shallow-equal.ts +4 -5
- assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap +1869 -1785
- assets/js/blocks/cart-checkout/checkout/form/billing-fields-step.js +3 -4
- assets/js/blocks/cart-checkout/checkout/form/contact-fields-step.js +4 -2
- assets/js/blocks/cart-checkout/checkout/form/order-notes-step.js +5 -7
- assets/js/blocks/cart-checkout/checkout/form/payment-method-step.js +4 -6
- assets/js/blocks/cart-checkout/checkout/form/shipping-fields-step.js +3 -3
- assets/js/blocks/cart-checkout/checkout/form/shipping-options-step.tsx +3 -3
- assets/js/blocks/cart-checkout/checkout/sidebar/index.js +7 -0
- assets/js/blocks/cart-checkout/checkout/sidebar/test/__snapshots__/index.js.snap +41 -29
- assets/js/blocks/cart-checkout/payment-methods/express-payment-methods.js +77 -6
- assets/js/blocks/cart-checkout/payment-methods/express-payment/cart-express-payment.js +38 -9
- assets/js/blocks/cart-checkout/payment-methods/express-payment/checkout-express-payment.js +49 -22
- assets/js/blocks/cart-checkout/payment-methods/payment-method-options.js +2 -5
- assets/js/blocks/single-product/frontend.js +2 -0
- assets/js/data/cart/actions.ts +31 -0
- assets/js/editor-components/products-control/index.js +9 -1
- assets/js/settings/blocks/constants.ts +15 -0
- assets/js/settings/shared/default-address-fields.ts +6 -0
- assets/js/settings/shared/utils.ts +3 -3
- assets/js/types/type-defs/cart.ts +4 -0
- assets/js/types/type-defs/contexts.js +3 -3
- build/active-filters-frontend.asset.php +1 -1
- build/active-filters-frontend.js +2 -2
- build/active-filters.asset.php +1 -1
- build/active-filters.js +1 -1
- build/all-products-frontend.asset.php +1 -1
- build/all-products-frontend.js +2 -2
- build/all-products.asset.php +1 -1
- build/all-products.js +1 -1
- build/all-reviews.asset.php +1 -1
- build/all-reviews.js +1 -1
- build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +1 -1
- build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
- build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js +1 -1
- build/atomic-block-components/add-to-cart-frontend.js +1 -1
assets/js/atomic/utils/index.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
-
export * from './get-block-map
|
2 |
-
export * from './create-blocks-from-template
|
3 |
-
export * from './render-parent-block
|
4 |
-
export * from './render-inner-blocks.js';
|
5 |
export * from './block-styling.js';
|
6 |
-
export * from './render-standalone-blocks
|
1 |
+
export * from './get-block-map';
|
2 |
+
export * from './create-blocks-from-template';
|
3 |
+
export * from './render-parent-block';
|
|
|
4 |
export * from './block-styling.js';
|
5 |
+
export * from './render-standalone-blocks';
|
assets/js/atomic/utils/render-inner-blocks.js
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { Suspense, cloneElement, isValidElement } from '@wordpress/element';
|
5 |
-
import parse from 'html-react-parser';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Internal dependencies
|
9 |
-
*/
|
10 |
-
import { getBlockMap } from './get-block-map';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Replaces saved block HTML markup with Inner Block Components.
|
14 |
-
*
|
15 |
-
* @param {Object} props Render props.
|
16 |
-
* @param {Array} props.children Children/inner blocks to render.
|
17 |
-
* @param {string} props.blockName Parent Block Name used to get the block map and for keys.
|
18 |
-
* @param {number} [props.depth] Depth of inner blocks being rendered.
|
19 |
-
*/
|
20 |
-
export const renderInnerBlocks = ( {
|
21 |
-
children,
|
22 |
-
blockName: parentBlockName,
|
23 |
-
depth = 1,
|
24 |
-
} ) => {
|
25 |
-
const blockMap = getBlockMap( parentBlockName );
|
26 |
-
|
27 |
-
return Array.from( children ).map( ( el, index ) => {
|
28 |
-
const componentProps = {
|
29 |
-
...el.dataset,
|
30 |
-
key: `${ parentBlockName }_${ depth }_${ index }`,
|
31 |
-
};
|
32 |
-
|
33 |
-
const componentChildren =
|
34 |
-
el.children && el.children.length
|
35 |
-
? renderInnerBlocks( {
|
36 |
-
children: el.children,
|
37 |
-
blockName: parentBlockName,
|
38 |
-
depth: depth + 1,
|
39 |
-
} )
|
40 |
-
: null;
|
41 |
-
|
42 |
-
const LayoutComponent =
|
43 |
-
componentProps.blockName && blockMap[ componentProps.blockName ]
|
44 |
-
? blockMap[ componentProps.blockName ]
|
45 |
-
: null;
|
46 |
-
|
47 |
-
if ( ! LayoutComponent ) {
|
48 |
-
const element = parse( el.outerHTML );
|
49 |
-
|
50 |
-
if ( isValidElement( element ) ) {
|
51 |
-
return componentChildren
|
52 |
-
? cloneElement( element, componentProps, componentChildren )
|
53 |
-
: cloneElement( element, componentProps );
|
54 |
-
}
|
55 |
-
return null;
|
56 |
-
}
|
57 |
-
|
58 |
-
return (
|
59 |
-
<Suspense
|
60 |
-
key={ `${ parentBlockName }_${ depth }_${ index }_suspense` }
|
61 |
-
fallback={ <div className="wc-block-placeholder" /> }
|
62 |
-
>
|
63 |
-
<LayoutComponent { ...componentProps }>
|
64 |
-
{ componentChildren }
|
65 |
-
</LayoutComponent>
|
66 |
-
</Suspense>
|
67 |
-
);
|
68 |
-
} );
|
69 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/atomic/utils/render-parent-block.js
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { renderFrontend } from '@woocommerce/base-utils';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Internal dependencies
|
8 |
-
*/
|
9 |
-
import { renderInnerBlocks } from './render-inner-blocks';
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Renders a block component in the place of a specified set of selectors.
|
13 |
-
*
|
14 |
-
* @param {Object} props Render props.
|
15 |
-
* @param {Function} props.Block React component to use as a replacement.
|
16 |
-
* @param {string} props.selector CSS selector to match the elements to replace.
|
17 |
-
* @param {string} [props.blockName] Optional Block Name. Used for inner block component mapping.
|
18 |
-
* @param {Function} [props.getProps] Function to generate the props object for the block.
|
19 |
-
*/
|
20 |
-
export const renderParentBlock = ( {
|
21 |
-
Block,
|
22 |
-
selector,
|
23 |
-
blockName = '',
|
24 |
-
getProps = () => {},
|
25 |
-
} ) => {
|
26 |
-
const getPropsWithChildren = ( el, i ) => {
|
27 |
-
const children =
|
28 |
-
el.children && el.children.length
|
29 |
-
? renderInnerBlocks( {
|
30 |
-
blockName,
|
31 |
-
children: el.children,
|
32 |
-
} )
|
33 |
-
: null;
|
34 |
-
return { ...getProps( el, i ), children };
|
35 |
-
};
|
36 |
-
renderFrontend( {
|
37 |
-
Block,
|
38 |
-
selector,
|
39 |
-
getProps: getPropsWithChildren,
|
40 |
-
} );
|
41 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/atomic/utils/render-parent-block.tsx
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { renderFrontend } from '@woocommerce/base-utils';
|
5 |
+
import {
|
6 |
+
Fragment,
|
7 |
+
Suspense,
|
8 |
+
cloneElement,
|
9 |
+
isValidElement,
|
10 |
+
} from '@wordpress/element';
|
11 |
+
import parse from 'html-react-parser';
|
12 |
+
|
13 |
+
interface renderBlockProps {
|
14 |
+
// Parent Block Name. Used for inner block component mapping.
|
15 |
+
blockName: string;
|
16 |
+
// Map of block names to block components for children.
|
17 |
+
blockMap: Record< string, React.ReactNode >;
|
18 |
+
// Wrapper for inner components.
|
19 |
+
blockWrapper?: React.ReactNode;
|
20 |
+
}
|
21 |
+
|
22 |
+
interface renderParentBlockProps extends renderBlockProps {
|
23 |
+
// React component to use as a replacement.
|
24 |
+
Block: React.FunctionComponent;
|
25 |
+
// CSS selector to match the elements to replace.
|
26 |
+
selector: string;
|
27 |
+
// Function to generate the props object for the block.
|
28 |
+
getProps: ( el: Element, i: number ) => Record< string, unknown >;
|
29 |
+
}
|
30 |
+
|
31 |
+
interface renderInnerBlockProps extends renderBlockProps {
|
32 |
+
children: HTMLCollection;
|
33 |
+
depth?: number;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Replaces saved block HTML markup with Inner Block Components.
|
38 |
+
*/
|
39 |
+
const renderInnerBlocks = ( {
|
40 |
+
blockName: parentBlockName,
|
41 |
+
blockMap,
|
42 |
+
blockWrapper,
|
43 |
+
depth = 1,
|
44 |
+
children,
|
45 |
+
}: renderInnerBlockProps ): ( JSX.Element | null )[] | null => {
|
46 |
+
return Array.from( children ).map( ( el: Element, index: number ) => {
|
47 |
+
const { blockName = '', ...componentProps } = {
|
48 |
+
key: `${ parentBlockName }_${ depth }_${ index }`,
|
49 |
+
...( el instanceof HTMLElement ? el.dataset : {} ),
|
50 |
+
};
|
51 |
+
|
52 |
+
const componentChildren =
|
53 |
+
el.children && el.children.length
|
54 |
+
? renderInnerBlocks( {
|
55 |
+
children: el.children,
|
56 |
+
blockName: parentBlockName,
|
57 |
+
blockMap,
|
58 |
+
depth: depth + 1,
|
59 |
+
blockWrapper,
|
60 |
+
} )
|
61 |
+
: null;
|
62 |
+
|
63 |
+
const LayoutComponent =
|
64 |
+
blockName && blockMap[ blockName ]
|
65 |
+
? ( blockMap[ blockName ] as React.ElementType )
|
66 |
+
: null;
|
67 |
+
|
68 |
+
if ( ! LayoutComponent ) {
|
69 |
+
const element = parse( el.outerHTML );
|
70 |
+
|
71 |
+
if ( isValidElement( element ) ) {
|
72 |
+
return componentChildren
|
73 |
+
? cloneElement( element, componentProps, componentChildren )
|
74 |
+
: cloneElement( element, componentProps );
|
75 |
+
}
|
76 |
+
return null;
|
77 |
+
}
|
78 |
+
|
79 |
+
const LayoutComponentWrapper = ( blockWrapper
|
80 |
+
? blockWrapper
|
81 |
+
: Fragment ) as React.ElementType;
|
82 |
+
|
83 |
+
return (
|
84 |
+
<Suspense
|
85 |
+
key={ `${ parentBlockName }_${ depth }_${ index }_suspense` }
|
86 |
+
fallback={ <div className="wc-block-placeholder" /> }
|
87 |
+
>
|
88 |
+
<LayoutComponentWrapper>
|
89 |
+
<LayoutComponent { ...componentProps }>
|
90 |
+
{ componentChildren }
|
91 |
+
</LayoutComponent>
|
92 |
+
</LayoutComponentWrapper>
|
93 |
+
</Suspense>
|
94 |
+
);
|
95 |
+
} );
|
96 |
+
};
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Renders a block component in the place of a specified set of selectors.
|
100 |
+
*/
|
101 |
+
export const renderParentBlock = ( {
|
102 |
+
Block,
|
103 |
+
selector,
|
104 |
+
blockName,
|
105 |
+
getProps = () => ( {} ),
|
106 |
+
blockMap,
|
107 |
+
blockWrapper,
|
108 |
+
}: renderParentBlockProps ): void => {
|
109 |
+
const getPropsWithChildren = ( el: Element, i: number ) => {
|
110 |
+
const children =
|
111 |
+
el.children && el.children.length
|
112 |
+
? renderInnerBlocks( {
|
113 |
+
blockName,
|
114 |
+
blockMap,
|
115 |
+
children: el.children,
|
116 |
+
blockWrapper,
|
117 |
+
} )
|
118 |
+
: null;
|
119 |
+
return { ...getProps( el, i ), children };
|
120 |
+
};
|
121 |
+
renderFrontend( {
|
122 |
+
Block,
|
123 |
+
selector,
|
124 |
+
getProps: getPropsWithChildren,
|
125 |
+
} );
|
126 |
+
};
|
assets/js/base/components/cart-checkout/address-form/{address-form.js → address-form.tsx}
RENAMED
@@ -16,7 +16,13 @@ import { useEffect, useMemo } from '@wordpress/element';
|
|
16 |
import { __ } from '@wordpress/i18n';
|
17 |
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
|
18 |
import { useShallowEqual } from '@woocommerce/base-hooks';
|
19 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
/**
|
22 |
* Internal dependencies
|
@@ -26,11 +32,11 @@ import prepareAddressFields from './prepare-address-fields';
|
|
26 |
// If it's the shipping address form and the user starts entering address
|
27 |
// values without having set the country first, show an error.
|
28 |
const validateShippingCountry = (
|
29 |
-
values,
|
30 |
-
setValidationErrors,
|
31 |
-
clearValidationError,
|
32 |
-
hasValidationError
|
33 |
-
) => {
|
34 |
if (
|
35 |
! hasValidationError &&
|
36 |
! values.country &&
|
@@ -51,6 +57,15 @@ const validateShippingCountry = (
|
|
51 |
}
|
52 |
};
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* Checkout address form.
|
56 |
*
|
@@ -65,13 +80,15 @@ const validateShippingCountry = (
|
|
65 |
*/
|
66 |
const AddressForm = ( {
|
67 |
id,
|
68 |
-
fields = Object.keys(
|
69 |
-
|
|
|
|
|
70 |
instanceId,
|
71 |
onChange,
|
72 |
type = 'shipping',
|
73 |
values,
|
74 |
-
} ) => {
|
75 |
const {
|
76 |
getValidationError,
|
77 |
setValidationErrors,
|
@@ -80,8 +97,12 @@ const AddressForm = ( {
|
|
80 |
|
81 |
const currentFields = useShallowEqual( fields );
|
82 |
|
83 |
-
const countryValidationError =
|
84 |
-
|
|
|
|
|
|
|
|
|
85 |
|
86 |
const addressFormFields = useMemo( () => {
|
87 |
return prepareAddressFields(
|
@@ -97,7 +118,7 @@ const AddressForm = ( {
|
|
97 |
values,
|
98 |
setValidationErrors,
|
99 |
clearValidationError,
|
100 |
-
countryValidationError.message &&
|
101 |
! countryValidationError.hidden
|
102 |
);
|
103 |
}
|
@@ -195,7 +216,7 @@ const AddressForm = ( {
|
|
195 |
value={ values[ field.key ] }
|
196 |
autoCapitalize={ field.autocapitalize }
|
197 |
autoComplete={ field.autocomplete }
|
198 |
-
onChange={ ( newValue ) =>
|
199 |
onChange( {
|
200 |
...values,
|
201 |
[ field.key ]: newValue,
|
16 |
import { __ } from '@wordpress/i18n';
|
17 |
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
|
18 |
import { useShallowEqual } from '@woocommerce/base-hooks';
|
19 |
+
import {
|
20 |
+
AddressField,
|
21 |
+
AddressFields,
|
22 |
+
AddressType,
|
23 |
+
defaultAddressFields,
|
24 |
+
EnteredAddress,
|
25 |
+
} from '@woocommerce/settings';
|
26 |
|
27 |
/**
|
28 |
* Internal dependencies
|
32 |
// If it's the shipping address form and the user starts entering address
|
33 |
// values without having set the country first, show an error.
|
34 |
const validateShippingCountry = (
|
35 |
+
values: EnteredAddress,
|
36 |
+
setValidationErrors: ( errors: Record< string, unknown > ) => void,
|
37 |
+
clearValidationError: ( error: string ) => void,
|
38 |
+
hasValidationError: boolean
|
39 |
+
): void => {
|
40 |
if (
|
41 |
! hasValidationError &&
|
42 |
! values.country &&
|
57 |
}
|
58 |
};
|
59 |
|
60 |
+
interface AddressFormProps {
|
61 |
+
id: string;
|
62 |
+
instanceId: string;
|
63 |
+
fields: ( keyof AddressFields )[];
|
64 |
+
fieldConfig: Record< keyof AddressFields, Partial< AddressField > >;
|
65 |
+
onChange: ( newValue: EnteredAddress ) => void;
|
66 |
+
type: AddressType;
|
67 |
+
values: EnteredAddress;
|
68 |
+
}
|
69 |
/**
|
70 |
* Checkout address form.
|
71 |
*
|
80 |
*/
|
81 |
const AddressForm = ( {
|
82 |
id,
|
83 |
+
fields = ( Object.keys(
|
84 |
+
defaultAddressFields
|
85 |
+
) as unknown ) as ( keyof AddressFields )[],
|
86 |
+
fieldConfig = {} as Record< keyof AddressFields, Partial< AddressField > >,
|
87 |
instanceId,
|
88 |
onChange,
|
89 |
type = 'shipping',
|
90 |
values,
|
91 |
+
}: AddressFormProps ): JSX.Element => {
|
92 |
const {
|
93 |
getValidationError,
|
94 |
setValidationErrors,
|
97 |
|
98 |
const currentFields = useShallowEqual( fields );
|
99 |
|
100 |
+
const countryValidationError = ( getValidationError(
|
101 |
+
'shipping-missing-country'
|
102 |
+
) || {} ) as {
|
103 |
+
message: string;
|
104 |
+
hidden: boolean;
|
105 |
+
};
|
106 |
|
107 |
const addressFormFields = useMemo( () => {
|
108 |
return prepareAddressFields(
|
118 |
values,
|
119 |
setValidationErrors,
|
120 |
clearValidationError,
|
121 |
+
!! countryValidationError.message &&
|
122 |
! countryValidationError.hidden
|
123 |
);
|
124 |
}
|
216 |
value={ values[ field.key ] }
|
217 |
autoCapitalize={ field.autocapitalize }
|
218 |
autoComplete={ field.autocomplete }
|
219 |
+
onChange={ ( newValue: string ) =>
|
220 |
onChange( {
|
221 |
...values,
|
222 |
[ field.key ]: newValue,
|
assets/js/base/components/cart-checkout/address-form/{index.js → index.ts}
RENAMED
File without changes
|
assets/js/base/components/cart-checkout/address-form/{prepare-address-fields.js → prepare-address-fields.ts}
RENAMED
@@ -3,8 +3,17 @@
|
|
3 |
/**
|
4 |
* External dependencies
|
5 |
*/
|
6 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
import { __, sprintf } from '@wordpress/i18n';
|
|
|
8 |
|
9 |
/**
|
10 |
* This is locale data from WooCommerce countries class. This doesn't match the shape of the new field data blocks uses,
|
@@ -12,7 +21,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
12 |
*
|
13 |
* This supports new properties such as optionalLabel which are not used by core (yet).
|
14 |
*/
|
15 |
-
const coreLocale = getSetting( 'countryLocale', {} );
|
16 |
|
17 |
/**
|
18 |
* Gets props from the core locale, then maps them to the shape we require in the client.
|
@@ -22,8 +31,10 @@ const coreLocale = getSetting( 'countryLocale', {} );
|
|
22 |
* @param {Object} localeField Locale fields from WooCommerce.
|
23 |
* @return {Object} Supported locale fields.
|
24 |
*/
|
25 |
-
const getSupportedCoreLocaleProps = (
|
26 |
-
|
|
|
|
|
27 |
|
28 |
if ( localeField.label !== undefined ) {
|
29 |
fields.label = localeField.label;
|
@@ -46,17 +57,22 @@ const getSupportedCoreLocaleProps = ( localeField ) => {
|
|
46 |
}
|
47 |
|
48 |
if ( localeField.priority ) {
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
-
if ( localeField.hidden
|
53 |
fields.required = false;
|
54 |
}
|
55 |
|
56 |
return fields;
|
57 |
};
|
58 |
|
59 |
-
const countryAddressFields = Object.entries( coreLocale )
|
60 |
.map( ( [ country, countryLocale ] ) => [
|
61 |
country,
|
62 |
Object.entries( countryLocale )
|
@@ -65,11 +81,15 @@ const countryAddressFields = Object.entries( coreLocale )
|
|
65 |
getSupportedCoreLocaleProps( localeField ),
|
66 |
] )
|
67 |
.reduce( ( obj, [ key, val ] ) => {
|
|
|
|
|
68 |
obj[ key ] = val;
|
69 |
return obj;
|
70 |
}, {} ),
|
71 |
] )
|
72 |
.reduce( ( obj, [ key, val ] ) => {
|
|
|
|
|
73 |
obj[ key ] = val;
|
74 |
return obj;
|
75 |
}, {} );
|
@@ -82,11 +102,15 @@ const countryAddressFields = Object.entries( coreLocale )
|
|
82 |
* @param {string} addressCountry Address country code. If unknown, locale fields will not be merged.
|
83 |
* @return {CountryAddressFields} Object containing address fields.
|
84 |
*/
|
85 |
-
const prepareAddressFields = (
|
86 |
-
|
|
|
|
|
|
|
|
|
87 |
addressCountry && countryAddressFields[ addressCountry ] !== undefined
|
88 |
? countryAddressFields[ addressCountry ]
|
89 |
-
: {};
|
90 |
|
91 |
return fields
|
92 |
.map( ( field ) => {
|
3 |
/**
|
4 |
* External dependencies
|
5 |
*/
|
6 |
+
import {
|
7 |
+
AddressField,
|
8 |
+
AddressFields,
|
9 |
+
CountryAddressFields,
|
10 |
+
defaultAddressFields,
|
11 |
+
getSetting,
|
12 |
+
KeyedAddressField,
|
13 |
+
LocaleSpecificAddressField,
|
14 |
+
} from '@woocommerce/settings';
|
15 |
import { __, sprintf } from '@wordpress/i18n';
|
16 |
+
import { isNumber, isString } from '@woocommerce/types';
|
17 |
|
18 |
/**
|
19 |
* This is locale data from WooCommerce countries class. This doesn't match the shape of the new field data blocks uses,
|
21 |
*
|
22 |
* This supports new properties such as optionalLabel which are not used by core (yet).
|
23 |
*/
|
24 |
+
const coreLocale = getSetting< CountryAddressFields >( 'countryLocale', {} );
|
25 |
|
26 |
/**
|
27 |
* Gets props from the core locale, then maps them to the shape we require in the client.
|
31 |
* @param {Object} localeField Locale fields from WooCommerce.
|
32 |
* @return {Object} Supported locale fields.
|
33 |
*/
|
34 |
+
const getSupportedCoreLocaleProps = (
|
35 |
+
localeField: LocaleSpecificAddressField
|
36 |
+
): Partial< AddressField > => {
|
37 |
+
const fields: Partial< AddressField > = {};
|
38 |
|
39 |
if ( localeField.label !== undefined ) {
|
40 |
fields.label = localeField.label;
|
57 |
}
|
58 |
|
59 |
if ( localeField.priority ) {
|
60 |
+
if ( isNumber( localeField.priority ) ) {
|
61 |
+
fields.index = localeField.priority;
|
62 |
+
}
|
63 |
+
if ( isString( localeField.priority ) ) {
|
64 |
+
fields.index = parseInt( localeField.priority, 10 );
|
65 |
+
}
|
66 |
}
|
67 |
|
68 |
+
if ( localeField.hidden ) {
|
69 |
fields.required = false;
|
70 |
}
|
71 |
|
72 |
return fields;
|
73 |
};
|
74 |
|
75 |
+
const countryAddressFields: CountryAddressFields = Object.entries( coreLocale )
|
76 |
.map( ( [ country, countryLocale ] ) => [
|
77 |
country,
|
78 |
Object.entries( countryLocale )
|
81 |
getSupportedCoreLocaleProps( localeField ),
|
82 |
] )
|
83 |
.reduce( ( obj, [ key, val ] ) => {
|
84 |
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
85 |
+
// @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
|
86 |
obj[ key ] = val;
|
87 |
return obj;
|
88 |
}, {} ),
|
89 |
] )
|
90 |
.reduce( ( obj, [ key, val ] ) => {
|
91 |
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
92 |
+
// @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
|
93 |
obj[ key ] = val;
|
94 |
return obj;
|
95 |
}, {} );
|
102 |
* @param {string} addressCountry Address country code. If unknown, locale fields will not be merged.
|
103 |
* @return {CountryAddressFields} Object containing address fields.
|
104 |
*/
|
105 |
+
const prepareAddressFields = (
|
106 |
+
fields: ( keyof AddressFields )[],
|
107 |
+
fieldConfigs: Record< string, Partial< AddressField > >,
|
108 |
+
addressCountry = ''
|
109 |
+
): KeyedAddressField[] => {
|
110 |
+
const localeConfigs: AddressFields =
|
111 |
addressCountry && countryAddressFields[ addressCountry ] !== undefined
|
112 |
? countryAddressFields[ addressCountry ]
|
113 |
+
: ( {} as AddressFields );
|
114 |
|
115 |
return fields
|
116 |
.map( ( field ) => {
|
assets/js/base/components/cart-checkout/place-order-button/index.js
CHANGED
@@ -11,6 +11,7 @@ const PlaceOrderButton = () => {
|
|
11 |
submitButtonText,
|
12 |
onSubmit,
|
13 |
isCalculating,
|
|
|
14 |
waitingForProcessing,
|
15 |
waitingForRedirect,
|
16 |
} = useCheckoutSubmit();
|
@@ -20,7 +21,10 @@ const PlaceOrderButton = () => {
|
|
20 |
className="wc-block-components-checkout-place-order-button"
|
21 |
onClick={ onSubmit }
|
22 |
disabled={
|
23 |
-
isCalculating ||
|
|
|
|
|
|
|
24 |
}
|
25 |
showSpinner={ waitingForProcessing }
|
26 |
>
|
11 |
submitButtonText,
|
12 |
onSubmit,
|
13 |
isCalculating,
|
14 |
+
isDisabled,
|
15 |
waitingForProcessing,
|
16 |
waitingForRedirect,
|
17 |
} = useCheckoutSubmit();
|
21 |
className="wc-block-components-checkout-place-order-button"
|
22 |
onClick={ onSubmit }
|
23 |
disabled={
|
24 |
+
isCalculating ||
|
25 |
+
isDisabled ||
|
26 |
+
waitingForProcessing ||
|
27 |
+
waitingForRedirect
|
28 |
}
|
29 |
showSpinner={ waitingForProcessing }
|
30 |
>
|
assets/js/base/components/cart-checkout/totals/coupon/index.js
CHANGED
@@ -27,7 +27,6 @@ const TotalsCoupon = ( {
|
|
27 |
const [ couponValue, setCouponValue ] = useState( '' );
|
28 |
const currentIsLoading = useRef( false );
|
29 |
const { getValidationError, getValidationErrorId } = useValidationContext();
|
30 |
-
|
31 |
const validationError = getValidationError( 'coupon' );
|
32 |
|
33 |
useEffect( () => {
|
27 |
const [ couponValue, setCouponValue ] = useState( '' );
|
28 |
const currentIsLoading = useRef( false );
|
29 |
const { getValidationError, getValidationErrorId } = useValidationContext();
|
|
|
30 |
const validationError = getValidationError( 'coupon' );
|
31 |
|
32 |
useEffect( () => {
|
assets/js/base/components/cart-checkout/totals/coupon/style.scss
CHANGED
@@ -17,6 +17,10 @@
|
|
17 |
padding-right: $gap-large;
|
18 |
white-space: nowrap;
|
19 |
}
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
.wc-block-components-totals-coupon__content {
|
17 |
padding-right: $gap-large;
|
18 |
white-space: nowrap;
|
19 |
}
|
20 |
+
|
21 |
+
.wc-block-components-totals-coupon__button.no-margin {
|
22 |
+
margin: 0;
|
23 |
+
}
|
24 |
}
|
25 |
|
26 |
.wc-block-components-totals-coupon__content {
|
assets/js/base/components/chip/stories/index.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { text, select, boolean } from '@storybook/addon-knobs';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import * as components from '../';
|
10 |
+
|
11 |
+
export default {
|
12 |
+
title: 'WooCommerce Blocks/@base-components/Chip',
|
13 |
+
component: Chip,
|
14 |
+
};
|
15 |
+
|
16 |
+
const radii = [ 'none', 'small', 'medium', 'large' ];
|
17 |
+
|
18 |
+
export const Chip = () => (
|
19 |
+
<components.Chip
|
20 |
+
text={ text( 'Text', 'example' ) }
|
21 |
+
radius={ select( 'Radius', radii ) }
|
22 |
+
screenReaderText={ text(
|
23 |
+
'Screen reader text',
|
24 |
+
'Example screen reader text'
|
25 |
+
) }
|
26 |
+
element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) }
|
27 |
+
/>
|
28 |
+
);
|
29 |
+
|
30 |
+
export const RemovableChip = () => (
|
31 |
+
<components.RemovableChip
|
32 |
+
text={ text( 'Text', 'example' ) }
|
33 |
+
radius={ select( 'Radius', radii ) }
|
34 |
+
screenReaderText={ text(
|
35 |
+
'Screen reader text',
|
36 |
+
'Example screen reader text'
|
37 |
+
) }
|
38 |
+
disabled={ boolean( 'Disabled', false ) }
|
39 |
+
removeOnAnyClick={ boolean( 'Remove on any click', false ) }
|
40 |
+
element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) }
|
41 |
+
/>
|
42 |
+
);
|
assets/js/base/components/country-input/CountryInputProps.ts
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export interface CountryInputProps {
|
2 |
+
className?: string;
|
3 |
+
label: string;
|
4 |
+
id: string;
|
5 |
+
autoComplete?: string;
|
6 |
+
value: string;
|
7 |
+
onChange: ( value: string ) => void;
|
8 |
+
required?: boolean;
|
9 |
+
errorMessage?: string;
|
10 |
+
errorId: null | 'shipping-missing-country';
|
11 |
+
}
|
12 |
+
|
13 |
+
export type CountryInputWithCountriesProps = CountryInputProps & {
|
14 |
+
countries: Record< string, string >;
|
15 |
+
};
|
assets/js/base/components/country-input/billing-country-input.js
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import PropTypes from 'prop-types';
|
5 |
-
import { getSetting } from '@woocommerce/settings';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Internal dependencies
|
9 |
-
*/
|
10 |
-
import CountryInput from './country-input.js';
|
11 |
-
|
12 |
-
const BillingCountryInput = ( props ) => {
|
13 |
-
return (
|
14 |
-
<CountryInput
|
15 |
-
countries={ getSetting( 'allowedCountries', {} ) }
|
16 |
-
{ ...props }
|
17 |
-
/>
|
18 |
-
);
|
19 |
-
};
|
20 |
-
|
21 |
-
BillingCountryInput.propTypes = {
|
22 |
-
onChange: PropTypes.func.isRequired,
|
23 |
-
className: PropTypes.string,
|
24 |
-
label: PropTypes.string,
|
25 |
-
value: PropTypes.string,
|
26 |
-
};
|
27 |
-
|
28 |
-
export default BillingCountryInput;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/country-input/billing-country-input.tsx
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { ALLOWED_COUNTRIES } from '@woocommerce/block-settings';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import CountryInput from './country-input';
|
10 |
+
import type { CountryInputProps } from './CountryInputProps';
|
11 |
+
|
12 |
+
const BillingCountryInput = ( props: CountryInputProps ): JSX.Element => {
|
13 |
+
return <CountryInput countries={ ALLOWED_COUNTRIES } { ...props } />;
|
14 |
+
};
|
15 |
+
|
16 |
+
export default BillingCountryInput;
|
assets/js/base/components/country-input/{country-input.js → country-input.tsx}
RENAMED
@@ -3,7 +3,6 @@
|
|
3 |
*/
|
4 |
import { useMemo } from '@wordpress/element';
|
5 |
import { __ } from '@wordpress/i18n';
|
6 |
-
import PropTypes from 'prop-types';
|
7 |
import { decodeEntities } from '@wordpress/html-entities';
|
8 |
import classnames from 'classnames';
|
9 |
|
@@ -12,6 +11,7 @@ import classnames from 'classnames';
|
|
12 |
*/
|
13 |
import { ValidatedSelect } from '../select';
|
14 |
import './style.scss';
|
|
|
15 |
|
16 |
const CountryInput = ( {
|
17 |
className,
|
@@ -27,7 +27,7 @@ const CountryInput = ( {
|
|
27 |
'Please select a country.',
|
28 |
'woo-gutenberg-products-block'
|
29 |
),
|
30 |
-
} ) => {
|
31 |
const options = useMemo(
|
32 |
() =>
|
33 |
Object.keys( countries ).map( ( key ) => ( {
|
@@ -81,16 +81,4 @@ const CountryInput = ( {
|
|
81 |
);
|
82 |
};
|
83 |
|
84 |
-
CountryInput.propTypes = {
|
85 |
-
countries: PropTypes.objectOf( PropTypes.string ).isRequired,
|
86 |
-
onChange: PropTypes.func.isRequired,
|
87 |
-
className: PropTypes.string,
|
88 |
-
id: PropTypes.string,
|
89 |
-
label: PropTypes.string,
|
90 |
-
value: PropTypes.string,
|
91 |
-
autoComplete: PropTypes.string,
|
92 |
-
errorId: PropTypes.string,
|
93 |
-
errorMessage: PropTypes.string,
|
94 |
-
};
|
95 |
-
|
96 |
export default CountryInput;
|
3 |
*/
|
4 |
import { useMemo } from '@wordpress/element';
|
5 |
import { __ } from '@wordpress/i18n';
|
|
|
6 |
import { decodeEntities } from '@wordpress/html-entities';
|
7 |
import classnames from 'classnames';
|
8 |
|
11 |
*/
|
12 |
import { ValidatedSelect } from '../select';
|
13 |
import './style.scss';
|
14 |
+
import type { CountryInputWithCountriesProps } from './CountryInputProps';
|
15 |
|
16 |
const CountryInput = ( {
|
17 |
className,
|
27 |
'Please select a country.',
|
28 |
'woo-gutenberg-products-block'
|
29 |
),
|
30 |
+
}: CountryInputWithCountriesProps ): JSX.Element => {
|
31 |
const options = useMemo(
|
32 |
() =>
|
33 |
Object.keys( countries ).map( ( key ) => ( {
|
81 |
);
|
82 |
};
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
export default CountryInput;
|
assets/js/base/components/country-input/{index.js → index.ts}
RENAMED
File without changes
|
assets/js/base/components/country-input/shipping-country-input.js
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import PropTypes from 'prop-types';
|
5 |
-
import { getSetting } from '@woocommerce/settings';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Internal dependencies
|
9 |
-
*/
|
10 |
-
import CountryInput from './country-input.js';
|
11 |
-
|
12 |
-
const ShippingCountryInput = ( props ) => {
|
13 |
-
return (
|
14 |
-
<CountryInput
|
15 |
-
countries={ getSetting( 'shippingCountries', {} ) }
|
16 |
-
{ ...props }
|
17 |
-
/>
|
18 |
-
);
|
19 |
-
};
|
20 |
-
|
21 |
-
ShippingCountryInput.propTypes = {
|
22 |
-
onChange: PropTypes.func.isRequired,
|
23 |
-
className: PropTypes.string,
|
24 |
-
label: PropTypes.string,
|
25 |
-
value: PropTypes.string,
|
26 |
-
};
|
27 |
-
|
28 |
-
export default ShippingCountryInput;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/country-input/shipping-country-input.tsx
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { SHIPPING_COUNTRIES } from '@woocommerce/block-settings';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import CountryInput from './country-input';
|
10 |
+
import { CountryInputProps } from './CountryInputProps';
|
11 |
+
|
12 |
+
const ShippingCountryInput = ( props: CountryInputProps ): JSX.Element => {
|
13 |
+
return <CountryInput countries={ SHIPPING_COUNTRIES } { ...props } />;
|
14 |
+
};
|
15 |
+
|
16 |
+
export default ShippingCountryInput;
|
assets/js/base/components/loading-mask/index.js
CHANGED
@@ -4,13 +4,14 @@
|
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import PropTypes from 'prop-types';
|
6 |
import classNames from 'classnames';
|
7 |
-
import { Spinner } from 'wordpress-components';
|
8 |
|
9 |
/**
|
10 |
* Internal dependencies
|
11 |
*/
|
12 |
import './style.scss';
|
|
|
13 |
|
|
|
14 |
const LoadingMask = ( {
|
15 |
children,
|
16 |
className,
|
@@ -18,29 +19,27 @@ const LoadingMask = ( {
|
|
18 |
showSpinner = false,
|
19 |
isLoading = true,
|
20 |
} ) => {
|
21 |
-
// If nothing is loading, just pass through the children.
|
22 |
-
if ( ! isLoading ) {
|
23 |
-
return children;
|
24 |
-
}
|
25 |
-
|
26 |
return (
|
27 |
<div
|
28 |
-
className={ classNames(
|
29 |
-
|
30 |
-
|
31 |
-
) }
|
32 |
>
|
33 |
-
{ showSpinner && <Spinner /> }
|
34 |
<div
|
35 |
-
className=
|
36 |
-
|
|
|
|
|
37 |
>
|
38 |
{ children }
|
39 |
</div>
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
</div>
|
45 |
);
|
46 |
};
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import PropTypes from 'prop-types';
|
6 |
import classNames from 'classnames';
|
|
|
7 |
|
8 |
/**
|
9 |
* Internal dependencies
|
10 |
*/
|
11 |
import './style.scss';
|
12 |
+
import Spinner from '../spinner';
|
13 |
|
14 |
+
// @todo Find a way to block buttons/form components when LoadingMask isLoading
|
15 |
const LoadingMask = ( {
|
16 |
children,
|
17 |
className,
|
19 |
showSpinner = false,
|
20 |
isLoading = true,
|
21 |
} ) => {
|
|
|
|
|
|
|
|
|
|
|
22 |
return (
|
23 |
<div
|
24 |
+
className={ classNames( className, {
|
25 |
+
'wc-block-components-loading-mask': isLoading,
|
26 |
+
} ) }
|
|
|
27 |
>
|
28 |
+
{ isLoading && showSpinner && <Spinner /> }
|
29 |
<div
|
30 |
+
className={ classNames( {
|
31 |
+
'wc-block-components-loading-mask__children': isLoading,
|
32 |
+
} ) }
|
33 |
+
aria-hidden={ isLoading }
|
34 |
>
|
35 |
{ children }
|
36 |
</div>
|
37 |
+
{ isLoading && (
|
38 |
+
<span className="screen-reader-text">
|
39 |
+
{ screenReaderLabel ||
|
40 |
+
__( 'Loading…', 'woo-gutenberg-products-block' ) }
|
41 |
+
</span>
|
42 |
+
) }
|
43 |
</div>
|
44 |
);
|
45 |
};
|
assets/js/base/components/loading-mask/style.scss
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
.wc-block-components-loading-mask {
|
2 |
position: relative;
|
3 |
min-height: 18px + $gap;
|
|
|
4 |
|
5 |
.components-spinner {
|
6 |
position: absolute;
|
@@ -9,8 +10,8 @@
|
|
9 |
left: 50%;
|
10 |
transform: translate(-50%, -50%);
|
11 |
}
|
12 |
-
}
|
13 |
|
14 |
-
.wc-block-components-loading-mask__children {
|
15 |
-
|
|
|
16 |
}
|
1 |
.wc-block-components-loading-mask {
|
2 |
position: relative;
|
3 |
min-height: 18px + $gap;
|
4 |
+
pointer-events: none;
|
5 |
|
6 |
.components-spinner {
|
7 |
position: absolute;
|
10 |
left: 50%;
|
11 |
transform: translate(-50%, -50%);
|
12 |
}
|
|
|
13 |
|
14 |
+
.wc-block-components-loading-mask__children {
|
15 |
+
opacity: 0.25;
|
16 |
+
}
|
17 |
}
|
assets/js/base/components/spinner/index.tsx
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import './style.scss';
|
5 |
+
|
6 |
+
const Spinner = (): JSX.Element => {
|
7 |
+
return <span className="wc-block-components-spinner" aria-hidden="true" />;
|
8 |
+
};
|
9 |
+
|
10 |
+
export default Spinner;
|
assets/js/base/components/spinner/style.scss
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-components-spinner {
|
2 |
+
position: absolute;
|
3 |
+
width: 100%;
|
4 |
+
height: 100%;
|
5 |
+
color: inherit;
|
6 |
+
box-sizing: content-box;
|
7 |
+
text-align: center;
|
8 |
+
font-size: 1.25em;
|
9 |
+
|
10 |
+
&::after {
|
11 |
+
content: " ";
|
12 |
+
position: absolute;
|
13 |
+
top: 50%;
|
14 |
+
left: 50%;
|
15 |
+
margin: -0.5em 0 0 -0.5em;
|
16 |
+
width: 1em;
|
17 |
+
height: 1em;
|
18 |
+
box-sizing: border-box;
|
19 |
+
transform-origin: 50% 50%;
|
20 |
+
transform: translateZ(0) scale(0.5);
|
21 |
+
backface-visibility: hidden;
|
22 |
+
border-radius: 50%;
|
23 |
+
border: 0.2em solid currentColor;
|
24 |
+
border-left-color: transparent;
|
25 |
+
animation: wc-block-components-spinner__animation 1s infinite linear;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
@keyframes wc-block-components-spinner__animation {
|
30 |
+
0% {
|
31 |
+
animation-timing-function: cubic-bezier(0.5856, 0.0703, 0.4143, 0.9297);
|
32 |
+
transform: rotate(0deg);
|
33 |
+
}
|
34 |
+
100% {
|
35 |
+
transform: rotate(360deg);
|
36 |
+
}
|
37 |
+
}
|
assets/js/base/components/state-input/StateInputProps.ts
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export interface StateInputProps {
|
2 |
+
className?: string;
|
3 |
+
label: string;
|
4 |
+
id: string;
|
5 |
+
autoComplete?: string;
|
6 |
+
value: string;
|
7 |
+
country: string;
|
8 |
+
onChange: ( value: string ) => void;
|
9 |
+
required?: boolean;
|
10 |
+
errorMessage?: string;
|
11 |
+
}
|
12 |
+
|
13 |
+
export type StateInputWithStatesProps = StateInputProps & {
|
14 |
+
states: Record< string, Record< string, string > >;
|
15 |
+
};
|
assets/js/base/components/state-input/billing-state-input.js
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import PropTypes from 'prop-types';
|
5 |
-
import { getSetting } from '@woocommerce/settings';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Internal dependencies
|
9 |
-
*/
|
10 |
-
import StateInput from './state-input.js';
|
11 |
-
|
12 |
-
const BillingStateInput = ( props ) => {
|
13 |
-
return (
|
14 |
-
<StateInput states={ getSetting( 'allowedStates', {} ) } { ...props } />
|
15 |
-
);
|
16 |
-
};
|
17 |
-
|
18 |
-
BillingStateInput.propTypes = {
|
19 |
-
onChange: PropTypes.func.isRequired,
|
20 |
-
className: PropTypes.string,
|
21 |
-
label: PropTypes.string,
|
22 |
-
value: PropTypes.string,
|
23 |
-
};
|
24 |
-
|
25 |
-
export default BillingStateInput;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/state-input/billing-state-input.tsx
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { ALLOWED_STATES } from '@woocommerce/block-settings';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import StateInput from './state-input';
|
10 |
+
import type { StateInputProps } from './StateInputProps';
|
11 |
+
|
12 |
+
const BillingStateInput = ( props: StateInputProps ): JSX.Element => {
|
13 |
+
return <StateInput states={ ALLOWED_STATES } { ...props } />;
|
14 |
+
};
|
15 |
+
|
16 |
+
export default BillingStateInput;
|
assets/js/base/components/state-input/{index.js → index.ts}
RENAMED
File without changes
|
assets/js/base/components/state-input/shipping-state-input.js
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import PropTypes from 'prop-types';
|
5 |
-
import { getSetting } from '@woocommerce/settings';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Internal dependencies
|
9 |
-
*/
|
10 |
-
import StateInput from './state-input.js';
|
11 |
-
|
12 |
-
const ShippingStateInput = ( props ) => {
|
13 |
-
return (
|
14 |
-
<StateInput
|
15 |
-
states={ getSetting( 'shippingStates', {} ) }
|
16 |
-
{ ...props }
|
17 |
-
/>
|
18 |
-
);
|
19 |
-
};
|
20 |
-
|
21 |
-
ShippingStateInput.propTypes = {
|
22 |
-
onChange: PropTypes.func.isRequired,
|
23 |
-
className: PropTypes.string,
|
24 |
-
label: PropTypes.string,
|
25 |
-
value: PropTypes.string,
|
26 |
-
};
|
27 |
-
|
28 |
-
export default ShippingStateInput;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/state-input/shipping-state-input.tsx
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { SHIPPING_STATES } from '@woocommerce/block-settings';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import StateInput from './state-input';
|
10 |
+
import type { StateInputProps } from './StateInputProps';
|
11 |
+
|
12 |
+
const ShippingStateInput = ( props: StateInputProps ): JSX.Element => {
|
13 |
+
return <StateInput states={ SHIPPING_STATES } { ...props } />;
|
14 |
+
};
|
15 |
+
|
16 |
+
export default ShippingStateInput;
|
assets/js/base/components/state-input/{state-input.js → state-input.tsx}
RENAMED
@@ -2,7 +2,6 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
-
import PropTypes from 'prop-types';
|
6 |
import { decodeEntities } from '@wordpress/html-entities';
|
7 |
import { useCallback, useMemo } from '@wordpress/element';
|
8 |
import classnames from 'classnames';
|
@@ -13,6 +12,7 @@ import classnames from 'classnames';
|
|
13 |
import { ValidatedTextInput } from '../text-input';
|
14 |
import { ValidatedSelect } from '../select';
|
15 |
import './style.scss';
|
|
|
16 |
|
17 |
const StateInput = ( {
|
18 |
className,
|
@@ -24,7 +24,7 @@ const StateInput = ( {
|
|
24 |
autoComplete = 'off',
|
25 |
value = '',
|
26 |
required = false,
|
27 |
-
} ) => {
|
28 |
const countryStates = states[ country ];
|
29 |
const options = useMemo(
|
30 |
() =>
|
@@ -112,20 +112,4 @@ const StateInput = ( {
|
|
112 |
);
|
113 |
};
|
114 |
|
115 |
-
StateInput.propTypes = {
|
116 |
-
states: PropTypes.objectOf(
|
117 |
-
PropTypes.oneOfType( [
|
118 |
-
PropTypes.array,
|
119 |
-
PropTypes.objectOf( PropTypes.string ),
|
120 |
-
] )
|
121 |
-
).isRequired,
|
122 |
-
onChange: PropTypes.func.isRequired,
|
123 |
-
autoComplete: PropTypes.string,
|
124 |
-
id: PropTypes.string,
|
125 |
-
className: PropTypes.string,
|
126 |
-
country: PropTypes.string,
|
127 |
-
label: PropTypes.string,
|
128 |
-
value: PropTypes.string,
|
129 |
-
};
|
130 |
-
|
131 |
export default StateInput;
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
|
|
5 |
import { decodeEntities } from '@wordpress/html-entities';
|
6 |
import { useCallback, useMemo } from '@wordpress/element';
|
7 |
import classnames from 'classnames';
|
12 |
import { ValidatedTextInput } from '../text-input';
|
13 |
import { ValidatedSelect } from '../select';
|
14 |
import './style.scss';
|
15 |
+
import type { StateInputWithStatesProps } from './StateInputProps';
|
16 |
|
17 |
const StateInput = ( {
|
18 |
className,
|
24 |
autoComplete = 'off',
|
25 |
value = '',
|
26 |
required = false,
|
27 |
+
}: StateInputWithStatesProps ): JSX.Element => {
|
28 |
const countryStates = states[ country ];
|
29 |
const options = useMemo(
|
30 |
() =>
|
112 |
);
|
113 |
};
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
export default StateInput;
|
assets/js/base/components/text-input/text-input.tsx
CHANGED
@@ -11,13 +11,6 @@ import { Label } from '@woocommerce/blocks-checkout';
|
|
11 |
*/
|
12 |
import './style.scss';
|
13 |
|
14 |
-
interface TextInputPropsWithNumberType {
|
15 |
-
type: 'number';
|
16 |
-
step?: number;
|
17 |
-
min?: number;
|
18 |
-
max?: number;
|
19 |
-
}
|
20 |
-
|
21 |
interface TextInputProps
|
22 |
extends Omit<
|
23 |
InputHTMLAttributes< HTMLInputElement >,
|
@@ -35,10 +28,7 @@ interface TextInputProps
|
|
35 |
onBlur?: ( newValue: string ) => void;
|
36 |
}
|
37 |
|
38 |
-
const TextInput = forwardRef<
|
39 |
-
HTMLInputElement,
|
40 |
-
TextInputProps & ( Record< string, never > | TextInputPropsWithNumberType )
|
41 |
-
>(
|
42 |
(
|
43 |
{
|
44 |
className,
|
@@ -54,41 +44,17 @@ const TextInput = forwardRef<
|
|
54 |
autoComplete = 'off',
|
55 |
value = '',
|
56 |
onChange,
|
57 |
-
min,
|
58 |
-
max,
|
59 |
-
step,
|
60 |
required = false,
|
61 |
onBlur = () => {
|
62 |
/* Do nothing */
|
63 |
},
|
64 |
feedback,
|
|
|
65 |
},
|
66 |
ref
|
67 |
) => {
|
68 |
const [ isActive, setIsActive ] = useState( false );
|
69 |
|
70 |
-
const numberAttributesFromProps: {
|
71 |
-
[ prop: string ]: string | number | undefined;
|
72 |
-
} =
|
73 |
-
type === 'number'
|
74 |
-
? {
|
75 |
-
step,
|
76 |
-
min,
|
77 |
-
max,
|
78 |
-
}
|
79 |
-
: {};
|
80 |
-
|
81 |
-
const numberProps: {
|
82 |
-
[ prop: string ]: string | number | undefined;
|
83 |
-
} = {};
|
84 |
-
|
85 |
-
Object.keys( numberAttributesFromProps ).forEach( ( key ) => {
|
86 |
-
if ( typeof numberAttributesFromProps[ key ] === 'undefined' ) {
|
87 |
-
return;
|
88 |
-
}
|
89 |
-
numberProps[ key ] = numberAttributesFromProps[ key ];
|
90 |
-
} );
|
91 |
-
|
92 |
return (
|
93 |
<div
|
94 |
className={ classnames(
|
@@ -122,7 +88,7 @@ const TextInput = forwardRef<
|
|
122 |
: ariaDescribedBy
|
123 |
}
|
124 |
required={ required }
|
125 |
-
{ ...
|
126 |
/>
|
127 |
<Label
|
128 |
label={ label }
|
11 |
*/
|
12 |
import './style.scss';
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
interface TextInputProps
|
15 |
extends Omit<
|
16 |
InputHTMLAttributes< HTMLInputElement >,
|
28 |
onBlur?: ( newValue: string ) => void;
|
29 |
}
|
30 |
|
31 |
+
const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
|
|
|
|
|
|
|
32 |
(
|
33 |
{
|
34 |
className,
|
44 |
autoComplete = 'off',
|
45 |
value = '',
|
46 |
onChange,
|
|
|
|
|
|
|
47 |
required = false,
|
48 |
onBlur = () => {
|
49 |
/* Do nothing */
|
50 |
},
|
51 |
feedback,
|
52 |
+
...rest
|
53 |
},
|
54 |
ref
|
55 |
) => {
|
56 |
const [ isActive, setIsActive ] = useState( false );
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
return (
|
59 |
<div
|
60 |
className={ classnames(
|
88 |
: ariaDescribedBy
|
89 |
}
|
90 |
required={ required }
|
91 |
+
{ ...rest }
|
92 |
/>
|
93 |
<Label
|
94 |
label={ label }
|
assets/js/base/components/text-input/validated-text-input.tsx
CHANGED
@@ -146,7 +146,10 @@ const ValidatedTextInput = ( {
|
|
146 |
} }
|
147 |
feedback={
|
148 |
showError && (
|
149 |
-
<ValidationInputError
|
|
|
|
|
|
|
150 |
)
|
151 |
}
|
152 |
ref={ inputRef }
|
146 |
} }
|
147 |
feedback={
|
148 |
showError && (
|
149 |
+
<ValidationInputError
|
150 |
+
errorMessage={ passedErrorMessage }
|
151 |
+
propertyName={ errorIdString }
|
152 |
+
/>
|
153 |
)
|
154 |
}
|
155 |
ref={ inputRef }
|
assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts
CHANGED
@@ -3,10 +3,11 @@
|
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
6 |
-
import { useEffect, useRef } from '@wordpress/element';
|
7 |
import PaymentMethodLabel from '@woocommerce/base-components/cart-checkout/payment-method-label';
|
8 |
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
9 |
import { getSetting } from '@woocommerce/settings';
|
|
|
10 |
|
11 |
/**
|
12 |
* Internal dependencies
|
@@ -85,6 +86,22 @@ export const usePaymentMethodInterface = (): Record< string, unknown > => {
|
|
85 |
};
|
86 |
}, [ cartTotals, needsShipping ] );
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
return {
|
89 |
activePaymentMethod,
|
90 |
billing: {
|
@@ -127,7 +144,7 @@ export const usePaymentMethodInterface = (): Record< string, unknown > => {
|
|
127 |
},
|
128 |
onSubmit,
|
129 |
paymentStatus: currentStatus,
|
130 |
-
setExpressPaymentError,
|
131 |
shippingData: {
|
132 |
shippingRates,
|
133 |
shippingRatesLoading,
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
6 |
+
import { useCallback, useEffect, useRef } from '@wordpress/element';
|
7 |
import PaymentMethodLabel from '@woocommerce/base-components/cart-checkout/payment-method-label';
|
8 |
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
9 |
import { getSetting } from '@woocommerce/settings';
|
10 |
+
import deprecated from '@wordpress/deprecated';
|
11 |
|
12 |
/**
|
13 |
* Internal dependencies
|
86 |
};
|
87 |
}, [ cartTotals, needsShipping ] );
|
88 |
|
89 |
+
const deprecatedSetExpressPaymentError = useCallback(
|
90 |
+
( errorMessage = '' ) => {
|
91 |
+
deprecated(
|
92 |
+
'setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).',
|
93 |
+
{
|
94 |
+
alternative: '',
|
95 |
+
plugin: 'woocommerce-gutenberg-products-block',
|
96 |
+
link:
|
97 |
+
'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228',
|
98 |
+
}
|
99 |
+
);
|
100 |
+
setExpressPaymentError( errorMessage );
|
101 |
+
},
|
102 |
+
[ setExpressPaymentError ]
|
103 |
+
);
|
104 |
+
|
105 |
return {
|
106 |
activePaymentMethod,
|
107 |
billing: {
|
144 |
},
|
145 |
onSubmit,
|
146 |
paymentStatus: currentStatus,
|
147 |
+
setExpressPaymentError: deprecatedSetExpressPaymentError,
|
148 |
shippingData: {
|
149 |
shippingRates,
|
150 |
shippingRatesLoading,
|
assets/js/base/context/hooks/payment-methods/use-payment-methods.js
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
* Internal dependencies
|
3 |
*/
|
@@ -10,12 +15,20 @@ const usePaymentMethodState = ( express = false ) => {
|
|
10 |
paymentMethodsInitialized,
|
11 |
expressPaymentMethodsInitialized,
|
12 |
} = usePaymentMethodDataContext();
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
};
|
20 |
|
21 |
export const usePaymentMethods = () => usePaymentMethodState();
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { useShallowEqual } from '@woocommerce/base-hooks';
|
5 |
+
|
6 |
/**
|
7 |
* Internal dependencies
|
8 |
*/
|
15 |
paymentMethodsInitialized,
|
16 |
expressPaymentMethodsInitialized,
|
17 |
} = usePaymentMethodDataContext();
|
18 |
+
|
19 |
+
const currentPaymentMethods = useShallowEqual( paymentMethods );
|
20 |
+
const currentExpressPaymentMethods = useShallowEqual(
|
21 |
+
expressPaymentMethods
|
22 |
+
);
|
23 |
+
|
24 |
+
return {
|
25 |
+
paymentMethods: express
|
26 |
+
? currentExpressPaymentMethods
|
27 |
+
: currentPaymentMethods,
|
28 |
+
isInitialized: express
|
29 |
+
? expressPaymentMethodsInitialized
|
30 |
+
: paymentMethodsInitialized,
|
31 |
+
};
|
32 |
};
|
33 |
|
34 |
export const usePaymentMethods = () => usePaymentMethodState();
|
assets/js/base/context/hooks/test/use-checkout-submit.js
CHANGED
@@ -12,7 +12,12 @@ import { useCheckoutSubmit } from '../use-checkout-submit';
|
|
12 |
const mockUseCheckoutContext = {
|
13 |
onSubmit: jest.fn(),
|
14 |
};
|
15 |
-
const mockUsePaymentMethodDataContext = {
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
jest.mock( '../../providers/cart-checkout/checkout-state', () => ( {
|
18 |
useCheckoutContext: () => mockUseCheckoutContext,
|
12 |
const mockUseCheckoutContext = {
|
13 |
onSubmit: jest.fn(),
|
14 |
};
|
15 |
+
const mockUsePaymentMethodDataContext = {
|
16 |
+
activePaymentMethod: '',
|
17 |
+
currentStatus: {
|
18 |
+
isDoingExpressPayment: false,
|
19 |
+
},
|
20 |
+
};
|
21 |
|
22 |
jest.mock( '../../providers/cart-checkout/checkout-state', () => ( {
|
23 |
useCheckoutContext: () => mockUseCheckoutContext,
|
assets/js/base/context/hooks/use-checkout-submit.js
CHANGED
@@ -25,8 +25,14 @@ export const useCheckoutSubmit = () => {
|
|
25 |
hasError,
|
26 |
} = useCheckoutContext();
|
27 |
const { paymentMethods = {} } = usePaymentMethods();
|
28 |
-
const {
|
|
|
|
|
|
|
29 |
const paymentMethod = paymentMethods[ activePaymentMethod ] || {};
|
|
|
|
|
|
|
30 |
|
31 |
return {
|
32 |
submitButtonText:
|
@@ -34,8 +40,8 @@ export const useCheckoutSubmit = () => {
|
|
34 |
__( 'Place Order', 'woo-gutenberg-products-block' ),
|
35 |
onSubmit,
|
36 |
isCalculating,
|
37 |
-
|
38 |
-
|
39 |
-
waitingForRedirect
|
40 |
};
|
41 |
};
|
25 |
hasError,
|
26 |
} = useCheckoutContext();
|
27 |
const { paymentMethods = {} } = usePaymentMethods();
|
28 |
+
const {
|
29 |
+
activePaymentMethod,
|
30 |
+
currentStatus: paymentStatus,
|
31 |
+
} = usePaymentMethodDataContext();
|
32 |
const paymentMethod = paymentMethods[ activePaymentMethod ] || {};
|
33 |
+
const waitingForProcessing =
|
34 |
+
isProcessing || isAfterProcessing || isBeforeProcessing;
|
35 |
+
const waitingForRedirect = isComplete && ! hasError;
|
36 |
|
37 |
return {
|
38 |
submitButtonText:
|
40 |
__( 'Place Order', 'woo-gutenberg-products-block' ),
|
41 |
onSubmit,
|
42 |
isCalculating,
|
43 |
+
isDisabled: isProcessing || paymentStatus.isDoingExpressPayment,
|
44 |
+
waitingForProcessing,
|
45 |
+
waitingForRedirect,
|
46 |
};
|
47 |
};
|
assets/js/base/context/hooks/use-store-events.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { doAction } from '@wordpress/hooks';
|
5 |
-
import { useCallback } from '@wordpress/element';
|
6 |
|
7 |
/**
|
8 |
* Internal dependencies
|
@@ -22,6 +22,13 @@ export const useStoreEvents = (): {
|
|
22 |
dispatchCheckoutEvent: StoreEvent;
|
23 |
} => {
|
24 |
const storeCart = useStoreCart();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
const dispatchStoreEvent = useCallback( ( eventName, eventParams = {} ) => {
|
27 |
try {
|
@@ -43,7 +50,7 @@ export const useStoreEvents = (): {
|
|
43 |
`experimental__woocommerce_blocks-checkout-${ eventName }`,
|
44 |
{
|
45 |
...eventParams,
|
46 |
-
storeCart,
|
47 |
}
|
48 |
);
|
49 |
} catch ( e ) {
|
@@ -52,7 +59,7 @@ export const useStoreEvents = (): {
|
|
52 |
console.error( e );
|
53 |
}
|
54 |
},
|
55 |
-
[
|
56 |
);
|
57 |
|
58 |
return { dispatchStoreEvent, dispatchCheckoutEvent };
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { doAction } from '@wordpress/hooks';
|
5 |
+
import { useCallback, useRef, useEffect } from '@wordpress/element';
|
6 |
|
7 |
/**
|
8 |
* Internal dependencies
|
22 |
dispatchCheckoutEvent: StoreEvent;
|
23 |
} => {
|
24 |
const storeCart = useStoreCart();
|
25 |
+
const currentStoreCart = useRef( storeCart );
|
26 |
+
|
27 |
+
// Track the latest version of the cart so we can use the current value in our callback function below without triggering
|
28 |
+
// other useEffect hooks using dispatchCheckoutEvent as a dependency.
|
29 |
+
useEffect( () => {
|
30 |
+
currentStoreCart.current = storeCart;
|
31 |
+
}, [ storeCart ] );
|
32 |
|
33 |
const dispatchStoreEvent = useCallback( ( eventName, eventParams = {} ) => {
|
34 |
try {
|
50 |
`experimental__woocommerce_blocks-checkout-${ eventName }`,
|
51 |
{
|
52 |
...eventParams,
|
53 |
+
storeCart: currentStoreCart.current,
|
54 |
}
|
55 |
);
|
56 |
} catch ( e ) {
|
59 |
console.error( e );
|
60 |
}
|
61 |
},
|
62 |
+
[]
|
63 |
);
|
64 |
|
65 |
return { dispatchStoreEvent, dispatchCheckoutEvent };
|
assets/js/base/context/providers/cart-checkout/checkout/processor/index.js
CHANGED
@@ -52,6 +52,7 @@ const CheckoutProcessor = () => {
|
|
52 |
const { cartNeedsPayment, receiveCart } = useStoreCart();
|
53 |
const {
|
54 |
activePaymentMethod,
|
|
|
55 |
currentStatus: currentPaymentStatus,
|
56 |
paymentMethodData,
|
57 |
expressPaymentMethods,
|
@@ -63,9 +64,6 @@ const CheckoutProcessor = () => {
|
|
63 |
const currentShippingAddress = useRef( shippingAddress );
|
64 |
const currentRedirectUrl = useRef( redirectUrl );
|
65 |
const [ isProcessingOrder, setIsProcessingOrder ] = useState( false );
|
66 |
-
const expressPaymentMethodActive = Object.keys(
|
67 |
-
expressPaymentMethods
|
68 |
-
).includes( activePaymentMethod );
|
69 |
|
70 |
const paymentMethodId = useMemo( () => {
|
71 |
const merged = { ...expressPaymentMethods, ...paymentMethods };
|
@@ -73,20 +71,20 @@ const CheckoutProcessor = () => {
|
|
73 |
}, [ activePaymentMethod, expressPaymentMethods, paymentMethods ] );
|
74 |
|
75 |
const checkoutWillHaveError =
|
76 |
-
( hasValidationErrors && !
|
77 |
currentPaymentStatus.hasError ||
|
78 |
shippingErrorStatus.hasError;
|
79 |
|
80 |
// If express payment method is active, let's suppress notices
|
81 |
useEffect( () => {
|
82 |
-
setIsSuppressed(
|
83 |
-
}, [
|
84 |
|
85 |
useEffect( () => {
|
86 |
if (
|
87 |
checkoutWillHaveError !== checkoutHasError &&
|
88 |
( checkoutIsProcessing || checkoutIsBeforeProcessing ) &&
|
89 |
-
!
|
90 |
) {
|
91 |
dispatchActions.setHasError( checkoutWillHaveError );
|
92 |
}
|
@@ -95,7 +93,7 @@ const CheckoutProcessor = () => {
|
|
95 |
checkoutHasError,
|
96 |
checkoutIsProcessing,
|
97 |
checkoutIsBeforeProcessing,
|
98 |
-
|
99 |
dispatchActions,
|
100 |
] );
|
101 |
|
@@ -146,21 +144,21 @@ const CheckoutProcessor = () => {
|
|
146 |
|
147 |
useEffect( () => {
|
148 |
let unsubscribeProcessing;
|
149 |
-
if ( !
|
150 |
unsubscribeProcessing = onCheckoutValidationBeforeProcessing(
|
151 |
checkValidation,
|
152 |
0
|
153 |
);
|
154 |
}
|
155 |
return () => {
|
156 |
-
if ( !
|
157 |
unsubscribeProcessing();
|
158 |
}
|
159 |
};
|
160 |
}, [
|
161 |
onCheckoutValidationBeforeProcessing,
|
162 |
checkValidation,
|
163 |
-
|
164 |
] );
|
165 |
|
166 |
const processOrder = useCallback( () => {
|
52 |
const { cartNeedsPayment, receiveCart } = useStoreCart();
|
53 |
const {
|
54 |
activePaymentMethod,
|
55 |
+
isExpressPaymentMethodActive,
|
56 |
currentStatus: currentPaymentStatus,
|
57 |
paymentMethodData,
|
58 |
expressPaymentMethods,
|
64 |
const currentShippingAddress = useRef( shippingAddress );
|
65 |
const currentRedirectUrl = useRef( redirectUrl );
|
66 |
const [ isProcessingOrder, setIsProcessingOrder ] = useState( false );
|
|
|
|
|
|
|
67 |
|
68 |
const paymentMethodId = useMemo( () => {
|
69 |
const merged = { ...expressPaymentMethods, ...paymentMethods };
|
71 |
}, [ activePaymentMethod, expressPaymentMethods, paymentMethods ] );
|
72 |
|
73 |
const checkoutWillHaveError =
|
74 |
+
( hasValidationErrors && ! isExpressPaymentMethodActive ) ||
|
75 |
currentPaymentStatus.hasError ||
|
76 |
shippingErrorStatus.hasError;
|
77 |
|
78 |
// If express payment method is active, let's suppress notices
|
79 |
useEffect( () => {
|
80 |
+
setIsSuppressed( isExpressPaymentMethodActive );
|
81 |
+
}, [ isExpressPaymentMethodActive, setIsSuppressed ] );
|
82 |
|
83 |
useEffect( () => {
|
84 |
if (
|
85 |
checkoutWillHaveError !== checkoutHasError &&
|
86 |
( checkoutIsProcessing || checkoutIsBeforeProcessing ) &&
|
87 |
+
! isExpressPaymentMethodActive
|
88 |
) {
|
89 |
dispatchActions.setHasError( checkoutWillHaveError );
|
90 |
}
|
93 |
checkoutHasError,
|
94 |
checkoutIsProcessing,
|
95 |
checkoutIsBeforeProcessing,
|
96 |
+
isExpressPaymentMethodActive,
|
97 |
dispatchActions,
|
98 |
] );
|
99 |
|
144 |
|
145 |
useEffect( () => {
|
146 |
let unsubscribeProcessing;
|
147 |
+
if ( ! isExpressPaymentMethodActive ) {
|
148 |
unsubscribeProcessing = onCheckoutValidationBeforeProcessing(
|
149 |
checkValidation,
|
150 |
0
|
151 |
);
|
152 |
}
|
153 |
return () => {
|
154 |
+
if ( ! isExpressPaymentMethodActive ) {
|
155 |
unsubscribeProcessing();
|
156 |
}
|
157 |
};
|
158 |
}, [
|
159 |
onCheckoutValidationBeforeProcessing,
|
160 |
checkValidation,
|
161 |
+
isExpressPaymentMethodActive,
|
162 |
] );
|
163 |
|
164 |
const processOrder = useCallback( () => {
|
assets/js/base/context/providers/cart-checkout/payment-methods/actions.ts
CHANGED
@@ -2,106 +2,77 @@
|
|
2 |
* Internal dependencies
|
3 |
*/
|
4 |
import { ACTION, STATUS } from './constants';
|
5 |
-
import type { PaymentMethods } from './types';
|
6 |
|
7 |
export interface ActionType {
|
8 |
type: ACTION | STATUS;
|
9 |
errorMessage?: string;
|
10 |
paymentMethodData?: Record< string, unknown >;
|
11 |
-
paymentMethods?: PaymentMethods;
|
12 |
shouldSavePaymentMethod?: boolean;
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
*/
|
18 |
-
export const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
* Used to dispatch an error message along with setting current payment status to ERROR.
|
22 |
-
*
|
23 |
-
* @param {string} errorMessage Whatever error message accompanying the error condition.
|
24 |
-
* @return {ActionType} The action object.
|
25 |
-
*/
|
26 |
-
export const error = ( errorMessage: string ): ActionType => ( {
|
27 |
-
type: STATUS.ERROR,
|
28 |
-
errorMessage,
|
29 |
-
} );
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Used to dispatch a payment failed status update.
|
33 |
-
*/
|
34 |
-
export const failed = ( {
|
35 |
-
errorMessage,
|
36 |
-
paymentMethodData,
|
37 |
-
}: {
|
38 |
-
errorMessage: string;
|
39 |
-
paymentMethodData: Record< string, unknown >;
|
40 |
-
} ): ActionType => ( {
|
41 |
-
type: STATUS.FAILED,
|
42 |
-
errorMessage,
|
43 |
-
paymentMethodData,
|
44 |
-
} );
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Used to dispatch a payment success status update.
|
48 |
-
*/
|
49 |
-
export const success = ( {
|
50 |
-
paymentMethodData,
|
51 |
-
}: {
|
52 |
-
paymentMethodData?: Record< string, unknown >;
|
53 |
-
} ): ActionType => ( {
|
54 |
-
type: STATUS.SUCCESS,
|
55 |
-
paymentMethodData,
|
56 |
-
} );
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Used to dispatch a payment started status update.
|
60 |
-
*/
|
61 |
-
export const started = ( {
|
62 |
-
paymentMethodData,
|
63 |
-
}: {
|
64 |
-
paymentMethodData?: Record< string, unknown >;
|
65 |
-
} ): ActionType => ( {
|
66 |
-
type: STATUS.STARTED,
|
67 |
-
paymentMethodData,
|
68 |
-
} );
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Used to dispatch an action for updating a registered payment method in the state.
|
72 |
-
*
|
73 |
-
* @param {Object} paymentMethods Payment methods to register.
|
74 |
-
* @return {Object} An action object.
|
75 |
-
*/
|
76 |
-
export const setRegisteredPaymentMethods = (
|
77 |
-
paymentMethods: PaymentMethods
|
78 |
-
): ActionType => ( {
|
79 |
-
type: ACTION.SET_REGISTERED_PAYMENT_METHODS,
|
80 |
-
paymentMethods,
|
81 |
-
} );
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Used to dispatch an action for updating a registered express payment method in the state.
|
85 |
-
*
|
86 |
-
* @param {Object} paymentMethods Payment methods to register.
|
87 |
-
* @return {Object} An action object.
|
88 |
-
*/
|
89 |
-
export const setRegisteredExpressPaymentMethods = (
|
90 |
-
paymentMethods: PaymentMethods
|
91 |
-
): ActionType => ( {
|
92 |
-
type: ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
|
93 |
-
paymentMethods,
|
94 |
-
} );
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Set a flag indicating that the payment method info (e.g. a payment card) should be saved to user account after order completion.
|
98 |
-
*
|
99 |
-
* @param {boolean} shouldSavePaymentMethod
|
100 |
-
* @return {Object} An action object.
|
101 |
-
*/
|
102 |
-
export const setShouldSavePaymentMethod = (
|
103 |
-
shouldSavePaymentMethod: boolean
|
104 |
-
): ActionType => ( {
|
105 |
-
type: ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD,
|
106 |
-
shouldSavePaymentMethod,
|
107 |
-
} );
|
2 |
* Internal dependencies
|
3 |
*/
|
4 |
import { ACTION, STATUS } from './constants';
|
5 |
+
import type { PaymentMethods, ExpressPaymentMethods } from './types';
|
6 |
|
7 |
export interface ActionType {
|
8 |
type: ACTION | STATUS;
|
9 |
errorMessage?: string;
|
10 |
paymentMethodData?: Record< string, unknown >;
|
11 |
+
paymentMethods?: PaymentMethods | ExpressPaymentMethods;
|
12 |
shouldSavePaymentMethod?: boolean;
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
+
* All the actions that can be dispatched for payment methods.
|
17 |
*/
|
18 |
+
export const actions = {
|
19 |
+
statusOnly: ( type: STATUS ): { type: STATUS } => ( { type } as const ),
|
20 |
+
error: ( errorMessage: string ): ActionType =>
|
21 |
+
( {
|
22 |
+
type: STATUS.ERROR,
|
23 |
+
errorMessage,
|
24 |
+
} as const ),
|
25 |
+
failed: ( {
|
26 |
+
errorMessage,
|
27 |
+
paymentMethodData,
|
28 |
+
}: {
|
29 |
+
errorMessage: string;
|
30 |
+
paymentMethodData: Record< string, unknown >;
|
31 |
+
} ): ActionType =>
|
32 |
+
( {
|
33 |
+
type: STATUS.FAILED,
|
34 |
+
errorMessage,
|
35 |
+
paymentMethodData,
|
36 |
+
} as const ),
|
37 |
+
success: ( {
|
38 |
+
paymentMethodData,
|
39 |
+
}: {
|
40 |
+
paymentMethodData?: Record< string, unknown >;
|
41 |
+
} ): ActionType =>
|
42 |
+
( {
|
43 |
+
type: STATUS.SUCCESS,
|
44 |
+
paymentMethodData,
|
45 |
+
} as const ),
|
46 |
+
started: ( {
|
47 |
+
paymentMethodData,
|
48 |
+
}: {
|
49 |
+
paymentMethodData?: Record< string, unknown >;
|
50 |
+
} ): ActionType =>
|
51 |
+
( {
|
52 |
+
type: STATUS.STARTED,
|
53 |
+
paymentMethodData,
|
54 |
+
} as const ),
|
55 |
+
setRegisteredPaymentMethods: (
|
56 |
+
paymentMethods: PaymentMethods
|
57 |
+
): ActionType =>
|
58 |
+
( {
|
59 |
+
type: ACTION.SET_REGISTERED_PAYMENT_METHODS,
|
60 |
+
paymentMethods,
|
61 |
+
} as const ),
|
62 |
+
setRegisteredExpressPaymentMethods: (
|
63 |
+
paymentMethods: ExpressPaymentMethods
|
64 |
+
): ActionType =>
|
65 |
+
( {
|
66 |
+
type: ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
|
67 |
+
paymentMethods,
|
68 |
+
} as const ),
|
69 |
+
setShouldSavePaymentMethod: (
|
70 |
+
shouldSavePaymentMethod: boolean
|
71 |
+
): ActionType =>
|
72 |
+
( {
|
73 |
+
type: ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD,
|
74 |
+
shouldSavePaymentMethod,
|
75 |
+
} as const ),
|
76 |
+
};
|
77 |
|
78 |
+
export default actions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/context/providers/cart-checkout/payment-methods/constants.ts
CHANGED
@@ -37,6 +37,7 @@ export const DEFAULT_PAYMENT_DATA_CONTEXT_STATE: PaymentMethodDataContextState =
|
|
37 |
|
38 |
export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
|
39 |
setPaymentStatus: () => ( {
|
|
|
40 |
started: () => void null,
|
41 |
processing: () => void null,
|
42 |
completed: () => void null,
|
@@ -54,6 +55,7 @@ export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
|
|
54 |
hasError: false,
|
55 |
hasFailed: false,
|
56 |
isSuccessful: false,
|
|
|
57 |
},
|
58 |
paymentStatuses: STATUS,
|
59 |
paymentMethodData: {},
|
@@ -69,6 +71,7 @@ export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
|
|
69 |
expressPaymentMethodsInitialized: false,
|
70 |
onPaymentProcessing: () => () => () => void null,
|
71 |
setExpressPaymentError: () => void null,
|
|
|
72 |
setShouldSavePayment: () => void null,
|
73 |
shouldSavePayment: false,
|
74 |
};
|
37 |
|
38 |
export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
|
39 |
setPaymentStatus: () => ( {
|
40 |
+
pristine: () => void null,
|
41 |
started: () => void null,
|
42 |
processing: () => void null,
|
43 |
completed: () => void null,
|
55 |
hasError: false,
|
56 |
hasFailed: false,
|
57 |
isSuccessful: false,
|
58 |
+
isDoingExpressPayment: false,
|
59 |
},
|
60 |
paymentStatuses: STATUS,
|
61 |
paymentMethodData: {},
|
71 |
expressPaymentMethodsInitialized: false,
|
72 |
onPaymentProcessing: () => () => () => void null,
|
73 |
setExpressPaymentError: () => void null,
|
74 |
+
isExpressPaymentMethodActive: false,
|
75 |
setShouldSavePayment: () => void null,
|
76 |
shouldSavePayment: false,
|
77 |
};
|
assets/js/base/context/providers/cart-checkout/payment-methods/payment-method-data-context.tsx
CHANGED
@@ -4,40 +4,33 @@
|
|
4 |
import {
|
5 |
createContext,
|
6 |
useContext,
|
7 |
-
useState,
|
8 |
useReducer,
|
9 |
useCallback,
|
10 |
-
useEffect,
|
11 |
useRef,
|
|
|
12 |
useMemo,
|
13 |
} from '@wordpress/element';
|
14 |
|
15 |
/**
|
16 |
* Internal dependencies
|
17 |
*/
|
|
|
|
|
|
|
|
|
18 |
import {
|
19 |
STATUS,
|
20 |
DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
|
21 |
DEFAULT_PAYMENT_METHOD_DATA,
|
22 |
} from './constants';
|
23 |
import reducer from './reducer';
|
24 |
-
import {
|
25 |
-
statusOnly,
|
26 |
-
error,
|
27 |
-
failed,
|
28 |
-
success,
|
29 |
-
started,
|
30 |
-
setRegisteredPaymentMethods,
|
31 |
-
setRegisteredExpressPaymentMethods,
|
32 |
-
setShouldSavePaymentMethod,
|
33 |
-
} from './actions';
|
34 |
import {
|
35 |
usePaymentMethods,
|
36 |
useExpressPaymentMethods,
|
37 |
} from './use-payment-method-registration';
|
38 |
-
import {
|
|
|
39 |
import { useCheckoutContext } from '../checkout-state';
|
40 |
-
import { useShippingDataContext } from '../shipping';
|
41 |
import { useEditorContext } from '../../editor-context';
|
42 |
import {
|
43 |
EMIT_TYPES,
|
@@ -46,29 +39,10 @@ import {
|
|
46 |
reducer as emitReducer,
|
47 |
} from './event-emit';
|
48 |
import { useValidationContext } from '../../validation';
|
49 |
-
import { useStoreEvents } from '../../../hooks/use-store-events';
|
50 |
import { useStoreNotices } from '../../../hooks/use-store-notices';
|
51 |
import { useEmitResponse } from '../../../hooks/use-emit-response';
|
52 |
-
|
53 |
-
import type {
|
54 |
-
PaymentStatusDispatchers,
|
55 |
-
PaymentMethods,
|
56 |
-
CustomerPaymentMethods,
|
57 |
-
PaymentMethodsDispatcherType,
|
58 |
-
PaymentMethodDataContextType,
|
59 |
-
} from './types';
|
60 |
import { getCustomerPaymentMethods } from './utils';
|
61 |
|
62 |
-
const {
|
63 |
-
STARTED,
|
64 |
-
PROCESSING,
|
65 |
-
COMPLETE,
|
66 |
-
PRISTINE,
|
67 |
-
ERROR,
|
68 |
-
FAILED,
|
69 |
-
SUCCESS,
|
70 |
-
} = STATUS;
|
71 |
-
|
72 |
const PaymentMethodDataContext = createContext( DEFAULT_PAYMENT_METHOD_DATA );
|
73 |
|
74 |
export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
|
@@ -76,11 +50,9 @@ export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
|
|
76 |
};
|
77 |
|
78 |
/**
|
79 |
-
* PaymentMethodDataProvider is automatically included in the
|
80 |
-
* CheckoutDataProvider.
|
81 |
*
|
82 |
-
* This provides the api interface (via the context hook) for payment method
|
83 |
-
* status and data.
|
84 |
*
|
85 |
* @param {Object} props Incoming props for provider
|
86 |
* @param {Object} props.children The wrapped components in this provider.
|
@@ -90,7 +62,6 @@ export const PaymentMethodDataProvider = ( {
|
|
90 |
}: {
|
91 |
children: React.ReactChildren;
|
92 |
} ): JSX.Element => {
|
93 |
-
const { setBillingData } = useCustomerDataContext();
|
94 |
const {
|
95 |
isProcessing: checkoutIsProcessing,
|
96 |
isIdle: checkoutIsIdle,
|
@@ -98,81 +69,46 @@ export const PaymentMethodDataProvider = ( {
|
|
98 |
hasError: checkoutHasError,
|
99 |
} = useCheckoutContext();
|
100 |
const { isEditor, getPreviewData } = useEditorContext();
|
|
|
|
|
101 |
const {
|
102 |
isSuccessResponse,
|
103 |
isErrorResponse,
|
104 |
isFailResponse,
|
105 |
noticeContexts,
|
106 |
} = useEmitResponse();
|
107 |
-
const { dispatchCheckoutEvent } = useStoreEvents();
|
108 |
-
|
109 |
-
const [ activePaymentMethod, setActive ] = useState( '' ); // The active payment method - e.g. Stripe CC or BACS.
|
110 |
-
const [ activeSavedToken, setActiveSavedToken ] = useState( '' ); // If a previously saved payment method is active, the token for that method. For example, a for a Stripe CC card saved to user account.
|
111 |
const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
|
112 |
-
const [ paymentData, dispatch ] = useReducer(
|
113 |
-
reducer,
|
114 |
-
DEFAULT_PAYMENT_DATA_CONTEXT_STATE
|
115 |
-
);
|
116 |
-
const currentObservers = useRef( observers );
|
117 |
const { onPaymentProcessing } = useEventEmitters( observerDispatch );
|
|
|
118 |
|
119 |
// ensure observers are always current.
|
120 |
useEffect( () => {
|
121 |
currentObservers.current = observers;
|
122 |
}, [ observers ] );
|
123 |
|
124 |
-
const
|
125 |
-
|
126 |
-
|
127 |
-
dispatch( statusOnly( PRISTINE ) );
|
128 |
-
dispatchCheckoutEvent( 'set-active-payment-method', {
|
129 |
-
paymentMethodSlug,
|
130 |
-
} );
|
131 |
-
},
|
132 |
-
[ setActive, dispatch, dispatchCheckoutEvent ]
|
133 |
-
);
|
134 |
-
|
135 |
-
const paymentMethodsDispatcher = useCallback<
|
136 |
-
PaymentMethodsDispatcherType
|
137 |
-
>(
|
138 |
-
( paymentMethods ) => {
|
139 |
-
dispatch(
|
140 |
-
setRegisteredPaymentMethods( paymentMethods as PaymentMethods )
|
141 |
-
);
|
142 |
-
},
|
143 |
-
[ dispatch ]
|
144 |
-
);
|
145 |
-
|
146 |
-
const expressPaymentMethodsDispatcher = useCallback<
|
147 |
-
PaymentMethodsDispatcherType
|
148 |
-
>(
|
149 |
-
( paymentMethods ) => {
|
150 |
-
dispatch(
|
151 |
-
setRegisteredExpressPaymentMethods(
|
152 |
-
paymentMethods as PaymentMethods
|
153 |
-
)
|
154 |
-
);
|
155 |
-
},
|
156 |
-
[ dispatch ]
|
157 |
);
|
|
|
|
|
|
|
|
|
158 |
|
159 |
const paymentMethodsInitialized = usePaymentMethods(
|
160 |
-
|
161 |
);
|
162 |
|
163 |
const expressPaymentMethodsInitialized = useExpressPaymentMethods(
|
164 |
-
|
165 |
);
|
166 |
|
167 |
-
const {
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
},
|
174 |
-
[ dispatch ]
|
175 |
-
);
|
176 |
|
177 |
const customerPaymentMethods = useMemo( (): CustomerPaymentMethods => {
|
178 |
if ( isEditor ) {
|
@@ -180,13 +116,9 @@ export const PaymentMethodDataProvider = ( {
|
|
180 |
'previewSavedPaymentMethods'
|
181 |
) as CustomerPaymentMethods;
|
182 |
}
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
) {
|
187 |
-
return {};
|
188 |
-
}
|
189 |
-
return getCustomerPaymentMethods( paymentData.paymentMethods );
|
190 |
}, [
|
191 |
isEditor,
|
192 |
getPreviewData,
|
@@ -211,71 +143,63 @@ export const PaymentMethodDataProvider = ( {
|
|
211 |
[ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
|
212 |
);
|
213 |
|
|
|
|
|
|
|
|
|
214 |
const currentStatus = useMemo(
|
215 |
() => ( {
|
216 |
-
isPristine: paymentData.currentStatus === PRISTINE,
|
217 |
-
isStarted: paymentData.currentStatus === STARTED,
|
218 |
-
isProcessing: paymentData.currentStatus === PROCESSING,
|
219 |
-
isFinished: [
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
225 |
} ),
|
226 |
-
[ paymentData.currentStatus ]
|
227 |
);
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
setBillingData( billingData );
|
263 |
-
}
|
264 |
-
if (
|
265 |
-
typeof shippingData !== undefined &&
|
266 |
-
shippingData?.address
|
267 |
-
) {
|
268 |
-
setShippingAddress( shippingData.address );
|
269 |
-
}
|
270 |
-
dispatch(
|
271 |
-
success( {
|
272 |
-
paymentMethodData,
|
273 |
-
} )
|
274 |
-
);
|
275 |
-
},
|
276 |
-
} ),
|
277 |
-
[ dispatch, setBillingData, setShippingAddress ]
|
278 |
-
);
|
279 |
|
280 |
// flip payment to processing if checkout processing is complete, there are no errors, and payment status is started.
|
281 |
useEffect( () => {
|
@@ -298,9 +222,9 @@ export const PaymentMethodDataProvider = ( {
|
|
298 |
// When checkout is returned to idle, set payment status to pristine but only if payment status is already not finished.
|
299 |
useEffect( () => {
|
300 |
if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
|
301 |
-
|
302 |
}
|
303 |
-
}, [ checkoutIsIdle, currentStatus.isSuccessful ] );
|
304 |
|
305 |
// if checkout has an error and payment is not being made with a saved token and payment status is success, then let's sync payment status back to pristine.
|
306 |
useEffect( () => {
|
@@ -309,48 +233,15 @@ export const PaymentMethodDataProvider = ( {
|
|
309 |
currentStatus.isSuccessful &&
|
310 |
! paymentData.hasSavedToken
|
311 |
) {
|
312 |
-
|
313 |
}
|
314 |
}, [
|
315 |
checkoutHasError,
|
316 |
currentStatus.isSuccessful,
|
317 |
paymentData.hasSavedToken,
|
|
|
318 |
] );
|
319 |
|
320 |
-
// Set active (selected) payment method as needed.
|
321 |
-
useEffect( () => {
|
322 |
-
const paymentMethodKeys = Object.keys( paymentData.paymentMethods );
|
323 |
-
const allPaymentMethodKeys = [
|
324 |
-
...paymentMethodKeys,
|
325 |
-
...Object.keys( paymentData.expressPaymentMethods ),
|
326 |
-
];
|
327 |
-
if ( ! paymentMethodsInitialized || ! paymentMethodKeys.length ) {
|
328 |
-
return;
|
329 |
-
}
|
330 |
-
|
331 |
-
setActive( ( currentActivePaymentMethod ) => {
|
332 |
-
// If there's no active payment method, or the active payment method has
|
333 |
-
// been removed (e.g. COD vs shipping methods), set one as active.
|
334 |
-
// Note: It's possible that the active payment method might be an
|
335 |
-
// express payment method. So registered express payment methods are
|
336 |
-
// included in the check here.
|
337 |
-
if (
|
338 |
-
! currentActivePaymentMethod ||
|
339 |
-
! allPaymentMethodKeys.includes( currentActivePaymentMethod )
|
340 |
-
) {
|
341 |
-
dispatch( statusOnly( PRISTINE ) );
|
342 |
-
return Object.keys( paymentData.paymentMethods )[ 0 ];
|
343 |
-
}
|
344 |
-
return currentActivePaymentMethod;
|
345 |
-
} );
|
346 |
-
}, [
|
347 |
-
paymentMethodsInitialized,
|
348 |
-
paymentData.paymentMethods,
|
349 |
-
paymentData.expressPaymentMethods,
|
350 |
-
setActive,
|
351 |
-
] );
|
352 |
-
|
353 |
-
// emit events.
|
354 |
useEffect( () => {
|
355 |
// Note: the nature of this event emitter is that it will bail on any
|
356 |
// observer that returns a response that !== true. However, this still
|
@@ -451,8 +342,9 @@ export const PaymentMethodDataProvider = ( {
|
|
451 |
paymentMethodsInitialized,
|
452 |
expressPaymentMethodsInitialized,
|
453 |
setExpressPaymentError,
|
|
|
454 |
shouldSavePayment: paymentData.shouldSavePaymentMethod,
|
455 |
-
setShouldSavePayment,
|
456 |
};
|
457 |
|
458 |
return (
|
4 |
import {
|
5 |
createContext,
|
6 |
useContext,
|
|
|
7 |
useReducer,
|
8 |
useCallback,
|
|
|
9 |
useRef,
|
10 |
+
useEffect,
|
11 |
useMemo,
|
12 |
} from '@wordpress/element';
|
13 |
|
14 |
/**
|
15 |
* Internal dependencies
|
16 |
*/
|
17 |
+
import type {
|
18 |
+
CustomerPaymentMethods,
|
19 |
+
PaymentMethodDataContextType,
|
20 |
+
} from './types';
|
21 |
import {
|
22 |
STATUS,
|
23 |
DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
|
24 |
DEFAULT_PAYMENT_METHOD_DATA,
|
25 |
} from './constants';
|
26 |
import reducer from './reducer';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
import {
|
28 |
usePaymentMethods,
|
29 |
useExpressPaymentMethods,
|
30 |
} from './use-payment-method-registration';
|
31 |
+
import { usePaymentMethodDataDispatchers } from './use-payment-method-dispatchers';
|
32 |
+
import { useActivePaymentMethod } from './use-active-payment-method';
|
33 |
import { useCheckoutContext } from '../checkout-state';
|
|
|
34 |
import { useEditorContext } from '../../editor-context';
|
35 |
import {
|
36 |
EMIT_TYPES,
|
39 |
reducer as emitReducer,
|
40 |
} from './event-emit';
|
41 |
import { useValidationContext } from '../../validation';
|
|
|
42 |
import { useStoreNotices } from '../../../hooks/use-store-notices';
|
43 |
import { useEmitResponse } from '../../../hooks/use-emit-response';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
import { getCustomerPaymentMethods } from './utils';
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
const PaymentMethodDataContext = createContext( DEFAULT_PAYMENT_METHOD_DATA );
|
47 |
|
48 |
export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
|
50 |
};
|
51 |
|
52 |
/**
|
53 |
+
* PaymentMethodDataProvider is automatically included in the CheckoutDataProvider.
|
|
|
54 |
*
|
55 |
+
* This provides the api interface (via the context hook) for payment method status and data.
|
|
|
56 |
*
|
57 |
* @param {Object} props Incoming props for provider
|
58 |
* @param {Object} props.children The wrapped components in this provider.
|
62 |
}: {
|
63 |
children: React.ReactChildren;
|
64 |
} ): JSX.Element => {
|
|
|
65 |
const {
|
66 |
isProcessing: checkoutIsProcessing,
|
67 |
isIdle: checkoutIsIdle,
|
69 |
hasError: checkoutHasError,
|
70 |
} = useCheckoutContext();
|
71 |
const { isEditor, getPreviewData } = useEditorContext();
|
72 |
+
const { setValidationErrors } = useValidationContext();
|
73 |
+
const { addErrorNotice, removeNotice } = useStoreNotices();
|
74 |
const {
|
75 |
isSuccessResponse,
|
76 |
isErrorResponse,
|
77 |
isFailResponse,
|
78 |
noticeContexts,
|
79 |
} = useEmitResponse();
|
|
|
|
|
|
|
|
|
80 |
const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
|
|
|
|
|
|
|
|
|
|
|
81 |
const { onPaymentProcessing } = useEventEmitters( observerDispatch );
|
82 |
+
const currentObservers = useRef( observers );
|
83 |
|
84 |
// ensure observers are always current.
|
85 |
useEffect( () => {
|
86 |
currentObservers.current = observers;
|
87 |
}, [ observers ] );
|
88 |
|
89 |
+
const [ paymentData, dispatch ] = useReducer(
|
90 |
+
reducer,
|
91 |
+
DEFAULT_PAYMENT_DATA_CONTEXT_STATE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
);
|
93 |
+
const {
|
94 |
+
dispatchActions,
|
95 |
+
setPaymentStatus,
|
96 |
+
} = usePaymentMethodDataDispatchers( dispatch );
|
97 |
|
98 |
const paymentMethodsInitialized = usePaymentMethods(
|
99 |
+
dispatchActions.setRegisteredPaymentMethods
|
100 |
);
|
101 |
|
102 |
const expressPaymentMethodsInitialized = useExpressPaymentMethods(
|
103 |
+
dispatchActions.setRegisteredExpressPaymentMethods
|
104 |
);
|
105 |
|
106 |
+
const {
|
107 |
+
activePaymentMethod,
|
108 |
+
activeSavedToken,
|
109 |
+
setActivePaymentMethod,
|
110 |
+
setActiveSavedToken,
|
111 |
+
} = useActivePaymentMethod();
|
|
|
|
|
|
|
112 |
|
113 |
const customerPaymentMethods = useMemo( (): CustomerPaymentMethods => {
|
114 |
if ( isEditor ) {
|
116 |
'previewSavedPaymentMethods'
|
117 |
) as CustomerPaymentMethods;
|
118 |
}
|
119 |
+
return paymentMethodsInitialized
|
120 |
+
? getCustomerPaymentMethods( paymentData.paymentMethods )
|
121 |
+
: {};
|
|
|
|
|
|
|
|
|
122 |
}, [
|
123 |
isEditor,
|
124 |
getPreviewData,
|
143 |
[ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
|
144 |
);
|
145 |
|
146 |
+
const isExpressPaymentMethodActive = Object.keys(
|
147 |
+
paymentData.expressPaymentMethods
|
148 |
+
).includes( activePaymentMethod );
|
149 |
+
|
150 |
const currentStatus = useMemo(
|
151 |
() => ( {
|
152 |
+
isPristine: paymentData.currentStatus === STATUS.PRISTINE,
|
153 |
+
isStarted: paymentData.currentStatus === STATUS.STARTED,
|
154 |
+
isProcessing: paymentData.currentStatus === STATUS.PROCESSING,
|
155 |
+
isFinished: [
|
156 |
+
STATUS.ERROR,
|
157 |
+
STATUS.FAILED,
|
158 |
+
STATUS.SUCCESS,
|
159 |
+
].includes( paymentData.currentStatus ),
|
160 |
+
hasError: paymentData.currentStatus === STATUS.ERROR,
|
161 |
+
hasFailed: paymentData.currentStatus === STATUS.FAILED,
|
162 |
+
isSuccessful: paymentData.currentStatus === STATUS.SUCCESS,
|
163 |
+
isDoingExpressPayment:
|
164 |
+
paymentData.currentStatus !== STATUS.PRISTINE &&
|
165 |
+
isExpressPaymentMethodActive,
|
166 |
} ),
|
167 |
+
[ paymentData.currentStatus, isExpressPaymentMethodActive ]
|
168 |
);
|
169 |
|
170 |
+
// Update the active (selected) payment method when it is empty, or invalid.
|
171 |
+
useEffect( () => {
|
172 |
+
const paymentMethodKeys = Object.keys( paymentData.paymentMethods );
|
173 |
+
const allPaymentMethodKeys = [
|
174 |
+
...paymentMethodKeys,
|
175 |
+
...Object.keys( paymentData.expressPaymentMethods ),
|
176 |
+
];
|
177 |
+
if ( ! paymentMethodsInitialized || ! paymentMethodKeys.length ) {
|
178 |
+
return;
|
179 |
+
}
|
180 |
+
|
181 |
+
setActivePaymentMethod( ( currentActivePaymentMethod ) => {
|
182 |
+
// If there's no active payment method, or the active payment method has
|
183 |
+
// been removed (e.g. COD vs shipping methods), set one as active.
|
184 |
+
// Note: It's possible that the active payment method might be an
|
185 |
+
// express payment method. So registered express payment methods are
|
186 |
+
// included in the check here.
|
187 |
+
if (
|
188 |
+
! currentActivePaymentMethod ||
|
189 |
+
! allPaymentMethodKeys.includes( currentActivePaymentMethod )
|
190 |
+
) {
|
191 |
+
setPaymentStatus().pristine();
|
192 |
+
return Object.keys( paymentData.paymentMethods )[ 0 ];
|
193 |
+
}
|
194 |
+
return currentActivePaymentMethod;
|
195 |
+
} );
|
196 |
+
}, [
|
197 |
+
paymentMethodsInitialized,
|
198 |
+
paymentData.paymentMethods,
|
199 |
+
paymentData.expressPaymentMethods,
|
200 |
+
setActivePaymentMethod,
|
201 |
+
setPaymentStatus,
|
202 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
// flip payment to processing if checkout processing is complete, there are no errors, and payment status is started.
|
205 |
useEffect( () => {
|
222 |
// When checkout is returned to idle, set payment status to pristine but only if payment status is already not finished.
|
223 |
useEffect( () => {
|
224 |
if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
|
225 |
+
setPaymentStatus().pristine();
|
226 |
}
|
227 |
+
}, [ checkoutIsIdle, currentStatus.isSuccessful, setPaymentStatus ] );
|
228 |
|
229 |
// if checkout has an error and payment is not being made with a saved token and payment status is success, then let's sync payment status back to pristine.
|
230 |
useEffect( () => {
|
233 |
currentStatus.isSuccessful &&
|
234 |
! paymentData.hasSavedToken
|
235 |
) {
|
236 |
+
setPaymentStatus().pristine();
|
237 |
}
|
238 |
}, [
|
239 |
checkoutHasError,
|
240 |
currentStatus.isSuccessful,
|
241 |
paymentData.hasSavedToken,
|
242 |
+
setPaymentStatus,
|
243 |
] );
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
useEffect( () => {
|
246 |
// Note: the nature of this event emitter is that it will bail on any
|
247 |
// observer that returns a response that !== true. However, this still
|
342 |
paymentMethodsInitialized,
|
343 |
expressPaymentMethodsInitialized,
|
344 |
setExpressPaymentError,
|
345 |
+
isExpressPaymentMethodActive,
|
346 |
shouldSavePayment: paymentData.shouldSavePaymentMethod,
|
347 |
+
setShouldSavePayment: dispatchActions.setShouldSavePayment,
|
348 |
};
|
349 |
|
350 |
return (
|
assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts
CHANGED
@@ -32,17 +32,14 @@ const reducer = (
|
|
32 |
): PaymentMethodDataContextState => {
|
33 |
switch ( type ) {
|
34 |
case STATUS.STARTED:
|
35 |
-
return
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
),
|
44 |
-
}
|
45 |
-
: state;
|
46 |
case STATUS.ERROR:
|
47 |
return state.currentStatus !== STATUS.ERROR
|
48 |
? {
|
32 |
): PaymentMethodDataContextState => {
|
33 |
switch ( type ) {
|
34 |
case STATUS.STARTED:
|
35 |
+
return {
|
36 |
+
...state,
|
37 |
+
currentStatus: STATUS.STARTED,
|
38 |
+
paymentMethodData: paymentMethodData || state.paymentMethodData,
|
39 |
+
hasSavedToken: hasSavedPaymentToken(
|
40 |
+
paymentMethodData || state.paymentMethodData
|
41 |
+
),
|
42 |
+
};
|
|
|
|
|
|
|
43 |
case STATUS.ERROR:
|
44 |
return state.currentStatus !== STATUS.ERROR
|
45 |
? {
|
assets/js/base/context/providers/cart-checkout/payment-methods/types.ts
CHANGED
@@ -62,11 +62,16 @@ export type CustomerPaymentMethods =
|
|
62 |
| Record< string, CustomerPaymentMethod >
|
63 |
| EmptyObjectType;
|
64 |
|
65 |
-
export type
|
66 |
-
paymentMethods: PaymentMethods
|
67 |
-
|
|
|
|
|
|
|
|
|
68 |
|
69 |
export interface PaymentStatusDispatchers {
|
|
|
70 |
started: ( paymentMethodData?: ObjectType | EmptyObjectType ) => void;
|
71 |
processing: () => void;
|
72 |
completed: () => void;
|
@@ -108,6 +113,8 @@ export type PaymentMethodCurrentStatusType = {
|
|
108 |
hasFailed: boolean;
|
109 |
// If true then the payment method has completed it's processing successfully.
|
110 |
isSuccessful: boolean;
|
|
|
|
|
111 |
};
|
112 |
|
113 |
export type PaymentMethodDataContextType = {
|
@@ -145,6 +152,8 @@ export type PaymentMethodDataContextType = {
|
|
145 |
onPaymentProcessing: ReturnType< typeof emitterCallback >;
|
146 |
// A function used by express payment methods to indicate an error for checkout to handle. It receives an error message string. Does not change payment status.
|
147 |
setExpressPaymentError: ( error: string ) => void;
|
|
|
|
|
148 |
// A function used to set the shouldSavePayment value.
|
149 |
setShouldSavePayment: ( shouldSavePayment: boolean ) => void;
|
150 |
// True means that the configured payment method option is saved for the customer.
|
62 |
| Record< string, CustomerPaymentMethod >
|
63 |
| EmptyObjectType;
|
64 |
|
65 |
+
export type PaymentMethodDispatchers = {
|
66 |
+
setRegisteredPaymentMethods: ( paymentMethods: PaymentMethods ) => void;
|
67 |
+
setRegisteredExpressPaymentMethods: (
|
68 |
+
paymentMethods: ExpressPaymentMethods
|
69 |
+
) => void;
|
70 |
+
setShouldSavePayment: ( shouldSave: boolean ) => void;
|
71 |
+
};
|
72 |
|
73 |
export interface PaymentStatusDispatchers {
|
74 |
+
pristine: () => void;
|
75 |
started: ( paymentMethodData?: ObjectType | EmptyObjectType ) => void;
|
76 |
processing: () => void;
|
77 |
completed: () => void;
|
113 |
hasFailed: boolean;
|
114 |
// If true then the payment method has completed it's processing successfully.
|
115 |
isSuccessful: boolean;
|
116 |
+
// If true, an express payment is in progress.
|
117 |
+
isDoingExpressPayment: boolean;
|
118 |
};
|
119 |
|
120 |
export type PaymentMethodDataContextType = {
|
152 |
onPaymentProcessing: ReturnType< typeof emitterCallback >;
|
153 |
// A function used by express payment methods to indicate an error for checkout to handle. It receives an error message string. Does not change payment status.
|
154 |
setExpressPaymentError: ( error: string ) => void;
|
155 |
+
// True if an express payment method is active.
|
156 |
+
isExpressPaymentMethodActive: boolean;
|
157 |
// A function used to set the shouldSavePayment value.
|
158 |
setShouldSavePayment: ( shouldSavePayment: boolean ) => void;
|
159 |
// True means that the configured payment method option is saved for the customer.
|
assets/js/base/context/providers/cart-checkout/payment-methods/use-active-payment-method.ts
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { useState, useEffect } from '@wordpress/element';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import { useStoreEvents } from '../../../hooks/use-store-events';
|
10 |
+
|
11 |
+
export const useActivePaymentMethod = (): {
|
12 |
+
activePaymentMethod: string;
|
13 |
+
activeSavedToken: string;
|
14 |
+
setActivePaymentMethod: React.Dispatch< React.SetStateAction< string > >;
|
15 |
+
setActiveSavedToken: ( token: string ) => void;
|
16 |
+
} => {
|
17 |
+
const { dispatchCheckoutEvent } = useStoreEvents();
|
18 |
+
|
19 |
+
// The active payment method - e.g. Stripe CC or BACS.
|
20 |
+
const [ activePaymentMethod, setActivePaymentMethod ] = useState( '' );
|
21 |
+
|
22 |
+
// If a previously saved payment method is active, the token for that method. For example, a for a Stripe CC card saved to user account.
|
23 |
+
const [ activeSavedToken, setActiveSavedToken ] = useState( '' );
|
24 |
+
|
25 |
+
// Trigger event on change.
|
26 |
+
useEffect( () => {
|
27 |
+
dispatchCheckoutEvent( 'set-active-payment-method', {
|
28 |
+
activePaymentMethod,
|
29 |
+
} );
|
30 |
+
}, [ dispatchCheckoutEvent, activePaymentMethod ] );
|
31 |
+
|
32 |
+
return {
|
33 |
+
activePaymentMethod,
|
34 |
+
activeSavedToken,
|
35 |
+
setActivePaymentMethod,
|
36 |
+
setActiveSavedToken,
|
37 |
+
};
|
38 |
+
};
|
assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-dispatchers.ts
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { useCallback, useMemo } from '@wordpress/element';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import { actions, ActionType } from './actions';
|
10 |
+
import { STATUS } from './constants';
|
11 |
+
import { useCustomerDataContext } from '../customer';
|
12 |
+
import { useShippingDataContext } from '../shipping';
|
13 |
+
import type {
|
14 |
+
PaymentStatusDispatchers,
|
15 |
+
PaymentMethodDispatchers,
|
16 |
+
} from './types';
|
17 |
+
|
18 |
+
export const usePaymentMethodDataDispatchers = (
|
19 |
+
dispatch: React.Dispatch< ActionType >
|
20 |
+
): {
|
21 |
+
dispatchActions: PaymentMethodDispatchers;
|
22 |
+
setPaymentStatus: () => PaymentStatusDispatchers;
|
23 |
+
} => {
|
24 |
+
const { setBillingData } = useCustomerDataContext();
|
25 |
+
const { setShippingAddress } = useShippingDataContext();
|
26 |
+
|
27 |
+
const dispatchActions = useMemo(
|
28 |
+
(): PaymentMethodDispatchers => ( {
|
29 |
+
setRegisteredPaymentMethods: ( paymentMethods ) =>
|
30 |
+
void dispatch(
|
31 |
+
actions.setRegisteredPaymentMethods( paymentMethods )
|
32 |
+
),
|
33 |
+
setRegisteredExpressPaymentMethods: ( paymentMethods ) =>
|
34 |
+
void dispatch(
|
35 |
+
actions.setRegisteredExpressPaymentMethods( paymentMethods )
|
36 |
+
),
|
37 |
+
setShouldSavePayment: ( shouldSave ) =>
|
38 |
+
void dispatch(
|
39 |
+
actions.setShouldSavePaymentMethod( shouldSave )
|
40 |
+
),
|
41 |
+
} ),
|
42 |
+
[ dispatch ]
|
43 |
+
);
|
44 |
+
|
45 |
+
const setPaymentStatus = useCallback(
|
46 |
+
(): PaymentStatusDispatchers => ( {
|
47 |
+
pristine: () => dispatch( actions.statusOnly( STATUS.PRISTINE ) ),
|
48 |
+
started: ( paymentMethodData ) => {
|
49 |
+
dispatch(
|
50 |
+
actions.started( {
|
51 |
+
paymentMethodData,
|
52 |
+
} )
|
53 |
+
);
|
54 |
+
},
|
55 |
+
processing: () =>
|
56 |
+
dispatch( actions.statusOnly( STATUS.PROCESSING ) ),
|
57 |
+
completed: () => dispatch( actions.statusOnly( STATUS.COMPLETE ) ),
|
58 |
+
error: ( errorMessage ) =>
|
59 |
+
dispatch( actions.error( errorMessage ) ),
|
60 |
+
failed: (
|
61 |
+
errorMessage,
|
62 |
+
paymentMethodData,
|
63 |
+
billingData = undefined
|
64 |
+
) => {
|
65 |
+
if ( billingData ) {
|
66 |
+
setBillingData( billingData );
|
67 |
+
}
|
68 |
+
dispatch(
|
69 |
+
actions.failed( {
|
70 |
+
errorMessage: errorMessage || '',
|
71 |
+
paymentMethodData: paymentMethodData || {},
|
72 |
+
} )
|
73 |
+
);
|
74 |
+
},
|
75 |
+
success: (
|
76 |
+
paymentMethodData,
|
77 |
+
billingData = undefined,
|
78 |
+
shippingData = undefined
|
79 |
+
) => {
|
80 |
+
if ( billingData ) {
|
81 |
+
setBillingData( billingData );
|
82 |
+
}
|
83 |
+
if (
|
84 |
+
typeof shippingData !== undefined &&
|
85 |
+
shippingData?.address
|
86 |
+
) {
|
87 |
+
setShippingAddress(
|
88 |
+
shippingData.address as Record< string, unknown >
|
89 |
+
);
|
90 |
+
}
|
91 |
+
dispatch(
|
92 |
+
actions.success( {
|
93 |
+
paymentMethodData,
|
94 |
+
} )
|
95 |
+
);
|
96 |
+
},
|
97 |
+
} ),
|
98 |
+
[ dispatch, setBillingData, setShippingAddress ]
|
99 |
+
);
|
100 |
+
|
101 |
+
return {
|
102 |
+
dispatchActions,
|
103 |
+
setPaymentStatus,
|
104 |
+
};
|
105 |
+
};
|
assets/js/base/context/providers/cart-checkout/payment-methods/utils.ts
CHANGED
@@ -14,6 +14,9 @@ import type { PaymentMethods, CustomerPaymentMethod } from './types';
|
|
14 |
export const getCustomerPaymentMethods = (
|
15 |
availablePaymentMethods: PaymentMethods = {}
|
16 |
): Record< string, CustomerPaymentMethod > => {
|
|
|
|
|
|
|
17 |
const customerPaymentMethods = getSetting( 'customerPaymentMethods', {} );
|
18 |
const paymentMethodKeys = Object.keys( customerPaymentMethods );
|
19 |
const enabledCustomerPaymentMethods = {} as Record<
|
14 |
export const getCustomerPaymentMethods = (
|
15 |
availablePaymentMethods: PaymentMethods = {}
|
16 |
): Record< string, CustomerPaymentMethod > => {
|
17 |
+
if ( Object.keys( availablePaymentMethods ).length === 0 ) {
|
18 |
+
return {};
|
19 |
+
}
|
20 |
const customerPaymentMethods = getSetting( 'customerPaymentMethods', {} );
|
21 |
const paymentMethodKeys = Object.keys( customerPaymentMethods );
|
22 |
const enabledCustomerPaymentMethods = {} as Record<
|
assets/js/base/context/providers/validation/components/validation-input-error/index.js
CHANGED
@@ -15,7 +15,8 @@ export const ValidationInputError = ( {
|
|
15 |
elementId = '',
|
16 |
} ) => {
|
17 |
const { getValidationError, getValidationErrorId } = useValidationContext();
|
18 |
-
|
|
|
19 |
const error = getValidationError( propertyName ) || {};
|
20 |
if ( error.message && ! error.hidden ) {
|
21 |
errorMessage = error.message;
|
15 |
elementId = '',
|
16 |
} ) => {
|
17 |
const { getValidationError, getValidationErrorId } = useValidationContext();
|
18 |
+
|
19 |
+
if ( ! errorMessage || typeof errorMessage !== 'string' ) {
|
20 |
const error = getValidationError( propertyName ) || {};
|
21 |
if ( error.message && ! error.hidden ) {
|
22 |
errorMessage = error.message;
|
assets/js/base/hooks/use-shallow-equal.ts
CHANGED
@@ -13,12 +13,11 @@ import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
13 |
*
|
14 |
* @param {*} value Value to keep the same if satisfies shallow equality.
|
15 |
*
|
16 |
-
* @return {*} The previous cached instance of the value if the current has
|
17 |
-
* shallow equality with it.
|
18 |
*/
|
19 |
-
export function useShallowEqual< T >( value: T ): T
|
20 |
-
const ref = useRef< T >();
|
21 |
-
if (
|
22 |
ref.current = value;
|
23 |
}
|
24 |
return ref.current;
|
13 |
*
|
14 |
* @param {*} value Value to keep the same if satisfies shallow equality.
|
15 |
*
|
16 |
+
* @return {*} The previous cached instance of the value if the current has shallow equality with it.
|
|
|
17 |
*/
|
18 |
+
export function useShallowEqual< T >( value: T ): T {
|
19 |
+
const ref = useRef< T >( value );
|
20 |
+
if ( ! isShallowEqual( value, ref.current ) ) {
|
21 |
ref.current = value;
|
22 |
}
|
23 |
return ref.current;
|
assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap
CHANGED
@@ -6,691 +6,719 @@ exports[`Testing cart Contains a Taxes section if Core options are set to show i
|
|
6 |
aria-hidden="true"
|
7 |
class="with-scroll-to-top__scroll-point"
|
8 |
/>
|
9 |
-
<h2
|
10 |
-
class="wc-block-components-title"
|
11 |
-
>
|
12 |
-
Your cart (3 items)
|
13 |
-
</h2>
|
14 |
<div
|
15 |
-
class="
|
16 |
>
|
17 |
-
<iframe
|
18 |
-
aria-hidden="true"
|
19 |
-
frameborder="0"
|
20 |
-
src="about:blank"
|
21 |
-
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
22 |
-
tabindex="-1"
|
23 |
-
/>
|
24 |
<div
|
25 |
-
|
|
|
26 |
>
|
27 |
-
<
|
28 |
-
class="wc-block-
|
29 |
>
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
</th>
|
48 |
-
<th
|
49 |
-
class="wc-block-cart-items__header-total"
|
50 |
-
>
|
51 |
-
<span>
|
52 |
-
Total
|
53 |
-
</span>
|
54 |
-
</th>
|
55 |
-
</tr>
|
56 |
-
</thead>
|
57 |
-
<tbody>
|
58 |
-
<tr
|
59 |
-
class="wc-block-cart-items__row"
|
60 |
>
|
61 |
-
<
|
62 |
-
|
63 |
-
|
64 |
-
>
|
65 |
-
<a
|
66 |
-
href="https://example.org"
|
67 |
-
tabindex="-1"
|
68 |
>
|
69 |
-
<
|
70 |
-
|
71 |
-
src="assets/img/beanie.jpg"
|
72 |
-
/>
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
<td
|
76 |
-
class="wc-block-cart-item__product"
|
77 |
-
>
|
78 |
-
<a
|
79 |
-
class="wc-block-components-product-name"
|
80 |
-
href="https://example.org"
|
81 |
-
>
|
82 |
-
Beanie
|
83 |
-
</a>
|
84 |
-
<div
|
85 |
-
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
86 |
-
>
|
87 |
-
2 left in stock
|
88 |
-
</div>
|
89 |
-
<div
|
90 |
-
class="wc-block-cart-item__prices"
|
91 |
-
>
|
92 |
-
<span
|
93 |
-
class="price wc-block-components-product-price"
|
94 |
>
|
95 |
-
<span
|
96 |
-
|
97 |
-
>
|
98 |
-
$6.40
|
99 |
</span>
|
100 |
-
</
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
>
|
105 |
-
<
|
106 |
-
|
|
|
107 |
>
|
108 |
-
<
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
116 |
>
|
117 |
-
<
|
118 |
-
class="wc-block-components-product-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
>
|
120 |
<span
|
121 |
-
class="wc-block-components-product-
|
122 |
>
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
</span>
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
129 |
>
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
>
|
136 |
-
<
|
137 |
-
class="wc-block-components-
|
138 |
>
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
>
|
146 |
-
|
147 |
-
</
|
148 |
-
</
|
149 |
-
</
|
150 |
-
|
151 |
-
|
152 |
-
class="wc-block-cart-item__quantity"
|
153 |
-
>
|
154 |
-
<div
|
155 |
-
class="wc-block-components-quantity-selector"
|
156 |
>
|
157 |
-
<
|
158 |
-
|
159 |
-
class="wc-block-components-quantity-selector__input"
|
160 |
-
min="0"
|
161 |
-
step="1"
|
162 |
-
type="number"
|
163 |
-
value="2"
|
164 |
-
/>
|
165 |
-
<button
|
166 |
-
aria-label="Reduce quantity"
|
167 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
168 |
-
>
|
169 |
-
-
|
170 |
-
</button>
|
171 |
-
<button
|
172 |
-
aria-label="Increase quantity"
|
173 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
174 |
>
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
190 |
>
|
191 |
-
<
|
192 |
-
|
|
|
193 |
>
|
194 |
-
<
|
195 |
-
|
|
|
196 |
>
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
>
|
206 |
-
<td
|
207 |
-
aria-hidden="true"
|
208 |
-
class="wc-block-cart-item__image"
|
209 |
-
>
|
210 |
-
<a
|
211 |
-
href="https://example.org"
|
212 |
-
tabindex="-1"
|
213 |
-
>
|
214 |
-
<img
|
215 |
-
alt=""
|
216 |
-
src="assets/img/cap.jpg"
|
217 |
-
/>
|
218 |
-
</a>
|
219 |
-
</td>
|
220 |
-
<td
|
221 |
-
class="wc-block-cart-item__product"
|
222 |
-
>
|
223 |
-
<a
|
224 |
-
class="wc-block-components-product-name"
|
225 |
-
href="https://example.org"
|
226 |
-
>
|
227 |
-
Cap
|
228 |
-
</a>
|
229 |
-
<div
|
230 |
-
class="wc-block-cart-item__prices"
|
231 |
-
>
|
232 |
-
<span
|
233 |
-
class="price wc-block-components-product-price"
|
234 |
>
|
235 |
-
<
|
236 |
-
class="
|
237 |
-
|
238 |
-
Previous price:
|
239 |
-
</span>
|
240 |
-
<del
|
241 |
-
class="wc-block-components-product-price__regular"
|
242 |
>
|
243 |
-
|
244 |
-
</
|
245 |
-
<
|
246 |
-
class="
|
247 |
-
>
|
248 |
-
Discounted price:
|
249 |
-
</span>
|
250 |
-
<ins
|
251 |
-
class="wc-block-components-product-price__value is-discounted"
|
252 |
-
>
|
253 |
-
$11.20
|
254 |
-
</ins>
|
255 |
-
</span>
|
256 |
-
</div>
|
257 |
-
<div
|
258 |
-
class="wc-block-components-product-badge wc-block-components-sale-badge"
|
259 |
-
>
|
260 |
-
Save
|
261 |
-
<span
|
262 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
263 |
-
>
|
264 |
-
$1.60
|
265 |
-
</span>
|
266 |
-
</div>
|
267 |
-
<div
|
268 |
-
class="wc-block-components-product-metadata"
|
269 |
-
>
|
270 |
-
<div
|
271 |
-
class="wc-block-components-product-metadata__description"
|
272 |
-
>
|
273 |
-
<p>
|
274 |
-
Lightweight baseball cap
|
275 |
-
</p>
|
276 |
-
|
277 |
-
|
278 |
-
</div>
|
279 |
-
<ul
|
280 |
-
class="wc-block-components-product-details"
|
281 |
-
>
|
282 |
-
<li
|
283 |
-
class="wc-block-components-product-details__color"
|
284 |
>
|
285 |
<span
|
286 |
-
class="wc-block-components-product-
|
287 |
>
|
288 |
-
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
</span>
|
291 |
-
|
|
|
|
|
|
|
|
|
292 |
<span
|
293 |
-
class="wc-block-components-
|
294 |
>
|
295 |
-
|
296 |
</span>
|
297 |
-
</
|
298 |
-
|
299 |
-
|
300 |
-
<div
|
301 |
-
class="wc-block-cart-item__quantity"
|
302 |
-
>
|
303 |
-
<div
|
304 |
-
class="wc-block-components-quantity-selector"
|
305 |
-
>
|
306 |
-
<input
|
307 |
-
aria-label="Quantity of Cap in your cart."
|
308 |
-
class="wc-block-components-quantity-selector__input"
|
309 |
-
min="0"
|
310 |
-
step="1"
|
311 |
-
type="number"
|
312 |
-
value="1"
|
313 |
-
/>
|
314 |
-
<button
|
315 |
-
aria-label="Reduce quantity"
|
316 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
317 |
-
disabled=""
|
318 |
>
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
>
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
>
|
344 |
-
<
|
345 |
-
class="wc-block-
|
346 |
>
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
Cart totals
|
363 |
-
</h2>
|
364 |
-
<div
|
365 |
-
class="wc-block-components-totals-item"
|
366 |
-
>
|
367 |
-
<span
|
368 |
-
class="wc-block-components-totals-item__label"
|
369 |
-
>
|
370 |
-
Subtotal
|
371 |
-
</span>
|
372 |
-
<span
|
373 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
374 |
-
>
|
375 |
-
$24.00
|
376 |
-
</span>
|
377 |
<div
|
378 |
-
class="wc-block-components-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
<
|
386 |
-
|
387 |
-
class="wc-block-components-panel__button"
|
388 |
>
|
389 |
-
<svg
|
390 |
-
aria-hidden="true"
|
391 |
-
class="wc-block-components-panel__button-icon"
|
392 |
-
focusable="false"
|
393 |
-
height="24"
|
394 |
-
role="img"
|
395 |
-
viewBox="0 0 24 24"
|
396 |
-
width="24"
|
397 |
-
xmlns="http://www.w3.org/2000/svg"
|
398 |
-
>
|
399 |
-
<path
|
400 |
-
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
401 |
-
/>
|
402 |
-
</svg>
|
403 |
<span
|
404 |
-
|
405 |
>
|
406 |
-
|
407 |
</span>
|
408 |
<span
|
409 |
-
class="
|
410 |
>
|
411 |
-
|
412 |
</span>
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
hidden=""
|
418 |
-
>
|
419 |
<div
|
420 |
-
class="wc-block-components-totals-
|
421 |
>
|
422 |
-
<
|
423 |
-
class="wc-block-components-totals-coupon__form"
|
424 |
-
>
|
425 |
-
<div
|
426 |
-
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
427 |
-
>
|
428 |
-
<input
|
429 |
-
aria-describedby=""
|
430 |
-
aria-label="Enter code"
|
431 |
-
autocapitalize="off"
|
432 |
-
autocomplete="off"
|
433 |
-
id="wc-block-components-totals-coupon__input-3"
|
434 |
-
type="text"
|
435 |
-
value=""
|
436 |
-
/>
|
437 |
-
<label
|
438 |
-
for="wc-block-components-totals-coupon__input-3"
|
439 |
-
>
|
440 |
-
Enter code
|
441 |
-
</label>
|
442 |
-
</div>
|
443 |
<button
|
444 |
-
|
445 |
-
|
446 |
-
type="submit"
|
447 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
<span
|
449 |
-
class="
|
450 |
>
|
451 |
-
Apply
|
452 |
</span>
|
453 |
</button>
|
454 |
-
</form>
|
455 |
-
</div>
|
456 |
-
</div>
|
457 |
-
</div>
|
458 |
-
<div
|
459 |
-
class="wc-block-components-discounts-meta"
|
460 |
-
/>
|
461 |
-
<div
|
462 |
-
class="wc-block-components-totals-shipping"
|
463 |
-
>
|
464 |
-
<div
|
465 |
-
class="wc-block-components-totals-item"
|
466 |
-
>
|
467 |
-
<span
|
468 |
-
class="wc-block-components-totals-item__label"
|
469 |
-
>
|
470 |
-
Shipping
|
471 |
-
</span>
|
472 |
-
<span
|
473 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
474 |
-
>
|
475 |
-
$0.00
|
476 |
-
</span>
|
477 |
-
<div
|
478 |
-
class="wc-block-components-totals-item__description"
|
479 |
-
>
|
480 |
-
<div
|
481 |
-
class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
|
482 |
-
>
|
483 |
-
via
|
484 |
-
|
485 |
-
Free shipping
|
486 |
</div>
|
487 |
-
</div>
|
488 |
-
</div>
|
489 |
-
<fieldset
|
490 |
-
class="wc-block-components-totals-shipping__fieldset"
|
491 |
-
>
|
492 |
-
<legend
|
493 |
-
class="screen-reader-text"
|
494 |
-
>
|
495 |
-
Shipping options
|
496 |
-
</legend>
|
497 |
-
<div
|
498 |
-
class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
|
499 |
-
>
|
500 |
<div
|
501 |
-
class="wc-block-components-
|
|
|
502 |
>
|
503 |
-
<div>
|
504 |
-
<button
|
505 |
-
aria-expanded="true"
|
506 |
-
class="wc-block-components-panel__button"
|
507 |
-
>
|
508 |
-
<svg
|
509 |
-
aria-hidden="true"
|
510 |
-
class="wc-block-components-panel__button-icon"
|
511 |
-
focusable="false"
|
512 |
-
height="24"
|
513 |
-
role="img"
|
514 |
-
viewBox="0 0 24 24"
|
515 |
-
width="24"
|
516 |
-
xmlns="http://www.w3.org/2000/svg"
|
517 |
-
>
|
518 |
-
<path
|
519 |
-
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
520 |
-
/>
|
521 |
-
</svg>
|
522 |
-
<div
|
523 |
-
class="wc-block-components-shipping-rates-control__package-title"
|
524 |
-
>
|
525 |
-
Shipping
|
526 |
-
</div>
|
527 |
-
</button>
|
528 |
-
</div>
|
529 |
<div
|
530 |
-
class="
|
531 |
>
|
532 |
<div
|
533 |
-
|
|
|
534 |
>
|
535 |
-
<
|
536 |
-
class="wc-block-components-
|
537 |
-
for="radio-control-3-free_shipping:1"
|
538 |
>
|
539 |
-
<
|
540 |
-
|
541 |
-
checked=""
|
542 |
-
class="wc-block-components-radio-control__input"
|
543 |
-
id="radio-control-3-free_shipping:1"
|
544 |
-
name="radio-control-3"
|
545 |
-
type="radio"
|
546 |
-
value="free_shipping:1"
|
547 |
-
/>
|
548 |
-
<div
|
549 |
-
class="wc-block-components-radio-control__option-layout"
|
550 |
>
|
551 |
<div
|
552 |
-
class="wc-block-components-
|
553 |
>
|
554 |
-
<
|
555 |
-
|
556 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
>
|
558 |
-
|
559 |
-
</
|
560 |
</div>
|
561 |
-
<
|
562 |
-
class="wc-block-components-
|
|
|
|
|
563 |
>
|
564 |
<span
|
565 |
-
class="wc-block-components-
|
566 |
-
id="radio-control-3-free_shipping:1__description"
|
567 |
>
|
568 |
-
|
569 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
570 |
-
>
|
571 |
-
$0.00
|
572 |
-
</span>
|
573 |
-
|
574 |
</span>
|
575 |
-
</
|
576 |
-
</
|
577 |
-
</
|
578 |
-
|
579 |
-
|
580 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
>
|
582 |
-
<input
|
583 |
-
aria-describedby="radio-control-3-local_pickup:1__label radio-control-3-local_pickup:1__description"
|
584 |
-
class="wc-block-components-radio-control__input"
|
585 |
-
id="radio-control-3-local_pickup:1"
|
586 |
-
name="radio-control-3"
|
587 |
-
type="radio"
|
588 |
-
value="local_pickup:1"
|
589 |
-
/>
|
590 |
<div
|
591 |
-
class="wc-block-components-
|
592 |
>
|
593 |
-
<div
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
class="wc-block-components-radio-control__label"
|
598 |
-
id="radio-control-3-local_pickup:1__label"
|
599 |
>
|
600 |
-
|
601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
</div>
|
603 |
<div
|
604 |
-
class="wc-block-components-
|
605 |
>
|
606 |
-
<
|
607 |
-
class="wc-block-components-radio-
|
608 |
-
id="radio-control-3-local_pickup:1__description"
|
609 |
>
|
610 |
-
<
|
611 |
-
class="wc-block-
|
|
|
612 |
>
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
</div>
|
618 |
</div>
|
619 |
-
</
|
620 |
</div>
|
621 |
</div>
|
622 |
-
</
|
623 |
</div>
|
624 |
-
</fieldset>
|
625 |
-
</div>
|
626 |
-
<div
|
627 |
-
class="wc-block-components-totals-item wc-block-components-totals-taxes"
|
628 |
-
>
|
629 |
-
<span
|
630 |
-
class="wc-block-components-totals-item__label"
|
631 |
-
>
|
632 |
-
Taxes
|
633 |
-
</span>
|
634 |
-
<span
|
635 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
636 |
-
>
|
637 |
-
$6.00
|
638 |
-
</span>
|
639 |
-
<div
|
640 |
-
class="wc-block-components-totals-item__description"
|
641 |
-
/>
|
642 |
-
</div>
|
643 |
-
<div
|
644 |
-
class="wc-block-components-totals-item wc-block-components-totals-footer-item"
|
645 |
-
>
|
646 |
-
<span
|
647 |
-
class="wc-block-components-totals-item__label"
|
648 |
-
>
|
649 |
-
Total
|
650 |
-
</span>
|
651 |
-
<span
|
652 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
653 |
-
>
|
654 |
-
$30.00
|
655 |
-
</span>
|
656 |
-
<div
|
657 |
-
class="wc-block-components-totals-item__description"
|
658 |
-
/>
|
659 |
-
</div>
|
660 |
-
<div
|
661 |
-
class="wc-block-components-order-meta"
|
662 |
-
/>
|
663 |
-
<div
|
664 |
-
class="wc-block-cart__payment-options"
|
665 |
-
>
|
666 |
-
<div
|
667 |
-
class="wc-block-cart__submit"
|
668 |
-
>
|
669 |
<div
|
670 |
-
|
671 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
672 |
/>
|
673 |
<div
|
674 |
-
class="wc-block-
|
675 |
>
|
676 |
-
<
|
677 |
-
class="
|
678 |
-
href=""
|
679 |
>
|
680 |
-
<
|
681 |
-
|
|
|
|
|
|
|
|
|
682 |
>
|
683 |
-
|
684 |
-
|
685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
</div>
|
687 |
</div>
|
688 |
</div>
|
|
|
|
|
|
|
689 |
</div>
|
690 |
</div>
|
691 |
-
<div
|
692 |
-
style="display: none;"
|
693 |
-
/>
|
694 |
</div>
|
695 |
`;
|
696 |
|
@@ -700,696 +728,724 @@ exports[`Testing cart Shows individual tax lines if the store is set to do so 1`
|
|
700 |
aria-hidden="true"
|
701 |
class="with-scroll-to-top__scroll-point"
|
702 |
/>
|
703 |
-
<h2
|
704 |
-
class="wc-block-components-title"
|
705 |
-
>
|
706 |
-
Your cart (3 items)
|
707 |
-
</h2>
|
708 |
<div
|
709 |
-
class="
|
710 |
>
|
711 |
-
<iframe
|
712 |
-
aria-hidden="true"
|
713 |
-
frameborder="0"
|
714 |
-
src="about:blank"
|
715 |
-
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
716 |
-
tabindex="-1"
|
717 |
-
/>
|
718 |
<div
|
719 |
-
|
|
|
720 |
>
|
721 |
-
<
|
722 |
-
class="wc-block-
|
723 |
>
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
</th>
|
742 |
-
<th
|
743 |
-
class="wc-block-cart-items__header-total"
|
744 |
-
>
|
745 |
-
<span>
|
746 |
-
Total
|
747 |
-
</span>
|
748 |
-
</th>
|
749 |
-
</tr>
|
750 |
-
</thead>
|
751 |
-
<tbody>
|
752 |
-
<tr
|
753 |
-
class="wc-block-cart-items__row"
|
754 |
>
|
755 |
-
<
|
756 |
-
|
757 |
-
|
758 |
-
>
|
759 |
-
<a
|
760 |
-
href="https://example.org"
|
761 |
-
tabindex="-1"
|
762 |
-
>
|
763 |
-
<img
|
764 |
-
alt=""
|
765 |
-
src="assets/img/beanie.jpg"
|
766 |
-
/>
|
767 |
-
</a>
|
768 |
-
</td>
|
769 |
-
<td
|
770 |
-
class="wc-block-cart-item__product"
|
771 |
-
>
|
772 |
-
<a
|
773 |
-
class="wc-block-components-product-name"
|
774 |
-
href="https://example.org"
|
775 |
-
>
|
776 |
-
Beanie
|
777 |
-
</a>
|
778 |
-
<div
|
779 |
-
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
780 |
>
|
781 |
-
|
782 |
-
|
783 |
-
<div
|
784 |
-
class="wc-block-cart-item__prices"
|
785 |
-
>
|
786 |
-
<span
|
787 |
-
class="price wc-block-components-product-price"
|
788 |
>
|
789 |
-
<span
|
790 |
-
|
791 |
-
>
|
792 |
-
$6.40
|
793 |
</span>
|
794 |
-
</
|
795 |
-
|
796 |
-
|
797 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
798 |
>
|
799 |
-
<
|
800 |
-
|
|
|
801 |
>
|
802 |
-
<
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
|
|
|
|
|
|
|
|
810 |
>
|
811 |
-
<
|
812 |
-
class="wc-block-components-product-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
>
|
814 |
<span
|
815 |
-
class="wc-block-components-product-
|
816 |
>
|
817 |
-
|
818 |
-
|
|
|
|
|
|
|
819 |
</span>
|
820 |
-
|
821 |
-
|
822 |
-
|
|
|
|
|
|
|
823 |
>
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
829 |
>
|
830 |
-
<
|
831 |
-
class="wc-block-components-
|
832 |
>
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
>
|
840 |
-
|
841 |
-
</
|
842 |
-
</
|
843 |
-
</
|
844 |
-
|
845 |
-
|
846 |
-
class="wc-block-cart-item__quantity"
|
847 |
-
>
|
848 |
-
<div
|
849 |
-
class="wc-block-components-quantity-selector"
|
850 |
>
|
851 |
-
<
|
852 |
-
|
853 |
-
class="wc-block-components-quantity-selector__input"
|
854 |
-
min="0"
|
855 |
-
step="1"
|
856 |
-
type="number"
|
857 |
-
value="2"
|
858 |
-
/>
|
859 |
-
<button
|
860 |
-
aria-label="Reduce quantity"
|
861 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
862 |
-
>
|
863 |
-
-
|
864 |
-
</button>
|
865 |
-
<button
|
866 |
-
aria-label="Increase quantity"
|
867 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
868 |
>
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
884 |
>
|
885 |
-
<
|
886 |
-
|
|
|
887 |
>
|
888 |
-
<
|
889 |
-
|
|
|
890 |
>
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
>
|
900 |
-
<td
|
901 |
-
aria-hidden="true"
|
902 |
-
class="wc-block-cart-item__image"
|
903 |
-
>
|
904 |
-
<a
|
905 |
-
href="https://example.org"
|
906 |
-
tabindex="-1"
|
907 |
-
>
|
908 |
-
<img
|
909 |
-
alt=""
|
910 |
-
src="assets/img/cap.jpg"
|
911 |
-
/>
|
912 |
-
</a>
|
913 |
-
</td>
|
914 |
-
<td
|
915 |
-
class="wc-block-cart-item__product"
|
916 |
-
>
|
917 |
-
<a
|
918 |
-
class="wc-block-components-product-name"
|
919 |
-
href="https://example.org"
|
920 |
-
>
|
921 |
-
Cap
|
922 |
-
</a>
|
923 |
-
<div
|
924 |
-
class="wc-block-cart-item__prices"
|
925 |
-
>
|
926 |
-
<span
|
927 |
-
class="price wc-block-components-product-price"
|
928 |
>
|
929 |
-
<
|
930 |
-
class="
|
931 |
-
|
932 |
-
Previous price:
|
933 |
-
</span>
|
934 |
-
<del
|
935 |
-
class="wc-block-components-product-price__regular"
|
936 |
-
>
|
937 |
-
$12.80
|
938 |
-
</del>
|
939 |
-
<span
|
940 |
-
class="screen-reader-text"
|
941 |
>
|
942 |
-
|
943 |
-
</
|
944 |
-
<
|
945 |
-
class="wc-block-
|
946 |
-
>
|
947 |
-
$11.20
|
948 |
-
</ins>
|
949 |
-
</span>
|
950 |
-
</div>
|
951 |
-
<div
|
952 |
-
class="wc-block-components-product-badge wc-block-components-sale-badge"
|
953 |
-
>
|
954 |
-
Save
|
955 |
-
<span
|
956 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
957 |
-
>
|
958 |
-
$1.60
|
959 |
-
</span>
|
960 |
-
</div>
|
961 |
-
<div
|
962 |
-
class="wc-block-components-product-metadata"
|
963 |
-
>
|
964 |
-
<div
|
965 |
-
class="wc-block-components-product-metadata__description"
|
966 |
-
>
|
967 |
-
<p>
|
968 |
-
Lightweight baseball cap
|
969 |
-
</p>
|
970 |
-
|
971 |
-
|
972 |
-
</div>
|
973 |
-
<ul
|
974 |
-
class="wc-block-components-product-details"
|
975 |
-
>
|
976 |
-
<li
|
977 |
-
class="wc-block-components-product-details__color"
|
978 |
>
|
979 |
<span
|
980 |
-
class="wc-block-components-product-
|
981 |
>
|
982 |
-
|
983 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
</span>
|
985 |
-
|
|
|
|
|
|
|
|
|
986 |
<span
|
987 |
-
class="wc-block-components-
|
988 |
>
|
989 |
-
|
990 |
</span>
|
991 |
-
</
|
992 |
-
|
993 |
-
|
994 |
-
<div
|
995 |
-
class="wc-block-cart-item__quantity"
|
996 |
-
>
|
997 |
-
<div
|
998 |
-
class="wc-block-components-quantity-selector"
|
999 |
-
>
|
1000 |
-
<input
|
1001 |
-
aria-label="Quantity of Cap in your cart."
|
1002 |
-
class="wc-block-components-quantity-selector__input"
|
1003 |
-
min="0"
|
1004 |
-
step="1"
|
1005 |
-
type="number"
|
1006 |
-
value="1"
|
1007 |
-
/>
|
1008 |
-
<button
|
1009 |
-
aria-label="Reduce quantity"
|
1010 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1011 |
-
disabled=""
|
1012 |
>
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
>
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1037 |
>
|
1038 |
-
<
|
1039 |
-
class="wc-block-
|
1040 |
>
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
Cart totals
|
1057 |
-
</h2>
|
1058 |
-
<div
|
1059 |
-
class="wc-block-components-totals-item"
|
1060 |
-
>
|
1061 |
-
<span
|
1062 |
-
class="wc-block-components-totals-item__label"
|
1063 |
-
>
|
1064 |
-
Subtotal
|
1065 |
-
</span>
|
1066 |
-
<span
|
1067 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1068 |
-
>
|
1069 |
-
$24.00
|
1070 |
-
</span>
|
1071 |
-
<div
|
1072 |
-
class="wc-block-components-totals-item__description"
|
1073 |
-
/>
|
1074 |
-
</div>
|
1075 |
-
<div
|
1076 |
-
class="wc-block-components-totals-coupon wc-block-components-panel has-border"
|
1077 |
-
>
|
1078 |
-
<div>
|
1079 |
-
<button
|
1080 |
-
aria-expanded="false"
|
1081 |
-
class="wc-block-components-panel__button"
|
1082 |
-
>
|
1083 |
-
<svg
|
1084 |
-
aria-hidden="true"
|
1085 |
-
class="wc-block-components-panel__button-icon"
|
1086 |
-
focusable="false"
|
1087 |
-
height="24"
|
1088 |
-
role="img"
|
1089 |
-
viewBox="0 0 24 24"
|
1090 |
-
width="24"
|
1091 |
-
xmlns="http://www.w3.org/2000/svg"
|
1092 |
-
>
|
1093 |
-
<path
|
1094 |
-
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
1095 |
-
/>
|
1096 |
-
</svg>
|
1097 |
-
<span
|
1098 |
-
aria-hidden="true"
|
1099 |
-
>
|
1100 |
-
Coupon code
|
1101 |
-
</span>
|
1102 |
-
<span
|
1103 |
-
class="screen-reader-text"
|
1104 |
-
>
|
1105 |
-
Apply a coupon code
|
1106 |
-
</span>
|
1107 |
-
</button>
|
1108 |
-
</div>
|
1109 |
-
<div
|
1110 |
-
class="wc-block-components-panel__content"
|
1111 |
-
hidden=""
|
1112 |
-
>
|
1113 |
-
<div
|
1114 |
-
class="wc-block-components-totals-coupon__content"
|
1115 |
-
>
|
1116 |
-
<form
|
1117 |
-
class="wc-block-components-totals-coupon__form"
|
1118 |
-
>
|
1119 |
-
<div
|
1120 |
-
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
1121 |
-
>
|
1122 |
-
<input
|
1123 |
-
aria-describedby=""
|
1124 |
-
aria-label="Enter code"
|
1125 |
-
autocapitalize="off"
|
1126 |
-
autocomplete="off"
|
1127 |
-
id="wc-block-components-totals-coupon__input-5"
|
1128 |
-
type="text"
|
1129 |
-
value=""
|
1130 |
-
/>
|
1131 |
-
<label
|
1132 |
-
for="wc-block-components-totals-coupon__input-5"
|
1133 |
-
>
|
1134 |
-
Enter code
|
1135 |
-
</label>
|
1136 |
-
</div>
|
1137 |
-
<button
|
1138 |
-
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
1139 |
-
disabled=""
|
1140 |
-
type="submit"
|
1141 |
-
>
|
1142 |
-
<span
|
1143 |
-
class="wc-block-components-button__text"
|
1144 |
-
>
|
1145 |
-
Apply
|
1146 |
-
</span>
|
1147 |
-
</button>
|
1148 |
-
</form>
|
1149 |
-
</div>
|
1150 |
-
</div>
|
1151 |
-
</div>
|
1152 |
-
<div
|
1153 |
-
class="wc-block-components-discounts-meta"
|
1154 |
-
/>
|
1155 |
-
<div
|
1156 |
-
class="wc-block-components-totals-shipping"
|
1157 |
-
>
|
1158 |
<div
|
1159 |
-
class="wc-block-components-
|
1160 |
>
|
1161 |
-
<
|
1162 |
-
class="wc-block-components-
|
1163 |
-
>
|
1164 |
-
Shipping
|
1165 |
-
</span>
|
1166 |
-
<span
|
1167 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1168 |
>
|
1169 |
-
|
1170 |
-
</
|
1171 |
<div
|
1172 |
-
class="wc-block-components-totals-
|
1173 |
>
|
1174 |
-
<
|
1175 |
-
class="wc-block-components-totals-
|
1176 |
>
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1181 |
</div>
|
1182 |
-
</div>
|
1183 |
-
<fieldset
|
1184 |
-
class="wc-block-components-totals-shipping__fieldset"
|
1185 |
-
>
|
1186 |
-
<legend
|
1187 |
-
class="screen-reader-text"
|
1188 |
-
>
|
1189 |
-
Shipping options
|
1190 |
-
</legend>
|
1191 |
<div
|
1192 |
-
class="wc-block-components-
|
1193 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1194 |
<div
|
1195 |
-
class="wc-block-components-
|
|
|
1196 |
>
|
1197 |
-
<div>
|
1198 |
-
<button
|
1199 |
-
aria-expanded="true"
|
1200 |
-
class="wc-block-components-panel__button"
|
1201 |
-
>
|
1202 |
-
<svg
|
1203 |
-
aria-hidden="true"
|
1204 |
-
class="wc-block-components-panel__button-icon"
|
1205 |
-
focusable="false"
|
1206 |
-
height="24"
|
1207 |
-
role="img"
|
1208 |
-
viewBox="0 0 24 24"
|
1209 |
-
width="24"
|
1210 |
-
xmlns="http://www.w3.org/2000/svg"
|
1211 |
-
>
|
1212 |
-
<path
|
1213 |
-
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
1214 |
-
/>
|
1215 |
-
</svg>
|
1216 |
-
<div
|
1217 |
-
class="wc-block-components-shipping-rates-control__package-title"
|
1218 |
-
>
|
1219 |
-
Shipping
|
1220 |
-
</div>
|
1221 |
-
</button>
|
1222 |
-
</div>
|
1223 |
<div
|
1224 |
-
class="
|
1225 |
>
|
1226 |
<div
|
1227 |
-
|
|
|
1228 |
>
|
1229 |
-
<
|
1230 |
-
class="wc-block-components-
|
1231 |
-
for="radio-control-5-free_shipping:1"
|
1232 |
>
|
1233 |
-
<
|
1234 |
-
|
1235 |
-
checked=""
|
1236 |
-
class="wc-block-components-radio-control__input"
|
1237 |
-
id="radio-control-5-free_shipping:1"
|
1238 |
-
name="radio-control-5"
|
1239 |
-
type="radio"
|
1240 |
-
value="free_shipping:1"
|
1241 |
-
/>
|
1242 |
-
<div
|
1243 |
-
class="wc-block-components-radio-control__option-layout"
|
1244 |
>
|
1245 |
<div
|
1246 |
-
class="wc-block-components-
|
1247 |
>
|
1248 |
-
<
|
1249 |
-
|
1250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1251 |
>
|
1252 |
-
|
1253 |
-
</
|
1254 |
</div>
|
1255 |
-
<
|
1256 |
-
class="wc-block-components-
|
|
|
|
|
1257 |
>
|
1258 |
<span
|
1259 |
-
class="wc-block-components-
|
1260 |
-
id="radio-control-5-free_shipping:1__description"
|
1261 |
>
|
1262 |
-
|
1263 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
1264 |
-
>
|
1265 |
-
$0.00
|
1266 |
-
</span>
|
1267 |
-
|
1268 |
</span>
|
1269 |
-
</
|
1270 |
-
</
|
1271 |
-
</
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1275 |
>
|
1276 |
-
<input
|
1277 |
-
aria-describedby="radio-control-5-local_pickup:1__label radio-control-5-local_pickup:1__description"
|
1278 |
-
class="wc-block-components-radio-control__input"
|
1279 |
-
id="radio-control-5-local_pickup:1"
|
1280 |
-
name="radio-control-5"
|
1281 |
-
type="radio"
|
1282 |
-
value="local_pickup:1"
|
1283 |
-
/>
|
1284 |
<div
|
1285 |
-
class="wc-block-components-
|
1286 |
>
|
1287 |
-
<div
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
class="wc-block-components-radio-control__label"
|
1292 |
-
id="radio-control-5-local_pickup:1__label"
|
1293 |
>
|
1294 |
-
|
1295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1296 |
</div>
|
1297 |
<div
|
1298 |
-
class="wc-block-components-
|
1299 |
>
|
1300 |
-
<
|
1301 |
-
class="wc-block-components-radio-
|
1302 |
-
id="radio-control-5-local_pickup:1__description"
|
1303 |
>
|
1304 |
-
<
|
1305 |
-
class="wc-block-
|
|
|
1306 |
>
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1311 |
</div>
|
1312 |
</div>
|
1313 |
-
</
|
1314 |
</div>
|
1315 |
</div>
|
1316 |
-
</
|
1317 |
</div>
|
1318 |
-
|
1319 |
-
|
1320 |
-
<div
|
1321 |
-
class="wc-block-components-totals-taxes"
|
1322 |
-
>
|
1323 |
-
<div
|
1324 |
-
class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
|
1325 |
-
>
|
1326 |
-
<span
|
1327 |
-
class="wc-block-components-totals-item__label"
|
1328 |
-
>
|
1329 |
-
Sales tax
|
1330 |
-
</span>
|
1331 |
-
<span
|
1332 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1333 |
>
|
1334 |
-
|
1335 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1336 |
<div
|
1337 |
-
class="wc-block-components-totals-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
$30.00
|
1354 |
-
</span>
|
1355 |
-
<div
|
1356 |
-
class="wc-block-components-totals-item__description"
|
1357 |
-
/>
|
1358 |
-
</div>
|
1359 |
-
<div
|
1360 |
-
class="wc-block-components-order-meta"
|
1361 |
-
/>
|
1362 |
-
<div
|
1363 |
-
class="wc-block-cart__payment-options"
|
1364 |
-
>
|
1365 |
-
<div
|
1366 |
-
class="wc-block-cart__submit"
|
1367 |
-
>
|
1368 |
<div
|
1369 |
-
|
1370 |
-
style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
|
1371 |
/>
|
1372 |
<div
|
1373 |
-
class="wc-block-
|
1374 |
>
|
1375 |
-
<
|
1376 |
-
class="
|
1377 |
-
href=""
|
1378 |
>
|
1379 |
-
<
|
1380 |
-
|
|
|
|
|
|
|
|
|
1381 |
>
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1385 |
</div>
|
1386 |
</div>
|
1387 |
</div>
|
|
|
|
|
|
|
1388 |
</div>
|
1389 |
</div>
|
1390 |
-
<div
|
1391 |
-
style="display: none;"
|
1392 |
-
/>
|
1393 |
</div>
|
1394 |
`;
|
1395 |
|
@@ -1399,695 +1455,723 @@ exports[`Testing cart Shows rate percentages after tax lines if the block is set
|
|
1399 |
aria-hidden="true"
|
1400 |
class="with-scroll-to-top__scroll-point"
|
1401 |
/>
|
1402 |
-
<h2
|
1403 |
-
class="wc-block-components-title"
|
1404 |
-
>
|
1405 |
-
Your cart (3 items)
|
1406 |
-
</h2>
|
1407 |
<div
|
1408 |
-
class="
|
1409 |
>
|
1410 |
-
<iframe
|
1411 |
-
aria-hidden="true"
|
1412 |
-
frameborder="0"
|
1413 |
-
src="about:blank"
|
1414 |
-
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
1415 |
-
tabindex="-1"
|
1416 |
-
/>
|
1417 |
<div
|
1418 |
-
|
|
|
1419 |
>
|
1420 |
-
<
|
1421 |
-
class="wc-block-
|
1422 |
>
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
</th>
|
1441 |
-
<th
|
1442 |
-
class="wc-block-cart-items__header-total"
|
1443 |
-
>
|
1444 |
-
<span>
|
1445 |
-
Total
|
1446 |
-
</span>
|
1447 |
-
</th>
|
1448 |
-
</tr>
|
1449 |
-
</thead>
|
1450 |
-
<tbody>
|
1451 |
-
<tr
|
1452 |
-
class="wc-block-cart-items__row"
|
1453 |
>
|
1454 |
-
<
|
1455 |
-
|
1456 |
-
|
1457 |
-
>
|
1458 |
-
<a
|
1459 |
-
href="https://example.org"
|
1460 |
-
tabindex="-1"
|
1461 |
>
|
1462 |
-
<
|
1463 |
-
|
1464 |
-
src="assets/img/beanie.jpg"
|
1465 |
-
/>
|
1466 |
-
</a>
|
1467 |
-
</td>
|
1468 |
-
<td
|
1469 |
-
class="wc-block-cart-item__product"
|
1470 |
-
>
|
1471 |
-
<a
|
1472 |
-
class="wc-block-components-product-name"
|
1473 |
-
href="https://example.org"
|
1474 |
-
>
|
1475 |
-
Beanie
|
1476 |
-
</a>
|
1477 |
-
<div
|
1478 |
-
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
1479 |
-
>
|
1480 |
-
2 left in stock
|
1481 |
-
</div>
|
1482 |
-
<div
|
1483 |
-
class="wc-block-cart-item__prices"
|
1484 |
-
>
|
1485 |
-
<span
|
1486 |
-
class="price wc-block-components-product-price"
|
1487 |
>
|
1488 |
-
<span
|
1489 |
-
|
1490 |
-
>
|
1491 |
-
$6.40
|
1492 |
</span>
|
1493 |
-
</
|
1494 |
-
|
1495 |
-
|
1496 |
-
class="wc-block-components-product-metadata"
|
1497 |
-
>
|
1498 |
-
<div
|
1499 |
-
class="wc-block-components-product-metadata__description"
|
1500 |
-
>
|
1501 |
-
<p>
|
1502 |
-
Warm hat for winter
|
1503 |
-
</p>
|
1504 |
-
|
1505 |
-
|
1506 |
-
</div>
|
1507 |
-
<ul
|
1508 |
-
class="wc-block-components-product-details"
|
1509 |
-
>
|
1510 |
-
<li
|
1511 |
-
class="wc-block-components-product-details__color"
|
1512 |
-
>
|
1513 |
-
<span
|
1514 |
-
class="wc-block-components-product-details__name"
|
1515 |
-
>
|
1516 |
-
Color
|
1517 |
-
:
|
1518 |
-
</span>
|
1519 |
-
|
1520 |
-
<span
|
1521 |
-
class="wc-block-components-product-details__value"
|
1522 |
-
>
|
1523 |
-
Yellow
|
1524 |
-
</span>
|
1525 |
-
</li>
|
1526 |
-
<li
|
1527 |
-
class="wc-block-components-product-details__size"
|
1528 |
-
>
|
1529 |
-
<span
|
1530 |
-
class="wc-block-components-product-details__name"
|
1531 |
-
>
|
1532 |
-
Size
|
1533 |
-
:
|
1534 |
-
</span>
|
1535 |
-
|
1536 |
-
<span
|
1537 |
-
class="wc-block-components-product-details__value"
|
1538 |
-
>
|
1539 |
-
Small
|
1540 |
-
</span>
|
1541 |
-
</li>
|
1542 |
-
</ul>
|
1543 |
-
</div>
|
1544 |
-
<div
|
1545 |
-
class="wc-block-cart-item__quantity"
|
1546 |
-
>
|
1547 |
-
<div
|
1548 |
-
class="wc-block-components-quantity-selector"
|
1549 |
>
|
1550 |
-
<
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
value="2"
|
1557 |
-
/>
|
1558 |
-
<button
|
1559 |
-
aria-label="Reduce quantity"
|
1560 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1561 |
-
>
|
1562 |
-
-
|
1563 |
-
</button>
|
1564 |
-
<button
|
1565 |
-
aria-label="Increase quantity"
|
1566 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
1567 |
-
>
|
1568 |
-
+
|
1569 |
-
</button>
|
1570 |
-
</div>
|
1571 |
-
<button
|
1572 |
-
class="wc-block-cart-item__remove-link"
|
1573 |
>
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
>
|
1581 |
-
<
|
1582 |
-
class="wc-block-cart-
|
1583 |
>
|
1584 |
-
<
|
1585 |
-
|
|
|
1586 |
>
|
1587 |
-
<
|
1588 |
-
|
|
|
1589 |
>
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
>
|
1599 |
-
<td
|
1600 |
-
aria-hidden="true"
|
1601 |
-
class="wc-block-cart-item__image"
|
1602 |
-
>
|
1603 |
-
<a
|
1604 |
-
href="https://example.org"
|
1605 |
-
tabindex="-1"
|
1606 |
-
>
|
1607 |
-
<img
|
1608 |
-
alt=""
|
1609 |
-
src="assets/img/cap.jpg"
|
1610 |
-
/>
|
1611 |
-
</a>
|
1612 |
-
</td>
|
1613 |
-
<td
|
1614 |
-
class="wc-block-cart-item__product"
|
1615 |
-
>
|
1616 |
-
<a
|
1617 |
-
class="wc-block-components-product-name"
|
1618 |
-
href="https://example.org"
|
1619 |
-
>
|
1620 |
-
Cap
|
1621 |
-
</a>
|
1622 |
-
<div
|
1623 |
-
class="wc-block-cart-item__prices"
|
1624 |
-
>
|
1625 |
-
<span
|
1626 |
-
class="price wc-block-components-product-price"
|
1627 |
>
|
1628 |
-
<
|
1629 |
-
class="
|
|
|
1630 |
>
|
1631 |
-
|
1632 |
-
</
|
1633 |
-
<
|
1634 |
-
class="wc-block-components-product-
|
1635 |
>
|
1636 |
-
|
1637 |
-
</
|
1638 |
-
<
|
1639 |
-
class="
|
1640 |
>
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1645 |
>
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1656 |
>
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1662 |
>
|
1663 |
-
<
|
1664 |
-
|
|
|
1665 |
>
|
1666 |
-
<
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
|
|
|
|
|
|
|
|
1674 |
>
|
1675 |
-
<
|
1676 |
-
class="wc-block-components-product-
|
|
|
|
|
|
|
|
|
|
|
|
|
1677 |
>
|
1678 |
<span
|
1679 |
-
class="wc-block-components-product-
|
1680 |
>
|
1681 |
-
|
1682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1683 |
</span>
|
1684 |
-
|
|
|
|
|
|
|
|
|
1685 |
<span
|
1686 |
-
class="wc-block-components-
|
1687 |
>
|
1688 |
-
|
1689 |
</span>
|
1690 |
-
</
|
1691 |
-
|
1692 |
-
|
1693 |
-
<div
|
1694 |
-
class="wc-block-cart-item__quantity"
|
1695 |
-
>
|
1696 |
-
<div
|
1697 |
-
class="wc-block-components-quantity-selector"
|
1698 |
-
>
|
1699 |
-
<input
|
1700 |
-
aria-label="Quantity of Cap in your cart."
|
1701 |
-
class="wc-block-components-quantity-selector__input"
|
1702 |
-
min="0"
|
1703 |
-
step="1"
|
1704 |
-
type="number"
|
1705 |
-
value="1"
|
1706 |
-
/>
|
1707 |
-
<button
|
1708 |
-
aria-label="Reduce quantity"
|
1709 |
-
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1710 |
-
disabled=""
|
1711 |
>
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1717 |
>
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1736 |
>
|
1737 |
-
<
|
1738 |
-
class="wc-block-
|
1739 |
>
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
Cart totals
|
1756 |
-
</h2>
|
1757 |
-
<div
|
1758 |
-
class="wc-block-components-totals-item"
|
1759 |
-
>
|
1760 |
-
<span
|
1761 |
-
class="wc-block-components-totals-item__label"
|
1762 |
-
>
|
1763 |
-
Subtotal
|
1764 |
-
</span>
|
1765 |
-
<span
|
1766 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1767 |
-
>
|
1768 |
-
$24.00
|
1769 |
-
</span>
|
1770 |
<div
|
1771 |
-
class="wc-block-components-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
<
|
1779 |
-
|
1780 |
-
class="wc-block-components-panel__button"
|
1781 |
>
|
1782 |
-
<svg
|
1783 |
-
aria-hidden="true"
|
1784 |
-
class="wc-block-components-panel__button-icon"
|
1785 |
-
focusable="false"
|
1786 |
-
height="24"
|
1787 |
-
role="img"
|
1788 |
-
viewBox="0 0 24 24"
|
1789 |
-
width="24"
|
1790 |
-
xmlns="http://www.w3.org/2000/svg"
|
1791 |
-
>
|
1792 |
-
<path
|
1793 |
-
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
1794 |
-
/>
|
1795 |
-
</svg>
|
1796 |
<span
|
1797 |
-
|
1798 |
>
|
1799 |
-
|
1800 |
</span>
|
1801 |
<span
|
1802 |
-
class="
|
1803 |
>
|
1804 |
-
|
1805 |
</span>
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
hidden=""
|
1811 |
-
>
|
1812 |
<div
|
1813 |
-
class="wc-block-components-totals-
|
1814 |
>
|
1815 |
-
<
|
1816 |
-
class="wc-block-components-totals-coupon__form"
|
1817 |
-
>
|
1818 |
-
<div
|
1819 |
-
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
1820 |
-
>
|
1821 |
-
<input
|
1822 |
-
aria-describedby=""
|
1823 |
-
aria-label="Enter code"
|
1824 |
-
autocapitalize="off"
|
1825 |
-
autocomplete="off"
|
1826 |
-
id="wc-block-components-totals-coupon__input-7"
|
1827 |
-
type="text"
|
1828 |
-
value=""
|
1829 |
-
/>
|
1830 |
-
<label
|
1831 |
-
for="wc-block-components-totals-coupon__input-7"
|
1832 |
-
>
|
1833 |
-
Enter code
|
1834 |
-
</label>
|
1835 |
-
</div>
|
1836 |
<button
|
1837 |
-
|
1838 |
-
|
1839 |
-
type="submit"
|
1840 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1841 |
<span
|
1842 |
-
class="
|
1843 |
>
|
1844 |
-
Apply
|
1845 |
</span>
|
1846 |
</button>
|
1847 |
-
</form>
|
1848 |
-
</div>
|
1849 |
-
</div>
|
1850 |
-
</div>
|
1851 |
-
<div
|
1852 |
-
class="wc-block-components-discounts-meta"
|
1853 |
-
/>
|
1854 |
-
<div
|
1855 |
-
class="wc-block-components-totals-shipping"
|
1856 |
-
>
|
1857 |
-
<div
|
1858 |
-
class="wc-block-components-totals-item"
|
1859 |
-
>
|
1860 |
-
<span
|
1861 |
-
class="wc-block-components-totals-item__label"
|
1862 |
-
>
|
1863 |
-
Shipping
|
1864 |
-
</span>
|
1865 |
-
<span
|
1866 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1867 |
-
>
|
1868 |
-
$0.00
|
1869 |
-
</span>
|
1870 |
-
<div
|
1871 |
-
class="wc-block-components-totals-item__description"
|
1872 |
-
>
|
1873 |
-
<div
|
1874 |
-
class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
|
1875 |
-
>
|
1876 |
-
via
|
1877 |
-
|
1878 |
-
Free shipping
|
1879 |
</div>
|
1880 |
-
</div>
|
1881 |
-
</div>
|
1882 |
-
<fieldset
|
1883 |
-
class="wc-block-components-totals-shipping__fieldset"
|
1884 |
-
>
|
1885 |
-
<legend
|
1886 |
-
class="screen-reader-text"
|
1887 |
-
>
|
1888 |
-
Shipping options
|
1889 |
-
</legend>
|
1890 |
-
<div
|
1891 |
-
class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
|
1892 |
-
>
|
1893 |
<div
|
1894 |
-
class="wc-block-components-
|
|
|
1895 |
>
|
1896 |
-
<div>
|
1897 |
-
<button
|
1898 |
-
aria-expanded="true"
|
1899 |
-
class="wc-block-components-panel__button"
|
1900 |
-
>
|
1901 |
-
<svg
|
1902 |
-
aria-hidden="true"
|
1903 |
-
class="wc-block-components-panel__button-icon"
|
1904 |
-
focusable="false"
|
1905 |
-
height="24"
|
1906 |
-
role="img"
|
1907 |
-
viewBox="0 0 24 24"
|
1908 |
-
width="24"
|
1909 |
-
xmlns="http://www.w3.org/2000/svg"
|
1910 |
-
>
|
1911 |
-
<path
|
1912 |
-
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
1913 |
-
/>
|
1914 |
-
</svg>
|
1915 |
-
<div
|
1916 |
-
class="wc-block-components-shipping-rates-control__package-title"
|
1917 |
-
>
|
1918 |
-
Shipping
|
1919 |
-
</div>
|
1920 |
-
</button>
|
1921 |
-
</div>
|
1922 |
<div
|
1923 |
-
class="
|
1924 |
>
|
1925 |
<div
|
1926 |
-
|
|
|
1927 |
>
|
1928 |
-
<
|
1929 |
-
class="wc-block-components-
|
1930 |
-
for="radio-control-7-free_shipping:1"
|
1931 |
>
|
1932 |
-
<
|
1933 |
-
|
1934 |
-
checked=""
|
1935 |
-
class="wc-block-components-radio-control__input"
|
1936 |
-
id="radio-control-7-free_shipping:1"
|
1937 |
-
name="radio-control-7"
|
1938 |
-
type="radio"
|
1939 |
-
value="free_shipping:1"
|
1940 |
-
/>
|
1941 |
-
<div
|
1942 |
-
class="wc-block-components-radio-control__option-layout"
|
1943 |
>
|
1944 |
<div
|
1945 |
-
class="wc-block-components-
|
1946 |
>
|
1947 |
-
<
|
1948 |
-
|
1949 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1950 |
>
|
1951 |
-
|
1952 |
-
</
|
1953 |
</div>
|
1954 |
-
<
|
1955 |
-
class="wc-block-components-
|
|
|
|
|
1956 |
>
|
1957 |
<span
|
1958 |
-
class="wc-block-components-
|
1959 |
-
id="radio-control-7-free_shipping:1__description"
|
1960 |
>
|
1961 |
-
|
1962 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
1963 |
-
>
|
1964 |
-
$0.00
|
1965 |
-
</span>
|
1966 |
-
|
1967 |
</span>
|
1968 |
-
</
|
1969 |
-
</
|
1970 |
-
</
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1974 |
>
|
1975 |
-
<input
|
1976 |
-
aria-describedby="radio-control-7-local_pickup:1__label radio-control-7-local_pickup:1__description"
|
1977 |
-
class="wc-block-components-radio-control__input"
|
1978 |
-
id="radio-control-7-local_pickup:1"
|
1979 |
-
name="radio-control-7"
|
1980 |
-
type="radio"
|
1981 |
-
value="local_pickup:1"
|
1982 |
-
/>
|
1983 |
<div
|
1984 |
-
class="wc-block-components-
|
1985 |
>
|
1986 |
-
<div
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
class="wc-block-components-radio-control__label"
|
1991 |
-
id="radio-control-7-local_pickup:1__label"
|
1992 |
>
|
1993 |
-
|
1994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995 |
</div>
|
1996 |
<div
|
1997 |
-
class="wc-block-components-
|
1998 |
>
|
1999 |
-
<
|
2000 |
-
class="wc-block-components-radio-
|
2001 |
-
id="radio-control-7-local_pickup:1__description"
|
2002 |
>
|
2003 |
-
<
|
2004 |
-
class="wc-block-
|
|
|
2005 |
>
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010 |
</div>
|
2011 |
</div>
|
2012 |
-
</
|
2013 |
</div>
|
2014 |
</div>
|
2015 |
-
</
|
2016 |
</div>
|
2017 |
-
|
2018 |
-
|
2019 |
-
<div
|
2020 |
-
class="wc-block-components-totals-taxes"
|
2021 |
-
>
|
2022 |
-
<div
|
2023 |
-
class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
|
2024 |
-
>
|
2025 |
-
<span
|
2026 |
-
class="wc-block-components-totals-item__label"
|
2027 |
-
>
|
2028 |
-
Sales tax 20%
|
2029 |
-
</span>
|
2030 |
-
<span
|
2031 |
-
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
2032 |
>
|
2033 |
-
|
2034 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2035 |
<div
|
2036 |
-
class="wc-block-components-totals-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
$30.00
|
2053 |
-
</span>
|
2054 |
-
<div
|
2055 |
-
class="wc-block-components-totals-item__description"
|
2056 |
-
/>
|
2057 |
-
</div>
|
2058 |
-
<div
|
2059 |
-
class="wc-block-components-order-meta"
|
2060 |
-
/>
|
2061 |
-
<div
|
2062 |
-
class="wc-block-cart__payment-options"
|
2063 |
-
>
|
2064 |
-
<div
|
2065 |
-
class="wc-block-cart__submit"
|
2066 |
-
>
|
2067 |
<div
|
2068 |
-
|
2069 |
-
style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
|
2070 |
/>
|
2071 |
<div
|
2072 |
-
class="wc-block-
|
2073 |
>
|
2074 |
-
<
|
2075 |
-
class="
|
2076 |
-
href=""
|
2077 |
>
|
2078 |
-
<
|
2079 |
-
|
|
|
|
|
|
|
|
|
2080 |
>
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2084 |
</div>
|
2085 |
</div>
|
2086 |
</div>
|
|
|
|
|
|
|
2087 |
</div>
|
2088 |
</div>
|
2089 |
-
<div
|
2090 |
-
style="display: none;"
|
2091 |
-
/>
|
2092 |
</div>
|
2093 |
`;
|
6 |
aria-hidden="true"
|
7 |
class="with-scroll-to-top__scroll-point"
|
8 |
/>
|
|
|
|
|
|
|
|
|
|
|
9 |
<div
|
10 |
+
class=""
|
11 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<div
|
13 |
+
aria-hidden="false"
|
14 |
+
class=""
|
15 |
>
|
16 |
+
<h2
|
17 |
+
class="wc-block-components-title"
|
18 |
>
|
19 |
+
Your cart (3 items)
|
20 |
+
</h2>
|
21 |
+
<div
|
22 |
+
class="wc-block-components-sidebar-layout wc-block-cart"
|
23 |
+
>
|
24 |
+
<iframe
|
25 |
+
aria-hidden="true"
|
26 |
+
frameborder="0"
|
27 |
+
src="about:blank"
|
28 |
+
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
29 |
+
tabindex="-1"
|
30 |
+
/>
|
31 |
+
<div
|
32 |
+
class="wc-block-components-main wc-block-cart__main"
|
33 |
+
>
|
34 |
+
<table
|
35 |
+
class="wc-block-cart-items"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
>
|
37 |
+
<thead>
|
38 |
+
<tr
|
39 |
+
class="wc-block-cart-items__header"
|
|
|
|
|
|
|
|
|
40 |
>
|
41 |
+
<th
|
42 |
+
class="wc-block-cart-items__header-image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
>
|
44 |
+
<span>
|
45 |
+
Product
|
|
|
|
|
46 |
</span>
|
47 |
+
</th>
|
48 |
+
<th
|
49 |
+
class="wc-block-cart-items__header-product"
|
50 |
+
>
|
51 |
+
<span>
|
52 |
+
Details
|
53 |
+
</span>
|
54 |
+
</th>
|
55 |
+
<th
|
56 |
+
class="wc-block-cart-items__header-total"
|
57 |
+
>
|
58 |
+
<span>
|
59 |
+
Total
|
60 |
+
</span>
|
61 |
+
</th>
|
62 |
+
</tr>
|
63 |
+
</thead>
|
64 |
+
<tbody>
|
65 |
+
<tr
|
66 |
+
class="wc-block-cart-items__row"
|
67 |
>
|
68 |
+
<td
|
69 |
+
aria-hidden="true"
|
70 |
+
class="wc-block-cart-item__image"
|
71 |
>
|
72 |
+
<a
|
73 |
+
href="https://example.org"
|
74 |
+
tabindex="-1"
|
75 |
+
>
|
76 |
+
<img
|
77 |
+
alt=""
|
78 |
+
src="assets/img/beanie.jpg"
|
79 |
+
/>
|
80 |
+
</a>
|
81 |
+
</td>
|
82 |
+
<td
|
83 |
+
class="wc-block-cart-item__product"
|
84 |
>
|
85 |
+
<a
|
86 |
+
class="wc-block-components-product-name"
|
87 |
+
href="https://example.org"
|
88 |
+
>
|
89 |
+
Beanie
|
90 |
+
</a>
|
91 |
+
<div
|
92 |
+
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
93 |
+
>
|
94 |
+
2 left in stock
|
95 |
+
</div>
|
96 |
+
<div
|
97 |
+
class="wc-block-cart-item__prices"
|
98 |
>
|
99 |
<span
|
100 |
+
class="price wc-block-components-product-price"
|
101 |
>
|
102 |
+
<span
|
103 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
104 |
+
>
|
105 |
+
$6.40
|
106 |
+
</span>
|
107 |
</span>
|
108 |
+
</div>
|
109 |
+
<div
|
110 |
+
class="wc-block-components-product-metadata"
|
111 |
+
>
|
112 |
+
<div
|
113 |
+
class="wc-block-components-product-metadata__description"
|
114 |
>
|
115 |
+
<p>
|
116 |
+
Warm hat for winter
|
117 |
+
</p>
|
118 |
+
|
119 |
+
|
120 |
+
</div>
|
121 |
+
<ul
|
122 |
+
class="wc-block-components-product-details"
|
123 |
+
>
|
124 |
+
<li
|
125 |
+
class="wc-block-components-product-details__color"
|
126 |
+
>
|
127 |
+
<span
|
128 |
+
class="wc-block-components-product-details__name"
|
129 |
+
>
|
130 |
+
Color
|
131 |
+
:
|
132 |
+
</span>
|
133 |
+
|
134 |
+
<span
|
135 |
+
class="wc-block-components-product-details__value"
|
136 |
+
>
|
137 |
+
Yellow
|
138 |
+
</span>
|
139 |
+
</li>
|
140 |
+
<li
|
141 |
+
class="wc-block-components-product-details__size"
|
142 |
+
>
|
143 |
+
<span
|
144 |
+
class="wc-block-components-product-details__name"
|
145 |
+
>
|
146 |
+
Size
|
147 |
+
:
|
148 |
+
</span>
|
149 |
+
|
150 |
+
<span
|
151 |
+
class="wc-block-components-product-details__value"
|
152 |
+
>
|
153 |
+
Small
|
154 |
+
</span>
|
155 |
+
</li>
|
156 |
+
</ul>
|
157 |
+
</div>
|
158 |
+
<div
|
159 |
+
class="wc-block-cart-item__quantity"
|
160 |
>
|
161 |
+
<div
|
162 |
+
class="wc-block-components-quantity-selector"
|
163 |
>
|
164 |
+
<input
|
165 |
+
aria-label="Quantity of Beanie in your cart."
|
166 |
+
class="wc-block-components-quantity-selector__input"
|
167 |
+
min="0"
|
168 |
+
step="1"
|
169 |
+
type="number"
|
170 |
+
value="1"
|
171 |
+
/>
|
172 |
+
<button
|
173 |
+
aria-label="Reduce quantity"
|
174 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
175 |
+
disabled=""
|
176 |
+
>
|
177 |
+
-
|
178 |
+
</button>
|
179 |
+
<button
|
180 |
+
aria-label="Increase quantity"
|
181 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
182 |
+
>
|
183 |
+
+
|
184 |
+
</button>
|
185 |
+
</div>
|
186 |
+
<button
|
187 |
+
class="wc-block-cart-item__remove-link"
|
188 |
>
|
189 |
+
Remove item
|
190 |
+
</button>
|
191 |
+
</div>
|
192 |
+
</td>
|
193 |
+
<td
|
194 |
+
class="wc-block-cart-item__total"
|
|
|
|
|
|
|
|
|
195 |
>
|
196 |
+
<div
|
197 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
>
|
199 |
+
<span
|
200 |
+
class="price wc-block-components-product-price"
|
201 |
+
>
|
202 |
+
<span
|
203 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
204 |
+
>
|
205 |
+
$12.80
|
206 |
+
</span>
|
207 |
+
</span>
|
208 |
+
</div>
|
209 |
+
</td>
|
210 |
+
</tr>
|
211 |
+
<tr
|
212 |
+
class="wc-block-cart-items__row"
|
|
|
213 |
>
|
214 |
+
<td
|
215 |
+
aria-hidden="true"
|
216 |
+
class="wc-block-cart-item__image"
|
217 |
>
|
218 |
+
<a
|
219 |
+
href="https://example.org"
|
220 |
+
tabindex="-1"
|
221 |
>
|
222 |
+
<img
|
223 |
+
alt=""
|
224 |
+
src="assets/img/cap.jpg"
|
225 |
+
/>
|
226 |
+
</a>
|
227 |
+
</td>
|
228 |
+
<td
|
229 |
+
class="wc-block-cart-item__product"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
>
|
231 |
+
<a
|
232 |
+
class="wc-block-components-product-name"
|
233 |
+
href="https://example.org"
|
|
|
|
|
|
|
|
|
234 |
>
|
235 |
+
Cap
|
236 |
+
</a>
|
237 |
+
<div
|
238 |
+
class="wc-block-cart-item__prices"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
>
|
240 |
<span
|
241 |
+
class="price wc-block-components-product-price"
|
242 |
>
|
243 |
+
<span
|
244 |
+
class="screen-reader-text"
|
245 |
+
>
|
246 |
+
Previous price:
|
247 |
+
</span>
|
248 |
+
<del
|
249 |
+
class="wc-block-components-product-price__regular"
|
250 |
+
>
|
251 |
+
$12.80
|
252 |
+
</del>
|
253 |
+
<span
|
254 |
+
class="screen-reader-text"
|
255 |
+
>
|
256 |
+
Discounted price:
|
257 |
+
</span>
|
258 |
+
<ins
|
259 |
+
class="wc-block-components-product-price__value is-discounted"
|
260 |
+
>
|
261 |
+
$11.20
|
262 |
+
</ins>
|
263 |
</span>
|
264 |
+
</div>
|
265 |
+
<div
|
266 |
+
class="wc-block-components-product-badge wc-block-components-sale-badge"
|
267 |
+
>
|
268 |
+
Save
|
269 |
<span
|
270 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
271 |
>
|
272 |
+
$1.60
|
273 |
</span>
|
274 |
+
</div>
|
275 |
+
<div
|
276 |
+
class="wc-block-components-product-metadata"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
>
|
278 |
+
<div
|
279 |
+
class="wc-block-components-product-metadata__description"
|
280 |
+
>
|
281 |
+
<p>
|
282 |
+
Lightweight baseball cap
|
283 |
+
</p>
|
284 |
+
|
285 |
+
|
286 |
+
</div>
|
287 |
+
<ul
|
288 |
+
class="wc-block-components-product-details"
|
289 |
+
>
|
290 |
+
<li
|
291 |
+
class="wc-block-components-product-details__color"
|
292 |
+
>
|
293 |
+
<span
|
294 |
+
class="wc-block-components-product-details__name"
|
295 |
+
>
|
296 |
+
Color
|
297 |
+
:
|
298 |
+
</span>
|
299 |
+
|
300 |
+
<span
|
301 |
+
class="wc-block-components-product-details__value"
|
302 |
+
>
|
303 |
+
Orange
|
304 |
+
</span>
|
305 |
+
</li>
|
306 |
+
</ul>
|
307 |
+
</div>
|
308 |
+
<div
|
309 |
+
class="wc-block-cart-item__quantity"
|
310 |
>
|
311 |
+
<div
|
312 |
+
class="wc-block-components-quantity-selector"
|
313 |
+
>
|
314 |
+
<input
|
315 |
+
aria-label="Quantity of Cap in your cart."
|
316 |
+
class="wc-block-components-quantity-selector__input"
|
317 |
+
min="0"
|
318 |
+
step="1"
|
319 |
+
type="number"
|
320 |
+
value="1"
|
321 |
+
/>
|
322 |
+
<button
|
323 |
+
aria-label="Reduce quantity"
|
324 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
325 |
+
disabled=""
|
326 |
+
>
|
327 |
+
-
|
328 |
+
</button>
|
329 |
+
<button
|
330 |
+
aria-label="Increase quantity"
|
331 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
332 |
+
>
|
333 |
+
+
|
334 |
+
</button>
|
335 |
+
</div>
|
336 |
+
<button
|
337 |
+
class="wc-block-cart-item__remove-link"
|
338 |
+
>
|
339 |
+
Remove item
|
340 |
+
</button>
|
341 |
+
</div>
|
342 |
+
</td>
|
343 |
+
<td
|
344 |
+
class="wc-block-cart-item__total"
|
345 |
>
|
346 |
+
<div
|
347 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
348 |
>
|
349 |
+
<span
|
350 |
+
class="price wc-block-components-product-price"
|
351 |
+
>
|
352 |
+
<span
|
353 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
354 |
+
>
|
355 |
+
$11.20
|
356 |
+
</span>
|
357 |
+
</span>
|
358 |
+
</div>
|
359 |
+
</td>
|
360 |
+
</tr>
|
361 |
+
</tbody>
|
362 |
+
</table>
|
363 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
<div
|
365 |
+
class="wc-block-components-sidebar wc-block-cart__sidebar"
|
366 |
+
>
|
367 |
+
<h2
|
368 |
+
class="wc-block-components-title wc-block-cart__totals-title"
|
369 |
+
>
|
370 |
+
Cart totals
|
371 |
+
</h2>
|
372 |
+
<div
|
373 |
+
class="wc-block-components-totals-item"
|
|
|
374 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
<span
|
376 |
+
class="wc-block-components-totals-item__label"
|
377 |
>
|
378 |
+
Subtotal
|
379 |
</span>
|
380 |
<span
|
381 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
382 |
>
|
383 |
+
$24.00
|
384 |
</span>
|
385 |
+
<div
|
386 |
+
class="wc-block-components-totals-item__description"
|
387 |
+
/>
|
388 |
+
</div>
|
|
|
|
|
389 |
<div
|
390 |
+
class="wc-block-components-totals-coupon wc-block-components-panel has-border"
|
391 |
>
|
392 |
+
<div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
<button
|
394 |
+
aria-expanded="false"
|
395 |
+
class="wc-block-components-panel__button"
|
|
|
396 |
>
|
397 |
+
<svg
|
398 |
+
aria-hidden="true"
|
399 |
+
class="wc-block-components-panel__button-icon"
|
400 |
+
focusable="false"
|
401 |
+
height="24"
|
402 |
+
role="img"
|
403 |
+
viewBox="0 0 24 24"
|
404 |
+
width="24"
|
405 |
+
xmlns="http://www.w3.org/2000/svg"
|
406 |
+
>
|
407 |
+
<path
|
408 |
+
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
409 |
+
/>
|
410 |
+
</svg>
|
411 |
+
<span
|
412 |
+
aria-hidden="true"
|
413 |
+
>
|
414 |
+
Coupon code
|
415 |
+
</span>
|
416 |
<span
|
417 |
+
class="screen-reader-text"
|
418 |
>
|
419 |
+
Apply a coupon code
|
420 |
</span>
|
421 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
<div
|
424 |
+
class="wc-block-components-panel__content"
|
425 |
+
hidden=""
|
426 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
<div
|
428 |
+
class=""
|
429 |
>
|
430 |
<div
|
431 |
+
aria-hidden="false"
|
432 |
+
class=""
|
433 |
>
|
434 |
+
<div
|
435 |
+
class="wc-block-components-totals-coupon__content"
|
|
|
436 |
>
|
437 |
+
<form
|
438 |
+
class="wc-block-components-totals-coupon__form"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
>
|
440 |
<div
|
441 |
+
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
442 |
>
|
443 |
+
<input
|
444 |
+
aria-describedby=""
|
445 |
+
aria-label="Enter code"
|
446 |
+
autocapitalize="off"
|
447 |
+
autocomplete="off"
|
448 |
+
id="wc-block-components-totals-coupon__input-1"
|
449 |
+
type="text"
|
450 |
+
value=""
|
451 |
+
/>
|
452 |
+
<label
|
453 |
+
for="wc-block-components-totals-coupon__input-1"
|
454 |
>
|
455 |
+
Enter code
|
456 |
+
</label>
|
457 |
</div>
|
458 |
+
<button
|
459 |
+
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
460 |
+
disabled=""
|
461 |
+
type="submit"
|
462 |
>
|
463 |
<span
|
464 |
+
class="wc-block-components-button__text"
|
|
|
465 |
>
|
466 |
+
Apply
|
|
|
|
|
|
|
|
|
|
|
467 |
</span>
|
468 |
+
</button>
|
469 |
+
</form>
|
470 |
+
</div>
|
471 |
+
</div>
|
472 |
+
</div>
|
473 |
+
</div>
|
474 |
+
</div>
|
475 |
+
<div
|
476 |
+
class="wc-block-components-discounts-meta"
|
477 |
+
/>
|
478 |
+
<div
|
479 |
+
class="wc-block-components-totals-shipping"
|
480 |
+
>
|
481 |
+
<div
|
482 |
+
class="wc-block-components-totals-item"
|
483 |
+
>
|
484 |
+
<span
|
485 |
+
class="wc-block-components-totals-item__label"
|
486 |
+
>
|
487 |
+
Shipping
|
488 |
+
</span>
|
489 |
+
<span
|
490 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
491 |
+
>
|
492 |
+
$0.00
|
493 |
+
</span>
|
494 |
+
<div
|
495 |
+
class="wc-block-components-totals-item__description"
|
496 |
+
>
|
497 |
+
<div
|
498 |
+
class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
|
499 |
+
>
|
500 |
+
via
|
501 |
+
|
502 |
+
Free shipping
|
503 |
+
</div>
|
504 |
+
</div>
|
505 |
+
</div>
|
506 |
+
<fieldset
|
507 |
+
class="wc-block-components-totals-shipping__fieldset"
|
508 |
+
>
|
509 |
+
<legend
|
510 |
+
class="screen-reader-text"
|
511 |
+
>
|
512 |
+
Shipping options
|
513 |
+
</legend>
|
514 |
+
<div
|
515 |
+
class=""
|
516 |
+
>
|
517 |
+
<div
|
518 |
+
aria-hidden="false"
|
519 |
+
class=""
|
520 |
+
>
|
521 |
+
<div
|
522 |
+
class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
|
523 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
<div
|
525 |
+
class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
|
526 |
>
|
527 |
+
<div>
|
528 |
+
<button
|
529 |
+
aria-expanded="true"
|
530 |
+
class="wc-block-components-panel__button"
|
|
|
|
|
531 |
>
|
532 |
+
<svg
|
533 |
+
aria-hidden="true"
|
534 |
+
class="wc-block-components-panel__button-icon"
|
535 |
+
focusable="false"
|
536 |
+
height="24"
|
537 |
+
role="img"
|
538 |
+
viewBox="0 0 24 24"
|
539 |
+
width="24"
|
540 |
+
xmlns="http://www.w3.org/2000/svg"
|
541 |
+
>
|
542 |
+
<path
|
543 |
+
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
544 |
+
/>
|
545 |
+
</svg>
|
546 |
+
<div
|
547 |
+
class="wc-block-components-shipping-rates-control__package-title"
|
548 |
+
>
|
549 |
+
Shipping
|
550 |
+
</div>
|
551 |
+
</button>
|
552 |
</div>
|
553 |
<div
|
554 |
+
class="wc-block-components-panel__content"
|
555 |
>
|
556 |
+
<div
|
557 |
+
class="wc-block-components-radio-control"
|
|
|
558 |
>
|
559 |
+
<label
|
560 |
+
class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
|
561 |
+
for="radio-control-1-free_shipping:1"
|
562 |
>
|
563 |
+
<input
|
564 |
+
aria-describedby="radio-control-1-free_shipping:1__label radio-control-1-free_shipping:1__description"
|
565 |
+
checked=""
|
566 |
+
class="wc-block-components-radio-control__input"
|
567 |
+
id="radio-control-1-free_shipping:1"
|
568 |
+
name="radio-control-1"
|
569 |
+
type="radio"
|
570 |
+
value="free_shipping:1"
|
571 |
+
/>
|
572 |
+
<div
|
573 |
+
class="wc-block-components-radio-control__option-layout"
|
574 |
+
>
|
575 |
+
<div
|
576 |
+
class="wc-block-components-radio-control__label-group"
|
577 |
+
>
|
578 |
+
<span
|
579 |
+
class="wc-block-components-radio-control__label"
|
580 |
+
id="radio-control-1-free_shipping:1__label"
|
581 |
+
>
|
582 |
+
Free shipping
|
583 |
+
</span>
|
584 |
+
</div>
|
585 |
+
<div
|
586 |
+
class="wc-block-components-radio-control__description-group"
|
587 |
+
>
|
588 |
+
<span
|
589 |
+
class="wc-block-components-radio-control__description"
|
590 |
+
id="radio-control-1-free_shipping:1__description"
|
591 |
+
>
|
592 |
+
<span
|
593 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
594 |
+
>
|
595 |
+
$0.00
|
596 |
+
</span>
|
597 |
+
|
598 |
+
</span>
|
599 |
+
</div>
|
600 |
+
</div>
|
601 |
+
</label>
|
602 |
+
<label
|
603 |
+
class="wc-block-components-radio-control__option"
|
604 |
+
for="radio-control-1-local_pickup:1"
|
605 |
+
>
|
606 |
+
<input
|
607 |
+
aria-describedby="radio-control-1-local_pickup:1__label radio-control-1-local_pickup:1__description"
|
608 |
+
class="wc-block-components-radio-control__input"
|
609 |
+
id="radio-control-1-local_pickup:1"
|
610 |
+
name="radio-control-1"
|
611 |
+
type="radio"
|
612 |
+
value="local_pickup:1"
|
613 |
+
/>
|
614 |
+
<div
|
615 |
+
class="wc-block-components-radio-control__option-layout"
|
616 |
+
>
|
617 |
+
<div
|
618 |
+
class="wc-block-components-radio-control__label-group"
|
619 |
+
>
|
620 |
+
<span
|
621 |
+
class="wc-block-components-radio-control__label"
|
622 |
+
id="radio-control-1-local_pickup:1__label"
|
623 |
+
>
|
624 |
+
Local pickup
|
625 |
+
</span>
|
626 |
+
</div>
|
627 |
+
<div
|
628 |
+
class="wc-block-components-radio-control__description-group"
|
629 |
+
>
|
630 |
+
<span
|
631 |
+
class="wc-block-components-radio-control__description"
|
632 |
+
id="radio-control-1-local_pickup:1__description"
|
633 |
+
>
|
634 |
+
<span
|
635 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
636 |
+
>
|
637 |
+
$2.00
|
638 |
+
</span>
|
639 |
+
|
640 |
+
</span>
|
641 |
+
</div>
|
642 |
+
</div>
|
643 |
+
</label>
|
644 |
+
</div>
|
645 |
</div>
|
646 |
</div>
|
647 |
+
</div>
|
648 |
</div>
|
649 |
</div>
|
650 |
+
</fieldset>
|
651 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
652 |
<div
|
653 |
+
class="wc-block-components-totals-item wc-block-components-totals-taxes"
|
654 |
+
>
|
655 |
+
<span
|
656 |
+
class="wc-block-components-totals-item__label"
|
657 |
+
>
|
658 |
+
Taxes
|
659 |
+
</span>
|
660 |
+
<span
|
661 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
662 |
+
>
|
663 |
+
$6.00
|
664 |
+
</span>
|
665 |
+
<div
|
666 |
+
class="wc-block-components-totals-item__description"
|
667 |
+
/>
|
668 |
+
</div>
|
669 |
+
<div
|
670 |
+
class="wc-block-components-totals-item wc-block-components-totals-footer-item"
|
671 |
+
>
|
672 |
+
<span
|
673 |
+
class="wc-block-components-totals-item__label"
|
674 |
+
>
|
675 |
+
Total
|
676 |
+
</span>
|
677 |
+
<span
|
678 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
679 |
+
>
|
680 |
+
$30.00
|
681 |
+
</span>
|
682 |
+
<div
|
683 |
+
class="wc-block-components-totals-item__description"
|
684 |
+
/>
|
685 |
+
</div>
|
686 |
+
<div
|
687 |
+
class="wc-block-components-order-meta"
|
688 |
/>
|
689 |
<div
|
690 |
+
class="wc-block-cart__payment-options"
|
691 |
>
|
692 |
+
<div
|
693 |
+
class="wc-block-cart__submit"
|
|
|
694 |
>
|
695 |
+
<div
|
696 |
+
aria-hidden="true"
|
697 |
+
style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
|
698 |
+
/>
|
699 |
+
<div
|
700 |
+
class="wc-block-cart__submit-container"
|
701 |
>
|
702 |
+
<a
|
703 |
+
class="components-button wc-block-components-button wc-block-cart__submit-button"
|
704 |
+
href=""
|
705 |
+
>
|
706 |
+
<span
|
707 |
+
class="wc-block-components-button__text"
|
708 |
+
>
|
709 |
+
Proceed to Checkout
|
710 |
+
</span>
|
711 |
+
</a>
|
712 |
+
</div>
|
713 |
+
</div>
|
714 |
</div>
|
715 |
</div>
|
716 |
</div>
|
717 |
+
<div
|
718 |
+
style="display: none;"
|
719 |
+
/>
|
720 |
</div>
|
721 |
</div>
|
|
|
|
|
|
|
722 |
</div>
|
723 |
`;
|
724 |
|
728 |
aria-hidden="true"
|
729 |
class="with-scroll-to-top__scroll-point"
|
730 |
/>
|
|
|
|
|
|
|
|
|
|
|
731 |
<div
|
732 |
+
class=""
|
733 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
<div
|
735 |
+
aria-hidden="false"
|
736 |
+
class=""
|
737 |
>
|
738 |
+
<h2
|
739 |
+
class="wc-block-components-title"
|
740 |
>
|
741 |
+
Your cart (3 items)
|
742 |
+
</h2>
|
743 |
+
<div
|
744 |
+
class="wc-block-components-sidebar-layout wc-block-cart"
|
745 |
+
>
|
746 |
+
<iframe
|
747 |
+
aria-hidden="true"
|
748 |
+
frameborder="0"
|
749 |
+
src="about:blank"
|
750 |
+
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
751 |
+
tabindex="-1"
|
752 |
+
/>
|
753 |
+
<div
|
754 |
+
class="wc-block-components-main wc-block-cart__main"
|
755 |
+
>
|
756 |
+
<table
|
757 |
+
class="wc-block-cart-items"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
758 |
>
|
759 |
+
<thead>
|
760 |
+
<tr
|
761 |
+
class="wc-block-cart-items__header"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
762 |
>
|
763 |
+
<th
|
764 |
+
class="wc-block-cart-items__header-image"
|
|
|
|
|
|
|
|
|
|
|
765 |
>
|
766 |
+
<span>
|
767 |
+
Product
|
|
|
|
|
768 |
</span>
|
769 |
+
</th>
|
770 |
+
<th
|
771 |
+
class="wc-block-cart-items__header-product"
|
772 |
+
>
|
773 |
+
<span>
|
774 |
+
Details
|
775 |
+
</span>
|
776 |
+
</th>
|
777 |
+
<th
|
778 |
+
class="wc-block-cart-items__header-total"
|
779 |
+
>
|
780 |
+
<span>
|
781 |
+
Total
|
782 |
+
</span>
|
783 |
+
</th>
|
784 |
+
</tr>
|
785 |
+
</thead>
|
786 |
+
<tbody>
|
787 |
+
<tr
|
788 |
+
class="wc-block-cart-items__row"
|
789 |
>
|
790 |
+
<td
|
791 |
+
aria-hidden="true"
|
792 |
+
class="wc-block-cart-item__image"
|
793 |
>
|
794 |
+
<a
|
795 |
+
href="https://example.org"
|
796 |
+
tabindex="-1"
|
797 |
+
>
|
798 |
+
<img
|
799 |
+
alt=""
|
800 |
+
src="assets/img/beanie.jpg"
|
801 |
+
/>
|
802 |
+
</a>
|
803 |
+
</td>
|
804 |
+
<td
|
805 |
+
class="wc-block-cart-item__product"
|
806 |
>
|
807 |
+
<a
|
808 |
+
class="wc-block-components-product-name"
|
809 |
+
href="https://example.org"
|
810 |
+
>
|
811 |
+
Beanie
|
812 |
+
</a>
|
813 |
+
<div
|
814 |
+
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
815 |
+
>
|
816 |
+
2 left in stock
|
817 |
+
</div>
|
818 |
+
<div
|
819 |
+
class="wc-block-cart-item__prices"
|
820 |
>
|
821 |
<span
|
822 |
+
class="price wc-block-components-product-price"
|
823 |
>
|
824 |
+
<span
|
825 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
826 |
+
>
|
827 |
+
$6.40
|
828 |
+
</span>
|
829 |
</span>
|
830 |
+
</div>
|
831 |
+
<div
|
832 |
+
class="wc-block-components-product-metadata"
|
833 |
+
>
|
834 |
+
<div
|
835 |
+
class="wc-block-components-product-metadata__description"
|
836 |
>
|
837 |
+
<p>
|
838 |
+
Warm hat for winter
|
839 |
+
</p>
|
840 |
+
|
841 |
+
|
842 |
+
</div>
|
843 |
+
<ul
|
844 |
+
class="wc-block-components-product-details"
|
845 |
+
>
|
846 |
+
<li
|
847 |
+
class="wc-block-components-product-details__color"
|
848 |
+
>
|
849 |
+
<span
|
850 |
+
class="wc-block-components-product-details__name"
|
851 |
+
>
|
852 |
+
Color
|
853 |
+
:
|
854 |
+
</span>
|
855 |
+
|
856 |
+
<span
|
857 |
+
class="wc-block-components-product-details__value"
|
858 |
+
>
|
859 |
+
Yellow
|
860 |
+
</span>
|
861 |
+
</li>
|
862 |
+
<li
|
863 |
+
class="wc-block-components-product-details__size"
|
864 |
+
>
|
865 |
+
<span
|
866 |
+
class="wc-block-components-product-details__name"
|
867 |
+
>
|
868 |
+
Size
|
869 |
+
:
|
870 |
+
</span>
|
871 |
+
|
872 |
+
<span
|
873 |
+
class="wc-block-components-product-details__value"
|
874 |
+
>
|
875 |
+
Small
|
876 |
+
</span>
|
877 |
+
</li>
|
878 |
+
</ul>
|
879 |
+
</div>
|
880 |
+
<div
|
881 |
+
class="wc-block-cart-item__quantity"
|
882 |
>
|
883 |
+
<div
|
884 |
+
class="wc-block-components-quantity-selector"
|
885 |
>
|
886 |
+
<input
|
887 |
+
aria-label="Quantity of Beanie in your cart."
|
888 |
+
class="wc-block-components-quantity-selector__input"
|
889 |
+
min="0"
|
890 |
+
step="1"
|
891 |
+
type="number"
|
892 |
+
value="1"
|
893 |
+
/>
|
894 |
+
<button
|
895 |
+
aria-label="Reduce quantity"
|
896 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
897 |
+
disabled=""
|
898 |
+
>
|
899 |
+
-
|
900 |
+
</button>
|
901 |
+
<button
|
902 |
+
aria-label="Increase quantity"
|
903 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
904 |
+
>
|
905 |
+
+
|
906 |
+
</button>
|
907 |
+
</div>
|
908 |
+
<button
|
909 |
+
class="wc-block-cart-item__remove-link"
|
910 |
>
|
911 |
+
Remove item
|
912 |
+
</button>
|
913 |
+
</div>
|
914 |
+
</td>
|
915 |
+
<td
|
916 |
+
class="wc-block-cart-item__total"
|
|
|
|
|
|
|
|
|
917 |
>
|
918 |
+
<div
|
919 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
920 |
>
|
921 |
+
<span
|
922 |
+
class="price wc-block-components-product-price"
|
923 |
+
>
|
924 |
+
<span
|
925 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
926 |
+
>
|
927 |
+
$12.80
|
928 |
+
</span>
|
929 |
+
</span>
|
930 |
+
</div>
|
931 |
+
</td>
|
932 |
+
</tr>
|
933 |
+
<tr
|
934 |
+
class="wc-block-cart-items__row"
|
|
|
935 |
>
|
936 |
+
<td
|
937 |
+
aria-hidden="true"
|
938 |
+
class="wc-block-cart-item__image"
|
939 |
>
|
940 |
+
<a
|
941 |
+
href="https://example.org"
|
942 |
+
tabindex="-1"
|
943 |
>
|
944 |
+
<img
|
945 |
+
alt=""
|
946 |
+
src="assets/img/cap.jpg"
|
947 |
+
/>
|
948 |
+
</a>
|
949 |
+
</td>
|
950 |
+
<td
|
951 |
+
class="wc-block-cart-item__product"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
>
|
953 |
+
<a
|
954 |
+
class="wc-block-components-product-name"
|
955 |
+
href="https://example.org"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
956 |
>
|
957 |
+
Cap
|
958 |
+
</a>
|
959 |
+
<div
|
960 |
+
class="wc-block-cart-item__prices"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
961 |
>
|
962 |
<span
|
963 |
+
class="price wc-block-components-product-price"
|
964 |
>
|
965 |
+
<span
|
966 |
+
class="screen-reader-text"
|
967 |
+
>
|
968 |
+
Previous price:
|
969 |
+
</span>
|
970 |
+
<del
|
971 |
+
class="wc-block-components-product-price__regular"
|
972 |
+
>
|
973 |
+
$12.80
|
974 |
+
</del>
|
975 |
+
<span
|
976 |
+
class="screen-reader-text"
|
977 |
+
>
|
978 |
+
Discounted price:
|
979 |
+
</span>
|
980 |
+
<ins
|
981 |
+
class="wc-block-components-product-price__value is-discounted"
|
982 |
+
>
|
983 |
+
$11.20
|
984 |
+
</ins>
|
985 |
</span>
|
986 |
+
</div>
|
987 |
+
<div
|
988 |
+
class="wc-block-components-product-badge wc-block-components-sale-badge"
|
989 |
+
>
|
990 |
+
Save
|
991 |
<span
|
992 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
993 |
>
|
994 |
+
$1.60
|
995 |
</span>
|
996 |
+
</div>
|
997 |
+
<div
|
998 |
+
class="wc-block-components-product-metadata"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
999 |
>
|
1000 |
+
<div
|
1001 |
+
class="wc-block-components-product-metadata__description"
|
1002 |
+
>
|
1003 |
+
<p>
|
1004 |
+
Lightweight baseball cap
|
1005 |
+
</p>
|
1006 |
+
|
1007 |
+
|
1008 |
+
</div>
|
1009 |
+
<ul
|
1010 |
+
class="wc-block-components-product-details"
|
1011 |
+
>
|
1012 |
+
<li
|
1013 |
+
class="wc-block-components-product-details__color"
|
1014 |
+
>
|
1015 |
+
<span
|
1016 |
+
class="wc-block-components-product-details__name"
|
1017 |
+
>
|
1018 |
+
Color
|
1019 |
+
:
|
1020 |
+
</span>
|
1021 |
+
|
1022 |
+
<span
|
1023 |
+
class="wc-block-components-product-details__value"
|
1024 |
+
>
|
1025 |
+
Orange
|
1026 |
+
</span>
|
1027 |
+
</li>
|
1028 |
+
</ul>
|
1029 |
+
</div>
|
1030 |
+
<div
|
1031 |
+
class="wc-block-cart-item__quantity"
|
1032 |
>
|
1033 |
+
<div
|
1034 |
+
class="wc-block-components-quantity-selector"
|
1035 |
+
>
|
1036 |
+
<input
|
1037 |
+
aria-label="Quantity of Cap in your cart."
|
1038 |
+
class="wc-block-components-quantity-selector__input"
|
1039 |
+
min="0"
|
1040 |
+
step="1"
|
1041 |
+
type="number"
|
1042 |
+
value="1"
|
1043 |
+
/>
|
1044 |
+
<button
|
1045 |
+
aria-label="Reduce quantity"
|
1046 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1047 |
+
disabled=""
|
1048 |
+
>
|
1049 |
+
-
|
1050 |
+
</button>
|
1051 |
+
<button
|
1052 |
+
aria-label="Increase quantity"
|
1053 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
1054 |
+
>
|
1055 |
+
+
|
1056 |
+
</button>
|
1057 |
+
</div>
|
1058 |
+
<button
|
1059 |
+
class="wc-block-cart-item__remove-link"
|
1060 |
+
>
|
1061 |
+
Remove item
|
1062 |
+
</button>
|
1063 |
+
</div>
|
1064 |
+
</td>
|
1065 |
+
<td
|
1066 |
+
class="wc-block-cart-item__total"
|
1067 |
>
|
1068 |
+
<div
|
1069 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
1070 |
>
|
1071 |
+
<span
|
1072 |
+
class="price wc-block-components-product-price"
|
1073 |
+
>
|
1074 |
+
<span
|
1075 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
1076 |
+
>
|
1077 |
+
$11.20
|
1078 |
+
</span>
|
1079 |
+
</span>
|
1080 |
+
</div>
|
1081 |
+
</td>
|
1082 |
+
</tr>
|
1083 |
+
</tbody>
|
1084 |
+
</table>
|
1085 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1086 |
<div
|
1087 |
+
class="wc-block-components-sidebar wc-block-cart__sidebar"
|
1088 |
>
|
1089 |
+
<h2
|
1090 |
+
class="wc-block-components-title wc-block-cart__totals-title"
|
|
|
|
|
|
|
|
|
|
|
1091 |
>
|
1092 |
+
Cart totals
|
1093 |
+
</h2>
|
1094 |
<div
|
1095 |
+
class="wc-block-components-totals-item"
|
1096 |
>
|
1097 |
+
<span
|
1098 |
+
class="wc-block-components-totals-item__label"
|
1099 |
>
|
1100 |
+
Subtotal
|
1101 |
+
</span>
|
1102 |
+
<span
|
1103 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1104 |
+
>
|
1105 |
+
$24.00
|
1106 |
+
</span>
|
1107 |
+
<div
|
1108 |
+
class="wc-block-components-totals-item__description"
|
1109 |
+
/>
|
1110 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1111 |
<div
|
1112 |
+
class="wc-block-components-totals-coupon wc-block-components-panel has-border"
|
1113 |
>
|
1114 |
+
<div>
|
1115 |
+
<button
|
1116 |
+
aria-expanded="false"
|
1117 |
+
class="wc-block-components-panel__button"
|
1118 |
+
>
|
1119 |
+
<svg
|
1120 |
+
aria-hidden="true"
|
1121 |
+
class="wc-block-components-panel__button-icon"
|
1122 |
+
focusable="false"
|
1123 |
+
height="24"
|
1124 |
+
role="img"
|
1125 |
+
viewBox="0 0 24 24"
|
1126 |
+
width="24"
|
1127 |
+
xmlns="http://www.w3.org/2000/svg"
|
1128 |
+
>
|
1129 |
+
<path
|
1130 |
+
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
1131 |
+
/>
|
1132 |
+
</svg>
|
1133 |
+
<span
|
1134 |
+
aria-hidden="true"
|
1135 |
+
>
|
1136 |
+
Coupon code
|
1137 |
+
</span>
|
1138 |
+
<span
|
1139 |
+
class="screen-reader-text"
|
1140 |
+
>
|
1141 |
+
Apply a coupon code
|
1142 |
+
</span>
|
1143 |
+
</button>
|
1144 |
+
</div>
|
1145 |
<div
|
1146 |
+
class="wc-block-components-panel__content"
|
1147 |
+
hidden=""
|
1148 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1149 |
<div
|
1150 |
+
class=""
|
1151 |
>
|
1152 |
<div
|
1153 |
+
aria-hidden="false"
|
1154 |
+
class=""
|
1155 |
>
|
1156 |
+
<div
|
1157 |
+
class="wc-block-components-totals-coupon__content"
|
|
|
1158 |
>
|
1159 |
+
<form
|
1160 |
+
class="wc-block-components-totals-coupon__form"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1161 |
>
|
1162 |
<div
|
1163 |
+
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
1164 |
>
|
1165 |
+
<input
|
1166 |
+
aria-describedby=""
|
1167 |
+
aria-label="Enter code"
|
1168 |
+
autocapitalize="off"
|
1169 |
+
autocomplete="off"
|
1170 |
+
id="wc-block-components-totals-coupon__input-2"
|
1171 |
+
type="text"
|
1172 |
+
value=""
|
1173 |
+
/>
|
1174 |
+
<label
|
1175 |
+
for="wc-block-components-totals-coupon__input-2"
|
1176 |
>
|
1177 |
+
Enter code
|
1178 |
+
</label>
|
1179 |
</div>
|
1180 |
+
<button
|
1181 |
+
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
1182 |
+
disabled=""
|
1183 |
+
type="submit"
|
1184 |
>
|
1185 |
<span
|
1186 |
+
class="wc-block-components-button__text"
|
|
|
1187 |
>
|
1188 |
+
Apply
|
|
|
|
|
|
|
|
|
|
|
1189 |
</span>
|
1190 |
+
</button>
|
1191 |
+
</form>
|
1192 |
+
</div>
|
1193 |
+
</div>
|
1194 |
+
</div>
|
1195 |
+
</div>
|
1196 |
+
</div>
|
1197 |
+
<div
|
1198 |
+
class="wc-block-components-discounts-meta"
|
1199 |
+
/>
|
1200 |
+
<div
|
1201 |
+
class="wc-block-components-totals-shipping"
|
1202 |
+
>
|
1203 |
+
<div
|
1204 |
+
class="wc-block-components-totals-item"
|
1205 |
+
>
|
1206 |
+
<span
|
1207 |
+
class="wc-block-components-totals-item__label"
|
1208 |
+
>
|
1209 |
+
Shipping
|
1210 |
+
</span>
|
1211 |
+
<span
|
1212 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1213 |
+
>
|
1214 |
+
$0.00
|
1215 |
+
</span>
|
1216 |
+
<div
|
1217 |
+
class="wc-block-components-totals-item__description"
|
1218 |
+
>
|
1219 |
+
<div
|
1220 |
+
class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
|
1221 |
+
>
|
1222 |
+
via
|
1223 |
+
|
1224 |
+
Free shipping
|
1225 |
+
</div>
|
1226 |
+
</div>
|
1227 |
+
</div>
|
1228 |
+
<fieldset
|
1229 |
+
class="wc-block-components-totals-shipping__fieldset"
|
1230 |
+
>
|
1231 |
+
<legend
|
1232 |
+
class="screen-reader-text"
|
1233 |
+
>
|
1234 |
+
Shipping options
|
1235 |
+
</legend>
|
1236 |
+
<div
|
1237 |
+
class=""
|
1238 |
+
>
|
1239 |
+
<div
|
1240 |
+
aria-hidden="false"
|
1241 |
+
class=""
|
1242 |
+
>
|
1243 |
+
<div
|
1244 |
+
class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
|
1245 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
<div
|
1247 |
+
class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
|
1248 |
>
|
1249 |
+
<div>
|
1250 |
+
<button
|
1251 |
+
aria-expanded="true"
|
1252 |
+
class="wc-block-components-panel__button"
|
|
|
|
|
1253 |
>
|
1254 |
+
<svg
|
1255 |
+
aria-hidden="true"
|
1256 |
+
class="wc-block-components-panel__button-icon"
|
1257 |
+
focusable="false"
|
1258 |
+
height="24"
|
1259 |
+
role="img"
|
1260 |
+
viewBox="0 0 24 24"
|
1261 |
+
width="24"
|
1262 |
+
xmlns="http://www.w3.org/2000/svg"
|
1263 |
+
>
|
1264 |
+
<path
|
1265 |
+
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
1266 |
+
/>
|
1267 |
+
</svg>
|
1268 |
+
<div
|
1269 |
+
class="wc-block-components-shipping-rates-control__package-title"
|
1270 |
+
>
|
1271 |
+
Shipping
|
1272 |
+
</div>
|
1273 |
+
</button>
|
1274 |
</div>
|
1275 |
<div
|
1276 |
+
class="wc-block-components-panel__content"
|
1277 |
>
|
1278 |
+
<div
|
1279 |
+
class="wc-block-components-radio-control"
|
|
|
1280 |
>
|
1281 |
+
<label
|
1282 |
+
class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
|
1283 |
+
for="radio-control-2-free_shipping:1"
|
1284 |
>
|
1285 |
+
<input
|
1286 |
+
aria-describedby="radio-control-2-free_shipping:1__label radio-control-2-free_shipping:1__description"
|
1287 |
+
checked=""
|
1288 |
+
class="wc-block-components-radio-control__input"
|
1289 |
+
id="radio-control-2-free_shipping:1"
|
1290 |
+
name="radio-control-2"
|
1291 |
+
type="radio"
|
1292 |
+
value="free_shipping:1"
|
1293 |
+
/>
|
1294 |
+
<div
|
1295 |
+
class="wc-block-components-radio-control__option-layout"
|
1296 |
+
>
|
1297 |
+
<div
|
1298 |
+
class="wc-block-components-radio-control__label-group"
|
1299 |
+
>
|
1300 |
+
<span
|
1301 |
+
class="wc-block-components-radio-control__label"
|
1302 |
+
id="radio-control-2-free_shipping:1__label"
|
1303 |
+
>
|
1304 |
+
Free shipping
|
1305 |
+
</span>
|
1306 |
+
</div>
|
1307 |
+
<div
|
1308 |
+
class="wc-block-components-radio-control__description-group"
|
1309 |
+
>
|
1310 |
+
<span
|
1311 |
+
class="wc-block-components-radio-control__description"
|
1312 |
+
id="radio-control-2-free_shipping:1__description"
|
1313 |
+
>
|
1314 |
+
<span
|
1315 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
1316 |
+
>
|
1317 |
+
$0.00
|
1318 |
+
</span>
|
1319 |
+
|
1320 |
+
</span>
|
1321 |
+
</div>
|
1322 |
+
</div>
|
1323 |
+
</label>
|
1324 |
+
<label
|
1325 |
+
class="wc-block-components-radio-control__option"
|
1326 |
+
for="radio-control-2-local_pickup:1"
|
1327 |
+
>
|
1328 |
+
<input
|
1329 |
+
aria-describedby="radio-control-2-local_pickup:1__label radio-control-2-local_pickup:1__description"
|
1330 |
+
class="wc-block-components-radio-control__input"
|
1331 |
+
id="radio-control-2-local_pickup:1"
|
1332 |
+
name="radio-control-2"
|
1333 |
+
type="radio"
|
1334 |
+
value="local_pickup:1"
|
1335 |
+
/>
|
1336 |
+
<div
|
1337 |
+
class="wc-block-components-radio-control__option-layout"
|
1338 |
+
>
|
1339 |
+
<div
|
1340 |
+
class="wc-block-components-radio-control__label-group"
|
1341 |
+
>
|
1342 |
+
<span
|
1343 |
+
class="wc-block-components-radio-control__label"
|
1344 |
+
id="radio-control-2-local_pickup:1__label"
|
1345 |
+
>
|
1346 |
+
Local pickup
|
1347 |
+
</span>
|
1348 |
+
</div>
|
1349 |
+
<div
|
1350 |
+
class="wc-block-components-radio-control__description-group"
|
1351 |
+
>
|
1352 |
+
<span
|
1353 |
+
class="wc-block-components-radio-control__description"
|
1354 |
+
id="radio-control-2-local_pickup:1__description"
|
1355 |
+
>
|
1356 |
+
<span
|
1357 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
1358 |
+
>
|
1359 |
+
$2.00
|
1360 |
+
</span>
|
1361 |
+
|
1362 |
+
</span>
|
1363 |
+
</div>
|
1364 |
+
</div>
|
1365 |
+
</label>
|
1366 |
+
</div>
|
1367 |
</div>
|
1368 |
</div>
|
1369 |
+
</div>
|
1370 |
</div>
|
1371 |
</div>
|
1372 |
+
</fieldset>
|
1373 |
</div>
|
1374 |
+
<div
|
1375 |
+
class="wc-block-components-totals-taxes"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1376 |
>
|
1377 |
+
<div
|
1378 |
+
class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
|
1379 |
+
>
|
1380 |
+
<span
|
1381 |
+
class="wc-block-components-totals-item__label"
|
1382 |
+
>
|
1383 |
+
Sales tax
|
1384 |
+
</span>
|
1385 |
+
<span
|
1386 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1387 |
+
>
|
1388 |
+
$6.00
|
1389 |
+
</span>
|
1390 |
+
<div
|
1391 |
+
class="wc-block-components-totals-item__description"
|
1392 |
+
/>
|
1393 |
+
</div>
|
1394 |
+
|
1395 |
+
</div>
|
1396 |
<div
|
1397 |
+
class="wc-block-components-totals-item wc-block-components-totals-footer-item"
|
1398 |
+
>
|
1399 |
+
<span
|
1400 |
+
class="wc-block-components-totals-item__label"
|
1401 |
+
>
|
1402 |
+
Total
|
1403 |
+
</span>
|
1404 |
+
<span
|
1405 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1406 |
+
>
|
1407 |
+
$30.00
|
1408 |
+
</span>
|
1409 |
+
<div
|
1410 |
+
class="wc-block-components-totals-item__description"
|
1411 |
+
/>
|
1412 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1413 |
<div
|
1414 |
+
class="wc-block-components-order-meta"
|
|
|
1415 |
/>
|
1416 |
<div
|
1417 |
+
class="wc-block-cart__payment-options"
|
1418 |
>
|
1419 |
+
<div
|
1420 |
+
class="wc-block-cart__submit"
|
|
|
1421 |
>
|
1422 |
+
<div
|
1423 |
+
aria-hidden="true"
|
1424 |
+
style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
|
1425 |
+
/>
|
1426 |
+
<div
|
1427 |
+
class="wc-block-cart__submit-container"
|
1428 |
>
|
1429 |
+
<a
|
1430 |
+
class="components-button wc-block-components-button wc-block-cart__submit-button"
|
1431 |
+
href=""
|
1432 |
+
>
|
1433 |
+
<span
|
1434 |
+
class="wc-block-components-button__text"
|
1435 |
+
>
|
1436 |
+
Proceed to Checkout
|
1437 |
+
</span>
|
1438 |
+
</a>
|
1439 |
+
</div>
|
1440 |
+
</div>
|
1441 |
</div>
|
1442 |
</div>
|
1443 |
</div>
|
1444 |
+
<div
|
1445 |
+
style="display: none;"
|
1446 |
+
/>
|
1447 |
</div>
|
1448 |
</div>
|
|
|
|
|
|
|
1449 |
</div>
|
1450 |
`;
|
1451 |
|
1455 |
aria-hidden="true"
|
1456 |
class="with-scroll-to-top__scroll-point"
|
1457 |
/>
|
|
|
|
|
|
|
|
|
|
|
1458 |
<div
|
1459 |
+
class=""
|
1460 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1461 |
<div
|
1462 |
+
aria-hidden="false"
|
1463 |
+
class=""
|
1464 |
>
|
1465 |
+
<h2
|
1466 |
+
class="wc-block-components-title"
|
1467 |
>
|
1468 |
+
Your cart (3 items)
|
1469 |
+
</h2>
|
1470 |
+
<div
|
1471 |
+
class="wc-block-components-sidebar-layout wc-block-cart"
|
1472 |
+
>
|
1473 |
+
<iframe
|
1474 |
+
aria-hidden="true"
|
1475 |
+
frameborder="0"
|
1476 |
+
src="about:blank"
|
1477 |
+
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
1478 |
+
tabindex="-1"
|
1479 |
+
/>
|
1480 |
+
<div
|
1481 |
+
class="wc-block-components-main wc-block-cart__main"
|
1482 |
+
>
|
1483 |
+
<table
|
1484 |
+
class="wc-block-cart-items"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1485 |
>
|
1486 |
+
<thead>
|
1487 |
+
<tr
|
1488 |
+
class="wc-block-cart-items__header"
|
|
|
|
|
|
|
|
|
1489 |
>
|
1490 |
+
<th
|
1491 |
+
class="wc-block-cart-items__header-image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1492 |
>
|
1493 |
+
<span>
|
1494 |
+
Product
|
|
|
|
|
1495 |
</span>
|
1496 |
+
</th>
|
1497 |
+
<th
|
1498 |
+
class="wc-block-cart-items__header-product"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1499 |
>
|
1500 |
+
<span>
|
1501 |
+
Details
|
1502 |
+
</span>
|
1503 |
+
</th>
|
1504 |
+
<th
|
1505 |
+
class="wc-block-cart-items__header-total"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1506 |
>
|
1507 |
+
<span>
|
1508 |
+
Total
|
1509 |
+
</span>
|
1510 |
+
</th>
|
1511 |
+
</tr>
|
1512 |
+
</thead>
|
1513 |
+
<tbody>
|
1514 |
+
<tr
|
1515 |
+
class="wc-block-cart-items__row"
|
1516 |
>
|
1517 |
+
<td
|
1518 |
+
aria-hidden="true"
|
1519 |
+
class="wc-block-cart-item__image"
|
1520 |
>
|
1521 |
+
<a
|
1522 |
+
href="https://example.org"
|
1523 |
+
tabindex="-1"
|
1524 |
>
|
1525 |
+
<img
|
1526 |
+
alt=""
|
1527 |
+
src="assets/img/beanie.jpg"
|
1528 |
+
/>
|
1529 |
+
</a>
|
1530 |
+
</td>
|
1531 |
+
<td
|
1532 |
+
class="wc-block-cart-item__product"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1533 |
>
|
1534 |
+
<a
|
1535 |
+
class="wc-block-components-product-name"
|
1536 |
+
href="https://example.org"
|
1537 |
>
|
1538 |
+
Beanie
|
1539 |
+
</a>
|
1540 |
+
<div
|
1541 |
+
class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
|
1542 |
>
|
1543 |
+
2 left in stock
|
1544 |
+
</div>
|
1545 |
+
<div
|
1546 |
+
class="wc-block-cart-item__prices"
|
1547 |
>
|
1548 |
+
<span
|
1549 |
+
class="price wc-block-components-product-price"
|
1550 |
+
>
|
1551 |
+
<span
|
1552 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
1553 |
+
>
|
1554 |
+
$6.40
|
1555 |
+
</span>
|
1556 |
+
</span>
|
1557 |
+
</div>
|
1558 |
+
<div
|
1559 |
+
class="wc-block-components-product-metadata"
|
1560 |
>
|
1561 |
+
<div
|
1562 |
+
class="wc-block-components-product-metadata__description"
|
1563 |
+
>
|
1564 |
+
<p>
|
1565 |
+
Warm hat for winter
|
1566 |
+
</p>
|
1567 |
+
|
1568 |
+
|
1569 |
+
</div>
|
1570 |
+
<ul
|
1571 |
+
class="wc-block-components-product-details"
|
1572 |
+
>
|
1573 |
+
<li
|
1574 |
+
class="wc-block-components-product-details__color"
|
1575 |
+
>
|
1576 |
+
<span
|
1577 |
+
class="wc-block-components-product-details__name"
|
1578 |
+
>
|
1579 |
+
Color
|
1580 |
+
:
|
1581 |
+
</span>
|
1582 |
+
|
1583 |
+
<span
|
1584 |
+
class="wc-block-components-product-details__value"
|
1585 |
+
>
|
1586 |
+
Yellow
|
1587 |
+
</span>
|
1588 |
+
</li>
|
1589 |
+
<li
|
1590 |
+
class="wc-block-components-product-details__size"
|
1591 |
+
>
|
1592 |
+
<span
|
1593 |
+
class="wc-block-components-product-details__name"
|
1594 |
+
>
|
1595 |
+
Size
|
1596 |
+
:
|
1597 |
+
</span>
|
1598 |
+
|
1599 |
+
<span
|
1600 |
+
class="wc-block-components-product-details__value"
|
1601 |
+
>
|
1602 |
+
Small
|
1603 |
+
</span>
|
1604 |
+
</li>
|
1605 |
+
</ul>
|
1606 |
+
</div>
|
1607 |
+
<div
|
1608 |
+
class="wc-block-cart-item__quantity"
|
1609 |
+
>
|
1610 |
+
<div
|
1611 |
+
class="wc-block-components-quantity-selector"
|
1612 |
+
>
|
1613 |
+
<input
|
1614 |
+
aria-label="Quantity of Beanie in your cart."
|
1615 |
+
class="wc-block-components-quantity-selector__input"
|
1616 |
+
min="0"
|
1617 |
+
step="1"
|
1618 |
+
type="number"
|
1619 |
+
value="1"
|
1620 |
+
/>
|
1621 |
+
<button
|
1622 |
+
aria-label="Reduce quantity"
|
1623 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1624 |
+
disabled=""
|
1625 |
+
>
|
1626 |
+
-
|
1627 |
+
</button>
|
1628 |
+
<button
|
1629 |
+
aria-label="Increase quantity"
|
1630 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
1631 |
+
>
|
1632 |
+
+
|
1633 |
+
</button>
|
1634 |
+
</div>
|
1635 |
+
<button
|
1636 |
+
class="wc-block-cart-item__remove-link"
|
1637 |
+
>
|
1638 |
+
Remove item
|
1639 |
+
</button>
|
1640 |
+
</div>
|
1641 |
+
</td>
|
1642 |
+
<td
|
1643 |
+
class="wc-block-cart-item__total"
|
1644 |
>
|
1645 |
+
<div
|
1646 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
1647 |
+
>
|
1648 |
+
<span
|
1649 |
+
class="price wc-block-components-product-price"
|
1650 |
+
>
|
1651 |
+
<span
|
1652 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
1653 |
+
>
|
1654 |
+
$12.80
|
1655 |
+
</span>
|
1656 |
+
</span>
|
1657 |
+
</div>
|
1658 |
+
</td>
|
1659 |
+
</tr>
|
1660 |
+
<tr
|
1661 |
+
class="wc-block-cart-items__row"
|
1662 |
>
|
1663 |
+
<td
|
1664 |
+
aria-hidden="true"
|
1665 |
+
class="wc-block-cart-item__image"
|
1666 |
>
|
1667 |
+
<a
|
1668 |
+
href="https://example.org"
|
1669 |
+
tabindex="-1"
|
1670 |
+
>
|
1671 |
+
<img
|
1672 |
+
alt=""
|
1673 |
+
src="assets/img/cap.jpg"
|
1674 |
+
/>
|
1675 |
+
</a>
|
1676 |
+
</td>
|
1677 |
+
<td
|
1678 |
+
class="wc-block-cart-item__product"
|
1679 |
>
|
1680 |
+
<a
|
1681 |
+
class="wc-block-components-product-name"
|
1682 |
+
href="https://example.org"
|
1683 |
+
>
|
1684 |
+
Cap
|
1685 |
+
</a>
|
1686 |
+
<div
|
1687 |
+
class="wc-block-cart-item__prices"
|
1688 |
>
|
1689 |
<span
|
1690 |
+
class="price wc-block-components-product-price"
|
1691 |
>
|
1692 |
+
<span
|
1693 |
+
class="screen-reader-text"
|
1694 |
+
>
|
1695 |
+
Previous price:
|
1696 |
+
</span>
|
1697 |
+
<del
|
1698 |
+
class="wc-block-components-product-price__regular"
|
1699 |
+
>
|
1700 |
+
$12.80
|
1701 |
+
</del>
|
1702 |
+
<span
|
1703 |
+
class="screen-reader-text"
|
1704 |
+
>
|
1705 |
+
Discounted price:
|
1706 |
+
</span>
|
1707 |
+
<ins
|
1708 |
+
class="wc-block-components-product-price__value is-discounted"
|
1709 |
+
>
|
1710 |
+
$11.20
|
1711 |
+
</ins>
|
1712 |
</span>
|
1713 |
+
</div>
|
1714 |
+
<div
|
1715 |
+
class="wc-block-components-product-badge wc-block-components-sale-badge"
|
1716 |
+
>
|
1717 |
+
Save
|
1718 |
<span
|
1719 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
1720 |
>
|
1721 |
+
$1.60
|
1722 |
</span>
|
1723 |
+
</div>
|
1724 |
+
<div
|
1725 |
+
class="wc-block-components-product-metadata"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1726 |
>
|
1727 |
+
<div
|
1728 |
+
class="wc-block-components-product-metadata__description"
|
1729 |
+
>
|
1730 |
+
<p>
|
1731 |
+
Lightweight baseball cap
|
1732 |
+
</p>
|
1733 |
+
|
1734 |
+
|
1735 |
+
</div>
|
1736 |
+
<ul
|
1737 |
+
class="wc-block-components-product-details"
|
1738 |
+
>
|
1739 |
+
<li
|
1740 |
+
class="wc-block-components-product-details__color"
|
1741 |
+
>
|
1742 |
+
<span
|
1743 |
+
class="wc-block-components-product-details__name"
|
1744 |
+
>
|
1745 |
+
Color
|
1746 |
+
:
|
1747 |
+
</span>
|
1748 |
+
|
1749 |
+
<span
|
1750 |
+
class="wc-block-components-product-details__value"
|
1751 |
+
>
|
1752 |
+
Orange
|
1753 |
+
</span>
|
1754 |
+
</li>
|
1755 |
+
</ul>
|
1756 |
+
</div>
|
1757 |
+
<div
|
1758 |
+
class="wc-block-cart-item__quantity"
|
1759 |
>
|
1760 |
+
<div
|
1761 |
+
class="wc-block-components-quantity-selector"
|
1762 |
+
>
|
1763 |
+
<input
|
1764 |
+
aria-label="Quantity of Cap in your cart."
|
1765 |
+
class="wc-block-components-quantity-selector__input"
|
1766 |
+
min="0"
|
1767 |
+
step="1"
|
1768 |
+
type="number"
|
1769 |
+
value="1"
|
1770 |
+
/>
|
1771 |
+
<button
|
1772 |
+
aria-label="Reduce quantity"
|
1773 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
1774 |
+
disabled=""
|
1775 |
+
>
|
1776 |
+
-
|
1777 |
+
</button>
|
1778 |
+
<button
|
1779 |
+
aria-label="Increase quantity"
|
1780 |
+
class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
1781 |
+
>
|
1782 |
+
+
|
1783 |
+
</button>
|
1784 |
+
</div>
|
1785 |
+
<button
|
1786 |
+
class="wc-block-cart-item__remove-link"
|
1787 |
+
>
|
1788 |
+
Remove item
|
1789 |
+
</button>
|
1790 |
+
</div>
|
1791 |
+
</td>
|
1792 |
+
<td
|
1793 |
+
class="wc-block-cart-item__total"
|
1794 |
>
|
1795 |
+
<div
|
1796 |
+
class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
|
1797 |
>
|
1798 |
+
<span
|
1799 |
+
class="price wc-block-components-product-price"
|
1800 |
+
>
|
1801 |
+
<span
|
1802 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
|
1803 |
+
>
|
1804 |
+
$11.20
|
1805 |
+
</span>
|
1806 |
+
</span>
|
1807 |
+
</div>
|
1808 |
+
</td>
|
1809 |
+
</tr>
|
1810 |
+
</tbody>
|
1811 |
+
</table>
|
1812 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1813 |
<div
|
1814 |
+
class="wc-block-components-sidebar wc-block-cart__sidebar"
|
1815 |
+
>
|
1816 |
+
<h2
|
1817 |
+
class="wc-block-components-title wc-block-cart__totals-title"
|
1818 |
+
>
|
1819 |
+
Cart totals
|
1820 |
+
</h2>
|
1821 |
+
<div
|
1822 |
+
class="wc-block-components-totals-item"
|
|
|
1823 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1824 |
<span
|
1825 |
+
class="wc-block-components-totals-item__label"
|
1826 |
>
|
1827 |
+
Subtotal
|
1828 |
</span>
|
1829 |
<span
|
1830 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1831 |
>
|
1832 |
+
$24.00
|
1833 |
</span>
|
1834 |
+
<div
|
1835 |
+
class="wc-block-components-totals-item__description"
|
1836 |
+
/>
|
1837 |
+
</div>
|
|
|
|
|
1838 |
<div
|
1839 |
+
class="wc-block-components-totals-coupon wc-block-components-panel has-border"
|
1840 |
>
|
1841 |
+
<div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1842 |
<button
|
1843 |
+
aria-expanded="false"
|
1844 |
+
class="wc-block-components-panel__button"
|
|
|
1845 |
>
|
1846 |
+
<svg
|
1847 |
+
aria-hidden="true"
|
1848 |
+
class="wc-block-components-panel__button-icon"
|
1849 |
+
focusable="false"
|
1850 |
+
height="24"
|
1851 |
+
role="img"
|
1852 |
+
viewBox="0 0 24 24"
|
1853 |
+
width="24"
|
1854 |
+
xmlns="http://www.w3.org/2000/svg"
|
1855 |
+
>
|
1856 |
+
<path
|
1857 |
+
d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
|
1858 |
+
/>
|
1859 |
+
</svg>
|
1860 |
+
<span
|
1861 |
+
aria-hidden="true"
|
1862 |
+
>
|
1863 |
+
Coupon code
|
1864 |
+
</span>
|
1865 |
<span
|
1866 |
+
class="screen-reader-text"
|
1867 |
>
|
1868 |
+
Apply a coupon code
|
1869 |
</span>
|
1870 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1871 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1872 |
<div
|
1873 |
+
class="wc-block-components-panel__content"
|
1874 |
+
hidden=""
|
1875 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1876 |
<div
|
1877 |
+
class=""
|
1878 |
>
|
1879 |
<div
|
1880 |
+
aria-hidden="false"
|
1881 |
+
class=""
|
1882 |
>
|
1883 |
+
<div
|
1884 |
+
class="wc-block-components-totals-coupon__content"
|
|
|
1885 |
>
|
1886 |
+
<form
|
1887 |
+
class="wc-block-components-totals-coupon__form"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1888 |
>
|
1889 |
<div
|
1890 |
+
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
1891 |
>
|
1892 |
+
<input
|
1893 |
+
aria-describedby=""
|
1894 |
+
aria-label="Enter code"
|
1895 |
+
autocapitalize="off"
|
1896 |
+
autocomplete="off"
|
1897 |
+
id="wc-block-components-totals-coupon__input-3"
|
1898 |
+
type="text"
|
1899 |
+
value=""
|
1900 |
+
/>
|
1901 |
+
<label
|
1902 |
+
for="wc-block-components-totals-coupon__input-3"
|
1903 |
>
|
1904 |
+
Enter code
|
1905 |
+
</label>
|
1906 |
</div>
|
1907 |
+
<button
|
1908 |
+
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
1909 |
+
disabled=""
|
1910 |
+
type="submit"
|
1911 |
>
|
1912 |
<span
|
1913 |
+
class="wc-block-components-button__text"
|
|
|
1914 |
>
|
1915 |
+
Apply
|
|
|
|
|
|
|
|
|
|
|
1916 |
</span>
|
1917 |
+
</button>
|
1918 |
+
</form>
|
1919 |
+
</div>
|
1920 |
+
</div>
|
1921 |
+
</div>
|
1922 |
+
</div>
|
1923 |
+
</div>
|
1924 |
+
<div
|
1925 |
+
class="wc-block-components-discounts-meta"
|
1926 |
+
/>
|
1927 |
+
<div
|
1928 |
+
class="wc-block-components-totals-shipping"
|
1929 |
+
>
|
1930 |
+
<div
|
1931 |
+
class="wc-block-components-totals-item"
|
1932 |
+
>
|
1933 |
+
<span
|
1934 |
+
class="wc-block-components-totals-item__label"
|
1935 |
+
>
|
1936 |
+
Shipping
|
1937 |
+
</span>
|
1938 |
+
<span
|
1939 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
1940 |
+
>
|
1941 |
+
$0.00
|
1942 |
+
</span>
|
1943 |
+
<div
|
1944 |
+
class="wc-block-components-totals-item__description"
|
1945 |
+
>
|
1946 |
+
<div
|
1947 |
+
class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
|
1948 |
+
>
|
1949 |
+
via
|
1950 |
+
|
1951 |
+
Free shipping
|
1952 |
+
</div>
|
1953 |
+
</div>
|
1954 |
+
</div>
|
1955 |
+
<fieldset
|
1956 |
+
class="wc-block-components-totals-shipping__fieldset"
|
1957 |
+
>
|
1958 |
+
<legend
|
1959 |
+
class="screen-reader-text"
|
1960 |
+
>
|
1961 |
+
Shipping options
|
1962 |
+
</legend>
|
1963 |
+
<div
|
1964 |
+
class=""
|
1965 |
+
>
|
1966 |
+
<div
|
1967 |
+
aria-hidden="false"
|
1968 |
+
class=""
|
1969 |
+
>
|
1970 |
+
<div
|
1971 |
+
class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
|
1972 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1973 |
<div
|
1974 |
+
class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
|
1975 |
>
|
1976 |
+
<div>
|
1977 |
+
<button
|
1978 |
+
aria-expanded="true"
|
1979 |
+
class="wc-block-components-panel__button"
|
|
|
|
|
1980 |
>
|
1981 |
+
<svg
|
1982 |
+
aria-hidden="true"
|
1983 |
+
class="wc-block-components-panel__button-icon"
|
1984 |
+
focusable="false"
|
1985 |
+
height="24"
|
1986 |
+
role="img"
|
1987 |
+
viewBox="0 0 24 24"
|
1988 |
+
width="24"
|
1989 |
+
xmlns="http://www.w3.org/2000/svg"
|
1990 |
+
>
|
1991 |
+
<path
|
1992 |
+
d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
|
1993 |
+
/>
|
1994 |
+
</svg>
|
1995 |
+
<div
|
1996 |
+
class="wc-block-components-shipping-rates-control__package-title"
|
1997 |
+
>
|
1998 |
+
Shipping
|
1999 |
+
</div>
|
2000 |
+
</button>
|
2001 |
</div>
|
2002 |
<div
|
2003 |
+
class="wc-block-components-panel__content"
|
2004 |
>
|
2005 |
+
<div
|
2006 |
+
class="wc-block-components-radio-control"
|
|
|
2007 |
>
|
2008 |
+
<label
|
2009 |
+
class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
|
2010 |
+
for="radio-control-3-free_shipping:1"
|
2011 |
>
|
2012 |
+
<input
|
2013 |
+
aria-describedby="radio-control-3-free_shipping:1__label radio-control-3-free_shipping:1__description"
|
2014 |
+
checked=""
|
2015 |
+
class="wc-block-components-radio-control__input"
|
2016 |
+
id="radio-control-3-free_shipping:1"
|
2017 |
+
name="radio-control-3"
|
2018 |
+
type="radio"
|
2019 |
+
value="free_shipping:1"
|
2020 |
+
/>
|
2021 |
+
<div
|
2022 |
+
class="wc-block-components-radio-control__option-layout"
|
2023 |
+
>
|
2024 |
+
<div
|
2025 |
+
class="wc-block-components-radio-control__label-group"
|
2026 |
+
>
|
2027 |
+
<span
|
2028 |
+
class="wc-block-components-radio-control__label"
|
2029 |
+
id="radio-control-3-free_shipping:1__label"
|
2030 |
+
>
|
2031 |
+
Free shipping
|
2032 |
+
</span>
|
2033 |
+
</div>
|
2034 |
+
<div
|
2035 |
+
class="wc-block-components-radio-control__description-group"
|
2036 |
+
>
|
2037 |
+
<span
|
2038 |
+
class="wc-block-components-radio-control__description"
|
2039 |
+
id="radio-control-3-free_shipping:1__description"
|
2040 |
+
>
|
2041 |
+
<span
|
2042 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
2043 |
+
>
|
2044 |
+
$0.00
|
2045 |
+
</span>
|
2046 |
+
|
2047 |
+
</span>
|
2048 |
+
</div>
|
2049 |
+
</div>
|
2050 |
+
</label>
|
2051 |
+
<label
|
2052 |
+
class="wc-block-components-radio-control__option"
|
2053 |
+
for="radio-control-3-local_pickup:1"
|
2054 |
+
>
|
2055 |
+
<input
|
2056 |
+
aria-describedby="radio-control-3-local_pickup:1__label radio-control-3-local_pickup:1__description"
|
2057 |
+
class="wc-block-components-radio-control__input"
|
2058 |
+
id="radio-control-3-local_pickup:1"
|
2059 |
+
name="radio-control-3"
|
2060 |
+
type="radio"
|
2061 |
+
value="local_pickup:1"
|
2062 |
+
/>
|
2063 |
+
<div
|
2064 |
+
class="wc-block-components-radio-control__option-layout"
|
2065 |
+
>
|
2066 |
+
<div
|
2067 |
+
class="wc-block-components-radio-control__label-group"
|
2068 |
+
>
|
2069 |
+
<span
|
2070 |
+
class="wc-block-components-radio-control__label"
|
2071 |
+
id="radio-control-3-local_pickup:1__label"
|
2072 |
+
>
|
2073 |
+
Local pickup
|
2074 |
+
</span>
|
2075 |
+
</div>
|
2076 |
+
<div
|
2077 |
+
class="wc-block-components-radio-control__description-group"
|
2078 |
+
>
|
2079 |
+
<span
|
2080 |
+
class="wc-block-components-radio-control__description"
|
2081 |
+
id="radio-control-3-local_pickup:1__description"
|
2082 |
+
>
|
2083 |
+
<span
|
2084 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
|
2085 |
+
>
|
2086 |
+
$2.00
|
2087 |
+
</span>
|
2088 |
+
|
2089 |
+
</span>
|
2090 |
+
</div>
|
2091 |
+
</div>
|
2092 |
+
</label>
|
2093 |
+
</div>
|
2094 |
</div>
|
2095 |
</div>
|
2096 |
+
</div>
|
2097 |
</div>
|
2098 |
</div>
|
2099 |
+
</fieldset>
|
2100 |
</div>
|
2101 |
+
<div
|
2102 |
+
class="wc-block-components-totals-taxes"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2103 |
>
|
2104 |
+
<div
|
2105 |
+
class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
|
2106 |
+
>
|
2107 |
+
<span
|
2108 |
+
class="wc-block-components-totals-item__label"
|
2109 |
+
>
|
2110 |
+
Sales tax 20%
|
2111 |
+
</span>
|
2112 |
+
<span
|
2113 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
2114 |
+
>
|
2115 |
+
$6.00
|
2116 |
+
</span>
|
2117 |
+
<div
|
2118 |
+
class="wc-block-components-totals-item__description"
|
2119 |
+
/>
|
2120 |
+
</div>
|
2121 |
+
|
2122 |
+
</div>
|
2123 |
<div
|
2124 |
+
class="wc-block-components-totals-item wc-block-components-totals-footer-item"
|
2125 |
+
>
|
2126 |
+
<span
|
2127 |
+
class="wc-block-components-totals-item__label"
|
2128 |
+
>
|
2129 |
+
Total
|
2130 |
+
</span>
|
2131 |
+
<span
|
2132 |
+
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
|
2133 |
+
>
|
2134 |
+
$30.00
|
2135 |
+
</span>
|
2136 |
+
<div
|
2137 |
+
class="wc-block-components-totals-item__description"
|
2138 |
+
/>
|
2139 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2140 |
<div
|
2141 |
+
class="wc-block-components-order-meta"
|
|
|
2142 |
/>
|
2143 |
<div
|
2144 |
+
class="wc-block-cart__payment-options"
|
2145 |
>
|
2146 |
+
<div
|
2147 |
+
class="wc-block-cart__submit"
|
|
|
2148 |
>
|
2149 |
+
<div
|
2150 |
+
aria-hidden="true"
|
2151 |
+
style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
|
2152 |
+
/>
|
2153 |
+
<div
|
2154 |
+
class="wc-block-cart__submit-container"
|
2155 |
>
|
2156 |
+
<a
|
2157 |
+
class="components-button wc-block-components-button wc-block-cart__submit-button"
|
2158 |
+
href=""
|
2159 |
+
>
|
2160 |
+
<span
|
2161 |
+
class="wc-block-components-button__text"
|
2162 |
+
>
|
2163 |
+
Proceed to Checkout
|
2164 |
+
</span>
|
2165 |
+
</a>
|
2166 |
+
</div>
|
2167 |
+
</div>
|
2168 |
</div>
|
2169 |
</div>
|
2170 |
</div>
|
2171 |
+
<div
|
2172 |
+
style="display: none;"
|
2173 |
+
/>
|
2174 |
</div>
|
2175 |
</div>
|
|
|
|
|
|
|
2176 |
</div>
|
2177 |
`;
|
assets/js/blocks/cart-checkout/checkout/form/billing-fields-step.js
CHANGED
@@ -3,16 +3,15 @@
|
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
-
import {
|
7 |
import PropTypes from 'prop-types';
|
8 |
|
9 |
const BillingFieldsStep = ( { children } ) => {
|
10 |
-
const {
|
11 |
-
|
12 |
return (
|
13 |
<FormStep
|
14 |
id="billing-fields"
|
15 |
-
disabled={
|
16 |
className="wc-block-checkout__billing-fields"
|
17 |
title={ __( 'Billing address', 'woo-gutenberg-products-block' ) }
|
18 |
description={ __(
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
+
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
|
7 |
import PropTypes from 'prop-types';
|
8 |
|
9 |
const BillingFieldsStep = ( { children } ) => {
|
10 |
+
const { isDisabled } = useCheckoutSubmit();
|
|
|
11 |
return (
|
12 |
<FormStep
|
13 |
id="billing-fields"
|
14 |
+
disabled={ isDisabled }
|
15 |
className="wc-block-checkout__billing-fields"
|
16 |
title={ __( 'Billing address', 'woo-gutenberg-products-block' ) }
|
17 |
description={ __(
|
assets/js/blocks/cart-checkout/checkout/form/contact-fields-step.js
CHANGED
@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
|
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
|
7 |
import { useCheckoutContext } from '@woocommerce/base-context';
|
|
|
8 |
import { getSetting } from '@woocommerce/settings';
|
9 |
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
|
10 |
|
@@ -18,11 +19,11 @@ const ContactFieldsStep = ( {
|
|
18 |
allowCreateAccount,
|
19 |
} ) => {
|
20 |
const {
|
21 |
-
isProcessing: checkoutIsProcessing,
|
22 |
customerId,
|
23 |
shouldCreateAccount,
|
24 |
setShouldCreateAccount,
|
25 |
} = useCheckoutContext();
|
|
|
26 |
|
27 |
const createAccountUI = ! customerId &&
|
28 |
allowCreateAccount &&
|
@@ -38,10 +39,11 @@ const ContactFieldsStep = ( {
|
|
38 |
onChange={ ( value ) => setShouldCreateAccount( value ) }
|
39 |
/>
|
40 |
);
|
|
|
41 |
return (
|
42 |
<FormStep
|
43 |
id="contact-fields"
|
44 |
-
disabled={
|
45 |
className="wc-block-checkout__contact-fields"
|
46 |
title={ __(
|
47 |
'Contact information',
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
|
7 |
import { useCheckoutContext } from '@woocommerce/base-context';
|
8 |
+
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
|
9 |
import { getSetting } from '@woocommerce/settings';
|
10 |
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
|
11 |
|
19 |
allowCreateAccount,
|
20 |
} ) => {
|
21 |
const {
|
|
|
22 |
customerId,
|
23 |
shouldCreateAccount,
|
24 |
setShouldCreateAccount,
|
25 |
} = useCheckoutContext();
|
26 |
+
const { isDisabled } = useCheckoutSubmit();
|
27 |
|
28 |
const createAccountUI = ! customerId &&
|
29 |
allowCreateAccount &&
|
39 |
onChange={ ( value ) => setShouldCreateAccount( value ) }
|
40 |
/>
|
41 |
);
|
42 |
+
|
43 |
return (
|
44 |
<FormStep
|
45 |
id="contact-fields"
|
46 |
+
disabled={ isDisabled }
|
47 |
className="wc-block-checkout__contact-fields"
|
48 |
title={ __(
|
49 |
'Contact information',
|
assets/js/blocks/cart-checkout/checkout/form/order-notes-step.js
CHANGED
@@ -7,6 +7,7 @@ import {
|
|
7 |
useCheckoutContext,
|
8 |
useShippingDataContext,
|
9 |
} from '@woocommerce/base-context';
|
|
|
10 |
|
11 |
/**
|
12 |
* Internal dependencies
|
@@ -15,11 +16,8 @@ import CheckoutOrderNotes from './order-notes';
|
|
15 |
|
16 |
const OrderNotesStep = () => {
|
17 |
const { needsShipping } = useShippingDataContext();
|
18 |
-
const {
|
19 |
-
|
20 |
-
orderNotes,
|
21 |
-
dispatchActions,
|
22 |
-
} = useCheckoutContext();
|
23 |
const { setOrderNotes } = dispatchActions;
|
24 |
|
25 |
return (
|
@@ -27,11 +25,11 @@ const OrderNotesStep = () => {
|
|
27 |
id="order-notes"
|
28 |
showStepNumber={ false }
|
29 |
className="wc-block-checkout__order-notes"
|
30 |
-
disabled={
|
31 |
>
|
32 |
<CheckoutOrderNotes
|
33 |
-
disabled={ checkoutIsProcessing }
|
34 |
onChange={ setOrderNotes }
|
|
|
35 |
placeholder={
|
36 |
needsShipping
|
37 |
? __(
|
7 |
useCheckoutContext,
|
8 |
useShippingDataContext,
|
9 |
} from '@woocommerce/base-context';
|
10 |
+
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
|
11 |
|
12 |
/**
|
13 |
* Internal dependencies
|
16 |
|
17 |
const OrderNotesStep = () => {
|
18 |
const { needsShipping } = useShippingDataContext();
|
19 |
+
const { orderNotes, dispatchActions } = useCheckoutContext();
|
20 |
+
const { isDisabled } = useCheckoutSubmit();
|
|
|
|
|
|
|
21 |
const { setOrderNotes } = dispatchActions;
|
22 |
|
23 |
return (
|
25 |
id="order-notes"
|
26 |
showStepNumber={ false }
|
27 |
className="wc-block-checkout__order-notes"
|
28 |
+
disabled={ isDisabled }
|
29 |
>
|
30 |
<CheckoutOrderNotes
|
|
|
31 |
onChange={ setOrderNotes }
|
32 |
+
disabled={ isDisabled }
|
33 |
placeholder={
|
34 |
needsShipping
|
35 |
? __(
|
assets/js/blocks/cart-checkout/checkout/form/payment-method-step.js
CHANGED
@@ -3,14 +3,12 @@
|
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
-
import {
|
7 |
-
useCheckoutContext,
|
8 |
-
StoreNoticesProvider,
|
9 |
-
} from '@woocommerce/base-context';
|
10 |
import {
|
11 |
useStoreCart,
|
12 |
useEmitResponse,
|
13 |
usePaymentMethods,
|
|
|
14 |
} from '@woocommerce/base-context/hooks';
|
15 |
|
16 |
/**
|
@@ -19,7 +17,7 @@ import {
|
|
19 |
import { PaymentMethods } from '../../payment-methods';
|
20 |
|
21 |
const PaymentMethodStep = () => {
|
22 |
-
const {
|
23 |
const { cartNeedsPayment } = useStoreCart();
|
24 |
const { paymentMethods } = usePaymentMethods();
|
25 |
const { noticeContexts } = useEmitResponse();
|
@@ -31,7 +29,7 @@ const PaymentMethodStep = () => {
|
|
31 |
return (
|
32 |
<FormStep
|
33 |
id="payment-method"
|
34 |
-
disabled={
|
35 |
className="wc-block-checkout__payment-method"
|
36 |
title={ __( 'Payment method', 'woo-gutenberg-products-block' ) }
|
37 |
description={
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
+
import { StoreNoticesProvider } from '@woocommerce/base-context';
|
|
|
|
|
|
|
7 |
import {
|
8 |
useStoreCart,
|
9 |
useEmitResponse,
|
10 |
usePaymentMethods,
|
11 |
+
useCheckoutSubmit,
|
12 |
} from '@woocommerce/base-context/hooks';
|
13 |
|
14 |
/**
|
17 |
import { PaymentMethods } from '../../payment-methods';
|
18 |
|
19 |
const PaymentMethodStep = () => {
|
20 |
+
const { isDisabled } = useCheckoutSubmit();
|
21 |
const { cartNeedsPayment } = useStoreCart();
|
22 |
const { paymentMethods } = usePaymentMethods();
|
23 |
const { noticeContexts } = useEmitResponse();
|
29 |
return (
|
30 |
<FormStep
|
31 |
id="payment-method"
|
32 |
+
disabled={ isDisabled }
|
33 |
className="wc-block-checkout__payment-method"
|
34 |
title={ __( 'Payment method', 'woo-gutenberg-products-block' ) }
|
35 |
description={
|
assets/js/blocks/cart-checkout/checkout/form/shipping-fields-step.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
|
7 |
-
import {
|
8 |
import PropTypes from 'prop-types';
|
9 |
|
10 |
const ShippingFieldsStep = ( {
|
@@ -12,12 +12,12 @@ const ShippingFieldsStep = ( {
|
|
12 |
setShippingAsBilling,
|
13 |
children,
|
14 |
} ) => {
|
15 |
-
const {
|
16 |
|
17 |
return (
|
18 |
<FormStep
|
19 |
id="shipping-fields"
|
20 |
-
disabled={
|
21 |
className="wc-block-checkout__shipping-fields"
|
22 |
title={ __( 'Shipping address', 'woo-gutenberg-products-block' ) }
|
23 |
description={ __(
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { FormStep } from '@woocommerce/base-components/cart-checkout';
|
6 |
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
|
7 |
+
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
|
8 |
import PropTypes from 'prop-types';
|
9 |
|
10 |
const ShippingFieldsStep = ( {
|
12 |
setShippingAsBilling,
|
13 |
children,
|
14 |
} ) => {
|
15 |
+
const { isDisabled } = useCheckoutSubmit();
|
16 |
|
17 |
return (
|
18 |
<FormStep
|
19 |
id="shipping-fields"
|
20 |
+
disabled={ isDisabled }
|
21 |
className="wc-block-checkout__shipping-fields"
|
22 |
title={ __( 'Shipping address', 'woo-gutenberg-products-block' ) }
|
23 |
description={ __(
|
assets/js/blocks/cart-checkout/checkout/form/shipping-options-step.tsx
CHANGED
@@ -13,10 +13,10 @@ import {
|
|
13 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
14 |
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
|
15 |
import {
|
16 |
-
useCheckoutContext,
|
17 |
useEditorContext,
|
18 |
useShippingDataContext,
|
19 |
} from '@woocommerce/base-context';
|
|
|
20 |
import { decodeEntities } from '@wordpress/html-entities';
|
21 |
import { Notice } from 'wordpress-components';
|
22 |
import classnames from 'classnames';
|
@@ -55,7 +55,7 @@ const renderShippingRatesControlOption = (
|
|
55 |
};
|
56 |
|
57 |
const ShippingOptionsStep = (): JSX.Element | null => {
|
58 |
-
const {
|
59 |
const { isEditor } = useEditorContext();
|
60 |
const {
|
61 |
shippingRates,
|
@@ -71,7 +71,7 @@ const ShippingOptionsStep = (): JSX.Element | null => {
|
|
71 |
return (
|
72 |
<FormStep
|
73 |
id="shipping-option"
|
74 |
-
disabled={
|
75 |
className="wc-block-checkout__shipping-option"
|
76 |
title={ __( 'Shipping options', 'woo-gutenberg-products-block' ) }
|
77 |
description={
|
13 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
14 |
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
|
15 |
import {
|
|
|
16 |
useEditorContext,
|
17 |
useShippingDataContext,
|
18 |
} from '@woocommerce/base-context';
|
19 |
+
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
|
20 |
import { decodeEntities } from '@wordpress/html-entities';
|
21 |
import { Notice } from 'wordpress-components';
|
22 |
import classnames from 'classnames';
|
55 |
};
|
56 |
|
57 |
const ShippingOptionsStep = (): JSX.Element | null => {
|
58 |
+
const { isDisabled } = useCheckoutSubmit();
|
59 |
const { isEditor } = useEditorContext();
|
60 |
const {
|
61 |
shippingRates,
|
71 |
return (
|
72 |
<FormStep
|
73 |
id="shipping-option"
|
74 |
+
disabled={ isDisabled }
|
75 |
className="wc-block-checkout__shipping-option"
|
76 |
title={ __( 'Shipping options', 'woo-gutenberg-products-block' ) }
|
77 |
description={
|
assets/js/blocks/cart-checkout/checkout/sidebar/index.js
CHANGED
@@ -14,6 +14,7 @@ import {
|
|
14 |
TotalsFees,
|
15 |
TotalsTaxes,
|
16 |
ExperimentalOrderMeta,
|
|
|
17 |
} from '@woocommerce/blocks-checkout';
|
18 |
|
19 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
@@ -50,6 +51,11 @@ const CheckoutSidebar = ( {
|
|
50 |
cart,
|
51 |
};
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
return (
|
54 |
<>
|
55 |
<OrderSummary cartItems={ cartItems } />
|
@@ -69,6 +75,7 @@ const CheckoutSidebar = ( {
|
|
69 |
isLoading={ isApplyingCoupon }
|
70 |
/>
|
71 |
) }
|
|
|
72 |
{ needsShipping && (
|
73 |
<TotalsShipping
|
74 |
showCalculator={ false }
|
14 |
TotalsFees,
|
15 |
TotalsTaxes,
|
16 |
ExperimentalOrderMeta,
|
17 |
+
ExperimentalDiscountsMeta,
|
18 |
} from '@woocommerce/blocks-checkout';
|
19 |
|
20 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
51 |
cart,
|
52 |
};
|
53 |
|
54 |
+
const discountsSlotFillProps = {
|
55 |
+
extensions,
|
56 |
+
cart,
|
57 |
+
};
|
58 |
+
|
59 |
return (
|
60 |
<>
|
61 |
<OrderSummary cartItems={ cartItems } />
|
75 |
isLoading={ isApplyingCoupon }
|
76 |
/>
|
77 |
) }
|
78 |
+
<ExperimentalDiscountsMeta.Slot { ...discountsSlotFillProps } />
|
79 |
{ needsShipping && (
|
80 |
<TotalsShipping
|
81 |
showCalculator={ false }
|
assets/js/blocks/cart-checkout/checkout/sidebar/test/__snapshots__/index.js.snap
CHANGED
@@ -58,44 +58,56 @@ exports[`Testing checkout sidebar Shows rate percentages after tax lines if the
|
|
58 |
hidden=""
|
59 |
>
|
60 |
<div
|
61 |
-
class="
|
62 |
>
|
63 |
-
<
|
64 |
-
|
|
|
65 |
>
|
66 |
<div
|
67 |
-
class="wc-block-components-
|
68 |
>
|
69 |
-
<
|
70 |
-
|
71 |
-
aria-label="Enter code"
|
72 |
-
autocapitalize="off"
|
73 |
-
autocomplete="off"
|
74 |
-
id="wc-block-components-totals-coupon__input-0"
|
75 |
-
type="text"
|
76 |
-
value=""
|
77 |
-
/>
|
78 |
-
<label
|
79 |
-
for="wc-block-components-totals-coupon__input-0"
|
80 |
>
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
</div>
|
84 |
-
|
85 |
-
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
86 |
-
disabled=""
|
87 |
-
type="submit"
|
88 |
-
>
|
89 |
-
<span
|
90 |
-
class="wc-block-components-button__text"
|
91 |
-
>
|
92 |
-
Apply
|
93 |
-
</span>
|
94 |
-
</button>
|
95 |
-
</form>
|
96 |
</div>
|
97 |
</div>
|
98 |
</div>
|
|
|
|
|
|
|
99 |
<div
|
100 |
class="wc-block-components-totals-taxes"
|
101 |
>
|
58 |
hidden=""
|
59 |
>
|
60 |
<div
|
61 |
+
class=""
|
62 |
>
|
63 |
+
<div
|
64 |
+
aria-hidden="false"
|
65 |
+
class=""
|
66 |
>
|
67 |
<div
|
68 |
+
class="wc-block-components-totals-coupon__content"
|
69 |
>
|
70 |
+
<form
|
71 |
+
class="wc-block-components-totals-coupon__form"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
>
|
73 |
+
<div
|
74 |
+
class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
|
75 |
+
>
|
76 |
+
<input
|
77 |
+
aria-describedby="wc-block-components-totals-coupon__input-0"
|
78 |
+
aria-label="Enter code"
|
79 |
+
autocapitalize="off"
|
80 |
+
autocomplete="off"
|
81 |
+
id="wc-block-components-totals-coupon__input-0"
|
82 |
+
type="text"
|
83 |
+
value=""
|
84 |
+
/>
|
85 |
+
<label
|
86 |
+
for="wc-block-components-totals-coupon__input-0"
|
87 |
+
>
|
88 |
+
Enter code
|
89 |
+
</label>
|
90 |
+
</div>
|
91 |
+
<button
|
92 |
+
class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
|
93 |
+
disabled=""
|
94 |
+
type="submit"
|
95 |
+
>
|
96 |
+
<span
|
97 |
+
class="wc-block-components-button__text"
|
98 |
+
>
|
99 |
+
Apply
|
100 |
+
</span>
|
101 |
+
</button>
|
102 |
+
</form>
|
103 |
</div>
|
104 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
</div>
|
106 |
</div>
|
107 |
</div>
|
108 |
+
<div
|
109 |
+
class="wc-block-components-discounts-meta"
|
110 |
+
/>
|
111 |
<div
|
112 |
class="wc-block-components-totals-taxes"
|
113 |
>
|
assets/js/blocks/cart-checkout/payment-methods/express-payment-methods.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
/**
|
2 |
* External dependencies
|
3 |
*/
|
|
|
4 |
import {
|
5 |
useExpressPaymentMethods,
|
6 |
usePaymentMethodInterface,
|
@@ -15,6 +16,7 @@ import {
|
|
15 |
useEditorContext,
|
16 |
usePaymentMethodDataContext,
|
17 |
} from '@woocommerce/base-context';
|
|
|
18 |
|
19 |
/**
|
20 |
* Internal dependencies
|
@@ -25,6 +27,7 @@ const ExpressPaymentMethods = () => {
|
|
25 |
const { isEditor } = useEditorContext();
|
26 |
const {
|
27 |
setActivePaymentMethod,
|
|
|
28 |
activePaymentMethod,
|
29 |
paymentMethodData,
|
30 |
setPaymentStatus,
|
@@ -34,6 +37,11 @@ const ExpressPaymentMethods = () => {
|
|
34 |
const previousActivePaymentMethod = useRef( activePaymentMethod );
|
35 |
const previousPaymentMethodData = useRef( paymentMethodData );
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
const onExpressPaymentClick = useCallback(
|
38 |
( paymentMethodId ) => () => {
|
39 |
previousActivePaymentMethod.current = activePaymentMethod;
|
@@ -48,32 +56,95 @@ const ExpressPaymentMethods = () => {
|
|
48 |
setPaymentStatus,
|
49 |
]
|
50 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
const onExpressPaymentClose = useCallback( () => {
|
|
|
52 |
setActivePaymentMethod( previousActivePaymentMethod.current );
|
53 |
if ( previousPaymentMethodData.current.isSavedToken ) {
|
54 |
setPaymentStatus().started( previousPaymentMethodData.current );
|
55 |
}
|
56 |
}, [ setActivePaymentMethod, setPaymentStatus ] );
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
const content =
|
59 |
-
|
60 |
-
|
61 |
const expressPaymentMethod = isEditor
|
62 |
-
?
|
63 |
-
:
|
64 |
return isValidElement( expressPaymentMethod ) ? (
|
65 |
<li key={ id } id={ `express-payment-method-${ id }` }>
|
66 |
{ cloneElement( expressPaymentMethod, {
|
67 |
...paymentMethodInterface,
|
68 |
onClick: onExpressPaymentClick( id ),
|
69 |
onClose: onExpressPaymentClose,
|
|
|
|
|
70 |
} ) }
|
71 |
</li>
|
72 |
) : null;
|
73 |
} )
|
74 |
) : (
|
75 |
-
<li key="noneRegistered">
|
|
|
|
|
|
|
|
|
|
|
76 |
);
|
|
|
77 |
return (
|
78 |
<PaymentMethodErrorBoundary isEditor={ isEditor }>
|
79 |
<ul className="wc-block-components-express-payment__event-buttons">
|
1 |
/**
|
2 |
* External dependencies
|
3 |
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
import {
|
6 |
useExpressPaymentMethods,
|
7 |
usePaymentMethodInterface,
|
16 |
useEditorContext,
|
17 |
usePaymentMethodDataContext,
|
18 |
} from '@woocommerce/base-context';
|
19 |
+
import deprecated from '@wordpress/deprecated';
|
20 |
|
21 |
/**
|
22 |
* Internal dependencies
|
27 |
const { isEditor } = useEditorContext();
|
28 |
const {
|
29 |
setActivePaymentMethod,
|
30 |
+
setExpressPaymentError,
|
31 |
activePaymentMethod,
|
32 |
paymentMethodData,
|
33 |
setPaymentStatus,
|
37 |
const previousActivePaymentMethod = useRef( activePaymentMethod );
|
38 |
const previousPaymentMethodData = useRef( paymentMethodData );
|
39 |
|
40 |
+
/**
|
41 |
+
* onExpressPaymentClick should be triggered when the express payment button is clicked.
|
42 |
+
*
|
43 |
+
* This will store the previous active payment method, set the express method as active, and set the payment status to started.
|
44 |
+
*/
|
45 |
const onExpressPaymentClick = useCallback(
|
46 |
( paymentMethodId ) => () => {
|
47 |
previousActivePaymentMethod.current = activePaymentMethod;
|
56 |
setPaymentStatus,
|
57 |
]
|
58 |
);
|
59 |
+
|
60 |
+
/**
|
61 |
+
* onExpressPaymentClose should be triggered when the express payment process is cancelled or closed.
|
62 |
+
*
|
63 |
+
* This restores the active method and returns the state to pristine.
|
64 |
+
*/
|
65 |
const onExpressPaymentClose = useCallback( () => {
|
66 |
+
setPaymentStatus().pristine();
|
67 |
setActivePaymentMethod( previousActivePaymentMethod.current );
|
68 |
if ( previousPaymentMethodData.current.isSavedToken ) {
|
69 |
setPaymentStatus().started( previousPaymentMethodData.current );
|
70 |
}
|
71 |
}, [ setActivePaymentMethod, setPaymentStatus ] );
|
72 |
+
|
73 |
+
/**
|
74 |
+
* onExpressPaymentError should be triggered when the express payment process errors.
|
75 |
+
*
|
76 |
+
* This shows an error message then restores the active method and returns the state to pristine.
|
77 |
+
*/
|
78 |
+
const onExpressPaymentError = useCallback(
|
79 |
+
( errorMessage ) => {
|
80 |
+
setPaymentStatus().error( errorMessage );
|
81 |
+
setExpressPaymentError( errorMessage );
|
82 |
+
setActivePaymentMethod( previousActivePaymentMethod.current );
|
83 |
+
if ( previousPaymentMethodData.current.isSavedToken ) {
|
84 |
+
setPaymentStatus().started( previousPaymentMethodData.current );
|
85 |
+
}
|
86 |
+
},
|
87 |
+
[ setActivePaymentMethod, setPaymentStatus, setExpressPaymentError ]
|
88 |
+
);
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Calling setExpressPaymentError directly is deprecated.
|
92 |
+
*/
|
93 |
+
const deprecatedSetExpressPaymentError = useCallback(
|
94 |
+
( errorMessage = '' ) => {
|
95 |
+
deprecated(
|
96 |
+
'Express Payment Methods should use the provided onError handler instead.',
|
97 |
+
{
|
98 |
+
alternative: 'onError',
|
99 |
+
plugin: 'woocommerce-gutenberg-products-block',
|
100 |
+
link:
|
101 |
+
'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228',
|
102 |
+
}
|
103 |
+
);
|
104 |
+
if ( errorMessage ) {
|
105 |
+
onExpressPaymentError( errorMessage );
|
106 |
+
} else {
|
107 |
+
setExpressPaymentError( '' );
|
108 |
+
}
|
109 |
+
},
|
110 |
+
[ setExpressPaymentError, onExpressPaymentError ]
|
111 |
+
);
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @todo Find a way to Memoize Express Payment Method Content
|
115 |
+
*
|
116 |
+
* Payment method content could potentially become a bottleneck if lots of logic is ran in the content component. It
|
117 |
+
* Currently re-renders excessively but is not easy to useMemo because paymentMethodInterface could become stale.
|
118 |
+
* paymentMethodInterface itself also updates on most renders.
|
119 |
+
*/
|
120 |
+
const entries = Object.entries( paymentMethods );
|
121 |
const content =
|
122 |
+
entries.length > 0 ? (
|
123 |
+
entries.map( ( [ id, paymentMethod ] ) => {
|
124 |
const expressPaymentMethod = isEditor
|
125 |
+
? paymentMethod.edit
|
126 |
+
: paymentMethod.content;
|
127 |
return isValidElement( expressPaymentMethod ) ? (
|
128 |
<li key={ id } id={ `express-payment-method-${ id }` }>
|
129 |
{ cloneElement( expressPaymentMethod, {
|
130 |
...paymentMethodInterface,
|
131 |
onClick: onExpressPaymentClick( id ),
|
132 |
onClose: onExpressPaymentClose,
|
133 |
+
onError: onExpressPaymentError,
|
134 |
+
setExpressPaymentError: deprecatedSetExpressPaymentError,
|
135 |
} ) }
|
136 |
</li>
|
137 |
) : null;
|
138 |
} )
|
139 |
) : (
|
140 |
+
<li key="noneRegistered">
|
141 |
+
{ __(
|
142 |
+
'No registered Payment Methods',
|
143 |
+
'woo-gutenberg-products-block'
|
144 |
+
) }
|
145 |
+
</li>
|
146 |
);
|
147 |
+
|
148 |
return (
|
149 |
<PaymentMethodErrorBoundary isEditor={ isEditor }>
|
150 |
<ul className="wc-block-components-express-payment__event-buttons">
|
assets/js/blocks/cart-checkout/payment-methods/express-payment/cart-express-payment.js
CHANGED
@@ -6,7 +6,12 @@ import {
|
|
6 |
useEmitResponse,
|
7 |
useExpressPaymentMethods,
|
8 |
} from '@woocommerce/base-context/hooks';
|
9 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
/**
|
12 |
* Internal dependencies
|
@@ -17,6 +22,15 @@ import './style.scss';
|
|
17 |
const CartExpressPayment = () => {
|
18 |
const { paymentMethods, isInitialized } = useExpressPaymentMethods();
|
19 |
const { noticeContexts } = useEmitResponse();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
if (
|
22 |
! isInitialized ||
|
@@ -25,17 +39,32 @@ const CartExpressPayment = () => {
|
|
25 |
return null;
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
return (
|
29 |
<>
|
30 |
-
<
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</div>
|
38 |
-
</
|
39 |
<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart">
|
40 |
{ /* translators: Shown in the Cart block between the express payment methods and the Proceed to Checkout button */ }
|
41 |
{ __( 'Or', 'woo-gutenberg-products-block' ) }
|
6 |
useEmitResponse,
|
7 |
useExpressPaymentMethods,
|
8 |
} from '@woocommerce/base-context/hooks';
|
9 |
+
import {
|
10 |
+
StoreNoticesProvider,
|
11 |
+
useCheckoutContext,
|
12 |
+
usePaymentMethodDataContext,
|
13 |
+
} from '@woocommerce/base-context';
|
14 |
+
import LoadingMask from '@woocommerce/base-components/loading-mask';
|
15 |
|
16 |
/**
|
17 |
* Internal dependencies
|
22 |
const CartExpressPayment = () => {
|
23 |
const { paymentMethods, isInitialized } = useExpressPaymentMethods();
|
24 |
const { noticeContexts } = useEmitResponse();
|
25 |
+
const {
|
26 |
+
isCalculating,
|
27 |
+
isProcessing,
|
28 |
+
isAfterProcessing,
|
29 |
+
isBeforeProcessing,
|
30 |
+
isComplete,
|
31 |
+
hasError,
|
32 |
+
} = useCheckoutContext();
|
33 |
+
const { currentStatus: paymentStatus } = usePaymentMethodDataContext();
|
34 |
|
35 |
if (
|
36 |
! isInitialized ||
|
39 |
return null;
|
40 |
}
|
41 |
|
42 |
+
// Set loading state for express payment methods when payment or checkout is in progress.
|
43 |
+
const checkoutProcessing =
|
44 |
+
isProcessing ||
|
45 |
+
isAfterProcessing ||
|
46 |
+
isBeforeProcessing ||
|
47 |
+
( isComplete && ! hasError );
|
48 |
+
|
49 |
return (
|
50 |
<>
|
51 |
+
<LoadingMask
|
52 |
+
isLoading={
|
53 |
+
isCalculating ||
|
54 |
+
checkoutProcessing ||
|
55 |
+
paymentStatus.isDoingExpressPayment
|
56 |
+
}
|
57 |
+
>
|
58 |
+
<div className="wc-block-components-express-payment wc-block-components-express-payment--cart">
|
59 |
+
<div className="wc-block-components-express-payment__content">
|
60 |
+
<StoreNoticesProvider
|
61 |
+
context={ noticeContexts.EXPRESS_PAYMENTS }
|
62 |
+
>
|
63 |
+
<ExpressPaymentMethods />
|
64 |
+
</StoreNoticesProvider>
|
65 |
+
</div>
|
66 |
</div>
|
67 |
+
</LoadingMask>
|
68 |
<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart">
|
69 |
{ /* translators: Shown in the Cart block between the express payment methods and the Proceed to Checkout button */ }
|
70 |
{ __( 'Or', 'woo-gutenberg-products-block' ) }
|
assets/js/blocks/cart-checkout/payment-methods/express-payment/checkout-express-payment.js
CHANGED
@@ -8,9 +8,12 @@ import {
|
|
8 |
} from '@woocommerce/base-context/hooks';
|
9 |
import {
|
10 |
StoreNoticesProvider,
|
|
|
|
|
11 |
useEditorContext,
|
12 |
} from '@woocommerce/base-context';
|
13 |
import Title from '@woocommerce/base-components/title';
|
|
|
14 |
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
|
15 |
|
16 |
/**
|
@@ -20,6 +23,15 @@ import ExpressPaymentMethods from '../express-payment-methods';
|
|
20 |
import './style.scss';
|
21 |
|
22 |
const CheckoutExpressPayment = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
const { paymentMethods, isInitialized } = useExpressPaymentMethods();
|
24 |
const { isEditor } = useEditorContext();
|
25 |
const { noticeContexts } = useEmitResponse();
|
@@ -40,34 +52,49 @@ const CheckoutExpressPayment = () => {
|
|
40 |
return null;
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
return (
|
44 |
<>
|
45 |
-
<
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
<StoreNoticesProvider
|
59 |
-
context={ noticeContexts.EXPRESS_PAYMENTS }
|
60 |
-
>
|
61 |
-
<p>
|
62 |
{ __(
|
63 |
-
'
|
64 |
'woo-gutenberg-products-block'
|
65 |
) }
|
66 |
-
</
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
</div>
|
70 |
-
</
|
71 |
<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout">
|
72 |
{ __( 'Or continue below', 'woo-gutenberg-products-block' ) }
|
73 |
</div>
|
8 |
} from '@woocommerce/base-context/hooks';
|
9 |
import {
|
10 |
StoreNoticesProvider,
|
11 |
+
useCheckoutContext,
|
12 |
+
usePaymentMethodDataContext,
|
13 |
useEditorContext,
|
14 |
} from '@woocommerce/base-context';
|
15 |
import Title from '@woocommerce/base-components/title';
|
16 |
+
import LoadingMask from '@woocommerce/base-components/loading-mask';
|
17 |
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
|
18 |
|
19 |
/**
|
23 |
import './style.scss';
|
24 |
|
25 |
const CheckoutExpressPayment = () => {
|
26 |
+
const {
|
27 |
+
isCalculating,
|
28 |
+
isProcessing,
|
29 |
+
isAfterProcessing,
|
30 |
+
isBeforeProcessing,
|
31 |
+
isComplete,
|
32 |
+
hasError,
|
33 |
+
} = useCheckoutContext();
|
34 |
+
const { currentStatus: paymentStatus } = usePaymentMethodDataContext();
|
35 |
const { paymentMethods, isInitialized } = useExpressPaymentMethods();
|
36 |
const { isEditor } = useEditorContext();
|
37 |
const { noticeContexts } = useEmitResponse();
|
52 |
return null;
|
53 |
}
|
54 |
|
55 |
+
// Set loading state for express payment methods when payment or checkout is in progress.
|
56 |
+
const checkoutProcessing =
|
57 |
+
isProcessing ||
|
58 |
+
isAfterProcessing ||
|
59 |
+
isBeforeProcessing ||
|
60 |
+
( isComplete && ! hasError );
|
61 |
+
|
62 |
return (
|
63 |
<>
|
64 |
+
<LoadingMask
|
65 |
+
isLoading={
|
66 |
+
isCalculating ||
|
67 |
+
checkoutProcessing ||
|
68 |
+
paymentStatus.isDoingExpressPayment
|
69 |
+
}
|
70 |
+
>
|
71 |
+
<div className="wc-block-components-express-payment wc-block-components-express-payment--checkout">
|
72 |
+
<div className="wc-block-components-express-payment__title-container">
|
73 |
+
<Title
|
74 |
+
className="wc-block-components-express-payment__title"
|
75 |
+
headingLevel="2"
|
76 |
+
>
|
|
|
|
|
|
|
|
|
77 |
{ __(
|
78 |
+
'Express checkout',
|
79 |
'woo-gutenberg-products-block'
|
80 |
) }
|
81 |
+
</Title>
|
82 |
+
</div>
|
83 |
+
<div className="wc-block-components-express-payment__content">
|
84 |
+
<StoreNoticesProvider
|
85 |
+
context={ noticeContexts.EXPRESS_PAYMENTS }
|
86 |
+
>
|
87 |
+
<p>
|
88 |
+
{ __(
|
89 |
+
'In a hurry? Use one of our express checkout options below:',
|
90 |
+
'woo-gutenberg-products-block'
|
91 |
+
) }
|
92 |
+
</p>
|
93 |
+
<ExpressPaymentMethods />
|
94 |
+
</StoreNoticesProvider>
|
95 |
+
</div>
|
96 |
</div>
|
97 |
+
</LoadingMask>
|
98 |
<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout">
|
99 |
{ __( 'Or continue below', 'woo-gutenberg-products-block' ) }
|
100 |
</div>
|
assets/js/blocks/cart-checkout/payment-methods/payment-method-options.js
CHANGED
@@ -30,7 +30,7 @@ const PaymentMethodOptions = () => {
|
|
30 |
setActivePaymentMethod,
|
31 |
activeSavedToken,
|
32 |
setActiveSavedToken,
|
33 |
-
|
34 |
customerPaymentMethods,
|
35 |
} = usePaymentMethodDataContext();
|
36 |
const { paymentMethods } = usePaymentMethods();
|
@@ -38,9 +38,6 @@ const PaymentMethodOptions = () => {
|
|
38 |
activePaymentMethod,
|
39 |
...paymentMethodInterface
|
40 |
} = usePaymentMethodInterface();
|
41 |
-
const expressPaymentMethodActive = Object.keys(
|
42 |
-
expressPaymentMethods
|
43 |
-
).includes( activePaymentMethod );
|
44 |
const { noticeContexts } = useEmitResponse();
|
45 |
const { removeNotice } = useStoreNotices();
|
46 |
const { isEditor } = useEditorContext();
|
@@ -82,7 +79,7 @@ const PaymentMethodOptions = () => {
|
|
82 |
'disable-radio-control': isSinglePaymentMethod,
|
83 |
} );
|
84 |
|
85 |
-
return
|
86 |
<RadioControlAccordion
|
87 |
id={ 'wc-payment-method-options' }
|
88 |
className={ singleOptionClass }
|
30 |
setActivePaymentMethod,
|
31 |
activeSavedToken,
|
32 |
setActiveSavedToken,
|
33 |
+
isExpressPaymentMethodActive,
|
34 |
customerPaymentMethods,
|
35 |
} = usePaymentMethodDataContext();
|
36 |
const { paymentMethods } = usePaymentMethods();
|
38 |
activePaymentMethod,
|
39 |
...paymentMethodInterface
|
40 |
} = usePaymentMethodInterface();
|
|
|
|
|
|
|
41 |
const { noticeContexts } = useEmitResponse();
|
42 |
const { removeNotice } = useStoreNotices();
|
43 |
const { isEditor } = useEditorContext();
|
79 |
'disable-radio-control': isSinglePaymentMethod,
|
80 |
} );
|
81 |
|
82 |
+
return isExpressPaymentMethodActive ? null : (
|
83 |
<RadioControlAccordion
|
84 |
id={ 'wc-payment-method-options' }
|
85 |
className={ singleOptionClass }
|
assets/js/blocks/single-product/frontend.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
*/
|
4 |
import { getValidBlockAttributes } from '@woocommerce/base-utils';
|
5 |
import {
|
|
|
6 |
renderParentBlock,
|
7 |
renderStandaloneBlocks,
|
8 |
} from '@woocommerce/atomic-utils';
|
@@ -25,6 +26,7 @@ renderParentBlock( {
|
|
25 |
blockName: BLOCK_NAME,
|
26 |
selector: '.wp-block-woocommerce-single-product',
|
27 |
getProps,
|
|
|
28 |
} );
|
29 |
|
30 |
renderStandaloneBlocks();
|
3 |
*/
|
4 |
import { getValidBlockAttributes } from '@woocommerce/base-utils';
|
5 |
import {
|
6 |
+
getBlockMap,
|
7 |
renderParentBlock,
|
8 |
renderStandaloneBlocks,
|
9 |
} from '@woocommerce/atomic-utils';
|
26 |
blockName: BLOCK_NAME,
|
27 |
selector: '.wp-block-woocommerce-single-product',
|
28 |
getProps,
|
29 |
+
blockMap: getBlockMap( BLOCK_NAME ),
|
30 |
} );
|
31 |
|
32 |
renderStandaloneBlocks();
|
assets/js/data/cart/actions.ts
CHANGED
@@ -8,6 +8,7 @@ import type {
|
|
8 |
CartResponseItem,
|
9 |
CartBillingAddress,
|
10 |
CartShippingAddress,
|
|
|
11 |
} from '@woocommerce/types';
|
12 |
import { ReturnOrGeneratorYieldUnion } from '@automattic/data-stores';
|
13 |
import { camelCase, mapKeys } from 'lodash';
|
@@ -167,6 +168,36 @@ export const updateCartFragments = () =>
|
|
167 |
type: types.UPDATE_LEGACY_CART_FRAGMENTS,
|
168 |
} as const );
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
/**
|
171 |
* Applies a coupon code and either invalidates caches, or receives an error if
|
172 |
* the coupon cannot be applied.
|
8 |
CartResponseItem,
|
9 |
CartBillingAddress,
|
10 |
CartShippingAddress,
|
11 |
+
ExtensionCartUpdateArgs,
|
12 |
} from '@woocommerce/types';
|
13 |
import { ReturnOrGeneratorYieldUnion } from '@automattic/data-stores';
|
14 |
import { camelCase, mapKeys } from 'lodash';
|
168 |
type: types.UPDATE_LEGACY_CART_FRAGMENTS,
|
169 |
} as const );
|
170 |
|
171 |
+
/**
|
172 |
+
* POSTs to the /cart/extensions endpoint with the data supplied by the extension.
|
173 |
+
*
|
174 |
+
* @param {Object} args The data to be posted to the endpoint
|
175 |
+
*/
|
176 |
+
export function* applyExtensionCartUpdate(
|
177 |
+
args: ExtensionCartUpdateArgs
|
178 |
+
): Generator< unknown, CartResponse, { response: CartResponse } > {
|
179 |
+
try {
|
180 |
+
const { response } = yield apiFetchWithHeaders( {
|
181 |
+
path: '/wc/store/cart/extensions',
|
182 |
+
method: 'POST',
|
183 |
+
data: { namespace: args.namespace, data: args.data },
|
184 |
+
cache: 'no-store',
|
185 |
+
} );
|
186 |
+
yield receiveCart( response );
|
187 |
+
yield updateCartFragments();
|
188 |
+
return response;
|
189 |
+
} catch ( error ) {
|
190 |
+
yield receiveError( error );
|
191 |
+
// If updated cart state was returned, also update that.
|
192 |
+
if ( error.data?.cart ) {
|
193 |
+
yield receiveCart( error.data.cart );
|
194 |
+
}
|
195 |
+
|
196 |
+
// Re-throw the error.
|
197 |
+
throw error;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
/**
|
202 |
* Applies a coupon code and either invalidates caches, or receives an error if
|
203 |
* the coupon cannot be applied.
|
assets/js/editor-components/products-control/index.js
CHANGED
@@ -66,7 +66,15 @@ const ProductsControl = ( {
|
|
66 |
return (
|
67 |
<SearchListControl
|
68 |
className="woocommerce-products"
|
69 |
-
list={ products
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
isCompact={ isCompact }
|
71 |
isLoading={ isLoading }
|
72 |
selected={ products.filter( ( { id } ) =>
|
66 |
return (
|
67 |
<SearchListControl
|
68 |
className="woocommerce-products"
|
69 |
+
list={ products.map( ( product ) => {
|
70 |
+
const formattedSku = product.sku
|
71 |
+
? ' (' + product.sku + ')'
|
72 |
+
: '';
|
73 |
+
return {
|
74 |
+
...product,
|
75 |
+
name: `${ product.name }${ formattedSku }`,
|
76 |
+
};
|
77 |
+
} ) }
|
78 |
isCompact={ isCompact }
|
79 |
isLoading={ isLoading }
|
80 |
selected={ products.filter( ( { id } ) =>
|
assets/js/settings/blocks/constants.ts
CHANGED
@@ -39,3 +39,18 @@ export const CART_URL = STORE_PAGES.cart.permalink;
|
|
39 |
export const LOGIN_URL = STORE_PAGES.myaccount.permalink
|
40 |
? STORE_PAGES.myaccount.permalink
|
41 |
: getSetting( 'wpLoginUrl', '/wp-login.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
export const LOGIN_URL = STORE_PAGES.myaccount.permalink
|
40 |
? STORE_PAGES.myaccount.permalink
|
41 |
: getSetting( 'wpLoginUrl', '/wp-login.php' );
|
42 |
+
export const SHIPPING_COUNTRIES = getSetting< Record< string, string > >(
|
43 |
+
'shippingCountries',
|
44 |
+
{}
|
45 |
+
);
|
46 |
+
export const ALLOWED_COUNTRIES = getSetting< Record< string, string > >(
|
47 |
+
'allowedCountries',
|
48 |
+
{}
|
49 |
+
);
|
50 |
+
export const SHIPPING_STATES = getSetting<
|
51 |
+
Record< string, Record< string, string > >
|
52 |
+
>( 'shippingStates', {} );
|
53 |
+
export const ALLOWED_STATES = getSetting< Record< string, string > >(
|
54 |
+
'allowedStates',
|
55 |
+
{}
|
56 |
+
);
|
assets/js/settings/shared/default-address-fields.ts
CHANGED
@@ -20,6 +20,10 @@ export interface AddressField {
|
|
20 |
index: number;
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
23 |
export interface AddressFields {
|
24 |
// eslint-disable-next-line camelcase
|
25 |
first_name: AddressField;
|
@@ -36,6 +40,7 @@ export interface AddressFields {
|
|
36 |
postcode: AddressField;
|
37 |
}
|
38 |
|
|
|
39 |
export interface EnteredAddress {
|
40 |
// eslint-disable-next-line camelcase
|
41 |
first_name: string;
|
@@ -54,6 +59,7 @@ export interface EnteredAddress {
|
|
54 |
|
55 |
export type KeyedAddressField = AddressField & {
|
56 |
key: keyof AddressFields;
|
|
|
57 |
};
|
58 |
export type ShippingAddress = EnteredAddress;
|
59 |
export type BillingAddress = EnteredAddress;
|
20 |
index: number;
|
21 |
}
|
22 |
|
23 |
+
export interface LocaleSpecificAddressField extends AddressField {
|
24 |
+
priority: number;
|
25 |
+
}
|
26 |
+
|
27 |
export interface AddressFields {
|
28 |
// eslint-disable-next-line camelcase
|
29 |
first_name: AddressField;
|
40 |
postcode: AddressField;
|
41 |
}
|
42 |
|
43 |
+
export type AddressType = 'billing' | 'shipping';
|
44 |
export interface EnteredAddress {
|
45 |
// eslint-disable-next-line camelcase
|
46 |
first_name: string;
|
59 |
|
60 |
export type KeyedAddressField = AddressField & {
|
61 |
key: keyof AddressFields;
|
62 |
+
errorMessage?: string;
|
63 |
};
|
64 |
export type ShippingAddress = EnteredAddress;
|
65 |
export type BillingAddress = EnteredAddress;
|
assets/js/settings/shared/utils.ts
CHANGED
@@ -15,14 +15,14 @@ import { allSettings } from './settings-init';
|
|
15 |
* the `fallback` will be returned instead. An optional `filter`
|
16 |
* callback can be passed to format the returned value.
|
17 |
*/
|
18 |
-
export const getSetting = (
|
19 |
name: string,
|
20 |
fallback: unknown = false,
|
21 |
filter = ( val: unknown, fb: unknown ) =>
|
22 |
typeof val !== 'undefined' ? val : fb
|
23 |
-
):
|
24 |
const value = name in allSettings ? allSettings[ name ] : fallback;
|
25 |
-
return filter( value, fallback );
|
26 |
};
|
27 |
|
28 |
/**
|
15 |
* the `fallback` will be returned instead. An optional `filter`
|
16 |
* callback can be passed to format the returned value.
|
17 |
*/
|
18 |
+
export const getSetting = < T >(
|
19 |
name: string,
|
20 |
fallback: unknown = false,
|
21 |
filter = ( val: unknown, fb: unknown ) =>
|
22 |
typeof val !== 'undefined' ? val : fb
|
23 |
+
): T => {
|
24 |
const value = name in allSettings ? allSettings[ name ] : fallback;
|
25 |
+
return filter( value, fallback ) as T;
|
26 |
};
|
27 |
|
28 |
/**
|
assets/js/types/type-defs/cart.ts
CHANGED
@@ -194,3 +194,7 @@ export interface CartMeta {
|
|
194 |
applyingCoupon: string;
|
195 |
removingCoupon: string;
|
196 |
}
|
|
|
|
|
|
|
|
194 |
applyingCoupon: string;
|
195 |
removingCoupon: string;
|
196 |
}
|
197 |
+
export interface ExtensionCartUpdateArgs {
|
198 |
+
data: Record< string, unknown >;
|
199 |
+
namespace: string;
|
200 |
+
}
|
assets/js/types/type-defs/contexts.js
CHANGED
@@ -13,8 +13,8 @@
|
|
13 |
*
|
14 |
* @property {BillingData} billingData The current billing data, including address and email.
|
15 |
* @property {CartShippingAddress} shippingAddress The current set address for shipping.
|
16 |
-
* @property {function()}
|
17 |
-
* @property {function()}
|
18 |
*/
|
19 |
|
20 |
/**
|
@@ -30,7 +30,7 @@
|
|
30 |
* @property {function()} setSelectedRates Function for setting the selected rates.
|
31 |
* @property {boolean} isSelectingRate True when rate is being selected.
|
32 |
* @property {CartShippingAddress} shippingAddress The current set address for shipping.
|
33 |
-
* @property {function()}
|
34 |
* @property {function()} onShippingRateSuccess Used to register a callback to be invoked when shipping
|
35 |
* rates are retrieved.
|
36 |
* @property {function()} onShippingRateSelectSuccess Used to register a callback to be invoked when shipping
|
13 |
*
|
14 |
* @property {BillingData} billingData The current billing data, including address and email.
|
15 |
* @property {CartShippingAddress} shippingAddress The current set address for shipping.
|
16 |
+
* @property {function(Object)} setBillingData A function for setting billing data.
|
17 |
+
* @property {function(Object)} setShippingAddress A function for setting shipping address.
|
18 |
*/
|
19 |
|
20 |
/**
|
30 |
* @property {function()} setSelectedRates Function for setting the selected rates.
|
31 |
* @property {boolean} isSelectingRate True when rate is being selected.
|
32 |
* @property {CartShippingAddress} shippingAddress The current set address for shipping.
|
33 |
+
* @property {function(Object)} setShippingAddress Function for setting the shipping address.
|
34 |
* @property {function()} onShippingRateSuccess Used to register a callback to be invoked when shipping
|
35 |
* rates are retrieved.
|
36 |
* @property {function()} onShippingRateSelectSuccess Used to register a callback to be invoked when shipping
|
build/active-filters-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c15eadfaece6a3c55aa983067d6194b3');
|
build/active-filters-frontend.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=235)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},11:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,a=e.getErrorBoundaryProps,s=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=s(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},12:function(e,t){!function(){e.exports=this.wp.data}()},122:function(e,t){},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(12),c=r(0),a=r(54),i=r(96),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),v=Object(a.a)(s),y=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,v],a=o.getCollectionError.apply(o,c);return a&&y(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,v,m,b]);return null!==g&&(d.current=g),d.current}},13:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return v})),r.d(t,"l",(function(){return y}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),y=(r(41),function(){return u>1})},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(16),a=r.n(c),i=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,u);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},141:function(e,t,r){"use strict";var n=r(0),o=r(15),c=r(12),a=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(5),o=Object(n.getSetting)("attributes",[]),c=o.reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),u.push(a)),t(Object(n.sortBy)(u,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=(r(3),r(4)),u=r.n(i),s=r(1),l=r(139),p=r(170),f=(r(122),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,p=e.radius,b=void 0===p?"small":p,d=e.children,m=void 0===d?null:d,v=a()(e,f),y=i,g=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+b),_=Boolean(n&&n!==t);return React.createElement(y,o()({className:g},v),React.createElement("span",{"aria-hidden":_,className:"wc-block-components-chip__text"},t),_&&React.createElement("span",{className:"screen-reader-text"},n),m)},d=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,f=void 0!==i&&i,m=e.onRemove,v=void 0===m?function(){}:m,y=e.removeOnAnyClick,g=void 0!==y&&y,_=e.text,O=e.screenReaderText,h=void 0===O?"":O,x=a()(e,d),E=g?"span":"button";if(!r){var w=h&&"string"==typeof h?h:_;r="string"!=typeof w?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),w)}var j={"aria-label":r,disabled:f,onClick:v,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||v()}},R=g?j:{},k=g?{"aria-hidden":!0}:j;return React.createElement(b,o()({},x,R,{className:u()(c,"is-removable"),element:g?"button":x.element,screenReaderText:h,text:_}),React.createElement(E,o()({className:"wc-block-components-chip__remove"},k),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},16:function(e,t,r){var n=r(71);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},170:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(28),u=["className","size"],s=function(e){var t=e.className,r=e.size,n=a()(e,u);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(s,null);t.a=l},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},2:function(e,t){!function(){e.exports=this.React}()},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},23:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},235:function(e,t,r){e.exports=r(284)},236:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},284:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(119),c=r(9),a=r.n(c),i=r(1),u=r(95),s=r(0),l=r(4),p=r.n(l),f=(r(3),r(11)),b=(r(236),r(150)),d=r(40),m=r(158),v=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,u=void 0===a||a,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},u&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.Label,{screenReaderLabel:p}))))},g=r(125),_=r(18),O=r(151),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,s=void 0===c?"in":c,l=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(u.b)("attributes",[]),m=a()(d,2),v=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),y({type:x,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(O.a)(v,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(u.b)("min_price"),g=a()(m,2),_=g[0],O=g[1],x=Object(u.b)("max_price"),E=a()(x,2),w=E[0],j=E[1],R=Object(s.useMemo)((function(){return Number.isFinite(_)||Number.isFinite(w)?y({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:v(_,w),removeCallback:function(){O(void 0),j(void 0)},displayStyle:t.displayStyle}):null}),[_,w,t.displayStyle,O,j]),k=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(_)||Number.isFinite(w)||n))return null;var S="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(S,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,k)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){O(void 0),j(void 0),d([])}},React.createElement(f.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(73)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(20).default,o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t,r){var n;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=236)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},11:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return f})),r.d(t,"l",(function(){return b})),r.d(t,"k",(function(){return d})),r.d(t,"c",(function(){return m})),r.d(t,"e",(function(){return v})),r.d(t,"h",(function(){return y})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return _})),r.d(t,"b",(function(){return O})),r.d(t,"p",(function(){return h}));var n,o=r(4),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),y=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),_=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{}),h=(r(42),function(){return u>1})},12:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),u=r(46);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,a=e.getErrorBoundaryProps,s=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=s(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},123:function(e,t){},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(16),o=r(13),c=r(0),a=r(49),i=r(97),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),v=Object(a.a)(s),y=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,v],a=o.getCollectionError.apply(o,c);return a&&y(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,v,m,b]);return null!==g&&(d.current=g),d.current}},13:function(e,t){!function(){e.exports=this.wp.data}()},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(15),a=r.n(c),i=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,u);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},141:function(e,t,r){"use strict";var n=r(0),o=r(16),c=r(13),a=r(11);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.o.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t,r){var n=r(72);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(4),o=Object(n.getSetting)("attributes",[]),c=o.reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(9),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),u.push(a)),t(Object(n.sortBy)(u,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},157:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),i=(r(3),r(5)),u=r.n(i),s=r(1),l=r(139),p=r(169),f=(r(123),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,p=e.radius,b=void 0===p?"small":p,d=e.children,m=void 0===d?null:d,v=a()(e,f),y=i,g=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+b),_=Boolean(n&&n!==t);return React.createElement(y,o()({className:g},v),React.createElement("span",{"aria-hidden":_,className:"wc-block-components-chip__text"},t),_&&React.createElement("span",{className:"screen-reader-text"},n),m)},d=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,f=void 0!==i&&i,m=e.onRemove,v=void 0===m?function(){}:m,y=e.removeOnAnyClick,g=void 0!==y&&y,_=e.text,O=e.screenReaderText,h=void 0===O?"":O,x=a()(e,d),E=g?"span":"button";if(!r){var w=h&&"string"==typeof h?h:_;r="string"!=typeof w?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),w)}var j={"aria-label":r,disabled:f,onClick:v,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||v()}},R=g?j:{},S=g?{"aria-hidden":!0}:j;return React.createElement(b,o()({},x,R,{className:u()(c,"is-removable"),element:g?"button":x.element,screenReaderText:h,text:_}),React.createElement(E,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},16:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},169:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),i=r(28),u=["className","size"],s=function(e){var t=e.className,r=e.size,n=a()(e,u);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(s,null);t.a=l},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},19:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},2:function(e,t){!function(){e.exports=this.React}()},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},23:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},236:function(e,t,r){e.exports=r(285)},237:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},285:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(120),c=r(8),a=r.n(c),i=r(1),u=r(96),s=r(0),l=r(5),p=r.n(l),f=(r(3),r(12)),b=(r(237),r(150)),d=r(40),m=r(157),v=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,u=void 0===a||a,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},u&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.Label,{screenReaderLabel:p}))))},g=r(126),_=r(18),O=r(151),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,s=void 0===c?"in":c,l=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(u.b)("attributes",[]),m=a()(d,2),v=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),y({type:x,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(O.a)(v,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(u.b)("min_price"),g=a()(m,2),_=g[0],O=g[1],x=Object(u.b)("max_price"),E=a()(x,2),w=E[0],j=E[1],R=Object(s.useMemo)((function(){return Number.isFinite(_)||Number.isFinite(w)?y({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:v(_,w),removeCallback:function(){O(void 0),j(void 0)},displayStyle:t.displayStyle}):null}),[_,w,t.displayStyle,O,j]),S=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(_)||Number.isFinite(w)||n))return null;var k="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(k,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,S)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){O(void 0),j(void 0),d([])}},React.createElement(f.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(76)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(19).default,o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t){!function(){e.exports=this.wc.priceFormat}()},42:function(e,t){!function(){e.exports=this.wp.blocks}()},46:function(e,t,r){"use strict";var n=r(32),o=r.n(n),c=r(33),a=r.n(c),i=r(23),u=r.n(i),s=r(34),l=r.n(s),p=r(35),f=r.n(p),b=r(25),d=r.n(b),m=r(7),v=r.n(m),y=(r(3),r(2)),g=r(1),_=r(11),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(_.m,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",i)))};r(78);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var x=function(e){l()(r,e);var t=h(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return e=t.call.apply(t,[this].concat(c)),v()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=this.state,u=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(O,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);x.defaultProps={showErrorMessage:!0};t.a=x},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},5:function(e,t,r){var n;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},64:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t,r){var n=r(69);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},69:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},72:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},76:function(e,t,r){"use strict";var n=r(77);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},77:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},78:function(e,t){},8:function(e,t,r){var n=r(85),o=r(86),c=r(68),a=r(87);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},87:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t){!function(){e.exports=this.lodash}()},96:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return m}));var n=r(8),o=r.n(n),c=r(16),a=r(13),i=r(0),u=r(22),s=r.n(u),l=r(49),p=r(108),f=r(61),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],u=c[1],d=Object(l.a)(a),m=Object(l.a)(e),v=Object(p.a)(m),y=Object(i.useRef)(!1);return Object(i.useEffect)((function(){s()(v,m)||(u(Object.assign({},d,m)),y.current=!0)}),[d,m,v,u]),y.current?[a,u]:[e,u]}},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}}});
|
build/active-filters.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '3fd9489240b08c1d5e4a2bed5cb556ad');
|
build/active-filters.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,i,a=t[0],l=t[1],u=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([733,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},104:function(e,t){},130:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var g=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=g},133:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return v}));var r=n(13),c=n.n(r),o=n(40),i=n(23),a=n(0),l=n(37),u=n.n(l),s=n(76),b=n(149),f=n(83),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(s.a)(i),v=Object(s.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){u()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(7);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},167:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),o=n(8),i=n.n(o);n(225);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},181:function(e,t){},184:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(40),c=n(23),o=n(0),i=n(76),a=n(134),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(u),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},22:function(e,t){!function(){e.exports=this.wp.compose}()},225:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},231:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(5),c=Object(r.getSetting)("attributes",[]),o=c.reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},232:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(i,"attribute")))}},239:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=(n(2),n(8)),u=n.n(l),s=n(1),b=n(58),f=n(311),p=(n(181),["text","screenReaderText","element","className","radius","children"]),d=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,f=e.radius,d=void 0===f?"small":f,v=e.children,m=void 0===v?null:v,h=i()(e,p),O=l,g=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),j=Boolean(r&&r!==t);return Object(a.createElement)(O,c()({className:g},h),Object(a.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(a.createElement)("span",{className:"screen-reader-text"},r),m)},v=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,p=void 0!==l&&l,m=e.onRemove,h=void 0===m?function(){}:m,O=e.removeOnAnyClick,g=void 0!==O&&O,j=e.text,y=e.screenReaderText,w=void 0===y?"":y,_=i()(e,v),E=g?"span":"button";if(!n){var k=w&&"string"==typeof w?w:j;n="string"!=typeof k?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),k)}var x={"aria-label":n,disabled:p,onClick:h,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||h()}},S=g?x:{},C=g?{"aria-hidden":!0}:x;return Object(a.createElement)(d,c()({},_,S,{className:u()(o,"is-removable"),element:g?"button":_.element,screenReaderText:w,text:j}),Object(a.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},311:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=n(33),u=["className","size"],s=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,u);return Object(a.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=i()(e,l);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},7:function(e,t){!function(){e.exports=this.React}()},733:function(e,t,n){e.exports=n(774)},734:function(e,t){},74:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),g=n(8),j=n.n(g),y=n(3),w=n(22);n(104);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return l()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,i=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.withInstanceId)(E)},76:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(37),o=n.n(c);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},774:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),o=n(0),i=n(1),a=n(25),l=n(58),u=n(33),s=Object(o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(8),f=n.n(b),p=n(24),d=n(3),v=n(130),m=n(167),h=n(74),O=n(13),g=n.n(O),j=n(133),y=(n(2),n(27)),w=(n(734),n(231)),_=n(59),E=n(239),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},u&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.Label,{screenReaderLabel:f}))))},S=n(184),C=n(29),N=n(232),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=g()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:u})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=g()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=g()(s,2),p=b[0],d=b[1],v=Object(j.b)("max_price"),m=g()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),u([])}},Object(o.createElement)(y.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:P,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,i,a=t[0],l=t[1],u=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([740,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},106:function(e,t){},131:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var g=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=g},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return v}));var r=n(13),c=n.n(r),o=n(40),i=n(22),a=n(0),l=n(37),u=n.n(l),s=n(68),b=n(150),f=n(83),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(s.a)(i),v=Object(s.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){u()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},135:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},167:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),o=n(7),i=n.n(o);n(225);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},181:function(e,t){},184:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(40),c=n(22),o=n(0),i=n(68),a=n(135),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(u),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},22:function(e,t){!function(){e.exports=this.wp.data}()},225:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.compose}()},231:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(4),c=Object(r.getSetting)("attributes",[]),o=c.reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},232:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(i,"attribute")))}},239:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=(n(2),n(7)),u=n.n(l),s=n(1),b=n(60),f=n(307),p=(n(181),["text","screenReaderText","element","className","radius","children"]),d=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,f=e.radius,d=void 0===f?"small":f,v=e.children,m=void 0===v?null:v,h=i()(e,p),O=l,g=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),j=Boolean(r&&r!==t);return Object(a.createElement)(O,c()({className:g},h),Object(a.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(a.createElement)("span",{className:"screen-reader-text"},r),m)},v=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,p=void 0!==l&&l,m=e.onRemove,h=void 0===m?function(){}:m,O=e.removeOnAnyClick,g=void 0!==O&&O,j=e.text,y=e.screenReaderText,w=void 0===y?"":y,_=i()(e,v),E=g?"span":"button";if(!n){var k=w&&"string"==typeof w?w:j;n="string"!=typeof k?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),k)}var x={"aria-label":n,disabled:p,onClick:h,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||h()}},S=g?x:{},C=g?{"aria-hidden":!0}:x;return Object(a.createElement)(d,c()({},_,S,{className:u()(o,"is-removable"),element:g?"button":_.element,screenReaderText:w,text:j}),Object(a.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},307:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=n(33),u=["className","size"],s=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,u);return Object(a.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=i()(e,l);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},61:function(e,t){!function(){e.exports=this.wc.priceFormat}()},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(37),o=n.n(c);function i(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},74:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),g=n(7),j=n.n(g),y=n(3),w=n(23);n(106);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return l()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,i=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.withInstanceId)(E)},740:function(e,t,n){e.exports=n(781)},741:function(e,t){},781:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),o=n(0),i=n(1),a=n(25),l=n(60),u=n(33),s=Object(o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(7),f=n.n(b),p=n(24),d=n(3),v=n(131),m=n(167),h=n(74),O=n(13),g=n.n(O),j=n(134),y=(n(2),n(27)),w=(n(741),n(231)),_=n(61),E=n(239),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},u&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.Label,{screenReaderLabel:f}))))},S=n(184),C=n(29),N=n(232),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=g()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:u})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=g()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=g()(s,2),p=b[0],d=b[1],v=Object(j.b)("max_price"),m=g()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),u([])}},Object(o.createElement)(y.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:P,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},8:function(e,t){!function(){e.exports=this.React}()},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider}});
|
build/all-products-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '94d66f40c3b671133335ff0e45719ca0');
|
build/all-products-frontend.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
!function(e){function t(t){for(var n,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&s.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()()}var n={},r={1:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({2:"atomic-block-components/add-to-cart",3:"atomic-block-components/button",4:"atomic-block-components/category-list",5:"atomic-block-components/image",6:"atomic-block-components/price",7:"atomic-block-components/rating",8:"atomic-block-components/sale-badge",9:"atomic-block-components/sku",10:"atomic-block-components/stock-indicator",11:"atomic-block-components/summary",12:"atomic-block-components/tag-list",13:"atomic-block-components/title",20:"vendors--atomic-block-components/price"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,n[1](u)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),c=n(67),i=n(85);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return v}));var r,o=n(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(n(41),function(){return u>1})},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(9),o=n.n(r),c=n(7),i=n.n(c),a=n(8),u=n(0),s=n(15),l=n(12),f=n(18),p=n(94),d=n(97),b=n(46);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},,function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(23),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(75);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(66),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(90))},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(78),i=n(0),a=n(38);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),s(s({},n),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},function(e,t){!function(){e.exports=this.wp.deprecated}()},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=n(5),u=n(1);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==d[n]?d[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return l(l(l({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},,function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(10)),c=r(n(71)),i=n(2),a=r(i),u=r(n(121)),s=r(n(23)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,R=function(){return Date.now()};function S(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:S,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=R(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=B(r,o,c),i}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new V(this,e,t)},t}(y),H=0,W=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,c=e.to,i=void 0===c?{}:c;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var a=t.delay,u=c(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),M||(M=!0,E(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,S=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,N),D=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||D&&F||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return S=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=A?e.lastVelocity:void 0,e.lastTime=A?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:S,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return F?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var c=new W,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},G=0,K=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Q=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};A((function(e){return new $(e)})),S("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),_e=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=F,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),R=new Set(P),S=new Set(s),C=s.filter((function(e){return!R.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!S.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return R.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var F=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=F.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),F=[].concat(F.slice(0,t),[r],F.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:F,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new W);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=U},function(e,t,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(4),a=n.n(i),u=n(8),s=n(57),l=n.n(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var b=n(69);function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(b.a)(e,t)}var h=n(20),v=n.n(h),g=n(14);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(19),w=n(42),k=n(62),E=n(27),_=n(130),x=n(21);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function C(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var T=n(29);function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var A=Object(c.createContext)({focusHistory:[]}),F=A.Provider,D=A.Consumer;F.displayName="FocusReturnProvider",D.displayName="FocusReturnConsumer";c.Component;function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var I=Object(E.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=M(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(T.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(T.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(D,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var B=Object(E.createHigherOrderComponent)((function(e){return function(t){m(r,t);var n=L(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=["button","submit"];function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var H=Object(E.createHigherOrderComponent)((function(e){return function(t){m(o,t);var n=V(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(q,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=W(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function G(e){e.stopPropagation()}var K=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:G}),n)})),Q=n(48);function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e){var t=Object(c.useContext)(Q.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return $($({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Z(e,t,n){return(Z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var X=n(59),ee=n(22),te=n.n(ee);function ne(e){var t=function(e,t){if("object"!==Object(X.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(X.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(X.a)(t)?t:String(t)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return oe(oe({},r),{},Object(x.a)({},e,oe(oe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(ne));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!te()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return oe(oe({},n),{},Object(x.a)({},e,[].concat(Object(T.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?oe(oe({},n),{},Object(x.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(Q.a.Provider,{value:v},h)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ae=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ue=ae.Provider,se=ae.Consumer;c.Component;function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var fe=function(e){m(n,e);var t=le(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Z(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),pe=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(fe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},de=0;function be(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(ae),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++de),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var me=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(be,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function he(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(Q.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function ve(e){var t,n,r=e.name,o=e.children,i=J(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ge(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(he,n):Object(c.createElement)(pe,n)}function ye(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me,e),Object(c.createElement)(ve,e))}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function we(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(x.a)(o,"is-from-"+l,"center"!==l),Object(x.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ke(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:we(je({type:t},r))})}var Ee=B(I((function(e){return e.children})));function _e(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function xe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Re(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Se=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,x=e.getAnchorRect,P=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,F=e.onFocusOutside,D=e.__unstableSticky,M=e.__unstableSlotName,I=void 0===M?"Popover":M,L=e.__unstableObserveElement,B=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),z=Object(c.useRef)(null),W=Object(c.useRef)(),G=Object(E.useViewportMatch)("medium","<"),Q=Object(c.useState)(),Y=Object(j.a)(Q,2),$=Y[0],Z=Y[1],X=J(I),ee=P&&G,te=Object(E.useResizeObserver)(),ne=Object(j.a)(te,2),re=ne[0],oe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return Re(W.current,"is-without-arrow",p),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis"),xe(W.current,"data-y-axis"),Pe(W.current,"top"),Pe(W.current,"left"),Pe(z.current,"maxHeight"),void Pe(z.current,"maxWidth");var e=function(){if(W.current&&z.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:_e(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:_e(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:_e(p,f)}}(q,O,x,g,y);if(e){var t,n,r=W.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(B)t=null===(n=W.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=C(e,t,s,p,r,o,c),b=S(e,t,f,p,r,d.yAxis,i);return R(R({},b),d)}(e,oe.height?oe:z.current.getBoundingClientRect(),m,D,W.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Pe(W.current,"top",s+"px"),Pe(W.current,"left",l+"px")),Re(W.current,"is-without-arrow",p||"center"===f&&"middle"===b),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis",f),xe(W.current,"data-y-axis",b),Pe(z.current,"maxHeight","number"==typeof h?h+"px":""),Pe(z.current,"maxWidth","number"==typeof v?v+"px":"");Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,O,x,g,y,m,oe,D,L,B]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,z);var ce=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ie=Object(c.createElement)(H,{onFocusOutside:function(e){if(F)F(e);else if(A){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(c.createElement)(ke,{type:N&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(c.createElement)(K,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},V,{onKeyDown:ce,ref:W}),ee&&Object(c.createElement)(U,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Le,{className:"components-popover__close",icon:_.a,onClick:n})),Object(c.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ie=Object(c.createElement)(Ee,null,ie)),X.ref&&(ie=Object(c.createElement)(ye,{name:I},ie)),g||O?ie:Object(c.createElement)("span",{ref:q},ie)};Se.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ge,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ce=Se;var Te=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Ae=function(e){m(n,e);var t=Ne(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Ce,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Te,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),Fe=n(86);function De(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ie=["onMouseDown","onClick"];var Le=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,R=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!R,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){A["aria-disabled"]=!0;var F,D=De(Ie);try{for(D.s();!(F=D.n()).done;){S[F.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,S,{className:C,"aria-label":S["aria-label"]||x,ref:t}),j&&Object(c.createElement)(Fe.a,{icon:j,size:w}),P);return M?Object(c.createElement)(Ae,{text:x,shortcut:_,position:E},I):I}))},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(21),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},function(e,t){!function(){e.exports=this.wp.autop}()},,,function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(36),u=n(1),s=(n(66),n(80));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(90))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(22),s=n.n(u),l=n(54),f=n(107),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(5),o=n(76),c=n(70),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(23),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(64);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return D}));var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(56),l=n(46),f=n(10),p=n.n(f),d=n(4),b=n.n(d),m=n(168),h=(n(120),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(19),E=n(8),_=n(79),x=n(27),P=n(91);var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=w(O.a.mark((function e(t){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:i});n=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},S=n(11),C=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=Object(S.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:o}),i=b()(t,"wc-block-components-notices__snackbar");return React.createElement(R,{notices:c,className:i,onRemove:r})};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),F=function(){return Object(a.useContext)(A)},D=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,N(N({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,N(N({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),R=y?null:React.createElement(C,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(A.Provider,{value:x},c&&P,t,R)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(54),a=n(96),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(16),i=n.n(c),a=n(0),u=["srcElement","size"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},c)):null}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(15),c=n(12),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,function(e,t,n){"use strict";n(3);var r=n(4),o=n.n(r),c=n(11),i=n(112);n(167);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-components-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.Label,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:r,onChange:a,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(13);n.p=c.j,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,317))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,316))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,294))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,315))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(1),u=n(36),s=n(130),l=n(80);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,,,,,,,,function(e,t,n){e.exports=n(276)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(123),c=n(119),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(9)),g=n.n(v),y=n(0),O=n(16),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(8),x=n(4),P=n.n(x),R=n(11),S=(n(226),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(R.Label,{screenReaderLabel:Object(E.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.Label,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(R.Label,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(R.Label,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.Label,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.Label,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=n(107),N=n(95),A=n(125),F=n(15),D=n(12),M=n(54);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(M.a)(a),s=Object(M.a)(c),l=Object(D.useSelect)((function(t){var o=t(F.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(56),q=n(115),z=n(81),H=n(36),W=n(139),U=n(28),G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(W.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(225),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(112),X=n(10),ee=n.n(X),te=n(157),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))})),re=(n(224),["order","orderby","page","per_page"]);function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ie=function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(_.isEqual)(t,o)&&Number.isFinite(n)},ae=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return ce(ce({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:c*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,re)||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),R=x[0],S=x[1],A=Object(N.b)("min_price"),F=g()(A,2),D=F[0],M=F[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],W=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ie);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(H.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(H.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,oe=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ae=p.length?p:Array.from({length:te}),ue=0!==p.length||b,se=R.length>0||Number.isFinite(D)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ue&&React.createElement(J,{onChange:o,value:c}),!ue&&se&&React.createElement(Y,{resetCallback:function(){S([]),M(null),W(null)}}),!ue&&!se&&React.createElement(K,null),ue&&React.createElement("ul",{className:"".concat(h,"__products")},ae.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(ne,{key:e.id||n,attributes:t,product:e})}))),oe>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:oe}))})),ue=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ae,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},se=n(13),le=React.createElement("img",{src:se.i+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),fe=n(5);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var de=function(e){f()(n,e);var t=pe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return le;var r=Object(fe.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ue,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(de,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
|
1 |
+
!function(e){function t(t){for(var n,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&s.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()()}var n={},r={1:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({2:"atomic-block-components/add-to-cart",3:"atomic-block-components/button",4:"atomic-block-components/category-list",5:"atomic-block-components/image",6:"atomic-block-components/price",7:"atomic-block-components/rating",8:"atomic-block-components/sale-badge",9:"atomic-block-components/sku",10:"atomic-block-components/stock-indicator",11:"atomic-block-components/summary",12:"atomic-block-components/tag-list",13:"atomic-block-components/title",20:"vendors--atomic-block-components/price"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,n[1](u)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=224)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(76)()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){var r;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(85),o=n(86),c=n(68),i=n(87);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"o",(function(){return c})),n.d(t,"m",(function(){return i})),n.d(t,"n",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return p})),n.d(t,"l",(function(){return d})),n.d(t,"k",(function(){return b})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"h",(function(){return v})),n.d(t,"a",(function(){return g})),n.d(t,"i",(function(){return y})),n.d(t,"b",(function(){return O})),n.d(t,"p",(function(){return j}));var r,o=n(4),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),y=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{}),j=(n(42),function(){return u>1})},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){var r=n(72);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(8),o=n.n(r),c=n(7),i=n.n(c),a=n(9),u=n(0),s=n(16),l=n(13),f=n(18),p=n(95),d=n(98),b=n(48);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.deprecated}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(23),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(11),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.m,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(78);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(13),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(66),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(91))},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(80),i=n(0),a=n(39);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t){!function(){e.exports=this.wp.warning}()},,function(e,t,n){var r=n(69);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return u}));var r=n(19),o=n.n(r),c=function(e){return"number"==typeof e},i=function(e){return"string"==typeof e},a=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function u(e,t){return a(e)&&t in e}},,,function(e,t,n){"use strict";var r=n(77);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(8),i=n.n(c),a=n(4),u=n(1),s=n(73);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},b=Object.entries(p).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,d(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==b[n]?b[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return f(f(f({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(10)),c=r(n(72)),i=n(2),a=r(i),u=r(n(122)),s=r(n(23)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,S=function(){return Date.now()};function R(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return S},injectNow:function(e){S=e},get defaultElement(){return P},injectDefaultElement:R,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=S(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=B(r,o,c),i}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new V(this,e,t)},t}(y),H=0,W=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,c=e.to,i=void 0===c?{}:c;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var a=t.delay,u=c(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),M||(M=!0,E(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,R=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,N),D=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||D&&F||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return R=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=A?e.lastVelocity:void 0,e.lastTime=A?e.lastTime:void 0,e.startTime=S(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:R,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return F?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var c=new W,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},G=0,K=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Q=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};A((function(e){return new $(e)})),R("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),_e=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=F,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),S=new Set(P),R=new Set(s),C=s.filter((function(e){return!S.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!R.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return S.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var F=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=F.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),F=[].concat(F.slice(0,t),[r],F.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:F,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new W);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=U},function(e,t,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(5),a=n.n(i),u=n(9),s=n(41),l=n.n(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var b=n(70);function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(b.a)(e,t)}var h=n(19),v=n.n(h),g=n(14);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(20),w=n(43),k=n(62),E=n(27),_=n(131),x=n(21);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function C(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var T=n(29);function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var A=Object(c.createContext)({focusHistory:[]}),F=A.Provider,D=A.Consumer;F.displayName="FocusReturnProvider",D.displayName="FocusReturnConsumer";c.Component;function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var I=Object(E.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=M(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(T.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(T.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(D,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var B=Object(E.createHigherOrderComponent)((function(e){return function(t){m(r,t);var n=L(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=["button","submit"];function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var H=Object(E.createHigherOrderComponent)((function(e){return function(t){m(o,t);var n=V(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(q,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=W(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function G(e){e.stopPropagation()}var K=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:G}),n)})),Q=n(50);function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e){var t=Object(c.useContext)(Q.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return $($({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Z(e,t,n){return(Z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var X=n(59),ee=n(22),te=n.n(ee);function ne(e){var t=function(e,t){if("object"!==Object(X.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(X.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(X.a)(t)?t:String(t)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return oe(oe({},r),{},Object(x.a)({},e,oe(oe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(ne));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!te()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return oe(oe({},n),{},Object(x.a)({},e,[].concat(Object(T.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?oe(oe({},n),{},Object(x.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(Q.a.Provider,{value:v},h)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ae=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ue=ae.Provider,se=ae.Consumer;c.Component;function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var fe=function(e){m(n,e);var t=le(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Z(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),pe=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(fe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},de=0;function be(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(ae),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++de),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var me=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(be,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function he(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(Q.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function ve(e){var t,n,r=e.name,o=e.children,i=J(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ge(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(he,n):Object(c.createElement)(pe,n)}function ye(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me,e),Object(c.createElement)(ve,e))}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function we(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(x.a)(o,"is-from-"+l,"center"!==l),Object(x.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ke(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:we(je({type:t},r))})}var Ee=B(I((function(e){return e.children})));function _e(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function xe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Se(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Re=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,x=e.getAnchorRect,P=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,F=e.onFocusOutside,D=e.__unstableSticky,M=e.__unstableSlotName,I=void 0===M?"Popover":M,L=e.__unstableObserveElement,B=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),z=Object(c.useRef)(null),W=Object(c.useRef)(),G=Object(E.useViewportMatch)("medium","<"),Q=Object(c.useState)(),Y=Object(j.a)(Q,2),$=Y[0],Z=Y[1],X=J(I),ee=P&&G,te=Object(E.useResizeObserver)(),ne=Object(j.a)(te,2),re=ne[0],oe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return Se(W.current,"is-without-arrow",p),Se(W.current,"is-alternate",d),xe(W.current,"data-x-axis"),xe(W.current,"data-y-axis"),Pe(W.current,"top"),Pe(W.current,"left"),Pe(z.current,"maxHeight"),void Pe(z.current,"maxWidth");var e=function(){if(W.current&&z.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:_e(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:_e(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:_e(p,f)}}(q,O,x,g,y);if(e){var t,n,r=W.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(B)t=null===(n=W.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=C(e,t,s,p,r,o,c),b=R(e,t,f,p,r,d.yAxis,i);return S(S({},b),d)}(e,oe.height?oe:z.current.getBoundingClientRect(),m,D,W.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Pe(W.current,"top",s+"px"),Pe(W.current,"left",l+"px")),Se(W.current,"is-without-arrow",p||"center"===f&&"middle"===b),Se(W.current,"is-alternate",d),xe(W.current,"data-x-axis",f),xe(W.current,"data-y-axis",b),Pe(z.current,"maxHeight","number"==typeof h?h+"px":""),Pe(z.current,"maxWidth","number"==typeof v?v+"px":"");Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,O,x,g,y,m,oe,D,L,B]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,z);var ce=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ie=Object(c.createElement)(H,{onFocusOutside:function(e){if(F)F(e);else if(A){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(c.createElement)(ke,{type:N&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(c.createElement)(K,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},V,{onKeyDown:ce,ref:W}),ee&&Object(c.createElement)(U,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Le,{className:"components-popover__close",icon:_.a,onClick:n})),Object(c.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ie=Object(c.createElement)(Ee,null,ie)),X.ref&&(ie=Object(c.createElement)(ye,{name:I},ie)),g||O?ie:Object(c.createElement)("span",{ref:q},ie)};Re.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ge,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ce=Re;var Te=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Ae=function(e){m(n,e);var t=Ne(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Ce,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Te,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),Fe=n(88);function De(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ie=["onMouseDown","onClick"];var Le=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,S=e.__experimentalIsFocusable,R=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!S,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&S){A["aria-disabled"]=!0;var F,D=De(Ie);try{for(D.s();!(F=D.n()).done;){R[F.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,R,{className:C,"aria-label":R["aria-label"]||x,ref:t}),j&&Object(c.createElement)(Fe.a,{icon:j,size:w}),P);return M?Object(c.createElement)(Ae,{text:x,shortcut:_,position:E},I):I}))},function(e,t){!function(){e.exports=this.wc.wcBlocksSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(21),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},function(e,t){!function(){e.exports=this.wp.autop}()},,function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(9),c=n(5),i=n.n(c),a=n(36),u=n(1),s=(n(66),n(82));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(91))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(8),o=n.n(r),c=n(16),i=n(13),a=n(0),u=n(22),s=n.n(u),l=n(49),f=n(108),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(4),o=n(79),c=n(71),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(9);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(23),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(46);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(64);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return D}));var r=n(7),o=n.n(r),c=n(8),i=n.n(c),a=(n(3),n(0)),u=n(13),s=n(57),l=n(48),f=n(10),p=n.n(f),d=n(5),b=n.n(d),m=n(167),h=(n(121),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(20),E=n(9),_=n(81),x=n(27),P=n(92);var S=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=w(O.a.mark((function e(t){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:i});n=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},R=n(12),C=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=Object(R.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:o}),i=b()(t,"wc-block-components-notices__snackbar");return React.createElement(S,{notices:c,className:i,onRemove:r})};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),F=function(){return Object(a.useContext)(A)},D=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,N(N({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,N(N({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),S=y?null:React.createElement(C,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(A.Provider,{value:x},c&&P,t,S)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(16),o=n(13),c=n(0),i=n(49),a=n(97),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(15),i=n.n(c),a=n(0),u=["srcElement","size"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},c)):null}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(16),c=n(13),i=n(11);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.o.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,function(e,t,n){"use strict";n(3);var r=n(5),o=n.n(r),c=n(12),i=n(113);n(166);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-components-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.Label,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:r,onChange:a,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(9),c=n(5),i=n.n(c),a=n(1),u=n(36),s=n(131),l=n(82);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(11);n.p=c.n,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,318))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,317))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,295))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,315))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,316))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,function(e,t){!function(){e.exports=this.wc.wcBlocksSharedHocs}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,,,,,,,,function(e,t,n){e.exports=n(277)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(124),c=n(120),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(8)),g=n.n(v),y=n(0),O=n(15),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(9),x=n(5),P=n.n(x),S=n(12),R=(n(227),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(S.Label,{screenReaderLabel:Object(E.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(S.Label,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(S.Label,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(S.Label,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(S.Label,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(S.Label,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});R.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=R,T=n(108),N=n(96),A=n(126),F=n(16),D=n(13),M=n(49);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(M.a)(a),s=Object(M.a)(c),l=Object(D.useSelect)((function(t){var o=t(F.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(57),q=n(116),z=n(83),H=n(36),W=n(139),U=n(28),G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(W.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(226),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(113),X=n(10),ee=n.n(X),te=n(195),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))})),re=(n(225),["order","orderby","page","per_page"]);function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ie=function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(_.isEqual)(t,o)&&Number.isFinite(n)},ae=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return ce(ce({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:c*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,re)||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),S=x[0],R=x[1],A=Object(N.b)("min_price"),F=g()(A,2),D=F[0],M=F[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],W=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ie);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(H.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(H.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,oe=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ae=p.length?p:Array.from({length:te}),ue=0!==p.length||b,se=S.length>0||Number.isFinite(D)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ue&&React.createElement(J,{onChange:o,value:c}),!ue&&se&&React.createElement(Y,{resetCallback:function(){R([]),M(null),W(null)}}),!ue&&!se&&React.createElement(K,null),ue&&React.createElement("ul",{className:"".concat(h,"__products")},ae.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(ne,{key:e.id||n,attributes:t,product:e})}))),oe>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:oe}))})),ue=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ae,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},se=n(11),le=React.createElement("img",{src:se.m+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),fe=n(4);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var de=function(e){f()(n,e);var t=pe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return le;var r=Object(fe.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ue,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(de,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
|
build/all-products.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-
|
1 |
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'bb1c5614e1e0f635e035b1095e60ecc3');
|
build/all-products.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([713,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},102:function(e,t){},103:function(e,t){!function(){e.exports=this.wp.coreData}()},104:function(e,t){},108:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=r(44),u=r(3),l=r(8),b=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},113:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(58),a=r(148),i=r(5),s=r(24),u=r(43);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},120:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(5),s=r(1);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(b).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,p(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==d[r]?d[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},121:function(e,t){!function(){e.exports=this.wp.wordcount}()},122:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),d=r(37),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},123:function(e,t,r){"use strict";var n=r(32),c=r.n(n),o=r(4),a=r.n(o),i=r(11),s=r.n(i),u=r(0),l=r(1),b=r(6),p=(r(2),r(44)),d=r(22),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(9),k=r.n(w);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var E=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),n}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(255),C=r(31),S=r.n(C),N=r(12),x=r.n(N),D=r(10),B=r.n(D),R=r(37),A=r.n(R),L=r(39),T=r(41);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var F=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=I(n);function n(){var e;m()(this,n);for(var t=arguments.length,c=new Array(t),o=0;o<t;o++)c[o]=arguments[o];return e=r.call.apply(r,[this].concat(c)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(L.g)(o).then((function(t){var r=t.map((function(e){return z(z({},e),{},{parent:o})}));e.setState({variations:z(z({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=S()(B.a.mark((function t(r){var n;return B.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(T.a)(r);case 2:n=t.sent,e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),n}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),M=r(46),H=r(8),q=r.n(H),G=r(108);r(178);function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},K=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,v=e.variationsLoading,h=function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=q()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:q()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||v,countLabel:t.variations.length>0?Object(l.sprintf)(Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:U(U({},e),{},{item:U(U({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))};if(r)return Object(u.createElement)(M.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?h:null),onSearch:d,messages:W,isHierarchical:!0})};K.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(P.a)(F(Object(d.withInstanceId)(K))))},125:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},128:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(27),i=r(172);r(180);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,s=e.onChange,u=e.options,l=e.screenReaderLabel,b=e.readOnly,p=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.Label,{label:i,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:c,onChange:s,readOnly:b,value:p},u.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},129:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=r(1),i=r(54),s=r(8),u=r.n(s),l=(r(2),r(136)),b=(r(207),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var E=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return E?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},130:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(e){var t=e.level,r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},131:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},133:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(40),a=r(23),i=r(0),s=r(37),u=r.n(s),l=r(76),b=r(149),p=r(83),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return g})),r.d(t,"e",(function(){return j})),r.d(t,"p",(function(){return h})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return w})),r.d(t,"o",(function(){return k}));var n,c=r(5),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=r(25),h=function(e,t){if(s>2)return Object(v.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(v.registerBlockType)(e,t)},w=function(){return s>2},k=function(){return s>1}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},148:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},159:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.k+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},160:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=(r(2),r(29)),u=r(8),l=r.n(u),b=(r(206),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:m,href:d},f),Object(s.decodeEntities)(u))}},161:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return E}));var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(23)),u=r(85),l=r(78),b=r(11),p=r.n(b),d=r(8),f=r.n(d),m=r(806),O=(r(208),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(810),v=r(27),h=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=Object(v.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:c}),a=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:o,className:a,onRemove:n})};function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var k=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),_=function(){return Object(i.useContext)(k)},E=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),v=j[0],y=j[1],_=Object(u.a)().dispatchStoreEvent,E=Object(l.b)().isEditor,P=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,w(w({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P("default",e,w(w({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:y},x=v?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:E}),D=v?null:Object(i.createElement)(h,{notices:N.notices,removeNotice:N.removeNotice,isEditor:E});return Object(i.createElement)(k.Provider,{value:N},o&&x,t,D)}},162:function(e,t,r){"use strict";var n=r(0),c=r(121),o=r(94),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},166:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(4),j=r.n(g),v=r(0),h=r(7);r(224);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=y(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},170:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(5),c=r(120),o=r(21),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},173:function(e,t){},178:function(e,t){},180:function(e,t){},183:function(e,t){!function(){e.exports=this.wp.warning}()},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(40),c=r(23),o=r(0),a=r(76),i=r(134),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.url}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},224:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},255:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(31),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(10),y=r.n(h),w=r(6),k=r(22),_=(r(2),r(14)),E=r(39),P=r(41);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.h)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.m.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},256:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(27),l=r(43),b=r(71);r(487);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.Label,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(122)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t){!function(){e.exports=this.moment}()},309:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},33:function(e,t){!function(){e.exports=this.wp.primitives}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},343:function(e,t){},344:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(14);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.o)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},345:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},346:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(8),p=r.n(b),d=r(5),f=r(43),m=r(71),O=r(85),g=r(256);r(488);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),k=s()(w,2),_=k[0],E=k[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(131),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(76),l=r(795),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",k="set_after_processing",_="set_processing_response",E="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=k,L=_,T=E,V=P,z=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:L,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?T:V;return{type:t}},K=function(e){return{type:z,quantity:e}},Y=function(e){return{type:I,data:e}},$=r(4),J=r.n($);function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=k,ae=_,ie=E,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(131),ve=r(347),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(351),Ee=r(122),Pe=r(63),Ce=r(57),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],k=Object(u.a)(y),_=Object(Pe.a)(),E=_.addErrorNotice,P=_.removeNotices,C=Object(Ee.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(k,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&E(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,E,P,j,k]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,E(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(k,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");E(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(k,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,E,x,D,N,k]);var A=Object(l.b)(r),L={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:L},t)},De=r(19),Be=r.n(De),Re=r(29),Ae=r(52);function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Te=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(Ee.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,k=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},Ve=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ee.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Te,null)))},ze=r(43),Ie=r(6),Fe=r(71),Me=(r(343),r(27)),He=r(58),qe=r(497),Ge=r(85),Qe=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(ze.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(496),r(32)),Ze=r.n(Xe),et=r(3),tt=r(7),rt=r(258),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ee.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(J()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},st=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=at(at({},r),{},J()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},J()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(ze.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Ve,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},350:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(43),u=r(24),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.o)()?{color:t,fontSize:r}:{}},p=r(71),d=r(160),f=r(85);r(486),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,k=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(k,"__product-title"),k),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.o)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){E("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(k,"__product-title"),k),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),c()(n,N,Object(l.o)()),n)),style:b({color:h,fontSize:w})})}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),i=r(10),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(4),c=r.n(n),o=r(21),a=r(19),i=r.n(a),s=r(6),u=r(5),l=r(14);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.m.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(31),c=r.n(n),o=r(10),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},449:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(129),u=r(59),l=r(43),b=r(24),p=r(14),d=r(71);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,_=e.saleColor,E=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||E,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),L={color:k,fontSize:v},T={color:E,fontSize:y},V=C.prices,z=Object(u.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.o)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.o)()),a)),M=I?T:L;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:V.price,priceClassName:F,priceStyle:Object(p.o)()?M:{},minPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==V||null===(f=V.price_range)||void 0===f?void 0:f.max_amount,regularPrice:V.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.o)()),m)),regularPriceStyle:Object(p.o)()?L:{}})}))},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},450:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(43),l=r(71),b=(r(489),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},451:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(0),s=(r(2),r(8)),u=r.n(s),l=r(1),b=r(85),p=r(716),d=r(29),f=r(43),m=r(71),O=(r(490),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),k=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",E={};return y?E.onClick=function(){v(),m("cart-add-item",{product:t})}:(E.href=n,E.rel="nofollow",E.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},453:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(162),u=r(14),l=r(43),b=r(71);r(491);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.m.wordCountType||"words"}):null}))},454:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(71);r(492);t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},455:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(493);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},456:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(494);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},457:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(71),b=(r(495),function(e){return Object(a.sprintf)(Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)}),p=function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")};t.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var i=!!a.is_in_stock,l=a.low_stock_remaining,d=a.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",i),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!i),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!l),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},l?b(l):p(i,d))}))},46:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},486:function(e,t){},487:function(e,t){},488:function(e,t){},489:function(e,t){},490:function(e,t){},491:function(e,t){},492:function(e,t){},493:function(e,t){},494:function(e,t){},495:function(e,t){},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(4),a=r.n(o),i=r(6),s=r(0),u=r(40),l=r(23),b=r(29),p=r(147),d=r(170),f=r(78);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},54:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(0),l=r(165),b=r(8),p=r.n(b),d=(r(173),["className","value","currency","onValueChange","displayType"]);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},j,{value:O,onValueChange:v}))}},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},58:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t){!function(){e.exports=this.wp.deprecated}()},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(161);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},685:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},692:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},7:function(e,t){!function(){e.exports=this.React}()},700:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},701:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:c.k+"img/pennant.jpg",thumbnail:c.k+"img/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},706:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},71:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},713:function(e,t,r){e.exports=r(765)},714:function(e,t){},715:function(e,t){},716:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(23),i=r(40),s=r(29),u=r(52),l=r(63),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},718:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},719:function(e,t){},72:function(e,t){!function(){e.exports=this.wp.dom}()},720:function(e,t){},721:function(e,t){},722:function(e,t){},73:function(e,t){!function(){e.exports=this.ReactDOM}()},74:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(8),h=r.n(v),y=r(3),w=r(22);r(104);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(g.Component);t.a=Object(w.withInstanceId)(_)},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},765:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Qr}));var n=r(4),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(24),l=r(25),b=r(58),p=r(33),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(14),m=r(8),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.n)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(344),h=r(3),y=r(22),w=r(130),k=r(350),_=r(13),E=r.n(_),P=r(123),C=r(20),S=r.n(C),N=(r(715),["className"]);var x=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,N),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},D=r(43),B=(r(714),function(e){return function(t){return function(r){var n=Object(D.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=E()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),R=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),A=Object(s.__)("Product Title","woo-gutenberg-products-block"),L=Object(i.createElement)(b.a,{srcElement:R}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),V=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.productLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.o)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},z=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),B({icon:L,label:A,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(V):V;function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M={title:A,description:T,icon:{src:L,foreground:"#874FB9"},attributes:v.a,edit:z};Object(l.registerBlockType)("woocommerce/product-title",F(F({},j),M));var H=r(449),q=r(309),G=Object(s.__)("Product Price","woo-gutenberg-products-block"),Q=Object(i.createElement)(b.a,{srcElement:q.a}),U=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),W=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},K=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.o)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(H.default,p))},Y=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),B({icon:Q,label:G,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(K):K;function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var X={productId:{type:"number",default:0}};function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.o)()&&(X=J(J({},X),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var te={title:G,description:U,icon:{src:Q,foreground:"#874FB9"},attributes:X,edit:Y};Object(l.registerBlockType)("woocommerce/product-price",ee(ee({},j),te));var re=r(345),ne=r(136),ce=r(74),oe=r(5),ae=r(346),ie=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),se=Object(s.__)("Product Image","woo-gutenberg-products-block"),ue=Object(i.createElement)(b.a,{srcElement:ie}),le=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),be=B({icon:ue,label:se,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=t.productLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(ce.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(ce.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(ne.a)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(oe.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ae.a,t)))}));function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fe={title:se,description:le,icon:{src:ue,foreground:"#874FB9"},attributes:re.a,edit:be};Object(l.registerBlockType)("woocommerce/product-image",de(de({},j),fe));var me={productId:{type:"number",default:0}},Oe=r(450),ge=r(700),je=Object(s.__)("Product Rating","woo-gutenberg-products-block"),ve=Object(i.createElement)(b.a,{srcElement:ge.a});function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we={title:je,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:ve,foreground:"#874FB9"},attributes:me,edit:B({icon:ve,label:je,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Oe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",ye(ye({},j),we));var ke={productId:{type:"number",default:0}},_e=r(451),Ee=r(718),Pe=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Ce=Object(i.createElement)(b.a,{srcElement:Ee.a});function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xe={title:Pe,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:Ce,foreground:"#874FB9"},attributes:ke,edit:B({icon:Ce,label:Pe,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(_e.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Ne(Ne({},j),xe));var De={productId:{type:"number",default:0}},Be=r(453),Re=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),Ae=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Le=Object(i.createElement)(b.a,{srcElement:Re});function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ze={title:Ae,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Le,foreground:"#874FB9"},attributes:De,edit:B({icon:Le,label:Ae,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Be.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Ve(Ve({},j),ze));var Ie={productId:{type:"number",default:0}},Fe=r(256),Me=r(692),He=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),qe=Object(i.createElement)(b.a,{srcElement:Me.a});function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ue={title:He,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:qe,foreground:"#874FB9"},supports:{html:!1},attributes:Ie,edit:B({icon:qe,label:He,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Fe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Qe(Qe({},j),Ue));var We={productId:{type:"number",default:0}},Ke=r(113),Ye=r(454),$e=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Je=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e});function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt={title:Je,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Xe,foreground:"#874FB9"},attributes:We,edit:B({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(Ye.default,t))}))};Object(f.p)("woocommerce/product-sku",et(et({},j),tt));var rt={productId:{type:"number",default:0}},nt=r(455),ct=r(685),ot=Object(s.__)("Product Category List","woo-gutenberg-products-block"),at=Object(i.createElement)(b.a,{srcElement:ct.a});function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function st(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut={title:ot,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:at,foreground:"#874FB9"},attributes:rt,edit:B({icon:at,label:ot,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(nt.default,t)))}))};Object(f.p)("woocommerce/product-category-list",st(st({},j),ut));var lt={productId:{type:"number",default:0}},bt=r(456),pt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),dt=Object(i.createElement)(b.a,{srcElement:Me.a});function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ot={title:pt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:dt,foreground:"#874FB9"},attributes:lt,edit:B({icon:dt,label:pt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(bt.default,t)))}))};Object(f.p)("woocommerce/product-tag-list",mt(mt({},j),Ot));var gt={productId:{type:"number",default:0}},jt=r(457),vt=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),ht=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),yt=Object(i.createElement)(b.a,{srcElement:vt});function wt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _t={title:ht,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:yt,foreground:"#874FB9"},attributes:gt,edit:B({icon:yt,label:ht,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(jt.default,t))}))};Object(f.p)("woocommerce/product-stock-indicator",kt(kt({},j),_t));var Et=r(795),Pt=(r(343),r(349)),Ct=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),St=Object(i.createElement)(b.a,{srcElement:Ee.a});function Nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dt={title:Ct,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:St,foreground:"#874FB9"},edit:B({icon:St,label:Ct,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(D.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Ke.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(Et.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pt.a,t)))})),attributes:r(348).a};Object(f.p)("woocommerce/product-add-to-cart",xt(xt({},j),Dt));var Bt=r(15),Rt=r.n(Bt),At=r(12),Lt=r.n(At),Tt=r(17),Vt=r.n(Tt),zt=r(18),It=r.n(zt),Ft=r(9),Mt=r.n(Ft),Ht=r(23),qt=(r(2),r(82)),Gt=r(791),Qt=r(701),Ut=r(148),Wt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},Kt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:oe.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Ut.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Yt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function $t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$t(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Zt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Jt(Jt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function er(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?er(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:tr(tr({},r),{},{orderBy:!r.orderBy})})}})},nr=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},cr=r(16),or=r.n(cr),ar=r(7),ir=r(6),sr=r(27),ur=(r(722),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=u.minIndex,b=u.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(sr.Label,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(sr.Label,{label:"<",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return o(1)},disabled:1===t},Object(i.createElement)(sr.Label,{label:1,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(sr.Label,{label:e,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:function(){return o(a)},disabled:t===a},Object(i.createElement)(sr.Label,{label:a,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t+1)},title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(sr.Label,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});ur.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var lr=ur,br=r(149),pr=r(133),dr=r(184),fr=r(40),mr=r(76);function Or(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Or(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(dr.a)(gr(gr({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var s=Object(mr.a)(i),u=Object(mr.a)(o),l=Object(Ht.useSelect)((function(t){var c=t(fr.COLLECTIONS_STORE_KEY),o=[e,r,n,s,u];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",gr(gr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},vr=r(85),hr=r(166),yr=r(80),wr=r(125),kr=function(){var e=Object(D.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:wr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},_r=r(706),Er=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(D.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:_r.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Pr=r(128),Cr=(r(721),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Pr.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:r,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:c})}),Sr=r(172),Nr=Object(Sr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(D.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"wc-block-layout",{"is-loading":l});return Object(i.createElement)("li",{className:b,"aria-hidden":l},function e(t,r,n,c){if(n){var o=Object(Gt.a)(t);return n.map((function(n,s){var u=E()(n,2),l=u[0],b=u[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))})),xr=(r(720),["order","orderby","page","per_page"]);function Dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ir.isEqual)(t,c)&&Number.isFinite(r)},Ar=Object(hr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(pr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return Br(Br({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:o*a,page:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=E()(b,1)[0],d=jr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(D.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,xr)||{}}(p),w=Object(vr.a)().dispatchStoreEvent,k=Object(pr.b)("attributes",[]),_=E()(k,2),P=_[0],C=_[1],N=Object(pr.b)("min_price"),x=E()(N,2),B=x[0],R=x[1],A=Object(pr.b)("max_price"),L=E()(A,2),T=L[0],V=L[1],z=Object(br.a)({totalQuery:y,totalProducts:m},Rr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)||(n(1),null!=z&&z.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(yr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(yr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==z?void 0:z.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(T);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Cr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(Er,{resetCallback:function(){C([]),R(null),V(null)}}),!K&&!Y&&Object(i.createElement)(kr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(Nr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(lr,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Lr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=E()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=E()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Ar,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Tr=r(159);function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var zr=function(e){Vt()(r,e);var t=Vr(r);function r(){return Rt()(this,r),t.apply(this,arguments)}return or()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;if(t.isPreview)return Tr.a;var n=Object(oe.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Lr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(ar.Component);r(719);function Ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var Fr=function(e){Vt()(r,e);var t=Ir(r);function r(){var e;Rt()(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),c()(Lt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Lt()(e),"blockMap",Object(Gt.a)("woocommerce/all-products")),c()(Lt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Lt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Lt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Lt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(Lt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(qt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(oe.getSetting)("min_columns",1),maxColumns:Object(oe.getSetting)("max_columns",6),minRows:Object(oe.getSetting)("min_rows",1),maxRows:Object(oe.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},rr(r,n),nr(r,n)))})),c()(Lt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Lt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(D.ProductDataContextProvider,{product:Qt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Zt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Xt.map((function(e){var t=E()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(Lt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(zr,{attributes:t})):Yt(c,o)})),c()(Lt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===f.m.productCount?Kt(n,c):Object(i.createElement)("div",{className:Wt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Mr=Object(y.compose)(h.withSpokenMessages,Object(Ht.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Ht.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Fr),Hr={columns:Object(oe.getSetting)("default_columns",3),rows:Object(oe.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Xt,isPreview:!1};function qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Hr,edit:function(e){return Object(i.createElement)(Mr,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Gr(Gr({},Qr),{},{deprecated:[{attributes:Object.assign({},Qr.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},77:function(e,t){!function(){e.exports=this.wp.viewport}()},78:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(23),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},791:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(14);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,449))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,812))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,813))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,450))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,451))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,453))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,256))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,454))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,455))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,456))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,457))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,814))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},80:function(e,t){!function(){e.exports=this.wp.a11y}()},82:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},83:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},84:function(e,t){!function(){e.exports=this.wp.date}()},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),c=r.n(n),o=r(51),a=r(0),i=r(52);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)();return{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},94:function(e,t){!function(){e.exports=this.wp.autop}()}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([720,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},104:function(e,t){},105:function(e,t){!function(){e.exports=this.wp.coreData}()},106:function(e,t){},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},110:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=r(44),u=r(3),l=r(7),b=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},115:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(60),a=r(149),i=r(4),s=r(24),u=r(43);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},121:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(13),a=r.n(o),i=r(4),s=r(1),u=r(107);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(i.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},f=Object.entries(p).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return b(b(b({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},122:function(e,t){!function(){e.exports=this.wp.wordcount}()},123:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(42),c=r.n(n),o=r(5),a=r.n(o),i=r(20),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),d=r(37),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},124:function(e,t,r){"use strict";var n=r(32),c=r.n(n),o=r(5),a=r.n(o),i=r(11),s=r.n(i),u=r(0),l=r(1),b=r(6),p=(r(2),r(44)),d=r(23),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(9),k=r.n(w);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var E=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),n}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(254),C=r(31),S=r.n(C),N=r(12),x=r.n(N),D=r(10),B=r.n(D),R=r(37),A=r.n(R),L=r(39),T=r(41);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var F=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=I(n);function n(){var e;m()(this,n);for(var t=arguments.length,c=new Array(t),o=0;o<t;o++)c[o]=arguments[o];return e=r.call.apply(r,[this].concat(c)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(L.g)(o).then((function(t){var r=t.map((function(e){return z(z({},e),{},{parent:o})}));e.setState({variations:z(z({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=S()(B.a.mark((function t(r){var n;return B.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(T.a)(r);case 2:n=t.sent,e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),n}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),M=r(46),H=r(7),q=r.n(H),G=r(110);r(178);function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},K=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,v=e.variationsLoading,h=function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=q()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:q()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||v,countLabel:t.variations.length>0?Object(l.sprintf)(Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:U(U({},e),{},{item:U(U({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))};if(r)return Object(u.createElement)(M.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?h:null),onSearch:d,messages:W,isHierarchical:!0})};K.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(P.a)(F(Object(d.withInstanceId)(K))))},126:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},129:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(27),i=r(172);r(180);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,s=e.onChange,u=e.options,l=e.screenReaderLabel,b=e.readOnly,p=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.Label,{label:i,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:c,onChange:s,readOnly:b,value:p},u.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},130:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(56),s=r(7),u=r.n(s),l=(r(2),r(137)),b=(r(207),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var E=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return E?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},131:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(e){var t=e.level,r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},132:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(6);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(40),a=r(22),i=r(0),s=r(37),u=r.n(s),l=r(68),b=r(150),p=r(83),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},135:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t,r){"use strict";r.d(t,"q",(function(){return o})),r.d(t,"o",(function(){return a})),r.d(t,"p",(function(){return i})),r.d(t,"l",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return b})),r.d(t,"i",(function(){return p})),r.d(t,"h",(function(){return d})),r.d(t,"n",(function(){return f})),r.d(t,"m",(function(){return m})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return j})),r.d(t,"j",(function(){return v})),r.d(t,"a",(function(){return h})),r.d(t,"k",(function(){return y})),r.d(t,"b",(function(){return w})),r.d(t,"t",(function(){return _})),r.d(t,"u",(function(){return E})),r.d(t,"r",(function(){return P})),r.d(t,"s",(function(){return C}));var n,c=r(4),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=Object(c.getSetting)("shippingCountries",{}),h=Object(c.getSetting)("allowedCountries",{}),y=Object(c.getSetting)("shippingStates",{}),w=Object(c.getSetting)("allowedStates",{}),k=r(25),_=function(e,t){if(s>2)return Object(k.registerBlockType)(e,t)},E=function(e,t){if(s>1)return Object(k.registerBlockType)(e,t)},P=function(){return s>2},C=function(){return s>1}},148:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},149:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(8);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},159:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.o+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},160:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=(r(2),r(29)),u=r(7),l=r.n(u),b=(r(206),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:m,href:d},f),Object(s.decodeEntities)(u))}},161:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return E}));var n=r(5),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(22)),u=r(85),l=r(77),b=r(11),p=r.n(b),d=r(7),f=r.n(d),m=r(812),O=(r(208),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(816),v=r(27),h=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=Object(v.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:c}),a=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:o,className:a,onRemove:n})};function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var k=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),_=function(){return Object(i.useContext)(k)},E=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),v=j[0],y=j[1],_=Object(u.a)().dispatchStoreEvent,E=Object(l.b)().isEditor,P=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,w(w({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P("default",e,w(w({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:y},x=v?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:E}),D=v?null:Object(i.createElement)(h,{notices:N.notices,removeNotice:N.removeNotice,isEditor:E});return Object(i.createElement)(k.Provider,{value:N},o&&x,t,D)}},162:function(e,t,r){"use strict";var n=r(0),c=r(122),o=r(95),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},166:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(5),j=r.n(g),v=r(0),h=r(8);r(224);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=y(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},170:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(4),c=r(121),o=r(21),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},173:function(e,t){},178:function(e,t){},180:function(e,t){},183:function(e,t){!function(){e.exports=this.wp.warning}()},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(40),c=r(22),o=r(0),a=r(68),i=r(135),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.url}()},22:function(e,t){!function(){e.exports=this.wp.data}()},224:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.compose}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},254:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(31),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(10),y=r.n(h),w=r(6),k=r(23),_=(r(2),r(14)),E=r(39),P=r(41);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.h)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.q.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},255:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(27),l=r(43),b=r(71);r(488);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.Label,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},257:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(123)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t){!function(){e.exports=this.moment}()},305:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},33:function(e,t){!function(){e.exports=this.wp.primitives}()},340:function(e,t){},341:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(14);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.s)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},342:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},343:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(7),p=r.n(b),d=r(4),f=r(43),m=r(71),O=r(85),g=r(255);r(489);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),k=s()(w,2),_=k[0],E=k[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},344:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(132),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},345:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},346:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(68),l=r(802),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",k="set_after_processing",_="set_processing_response",E="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=k,L=_,T=E,V=P,z=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:L,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?T:V;return{type:t}},K=function(e){return{type:z,quantity:e}},Y=function(e){return{type:I,data:e}},$=r(5),J=r.n($);function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=k,ae=_,ie=E,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(132),ve=r(344),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(348),Ee=r(123),Pe=r(63),Ce=r(58),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],k=Object(u.a)(y),_=Object(Pe.a)(),E=_.addErrorNotice,P=_.removeNotices,C=Object(Ee.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(k,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&E(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,E,P,j,k]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,E(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(k,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");E(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(k,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,E,x,D,N,k]);var A=Object(l.b)(r),L={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:L},t)},De=r(19),Be=r.n(De),Re=r(29),Ae=r(54);function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Te=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(Ee.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,k=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},Ve=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ee.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Te,null)))},ze=r(43),Ie=r(6),Fe=r(71),Me=(r(340),r(27)),He=r(60),qe=r(498),Ge=r(85),Qe=r(723),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(ze.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(497),r(32)),Ze=r.n(Xe),et=r(3),tt=r(8),rt=r(257),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ee.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(J()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},st=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=at(at({},r),{},J()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},J()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(ze.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Ve,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},347:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(43),u=r(24),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.s)()?{color:t,fontSize:r}:{}},p=r(71),d=r(160),f=r(85);r(487),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,k=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(k,"__product-title"),k),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.s)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.s)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){E("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(k,"__product-title"),k),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.s)()),c()(n,N,Object(l.s)()),n)),style:b({color:h,fontSize:w})})}))},348:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),i=r(10),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(58);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},35:function(e,t){!function(){e.exports=this.wp.dataControls}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(21),a=r(19),i=r.n(a),s=r(6),u=r(4),l=r(14);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.q.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(31),c=r.n(n),o=r(10),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t){!function(){e.exports=this.wc.wcBlocksSharedContext}()},448:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(130),u=r(61),l=r(43),b=r(24),p=r(14),d=r(71);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,_=e.saleColor,E=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||E,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),L={color:k,fontSize:v},T={color:E,fontSize:y},V=C.prices,z=Object(u.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.s)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.s)()),a)),M=I?T:L;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:V.price,priceClassName:F,priceStyle:Object(p.s)()?M:{},minPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==V||null===(f=V.price_range)||void 0===f?void 0:f.max_amount,regularPrice:V.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.s)()),m)),regularPriceStyle:Object(p.s)()?L:{}})}))},449:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(43),l=r(71),b=(r(490),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},450:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(85),p=r(723),d=r(29),f=r(43),m=r(71),O=(r(491),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),k=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",E={};return y?E.onClick=function(){v(),m("cart-add-item",{product:t})}:(E.href=n,E.rel="nofollow",E.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},452:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(162),u=r(14),l=r(43),b=r(71);r(492);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.q.wordCountType||"words"}):null}))},453:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71);r(493);t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},454:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(494);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},455:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(495);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},456:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71),b=(r(496),function(e){return Object(a.sprintf)(Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)}),p=function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")};t.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var i=!!a.is_in_stock,l=a.low_stock_remaining,d=a.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",i),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!i),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!l),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},l?b(l):p(i,d))}))},46:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},487:function(e,t){},488:function(e,t){},489:function(e,t){},490:function(e,t){},491:function(e,t){},492:function(e,t){},493:function(e,t){},494:function(e,t){},495:function(e,t){},496:function(e,t){},497:function(e,t){},498:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},51:function(e,t){!function(){e.exports=this.wp.deprecated}()},52:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},53:function(e,t){!function(){e.exports=this.wp.hooks}()},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(5),a=r.n(o),i=r(6),s=r(0),u=r(40),l=r(22),b=r(29),p=r(148),d=r(170),f=r(77);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},56:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(20),s=r.n(i),u=r(0),l=r(165),b=r(7),p=r.n(b),d=(r(173),["className","value","currency","onValueChange","displayType"]);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},j,{value:O,onValueChange:v}))}},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(107);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},61:function(e,t){!function(){e.exports=this.wc.priceFormat}()},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(0),a=r(161);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},692:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},699:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},707:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},708:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:c.o+"img/pennant.jpg",thumbnail:c.o+"img/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},71:function(e,t){!function(){e.exports=this.wc.wcBlocksSharedHocs}()},713:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},72:function(e,t){!function(){e.exports=this.wp.dom}()},720:function(e,t,r){e.exports=r(772)},721:function(e,t){},722:function(e,t){},723:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(22),i=r(40),s=r(29),u=r(54),l=r(63),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},725:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},726:function(e,t){},727:function(e,t){},728:function(e,t){},729:function(e,t){},73:function(e,t){!function(){e.exports=this.ReactDOM}()},74:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(7),h=r.n(v),y=r(3),w=r(23);r(106);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(g.Component);t.a=Object(w.withInstanceId)(_)},76:function(e,t){!function(){e.exports=this.wp.viewport}()},77:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(22),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},772:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Qr}));var n=r(5),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(24),l=r(25),b=r(60),p=r(33),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(14),m=r(7),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.r)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(341),h=r(3),y=r(23),w=r(131),k=r(347),_=r(13),E=r.n(_),P=r(124),C=r(20),S=r.n(C),N=(r(722),["className"]);var x=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,N),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},D=r(43),B=(r(721),function(e){return function(t){return function(r){var n=Object(D.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=E()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),R=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),A=Object(s.__)("Product Title","woo-gutenberg-products-block"),L=Object(i.createElement)(b.a,{srcElement:R}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),V=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.productLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.s)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.s)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},z=Object(f.s)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),B({icon:L,label:A,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(V):V;function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M={title:A,description:T,icon:{src:L,foreground:"#874FB9"},attributes:v.a,edit:z};Object(l.registerBlockType)("woocommerce/product-title",F(F({},j),M));var H=r(448),q=r(305),G=Object(s.__)("Product Price","woo-gutenberg-products-block"),Q=Object(i.createElement)(b.a,{srcElement:q.a}),U=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),W=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},K=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.s)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.s)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(H.default,p))},Y=Object(f.s)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),B({icon:Q,label:G,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(K):K;function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var X={productId:{type:"number",default:0}};function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.s)()&&(X=J(J({},X),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var te={title:G,description:U,icon:{src:Q,foreground:"#874FB9"},attributes:X,edit:Y};Object(l.registerBlockType)("woocommerce/product-price",ee(ee({},j),te));var re=r(342),ne=r(137),ce=r(74),oe=r(4),ae=r(343),ie=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),se=Object(s.__)("Product Image","woo-gutenberg-products-block"),ue=Object(i.createElement)(b.a,{srcElement:ie}),le=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),be=B({icon:ue,label:se,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=t.productLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(ce.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(ce.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(ne.a)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(oe.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ae.a,t)))}));function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fe={title:se,description:le,icon:{src:ue,foreground:"#874FB9"},attributes:re.a,edit:be};Object(l.registerBlockType)("woocommerce/product-image",de(de({},j),fe));var me={productId:{type:"number",default:0}},Oe=r(449),ge=r(707),je=Object(s.__)("Product Rating","woo-gutenberg-products-block"),ve=Object(i.createElement)(b.a,{srcElement:ge.a});function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we={title:je,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:ve,foreground:"#874FB9"},attributes:me,edit:B({icon:ve,label:je,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Oe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",ye(ye({},j),we));var ke={productId:{type:"number",default:0}},_e=r(450),Ee=r(725),Pe=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Ce=Object(i.createElement)(b.a,{srcElement:Ee.a});function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xe={title:Pe,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:Ce,foreground:"#874FB9"},attributes:ke,edit:B({icon:Ce,label:Pe,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(_e.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Ne(Ne({},j),xe));var De={productId:{type:"number",default:0}},Be=r(452),Re=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),Ae=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Le=Object(i.createElement)(b.a,{srcElement:Re});function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ze={title:Ae,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Le,foreground:"#874FB9"},attributes:De,edit:B({icon:Le,label:Ae,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Be.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Ve(Ve({},j),ze));var Ie={productId:{type:"number",default:0}},Fe=r(255),Me=r(699),He=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),qe=Object(i.createElement)(b.a,{srcElement:Me.a});function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ue={title:He,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:qe,foreground:"#874FB9"},supports:{html:!1},attributes:Ie,edit:B({icon:qe,label:He,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Fe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Qe(Qe({},j),Ue));var We={productId:{type:"number",default:0}},Ke=r(115),Ye=r(453),$e=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Je=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e});function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt={title:Je,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Xe,foreground:"#874FB9"},attributes:We,edit:B({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(Ye.default,t))}))};Object(f.t)("woocommerce/product-sku",et(et({},j),tt));var rt={productId:{type:"number",default:0}},nt=r(454),ct=r(692),ot=Object(s.__)("Product Category List","woo-gutenberg-products-block"),at=Object(i.createElement)(b.a,{srcElement:ct.a});function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function st(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut={title:ot,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:at,foreground:"#874FB9"},attributes:rt,edit:B({icon:at,label:ot,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(nt.default,t)))}))};Object(f.t)("woocommerce/product-category-list",st(st({},j),ut));var lt={productId:{type:"number",default:0}},bt=r(455),pt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),dt=Object(i.createElement)(b.a,{srcElement:Me.a});function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ot={title:pt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:dt,foreground:"#874FB9"},attributes:lt,edit:B({icon:dt,label:pt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(bt.default,t)))}))};Object(f.t)("woocommerce/product-tag-list",mt(mt({},j),Ot));var gt={productId:{type:"number",default:0}},jt=r(456),vt=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),ht=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),yt=Object(i.createElement)(b.a,{srcElement:vt});function wt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _t={title:ht,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:yt,foreground:"#874FB9"},attributes:gt,edit:B({icon:yt,label:ht,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(jt.default,t))}))};Object(f.t)("woocommerce/product-stock-indicator",kt(kt({},j),_t));var Et=r(802),Pt=(r(340),r(346)),Ct=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),St=Object(i.createElement)(b.a,{srcElement:Ee.a});function Nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dt={title:Ct,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:St,foreground:"#874FB9"},edit:B({icon:St,label:Ct,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(D.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Ke.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(Et.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pt.a,t)))})),attributes:r(345).a};Object(f.t)("woocommerce/product-add-to-cart",xt(xt({},j),Dt));var Bt=r(15),Rt=r.n(Bt),At=r(12),Lt=r.n(At),Tt=r(17),Vt=r.n(Tt),zt=r(18),It=r.n(zt),Ft=r(9),Mt=r.n(Ft),Ht=r(22),qt=(r(2),r(82)),Gt=r(798),Qt=r(708),Ut=r(149),Wt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},Kt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:oe.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Ut.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Yt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function $t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$t(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Zt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Jt(Jt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function er(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?er(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:tr(tr({},r),{},{orderBy:!r.orderBy})})}})},nr=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},cr=r(16),or=r.n(cr),ar=r(8),ir=r(6),sr=r(27),ur=(r(729),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=u.minIndex,b=u.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(sr.Label,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(sr.Label,{label:"<",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return o(1)},disabled:1===t},Object(i.createElement)(sr.Label,{label:1,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(sr.Label,{label:e,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:function(){return o(a)},disabled:t===a},Object(i.createElement)(sr.Label,{label:a,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t+1)},title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(sr.Label,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});ur.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var lr=ur,br=r(150),pr=r(134),dr=r(184),fr=r(40),mr=r(68);function Or(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Or(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(dr.a)(gr(gr({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var s=Object(mr.a)(i),u=Object(mr.a)(o),l=Object(Ht.useSelect)((function(t){var c=t(fr.COLLECTIONS_STORE_KEY),o=[e,r,n,s,u];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",gr(gr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},vr=r(85),hr=r(166),yr=r(80),wr=r(126),kr=function(){var e=Object(D.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:wr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},_r=r(713),Er=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(D.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:_r.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Pr=r(129),Cr=(r(728),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Pr.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:r,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:c})}),Sr=r(172),Nr=Object(Sr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(D.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"wc-block-layout",{"is-loading":l});return Object(i.createElement)("li",{className:b,"aria-hidden":l},function e(t,r,n,c){if(n){var o=Object(Gt.a)(t);return n.map((function(n,s){var u=E()(n,2),l=u[0],b=u[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))})),xr=(r(727),["order","orderby","page","per_page"]);function Dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ir.isEqual)(t,c)&&Number.isFinite(r)},Ar=Object(hr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(pr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return Br(Br({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:o*a,page:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=E()(b,1)[0],d=jr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(D.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,xr)||{}}(p),w=Object(vr.a)().dispatchStoreEvent,k=Object(pr.b)("attributes",[]),_=E()(k,2),P=_[0],C=_[1],N=Object(pr.b)("min_price"),x=E()(N,2),B=x[0],R=x[1],A=Object(pr.b)("max_price"),L=E()(A,2),T=L[0],V=L[1],z=Object(br.a)({totalQuery:y,totalProducts:m},Rr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)||(n(1),null!=z&&z.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(yr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(yr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==z?void 0:z.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(T);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Cr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(Er,{resetCallback:function(){C([]),R(null),V(null)}}),!K&&!Y&&Object(i.createElement)(kr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(Nr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(lr,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Lr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=E()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=E()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Ar,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Tr=r(159);function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var zr=function(e){Vt()(r,e);var t=Vr(r);function r(){return Rt()(this,r),t.apply(this,arguments)}return or()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;if(t.isPreview)return Tr.a;var n=Object(oe.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Lr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(ar.Component);r(726);function Ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var Fr=function(e){Vt()(r,e);var t=Ir(r);function r(){var e;Rt()(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),c()(Lt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Lt()(e),"blockMap",Object(Gt.a)("woocommerce/all-products")),c()(Lt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Lt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Lt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Lt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(Lt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(qt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(oe.getSetting)("min_columns",1),maxColumns:Object(oe.getSetting)("max_columns",6),minRows:Object(oe.getSetting)("min_rows",1),maxRows:Object(oe.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},rr(r,n),nr(r,n)))})),c()(Lt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Lt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(D.ProductDataContextProvider,{product:Qt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Zt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Xt.map((function(e){var t=E()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(Lt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(zr,{attributes:t})):Yt(c,o)})),c()(Lt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===f.q.productCount?Kt(n,c):Object(i.createElement)("div",{className:Wt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Mr=Object(y.compose)(h.withSpokenMessages,Object(Ht.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Ht.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Fr),Hr={columns:Object(oe.getSetting)("default_columns",3),rows:Object(oe.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Xt,isPreview:!1};function qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Hr,edit:function(e){return Object(i.createElement)(Mr,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Gr(Gr({},Qr),{},{deprecated:[{attributes:Object.assign({},Qr.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},798:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(52),c=r(0),o=r(14);r.p=o.p,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,448))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,818))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,819))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,449))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,450))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,452))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,255))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,453))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,454))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,455))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,456))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,820))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},8:function(e,t){!function(){e.exports=this.React}()},80:function(e,t){!function(){e.exports=this.wp.a11y}()},802:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},82:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},83:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},84:function(e,t){!function(){e.exports=this.wp.date}()},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(53),a=r(0),i=r(54);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},95:function(e,t){!function(){e.exports=this.wp.autop}()}});
|
build/all-reviews.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '89783cd93dfc642be6dd7228c92235e0');
|
build/all-reviews.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={7:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([702,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},104:function(e,t){},114:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(136),i=r(3),a=r(24),s=r(5),l=r(74),u=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},125:function(e,t,r){"use strict";var n=r(0),o=r(33),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},127:function(e,t){},128:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(8)),c=r.n(o),i=r(27),a=r(172);r(180);t.a=Object(a.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,a=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,b=e.readOnly,d=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.Label,{label:a,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:o,onChange:s,readOnly:b,value:d},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},135:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:null,verified:!1}]}}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return c})),r.d(t,"k",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"h",(function(){return l})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return w})),r.d(t,"i",(function(){return v})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"p",(function(){return O})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return j})),r.d(t,"o",(function(){return _}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=r(25),O=function(e,t){if(s>2)return Object(h.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(h.registerBlockType)(e,t)},j=function(){return s>2},_=function(){return s>1}},163:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},164:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(179),r(70));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},168:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(7),f=(r(2),r(6)),m=r(3),g=r(5),h=r(92),O=r(27),y=(r(223),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.Label,{label:r,screenReaderLabel:n})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(128),k=(r(220),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(4),E=r.n(R),P=r(8),C=r.n(P),S=r(12),T=r.n(S),N=r(197),x=r.n(N),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=M(e,t,r);return L(e,o-n.length,n)},M=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=L(e,n.middle),n=I(n,t.clientHeight,r);return n.middle},I=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=D(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(T()(n)),n.onClick=n.onClick.bind(T()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:A(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(v.Component);B.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(222);var G=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||v)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(w.__)("Verified buyer","woo-gutenberg-products-block")},Object(w.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(221);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,a=F(F({},t),{},{showReviewImage:c,showReviewRating:i});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:a}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:a,review:e})})))},W=r(11),U=r.n(W),J=r(31),q=r.n(J),Y=r(10),K=r.n(Y),Q=r(37),X=r.n(Q),Z=r(70),$=r(41);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(T()(e),"isPreview",!!e.props.attributes.previewReviews),E()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(v.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var a=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&a&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||a||s||u||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},179:function(e,t){},180:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},3:function(e,t){!function(){e.exports=this.wp.components}()},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(31),o=r.n(n),c=r(10),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},46:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(20),i=r.n(c),a=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,s);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},6:function(e,t){!function(){e.exports=this.lodash}()},7:function(e,t){!function(){e.exports=this.React}()},70:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(8),i=r.n(c),a=r(5),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),i()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":a,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},702:function(e,t,r){e.exports=r(779)},74:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(8),O=r.n(h),y=r(3),j=r(22);r(104);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(j.withInstanceId)(k)},779:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),c=r(0),i=r(1),a=r(25),s=r(58),l=r(33),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(179),r(24)),d=r(3),p=(r(2),r(168)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"))},v=r(114),f=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},m=r(163),g=r(164),h=r(135);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(a.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},92:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(58)),i=r(125),a=r(8),s=r.n(a),l=r(3),u=r(46);r(127);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={7:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([709,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},106:function(e,t){},116:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(137),i=r(3),a=r(24),s=r(4),l=r(74),u=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},126:function(e,t,r){"use strict";var n=r(0),o=r(33),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},128:function(e,t){},129:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(27),a=r(172);r(180);t.a=Object(a.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,a=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,b=e.readOnly,d=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.Label,{label:a,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:o,onChange:s,readOnly:b,value:d},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:null,verified:!1}]}}},14:function(e,t,r){"use strict";r.d(t,"q",(function(){return c})),r.d(t,"o",(function(){return i})),r.d(t,"p",(function(){return a})),r.d(t,"l",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"i",(function(){return d})),r.d(t,"h",(function(){return p})),r.d(t,"n",(function(){return w})),r.d(t,"m",(function(){return v})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return m})),r.d(t,"g",(function(){return g})),r.d(t,"j",(function(){return h})),r.d(t,"a",(function(){return O})),r.d(t,"k",(function(){return y})),r.d(t,"b",(function(){return j})),r.d(t,"t",(function(){return k})),r.d(t,"u",(function(){return R})),r.d(t,"r",(function(){return E})),r.d(t,"s",(function(){return P}));var n,o=r(4),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=Object(o.getSetting)("shippingCountries",{}),O=Object(o.getSetting)("allowedCountries",{}),y=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{}),_=r(25),k=function(e,t){if(s>2)return Object(_.registerBlockType)(e,t)},R=function(e,t){if(s>1)return Object(_.registerBlockType)(e,t)},E=function(){return s>2},P=function(){return s>1}},163:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},164:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(179),r(70));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},168:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(8),f=(r(2),r(6)),m=r(3),g=r(4),h=r(91),O=r(27),y=(r(223),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.Label,{label:r,screenReaderLabel:n})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(129),k=(r(220),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(5),E=r.n(R),P=r(7),C=r.n(P),S=r(12),T=r.n(S),N=r(197),x=r.n(N),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=M(e,t,r);return L(e,o-n.length,n)},M=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=L(e,n.middle),n=I(n,t.clientHeight,r);return n.middle},I=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=D(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(T()(n)),n.onClick=n.onClick.bind(T()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:A(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(v.Component);B.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(222);var G=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||v)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(w.__)("Verified buyer","woo-gutenberg-products-block")},Object(w.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(221);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,a=F(F({},t),{},{showReviewImage:c,showReviewRating:i});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:a}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:a,review:e})})))},W=r(11),U=r.n(W),J=r(31),q=r.n(J),Y=r(10),K=r.n(Y),Q=r(37),X=r.n(Q),Z=r(70),$=r(41);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(T()(e),"isPreview",!!e.props.attributes.previewReviews),E()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(v.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var a=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&a&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||a||s||u||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},179:function(e,t){},180:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.compose}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},3:function(e,t){!function(){e.exports=this.wp.components}()},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(31),o=r.n(n),c=r(10),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},46:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(20),i=r.n(c),a=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,s);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},70:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(7),i=r.n(c),a=r(4),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),i()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":a,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},709:function(e,t,r){e.exports=r(786)},74:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(7),O=r.n(h),y=r(3),j=r(23);r(106);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(j.withInstanceId)(k)},786:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),i=r(1),a=r(25),s=r(60),l=r(33),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(179),r(24)),d=r(3),p=(r(2),r(168)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"))},v=r(116),f=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},m=r(163),g=r(164),h=r(136);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(a.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},8:function(e,t){!function(){e.exports=this.React}()},91:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(60)),i=r(126),a=r(7),s=r.n(a),l=r(3),u=r(46);r(128);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
|
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{107:function(t,e,r){"use strict";r.d(e,"a",(function(){return c})),r.d(e,"c",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"d",(function(){return s}));var n=r(42),i=r.n(n),c=function(t){return"number"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return!function(t){return null===t}(t)&&"object"===i()(t)};function s(t,e){return a(t)&&e in t}},121:function(t,e,r){"use strict";var n=r(5),i=r.n(n),c=r(13),o=r.n(c),a=r(4),s=r(1),u=r(107);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=Object(a.getSetting)("countryLocale",{}),f=function(t){var e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),t.label)),t.priority&&(Object(u.a)(t.priority)&&(e.index=t.priority),Object(u.c)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},b=Object.entries(l).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,Object.entries(n).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,f(n)]})).reduce((function(t,e){var r=o()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{})]})).reduce((function(t,e){var r=o()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{});e.a=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return t.map((function(t){var r=a.defaultAddressFields[t]||{},i=n[t]||{},c=e[t]||{};return d(d(d({key:t},r),i),c)})).sort((function(t,e){return t.index-e.index}))}},148:function(t,e,r){"use strict";r.d(e,"a",(function(){return c}));var n=r(13),i=r.n(n),c=function(t){return t.reduce((function(t,e){var r=i()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{})}},170:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(4),i=r(121),c=r(21),o=function(t){var e=t.country,r=void 0===e?"":e,n=t.state,i=void 0===n?"":n,c=t.city,o=void 0===c?"":c,a=t.postcode,s=void 0===a?"":a;return{country:r.trim(),state:i.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(t){var e=t.email,r=void 0===e?"":e;return Object(c.isEmail)(r)?r.trim():""},s=function(t){var e=Object.keys(n.defaultAddressFields),r=Object(i.a)(e,{},t.country),c=Object.assign({},t);return r.forEach((function(e){var r=e.key,n=void 0===r?"":r,i=e.hidden;void 0!==i&&i&&function(t,e){return t in e}(n,t)&&(c[n]="")})),c}},54:function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(13),i=r.n(n),c=r(5),o=r.n(c),a=r(6),s=r(0),u=r(40),p=r(22),d=r(29),l=r(148),f=r(170),b=r(77);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},y=g(g({},v),{},{email:"",phone:""}),m=function(t){return Object(l.a)(Object.entries(t).map((function(t){var e=i()(t,2),r=e[0],n=e[1];return[r,Object(d.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:y,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(b.b)(),r=e.isEditor,n=e.previewData,i=(null==n?void 0:n.previewCart)||{},c=t.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(t,e){var n=e.dispatch;if(!c)return h;if(r)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:[],cartTotals:i.totals,cartIsLoading:!1,cartErrors:[],billingAddress:y,shippingAddress:v,extensions:{},shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:function(){}};var o=t(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=m(a.billingAddress),g=a.needsShipping?m(a.shippingAddress):O,j=a.fees.map((function(t){return m(t)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(g),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},77:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(0),i=r(22),c=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(c)},a=function(t){var e=t.children,r=t.currentPostId,o=void 0===r?0:r,a=t.previewData,s=void 0===a?{}:a,u=Object(i.useSelect)((function(t){return o||t("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(t){return t in s?s[t]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(c.Provider,{value:d},e)}},85:function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(5),i=r.n(n),c=r(53),o=r(0),a=r(54);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=function(){var t=Object(a.a)(),e=Object(o.useRef)(t);return Object(o.useEffect)((function(){e.current=t}),[t]),{dispatchStoreEvent:Object(o.useCallback)((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(t),e)}catch(t){console.error(t)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e.current}))}catch(t){console.error(t)}}),[])}}}}]);
|
build/atomic-block-components/add-to-cart--atomic-block-components/button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{161:function(e,t,n){"use strict";n.d(t,"b",(function(){return k})),n.d(t,"a",(function(){return E}));var c=n(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{161:function(e,t,n){"use strict";n.d(t,"b",(function(){return k})),n.d(t,"a",(function(){return E}));var c=n(5),r=n.n(c),o=n(13),i=n.n(o),a=n(0),s=(n(2),n(22)),u=n(85),f=n(77),l=n(11),b=n.n(l),d=n(7),v=n.n(d),O=n(812),p=(n(208),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),m=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(a.createElement)("div",{className:o},r.map((function(e){return Object(a.createElement)(O.a,b()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice","woocommerce-message",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))},j=n(816),N=n(27),g=function(e){var t=e.className,n=e.notices,c=e.removeNotice;if(e.isEditor)return null;var r=n.filter((function(e){return"snackbar"===e.type})),o=Object(N.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:r}),i=v()(t,"wc-block-components-notices__snackbar");return Object(a.createElement)(j.a,{notices:o,className:i,onRemove:c})};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),k=function(){return Object(a.useContext)(w)},E=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,l=e.context,b=void 0===l?"wc/core":l,d=Object(s.useDispatch)("core/notices"),v=d.createNotice,O=d.removeNotice,p=Object(a.useState)(!1),j=i()(p,2),N=j[0],h=j[1],k=Object(u.a)().dispatchStoreEvent,E=Object(f.b)().isEditor,S=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v(e,t,y(y({},n),{},{context:n.context||b})),k("store-notice-create",{status:e,content:t,options:n})}),[v,k,b]),P=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;O(e,t)}),[O,b]),D=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("default",e,y(y({},t),{},{type:"snackbar"}))}),[S]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(b)}}),[b]).notices,createNotice:S,createSnackbarNotice:D,removeNotice:P,context:b,setIsSuppressed:h},x=N?null:Object(a.createElement)(m,{className:c,notices:C.notices,removeNotice:C.removeNotice,isEditor:E}),I=N?null:Object(a.createElement)(g,{notices:C.notices,removeNotice:C.removeNotice,isEditor:E});return Object(a.createElement)(w.Provider,{value:C},o&&x,t,I)}},208:function(e,t){},63:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(5),r=n.n(c),o=n(0),i=n(161);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var f=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeNotice:c}}),[c]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[n,r]);return s(s(s({notices:t},f),l),{},{setIsSuppressed:a})}},723:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(13),r=n.n(c),o=n(0),i=n(22),a=n(40),s=n(29),u=n(54),f=n(63),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},b=function(e){var t=Object(i.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(u.a)(),c=n.cartItems,b=n.cartIsLoading,d=Object(f.a)(),v=d.addErrorNotice,O=d.removeNotice,p=Object(o.useState)(!1),m=r()(p,2),j=m[0],N=m[1],g=Object(o.useRef)(l(c,e));return Object(o.useEffect)((function(){var t=l(c,e);t!==g.current&&(g.current=t)}),[c,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:j,cartIsLoading:b,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return N(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){N(!1)}))}}}}}]);
|
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{817:function(e,n,a){"use strict";var c=a(11),r=a.n(c),t=a(0),o=function(e,n){var a=[];return Object.keys(e).forEach((function(c){if(void 0!==n[c])switch(e[c].type){case"boolean":a[c]="false"!==n[c]&&!1!==n[c];break;case"number":a[c]=parseInt(n[c],10);break;case"array":case"object":a[c]=JSON.parse(n[c]);break;default:a[c]=n[c]}else a[c]=e[c].default})),a};n.a=function(e){return function(n){return function(a){var c=o(e,a);return Object(t.createElement)(n,r()({},a,c))}}}}}]);
|
build/atomic-block-components/add-to-cart-frontend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{100:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},101:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},108:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),i=r(16),s=r.n(i),u=r(9),l=r.n(u),f=r(0),d=r(8),b=r(22),p=r.n(b);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var y=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(f.useContext)(y)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),b=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(O))}))}),[]),v=Object(f.useCallback)((function(){c({})}),[]),h=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),j={getValidationError:i,setValidationErrors:h,clearValidationError:b,clearAllValidationErrors:v,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(y.Provider,{value:j},t)}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(8);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:i}),s(s({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),s(s({},e),{},c()({},o,f))}}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(20),o=r.n(n),c=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function s(e,t){return i(e)&&t in e}},163:function(e,t){},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(108),o=(r(163),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,i=void 0===a?"":a,s=Object(n.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},r))})},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},211:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(127),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(52),a=r.n(c),i=r(26),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(45);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw c}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],i=f(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,d,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),i=f(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},287:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},292:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(199);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},299:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(9),o=r.n(n),c=r(0),a=r(12),i=r(15),s=r(18),u=r(38),l=r(51),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,v=b.removeNotice,m=Object(c.useState)(!1),O=o()(m,2),y=O[0],h=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:y,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){v("add-to-cart")})).catch((function(e){p(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},305:function(e,t){},306:function(e,t){},315:function(e,t,r){"use strict";r.r(t);var n=r(292),o=(r(3),r(4)),c=r.n(o),a=r(9),i=r.n(a),s=r(0),u=r(1),l=r(54),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",v="processing",m="before_processing",O="after_processing",y={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=h,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,B=C,M=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:B,quantity:e}},G=function(e){return{type:M,data:e}},X=r(7),$=r.n(X);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=h,re=g,ne=j,oe=E,ce=w,ae=P,ie=k,se=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,ve=v,me=m,Oe=O,ye=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=y;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case ie:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case se:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===ve||t.status===me?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},he=r(127),ge=r(211),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(212),_e=r(108),Re=r(51),Ce=r(45),Ae=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(s.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(s.useReducer)(ye,y),c=i()(o,2),a=c[0],d=c[1],h=Object(s.useReducer)(he.b,{}),g=i()(h,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(s.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(s.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(s.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(s.useEffect)((function(){a.status===m&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(s.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===v,isBeforeProcessing:a.status===m,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(38);function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),v=p.addErrorNotice,m=p.removeNotice,O=Object(Ve.a)().receiveCart,y=Object(s.useState)(!1),h=i()(y,2),g=h[0],j=h[1],E=!c&&a,w=Object(s.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(s.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(s.useCallback)((function(){j(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,m,O,t,n,l]);return Object(s.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(81),Me=r(8),Le=r(208),Qe=(r(305),r(11)),We=r(139),He=r(287),Ke=r(56),Je=r(299),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.Button,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.Button,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Be.useInnerBlockLayoutContext)().parentName,v=Object(Ke.a)().dispatchStoreEvent,m=Object(Je.a)(o.id||0).cartQuantity,O=Object(s.useState)(!1),y=i()(O,2),h=y[0],g=y[1],j=o.add_to_cart||{url:"",text:""};return Object(s.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:a,isProcessing:l,isDone:h,onClick:function(){b.submitForm(),v("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){v("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(306),r(49)),et=r.n(Ze),tt=r(210),rt=r(2),nt=r(192),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,i=e.onChange,s=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,m=t,O=b(m)||{};return Object(rt.useEffect)((function(){a?v(m):p($()({},m,{message:f,hidden:!0}))}),[a,m,f,v,p]),Object(rt.useEffect)((function(){return function(){v(m)}}),[m,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:s,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:m,elementId:m}))};function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],i=it(it({},r),{},$()({},o,null)),s=c?st(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(s.useState)(0),u=i()(a,2),f=u[0],d=u[1],b=Object(s.useState)({}),p=i()(b,2),v=p[0],m=p[1],O=Object(s.useMemo)((function(){return ut(o,c,v)}),[v,o,c]);return Object(s.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return st(e,t,r)[0]||0}(o,c,v)):f>0&&d(0)}),[v,f,o,c]),Object(s.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:v[e],onChange:function(t){m(ft(ft({},v),{},$()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Me.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},vt=function(){return React.createElement(ze,null)},mt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(mt,null)},yt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},ht=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Me.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(yt,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(ht)},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,c=r(134);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var a=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},49:function(e,t,r){var n=r(99),o=r(100),c=r(67),a=r(101);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),o=r.n(n),c=r(0),a=r(123);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(c.useRef)(t);Object(c.useEffect)((function(){u.current=t}),[t]);var l=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),f=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[r,o]);return s(s(s({notices:t},l),f),{},{setIsSuppressed:i})}},52:function(e,t){function r(e,t,r,n,o,c,a){try{var i=e[c](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var a=e.apply(t,n);function i(e){r(a,o,c,i,s,"next",e)}function s(e){r(a,o,c,i,s,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},99:function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{100:function(e,t,r){var n=r(69);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},101:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},102:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},109:function(e,t,r){"use strict";r.d(t,"b",(function(){return y})),r.d(t,"a",(function(){return g}));var n=r(19),o=r.n(n),c=r(7),a=r.n(c),i=r(15),s=r.n(i),u=r(8),l=r.n(u),f=r(0),d=r(9),b=r(22),p=r.n(b);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var h=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(h)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),b=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(O))}))}),[]),v=Object(f.useCallback)((function(){c({})}),[]),y=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),j={getValidationError:i,setValidationErrors:y,clearValidationError:b,clearAllValidationErrors:v,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(h.Provider,{value:j},t)}},128:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(9);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:i}),s(s({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),s(s({},e),{},c()({},o,f))}}},162:function(e,t){},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(109),o=(r(162),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,i=void 0===a?"":a,s=Object(n.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!r||"string"!=typeof r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},r))})},200:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(128),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},213:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(19),o=r.n(n),c=r(54),a=r.n(c),i=r(26),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(47);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw c}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],i=f(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,d,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),i=f(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},288:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},293:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(200);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},300:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(8),o=r.n(n),c=r(0),a=r(13),i=r(16),s=r(18),u=r(39),l=r(53),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,v=b.removeNotice,m=Object(c.useState)(!1),O=o()(m,2),h=O[0],y=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:h,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return y(!0),t(e,r).then((function(){v("add-to-cart")})).catch((function(e){p(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){y(!1)}))}}}},306:function(e,t){},307:function(e,t){},316:function(e,t,r){"use strict";r.r(t);var n=r(293),o=(r(3),r(5)),c=r.n(o),a=r(8),i=r.n(a),s=r(0),u=r(1),l=r(49),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",v="processing",m="before_processing",O="after_processing",h={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=y,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,B=C,M=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:B,quantity:e}},G=function(e){return{type:M,data:e}},X=r(7),$=r.n(X);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=y,re=g,ne=j,oe=E,ce=w,ae=P,ie=k,se=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,ve=v,me=m,Oe=O,he=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=h;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case ie:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case se:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===ve||t.status===me?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},ye=r(128),ge=r(212),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(213),_e=r(109),Re=r(53),Ce=r(47),Ae=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(s.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(s.useReducer)(he,h),c=i()(o,2),a=c[0],d=c[1],y=Object(s.useReducer)(ye.b,{}),g=i()(y,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(s.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(s.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(s.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(s.useEffect)((function(){a.status===m&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(s.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===v,isBeforeProcessing:a.status===m,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(39);function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),v=p.addErrorNotice,m=p.removeNotice,O=Object(Ve.a)().receiveCart,h=Object(s.useState)(!1),y=i()(h,2),g=y[0],j=y[1],E=!c&&a,w=Object(s.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(s.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(s.useCallback)((function(){j(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,m,O,t,n,l]);return Object(s.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(83),Me=r(9),Le=r(209),Qe=(r(306),r(12)),We=r(139),He=r(288),Ke=r(57),Je=r(300),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.Button,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.Button,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Be.useInnerBlockLayoutContext)().parentName,v=Object(Ke.a)().dispatchStoreEvent,m=Object(Je.a)(o.id||0).cartQuantity,O=Object(s.useState)(!1),h=i()(O,2),y=h[0],g=h[1],j=o.add_to_cart||{url:"",text:""};return Object(s.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:a,isProcessing:l,isDone:y,onClick:function(){b.submitForm(),v("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){v("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(307),r(51)),et=r.n(Ze),tt=r(211),rt=r(2),nt=r(192),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,i=e.onChange,s=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,m=t,O=b(m)||{};return Object(rt.useEffect)((function(){a?v(m):p($()({},m,{message:f,hidden:!0}))}),[a,m,f,v,p]),Object(rt.useEffect)((function(){return function(){v(m)}}),[m,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:s,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:m,elementId:m}))};function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],i=it(it({},r),{},$()({},o,null)),s=c?st(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(s.useState)(0),u=i()(a,2),f=u[0],d=u[1],b=Object(s.useState)({}),p=i()(b,2),v=p[0],m=p[1],O=Object(s.useMemo)((function(){return ut(o,c,v)}),[v,o,c]);return Object(s.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return st(e,t,r)[0]||0}(o,c,v)):f>0&&d(0)}),[v,f,o,c]),Object(s.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:v[e],onChange:function(t){m(ft(ft({},v),{},$()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Me.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},vt=function(){return React.createElement(ze,null)},mt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(mt,null)},ht=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},yt=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Me.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(ht,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(yt)},47:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,c=r(73);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var a=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=O
|