WooCommerce Gutenberg Products Block - Version 3.5.0

Version Description

  • 2020-09-29 =

Bug Fixes

  • Use light default background colour for country/state dropdowns. (3189)
  • Fix broken Express Payment Method use in the Checkout block for logged out or incognito users. (3165)
  • Fix State label for Spain. (3147)
  • Don't throw an error when registering a payment method fails. (3134)

refactor

  • Use noticeContexts from useEmitResponse instead of hardcoded values. (3161)
Download this release

Release Info

Developer assassinateur
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 3.5.0
Comparing to
See all releases

Code changes from version 3.4.0 to 3.5.0

Files changed (155) hide show
  1. assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/index.js +4 -0
  2. assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js +14 -1
  3. assets/js/atomic/blocks/product-elements/add-to-cart/shared/quantity-input.js +7 -0
  4. assets/js/atomic/blocks/product-elements/image/edit.js +2 -2
  5. assets/js/atomic/blocks/product-elements/price/block.js +0 -1
  6. assets/js/atomic/blocks/product-elements/rating/block.js +1 -0
  7. assets/js/atomic/blocks/product-elements/title/block.js +0 -1
  8. assets/js/base/components/button/index.js +10 -1
  9. assets/js/base/components/cart-checkout/address-form/country-address-fields.js +2 -2
  10. assets/js/base/components/cart-checkout/address-form/index.js +9 -0
  11. assets/js/base/components/cart-checkout/payment-method-icons/index.js +3 -2
  12. assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.js +5 -0
  13. assets/js/base/components/cart-checkout/product-image/index.js +3 -0
  14. assets/js/base/components/cart-checkout/product-low-stock-badge/index.js +3 -0
  15. assets/js/base/components/cart-checkout/product-sale-badge/index.js +2 -2
  16. assets/js/base/components/cart-checkout/product-summary/index.js +5 -0
  17. assets/js/base/components/cart-checkout/product-variation-data/index.js +4 -0
  18. assets/js/base/components/cart-checkout/shipping-location/index.js +3 -0
  19. assets/js/base/components/cart-checkout/shipping-rates-control/package.js +3 -3
  20. assets/js/base/components/cart-checkout/totals/totals-footer-item/index.js +2 -2
  21. assets/js/base/components/cart-checkout/totals/totals-shipping-item/index.js +7 -0
  22. assets/js/base/components/checkbox-control/index.js +8 -0
  23. assets/js/base/components/checkbox-list/index.js +10 -0
  24. assets/js/base/components/chip/chip.js +11 -0
  25. assets/js/base/components/chip/removable-chip.js +10 -0
  26. assets/js/base/components/dropdown-selector/index.js +11 -0
  27. assets/js/base/components/dropdown-selector/menu.js +1 -0
  28. assets/js/base/components/dropdown-selector/selected-chip.js +1 -0
  29. assets/js/base/components/formatted-monetary-amount/index.js +5 -0
  30. assets/js/base/components/label/index.js +6 -0
  31. assets/js/base/components/payment-methods/express-payment-methods.js +10 -3
  32. assets/js/base/components/payment-methods/express-payment/cart-express-payment.js +8 -2
  33. assets/js/base/components/payment-methods/express-payment/checkout-express-payment.js +23 -3
  34. assets/js/base/components/payment-methods/payment-method-error-boundary.js +10 -6
  35. assets/js/base/components/payment-methods/payment-methods.js +3 -6
  36. assets/js/base/components/payment-methods/saved-payment-method-options.js +44 -47
  37. assets/js/base/components/price-slider/index.js +11 -0
  38. assets/js/base/components/quantity-selector/index.js +3 -3
  39. assets/js/base/components/reviews/review-list-item/index.js +1 -0
  40. assets/js/base/components/select/style.scss +1 -1
  41. assets/js/base/components/sort-select/index.js +11 -0
  42. assets/js/base/components/store-notices-container/snackbar-notices.js +5 -3
  43. assets/js/base/components/store-notices-container/store-notices-container.js +2 -1
  44. assets/js/base/components/summary/utils.js +1 -1
  45. assets/js/base/components/title/index.js +8 -0
  46. assets/js/base/context/add-to-cart-form/form-state/reducer.js +3 -0
  47. assets/js/base/context/cart-checkout/checkout-state/reducer.js +5 -0
  48. assets/js/base/context/cart-checkout/payment-methods/payment-method-data-context.js +17 -5
  49. assets/js/base/context/cart-checkout/payment-methods/reducer.js +5 -0
  50. assets/js/base/context/cart-checkout/payment-methods/test/payment-method-data-context.js +138 -0
  51. assets/js/base/context/cart-checkout/payment-methods/use-payment-method-registration.js +34 -33
  52. assets/js/base/context/cart-checkout/shipping/index.js +3 -0
  53. assets/js/base/context/container-width-context.js +5 -0
  54. assets/js/base/context/shared/event-emit/reducer.js +5 -0
  55. assets/js/base/context/shared/validation/index.js +4 -0
  56. assets/js/base/context/store-notices-context.js +7 -0
  57. assets/js/base/hooks/cart/use-store-cart-coupons.js +1 -1
  58. assets/js/base/hooks/cart/use-store-cart-item-quantity.js +1 -1
  59. assets/js/base/hooks/shipping/use-select-shipping-rate.js +1 -1
  60. assets/js/base/hooks/test/use-store-notices.js +75 -0
  61. assets/js/base/hooks/use-position-relative-to-viewport.js +2 -0
  62. assets/js/base/hooks/use-store-notices.js +1 -2
  63. assets/js/base/utils/address.js +4 -0
  64. assets/js/base/utils/get-intersection-observer.js +4 -2
  65. assets/js/base/utils/legacy-events.js +3 -1
  66. assets/js/blocks-registry/block-components/get-registered-block-components.js +0 -2
  67. assets/js/blocks-registry/block-components/register-block-component.js +0 -2
  68. assets/js/blocks-registry/payment-methods/registry.js +10 -0
  69. assets/js/blocks/active-filters/active-attribute-filters.js +6 -0
  70. assets/js/blocks/active-filters/block.js +4 -0
  71. assets/js/blocks/active-filters/index.js +1 -3
  72. assets/js/blocks/active-filters/utils.js +2 -2
  73. assets/js/blocks/attribute-filter/block.js +8 -4
  74. assets/js/blocks/attribute-filter/edit.js +1 -0
  75. assets/js/blocks/attribute-filter/index.js +1 -3
  76. assets/js/blocks/attribute-filter/label.js +4 -0
  77. assets/js/blocks/cart-checkout/cart/checkout-button/index.js +3 -0
  78. assets/js/blocks/cart-checkout/cart/edit.js +7 -2
  79. assets/js/blocks/cart-checkout/cart/empty-cart-edit/index.js +4 -0
  80. assets/js/blocks/cart-checkout/cart/frontend.js +2 -2
  81. assets/js/blocks/cart-checkout/cart/full-cart/cart-line-items-title.js +1 -0
  82. assets/js/blocks/cart-checkout/cart/full-cart/index.js +3 -0
  83. assets/js/blocks/cart-checkout/cart/index.js +1 -3
  84. assets/js/blocks/cart-checkout/cart/test/block.js +2 -2
  85. assets/js/blocks/cart-checkout/checkout/block.js +2 -1
  86. assets/js/blocks/cart-checkout/checkout/checkout-order-error/index.js +6 -3
  87. assets/js/blocks/cart-checkout/checkout/edit.js +13 -7
  88. assets/js/blocks/cart-checkout/checkout/form/payment-method-step.js +7 -2
  89. assets/js/blocks/cart-checkout/checkout/frontend.js +3 -3
  90. assets/js/blocks/cart-checkout/checkout/index.js +2 -3
  91. assets/js/blocks/featured-category/block.js +12 -0
  92. assets/js/blocks/featured-product/block.js +13 -0
  93. assets/js/blocks/price-filter/block.js +2 -0
  94. assets/js/blocks/price-filter/index.js +1 -3
  95. assets/js/blocks/product-categories/block.js +5 -0
  96. assets/js/blocks/product-search/block.js +9 -0
  97. assets/js/blocks/product-search/edit.js +11 -0
  98. assets/js/blocks/products/all-products/index.js +1 -5
  99. assets/js/blocks/reviews/all-reviews/edit.js +4 -0
  100. assets/js/blocks/reviews/edit-utils.js +3 -3
  101. assets/js/blocks/reviews/frontend-block.js +7 -0
  102. assets/js/blocks/reviews/frontend-container-block.js +1 -0
  103. assets/js/blocks/reviews/reviews-by-category/edit.js +8 -2
  104. assets/js/blocks/reviews/reviews-by-product/edit.js +9 -2
  105. assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.js +1 -0
  106. assets/js/blocks/single-product/block.js +7 -0
  107. assets/js/blocks/single-product/edit/api-error.js +5 -0
  108. assets/js/blocks/single-product/edit/editor-block-controls.js +4 -0
  109. assets/js/blocks/single-product/edit/index.js +10 -0
  110. assets/js/blocks/single-product/edit/layout-editor.js +5 -0
  111. assets/js/blocks/single-product/edit/shared-product-control.js +4 -0
  112. assets/js/data/schema/selectors.js +1 -1
  113. assets/js/editor-components/feedback-prompt/index.js +4 -0
  114. assets/js/editor-components/grid-content-control/index.js +4 -0
  115. assets/js/editor-components/grid-layout-control/index.js +6 -0
  116. assets/js/editor-components/product-attribute-term-control/index.js +4 -2
  117. assets/js/editor-components/product-category-control/index.js +9 -4
  118. assets/js/editor-components/product-control/index.js +1 -0
  119. assets/js/editor-components/product-orderby-control/index.js +4 -0
  120. assets/js/editor-components/product-tag-control/index.js +4 -2
  121. assets/js/editor-components/products-control/index.js +2 -0
  122. assets/js/editor-components/utils/index.js +6 -4
  123. assets/js/payment-method-extensions/payment-methods/cod/index.js +5 -2
  124. assets/js/payment-method-extensions/payment-methods/stripe/credit-card/elements.js +10 -0
  125. assets/js/payment-method-extensions/payment-methods/stripe/payment-request/index.js +3 -0
  126. assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/type-defs.js +4 -0
  127. assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/utils.js +5 -1
  128. assets/js/previews/cart.js +1 -1
  129. assets/js/settings/shared/get-setting.js +0 -1
  130. assets/js/settings/shared/set-setting.js +4 -5
  131. assets/js/type-defs/contexts.js +8 -7
  132. assets/js/type-defs/hooks.js +4 -1
  133. assets/js/type-defs/registered-payment-method-props.js +6 -6
  134. build/active-filters-frontend.asset.php +1 -1
  135. build/active-filters-frontend.js +2 -2
  136. build/active-filters.asset.php +1 -1
  137. build/active-filters.js +1 -1
  138. build/all-products-frontend.asset.php +1 -1
  139. build/all-products-frontend.js +2 -2
  140. build/all-products.asset.php +1 -1
  141. build/all-products.js +1 -1
  142. build/all-reviews.asset.php +1 -1
  143. build/all-reviews.js +1 -1
  144. build/atomic-block-components/add-to-cart-frontend.js +1 -1
  145. build/atomic-block-components/add-to-cart.js +1 -1
  146. build/atomic-block-components/add-to-cart~atomic-block-components/button.js +1 -1
  147. build/atomic-block-components/add-to-cart~atomic-block-components/image~atomic-block-components/title.js +1 -1
  148. build/atomic-block-components/button-frontend.js +1 -1
  149. build/atomic-block-components/button.js +1 -1
  150. build/atomic-block-components/category-list-frontend.js +1 -1
  151. build/atomic-block-components/category-list.js +1 -1
  152. build/atomic-block-components/image-frontend.js +1 -1
  153. build/atomic-block-components/image.js +1 -1
  154. build/atomic-block-components/price-frontend.js +1 -1
  155. build/atomic-block-components/price.js +1 -1
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/index.js CHANGED
@@ -7,6 +7,10 @@ import { getAttributes, getVariationAttributes } from './utils';
7
 
8
  /**
9
  * VariationAttributes component.
 
 
 
 
10
  */
11
  const VariationAttributes = ( { product, dispatchers } ) => {
12
  const attributes = getAttributes( product.attributes );
7
 
8
  /**
9
  * VariationAttributes component.
10
+ *
11
+ * @param {Object} props Incoming props
12
+ * @param {Object} props.product Product
13
+ * @param {Object} props.dispatchers An object where values are dispatching functions.
14
  */
15
  const VariationAttributes = ( { product, dispatchers } ) => {
16
  const attributes = getAttributes( product.attributes );
assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js CHANGED
@@ -84,7 +84,12 @@ const AddToCartButton = () => {
84
  };
85
 
86
  /**
87
- * Button for non-purchasable products.
 
 
 
 
 
88
  */
89
  const LinkComponent = ( { className, href, text } ) => {
90
  return (
@@ -96,6 +101,14 @@ const LinkComponent = ( { className, href, text } ) => {
96
 
97
  /**
98
  * Button for purchasable products.
 
 
 
 
 
 
 
 
99
  */
100
  const ButtonComponent = ( {
101
  className,
84
  };
85
 
86
  /**
87
+ * Button component for non-purchasable products.
88
+ *
89
+ * @param {Object} props Incoming props.
90
+ * @param {string} props.className Css classnames.
91
+ * @param {string} props.href Link for button.
92
+ * @param {string} props.text Text content for button.
93
  */
94
  const LinkComponent = ( { className, href, text } ) => {
95
  return (
101
 
102
  /**
103
  * Button for purchasable products.
104
+ *
105
+ * @param {Object} props Incoming props for component
106
+ * @param {string} props.className Incoming css class name.
107
+ * @param {number} props.quantityInCart Quantity of item in cart.
108
+ * @param {boolean} props.isProcessing Whether processing action is occurring.
109
+ * @param {boolean} props.isDisabled Whether the button is disabled or not.
110
+ * @param {boolean} props.isDone Whether processing is done.
111
+ * @param {function():any} props.onClick Callback to execute when button is clicked.
112
  */
113
  const ButtonComponent = ( {
114
  className,
assets/js/atomic/blocks/product-elements/add-to-cart/shared/quantity-input.js CHANGED
@@ -1,5 +1,12 @@
1
  /**
2
  * Quantity Input Component.
 
 
 
 
 
 
 
3
  */
4
  const QuantityInput = ( { disabled, min, max, value, onChange } ) => {
5
  return (
1
  /**
2
  * Quantity Input Component.
3
+ *
4
+ * @param {Object} props Incoming props for component
5
+ * @param {boolean} props.disabled Whether input is disabled or not.
6
+ * @param {number} props.min Minimum value for input.
7
+ * @param {number} props.max Maximum value for input.
8
+ * @param {number} props.value Value for input.
9
+ * @param {function():any} props.onChange Function to call on input change event.
10
  */
11
  const QuantityInput = ( { disabled, min, max, value, onChange } ) => {
12
  return (
assets/js/atomic/blocks/product-elements/image/edit.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
6
  import { InspectorControls } from '@wordpress/block-editor';
7
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
8
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
9
  import { getAdminLink } from '@woocommerce/settings';
10
 
@@ -101,7 +101,7 @@ const Edit = ( { attributes, setAttributes } ) => {
101
  'Image Sizing',
102
  'woo-gutenberg-products-block'
103
  ) }
104
- help={ __experimentalCreateInterpolateElement(
105
  __(
106
  'Product image cropping can be modified in the <a>Customizer</a>.',
107
  'woo-gutenberg-products-block'
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
6
  import { InspectorControls } from '@wordpress/block-editor';
7
+ import { createInterpolateElement } from 'wordpress-element';
8
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
9
  import { getAdminLink } from '@woocommerce/settings';
10
 
101
  'Image Sizing',
102
  'woo-gutenberg-products-block'
103
  ) }
104
+ help={ createInterpolateElement(
105
  __(
106
  'Product image cropping can be modified in the <a>Customizer</a>.',
107
  'woo-gutenberg-products-block'
assets/js/atomic/blocks/product-elements/price/block.js CHANGED
@@ -27,7 +27,6 @@ import { withProductDataContext } from '@woocommerce/shared-hocs';
27
  * @param {string} [props.customColor] Normal Price custom text color.
28
  * @param {string} [props.saleColor] Original Price text color.
29
  * @param {string} [props.customSaleColor] Original Price custom text color.
30
- * @param {Object} [props.product] Optional product object. Product from
31
  * context will be used if this is not provided.
32
  * @return {*} The component.
33
  */
27
  * @param {string} [props.customColor] Normal Price custom text color.
28
  * @param {string} [props.saleColor] Original Price text color.
29
  * @param {string} [props.customSaleColor] Original Price custom text color.
 
30
  * context will be used if this is not provided.
31
  * @return {*} The component.
32
  */
assets/js/atomic/blocks/product-elements/rating/block.js CHANGED
@@ -36,6 +36,7 @@ const Block = ( { className } ) => {
36
  };
37
 
38
  const ratingText = sprintf(
 
39
  __( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
40
  rating
41
  );
36
  };
37
 
38
  const ratingText = sprintf(
39
+ /* Translators: %f is referring to the average rating value */
40
  __( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
41
  rating
42
  );
assets/js/atomic/blocks/product-elements/title/block.js CHANGED
@@ -30,7 +30,6 @@ import './style.scss';
30
  * @param {string} [props.customColor] Custom title color value.
31
  * @param {string} [props.fontSize] Title font size name.
32
  * @param {number } [props.customFontSize] Custom font size value.
33
- * @param {Object} [props.product] Optional product object. Product from context
34
  * will be used if this is not provided.
35
  * @return {*} The component.
36
  */
30
  * @param {string} [props.customColor] Custom title color value.
31
  * @param {string} [props.fontSize] Title font size name.
32
  * @param {number } [props.customFontSize] Custom font size value.
 
33
  * will be used if this is not provided.
34
  * @return {*} The component.
35
  */
assets/js/base/components/button/index.js CHANGED
@@ -10,8 +10,17 @@ import classNames from 'classnames';
10
  */
11
  import './style.scss';
12
 
 
 
13
  /**
14
- * Component that visually renders a button but semantically might be `<button>` or `<a>` depending on the props.
 
 
 
 
 
 
 
15
  */
16
  const Button = ( { className, showSpinner = false, children, ...props } ) => {
17
  const buttonClassName = classNames(
10
  */
11
  import './style.scss';
12
 
13
+ /** @typedef {import('react')} React */
14
+
15
  /**
16
+ * Component that visually renders a button but semantically might be `<button>` or `<a>` depending
17
+ * on the props.
18
+ *
19
+ * @param {Object} props Incoming props for the component.
20
+ * @param {string} props.className CSS classname used.
21
+ * @param {boolean} props.showSpinner Whether to show spinner or not.
22
+ * @param {React.ReactChildren} props.children Child components passed in.
23
+ * @param {Object} props.props Rest of incoming props.
24
  */
25
  const Button = ( { className, showSpinner = false, children, ...props } ) => {
26
  const buttonClassName = classNames(
assets/js/base/components/cart-checkout/address-form/country-address-fields.js CHANGED
@@ -198,9 +198,9 @@ const countryAddressFields = {
198
  ES: {
199
  ...postcodeBeforeCity,
200
  state: {
201
- label: __( 'State', 'woo-gutenberg-products-block' ),
202
  optionalLabel: __(
203
- 'State (optional)',
204
  'woo-gutenberg-products-block'
205
  ),
206
  },
198
  ES: {
199
  ...postcodeBeforeCity,
200
  state: {
201
+ label: __( 'Province', 'woo-gutenberg-products-block' ),
202
  optionalLabel: __(
203
+ 'Province (optional)',
204
  'woo-gutenberg-products-block'
205
  ),
206
  },
assets/js/base/components/cart-checkout/address-form/index.js CHANGED
@@ -52,6 +52,15 @@ const validateShippingCountry = (
52
 
53
  /**
54
  * Checkout address form.
 
 
 
 
 
 
 
 
 
55
  */
56
  const AddressForm = ( {
57
  id,
52
 
53
  /**
54
  * Checkout address form.
55
+ *
56
+ * @param {Object} props Incoming props for component.
57
+ * @param {string} props.id Id for component.
58
+ * @param {Array} props.fields Array of fields in form.
59
+ * @param {Object} props.fieldConfig Field configuration for fields in form.
60
+ * @param {string} props.instanceId Unique id for form.
61
+ * @param {function(any):any} props.onChange Function to all for an form onChange event.
62
+ * @param {string} props.type Type of form.
63
+ * @param {Object} props.values Values for fields.
64
  */
65
  const AddressForm = ( {
66
  id,
assets/js/base/components/cart-checkout/payment-method-icons/index.js CHANGED
@@ -15,8 +15,9 @@ import './style.scss';
15
  * For a given list of icons, render each as a list item, using common icons
16
  * where available.
17
  *
18
- * @param {Object} props Component props.
19
- * @param {Array} props.icons Array of icons object configs or ids as strings.
 
20
  */
21
  export const PaymentMethodIcons = ( { icons = [], align = 'center' } ) => {
22
  const iconConfigs = normalizeIconConfig( icons );
15
  * For a given list of icons, render each as a list item, using common icons
16
  * where available.
17
  *
18
+ * @param {Object} props Component props.
19
+ * @param {Array} props.icons Array of icons object configs or ids as strings.
20
+ * @param {string} props.align How to align the icon.
21
  */
22
  export const PaymentMethodIcons = ( { icons = [], align = 'center' } ) => {
23
  const iconConfigs = normalizeIconConfig( icons );
assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.js CHANGED
@@ -9,6 +9,11 @@ const getIconClassName = ( id ) => {
9
 
10
  /**
11
  * Return an element for an icon.
 
 
 
 
 
12
  */
13
  const PaymentMethodIcon = ( { id, src = null, alt = '' } ) => {
14
  if ( ! src ) {
9
 
10
  /**
11
  * Return an element for an icon.
12
+ *
13
+ * @param {Object} props Incoming props for component.
14
+ * @param {string} props.id Id for component.
15
+ * @param {string|null} props.src Optional src value for icon.
16
+ * @param {string} props.alt Optional alt value for icon.
17
  */
18
  const PaymentMethodIcon = ( { id, src = null, alt = '' } ) => {
19
  if ( ! src ) {
assets/js/base/components/cart-checkout/product-image/index.js CHANGED
@@ -7,6 +7,9 @@ import PropTypes from 'prop-types';
7
 
8
  /**
9
  * Formats and returns an image element.
 
 
 
10
  */
11
  const ProductImage = ( { image = {} } ) => {
12
  const imageProps = {
7
 
8
  /**
9
  * Formats and returns an image element.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {Object} props.image Image properties.
13
  */
14
  const ProductImage = ( { image = {} } ) => {
15
  const imageProps = {
assets/js/base/components/cart-checkout/product-low-stock-badge/index.js CHANGED
@@ -11,6 +11,9 @@ import ProductBadge from '../product-badge';
11
 
12
  /**
13
  * Returns a low stock badge.
 
 
 
14
  */
15
  const ProductLowStockBadge = ( { lowStockRemaining } ) => {
16
  if ( ! lowStockRemaining ) {
11
 
12
  /**
13
  * Returns a low stock badge.
14
+ *
15
+ * @param {Object} props Incoming props for the component.
16
+ * @param {boolean} props.lowStockRemaining Whether or not there is low stock remaining.
17
  */
18
  const ProductLowStockBadge = ( { lowStockRemaining } ) => {
19
  if ( ! lowStockRemaining ) {
assets/js/base/components/cart-checkout/product-sale-badge/index.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
5
  import { __ } from '@wordpress/i18n';
6
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
7
  import PropTypes from 'prop-types';
@@ -26,7 +26,7 @@ const ProductSaleBadge = ( { currency, saleAmount } ) => {
26
  }
27
  return (
28
  <ProductBadge className="wc-block-components-sale-badge">
29
- { __experimentalCreateInterpolateElement(
30
  /* translators: <price/> will be replaced by the discount amount */
31
  __( 'Save <price/>', 'woo-gutenberg-products-block' ),
32
  {
1
  /**
2
  * External dependencies
3
  */
4
+ import { createInterpolateElement } from 'wordpress-element';
5
  import { __ } from '@wordpress/i18n';
6
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
7
  import PropTypes from 'prop-types';
26
  }
27
  return (
28
  <ProductBadge className="wc-block-components-sale-badge">
29
+ { createInterpolateElement(
30
  /* translators: <price/> will be replaced by the discount amount */
31
  __( 'Save <price/>', 'woo-gutenberg-products-block' ),
32
  {
assets/js/base/components/cart-checkout/product-summary/index.js CHANGED
@@ -7,6 +7,11 @@ import { getSetting } from '@woocommerce/settings';
7
 
8
  /**
9
  * Returns an element containing a summary of the product.
 
 
 
 
 
10
  */
11
  const ProductSummary = ( {
12
  className,
7
 
8
  /**
9
  * Returns an element containing a summary of the product.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {string} props.className CSS class name used.
13
+ * @param {string} props.shortDescription Short description for the product.
14
+ * @param {string} props.fullDescription Full description for the product.
15
  */
16
  const ProductSummary = ( {
17
  className,
assets/js/base/components/cart-checkout/product-variation-data/index.js CHANGED
@@ -7,6 +7,10 @@ import classNames from 'classnames';
7
 
8
  /**
9
  * Returns a formatted element containing variation details.
 
 
 
 
10
  */
11
  const ProductVariationData = ( { className, variation = [] } ) => {
12
  if ( ! variation || variation.length === 0 ) {
7
 
8
  /**
9
  * Returns a formatted element containing variation details.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {string} props.className CSS class used.
13
+ * @param {Array<Object>} props.variation Variations in use.
14
  */
15
  const ProductVariationData = ( { className, variation = [] } ) => {
16
  if ( ! variation || variation.length === 0 ) {
assets/js/base/components/cart-checkout/shipping-location/index.js CHANGED
@@ -11,6 +11,9 @@ import { decodeEntities } from '@wordpress/html-entities';
11
 
12
  /**
13
  * Shows a formatted shipping location.
 
 
 
14
  */
15
  const ShippingLocation = ( { address } ) => {
16
  // we bail early if we don't have an address.
11
 
12
  /**
13
  * Shows a formatted shipping location.
14
+ *
15
+ * @param {Object} props Incoming props for the component.
16
+ * @param {Object} props.address Incoming address information.
17
  */
18
  const ShippingLocation = ( { address } ) => {
19
  // we bail early if we don't have an address.
assets/js/base/components/cart-checkout/shipping-rates-control/package.js CHANGED
@@ -49,10 +49,10 @@ const Package = ( {
49
  <Label
50
  label={ `${ name } ×${ quantity }` }
51
  screenReaderLabel={ sprintf(
52
- // translators: %s name of the product (ie: Sunglasses), %d number of units in the current cart package
53
  _n(
54
- '%s (%d unit)',
55
- '%s (%d units)',
56
  quantity,
57
  'woo-gutenberg-products-block'
58
  ),
49
  <Label
50
  label={ `${ name } ×${ quantity }` }
51
  screenReaderLabel={ sprintf(
52
+ // translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package
53
  _n(
54
+ '%1$s (%2$d unit)',
55
+ '%1$s (%2$d units)',
56
  quantity,
57
  'woo-gutenberg-products-block'
58
  ),
assets/js/base/components/cart-checkout/totals/totals-footer-item/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
6
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
7
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
8
  import PropTypes from 'prop-types';
9
 
@@ -25,7 +25,7 @@ const TotalsFooterItem = ( { currency, values } ) => {
25
  description={
26
  DISPLAY_CART_PRICES_INCLUDING_TAX && (
27
  <p className="wc-block-components-totals-footer-item-tax">
28
- { __experimentalCreateInterpolateElement(
29
  __(
30
  'Including <TaxAmount/> in taxes',
31
  'woo-gutenberg-products-block'
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
6
+ import { createInterpolateElement } from 'wordpress-element';
7
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
8
  import PropTypes from 'prop-types';
9
 
25
  description={
26
  DISPLAY_CART_PRICES_INCLUDING_TAX && (
27
  <p className="wc-block-components-totals-footer-item-tax">
28
+ { createInterpolateElement(
29
  __(
30
  'Including <TaxAmount/> in taxes',
31
  'woo-gutenberg-products-block'
assets/js/base/components/cart-checkout/totals/totals-shipping-item/index.js CHANGED
@@ -21,6 +21,13 @@ import './style.scss';
21
 
22
  /**
23
  * Renders the shipping totals row, rates, and calculator if enabled.
 
 
 
 
 
 
 
24
  */
25
  const TotalsShippingItem = ( {
26
  currency,
21
 
22
  /**
23
  * Renders the shipping totals row, rates, and calculator if enabled.
24
+ *
25
+ * @param {Object} props Incoming props for the component.
26
+ * @param {Object} props.currency Currency information.
27
+ * @param {Object} props.values Values in use.
28
+ * @param {boolean} props.isCheckout Whether in checkout or not.
29
+ * @param {boolean} props.showCalculator Whether to show shipping calculator or not.
30
+ * @param {boolean} props.showRatesWithoutAddress Whether to show rates without address or not.
31
  */
32
  const TotalsShippingItem = ( {
33
  currency,
assets/js/base/components/checkbox-control/index.js CHANGED
@@ -12,6 +12,14 @@ import './style.scss';
12
 
13
  /**
14
  * Component used to show a checkbox control with styles.
 
 
 
 
 
 
 
 
15
  */
16
  const CheckboxControl = ( {
17
  className,
12
 
13
  /**
14
  * Component used to show a checkbox control with styles.
15
+ *
16
+ * @param {Object} props Incoming props for the component.
17
+ * @param {string} props.className CSS class used.
18
+ * @param {string} props.label Label for component.
19
+ * @param {string} props.id Id for component.
20
+ * @param {string} props.instanceId Unique id for instance of component.
21
+ * @param {function():any} props.onChange Function called when input changes.
22
+ * @param {Object} props.rest Rest of properties spread.
23
  */
24
  const CheckboxControl = ( {
25
  className,
assets/js/base/components/checkbox-list/index.js CHANGED
@@ -13,6 +13,15 @@ import './style.scss';
13
 
14
  /**
15
  * Component used to show a list of checkboxes in a group.
 
 
 
 
 
 
 
 
 
16
  */
17
  const CheckboxList = ( {
18
  className,
@@ -49,6 +58,7 @@ const CheckboxList = ( {
49
  } }
50
  aria-expanded={ false }
51
  aria-label={ sprintf(
 
52
  _n(
53
  'Show %s more option',
54
  'Show %s more options',
13
 
14
  /**
15
  * Component used to show a list of checkboxes in a group.
16
+ *
17
+ * @param {Object} props Incoming props for the component.
18
+ * @param {string} props.className CSS class used.
19
+ * @param {function():any} props.onChange Function called when inputs change.
20
+ * @param {Array} props.options Options for list.
21
+ * @param {Array} props.checked Which items are checked.
22
+ * @param {boolean} props.isLoading If loading or not.
23
+ * @param {boolean} props.isDisabled If inputs are disabled or not.
24
+ * @param {number} props.limit Whether to limit the number of inputs showing.
25
  */
26
  const CheckboxList = ( {
27
  className,
58
  } }
59
  aria-expanded={ false }
60
  aria-label={ sprintf(
61
+ /* Translators: %s is referring the remaining count of options */
62
  _n(
63
  'Show %s more option',
64
  'Show %s more options',
assets/js/base/components/chip/chip.js CHANGED
@@ -9,11 +9,22 @@ import classNames from 'classnames';
9
  */
10
  import './style.scss';
11
 
 
 
12
  /**
13
  * Component used to render a "chip" -- a list item containing some text.
14
  *
15
  * Each chip defaults to a list element but this can be customized by providing
16
  * a wrapperElement.
 
 
 
 
 
 
 
 
 
17
  */
18
  const Chip = ( {
19
  text,
9
  */
10
  import './style.scss';
11
 
12
+ /** @typedef {import('react')} React */
13
+
14
  /**
15
  * Component used to render a "chip" -- a list item containing some text.
16
  *
17
  * Each chip defaults to a list element but this can be customized by providing
18
  * a wrapperElement.
19
+ *
20
+ * @param {Object} props Incoming props for the component.
21
+ * @param {string} props.text Text for chip content.
22
+ * @param {string} props.screenReaderText Screenreader text for the content.
23
+ * @param {string} props.element The element type for the chip.
24
+ * @param {string} props.className CSS class used.
25
+ * @param {string} props.radius Radius size.
26
+ * @param {React.ReactChildren|null} props.children React children.
27
+ * @param {Object} props.props Rest of props passed through to component.
28
  */
29
  const Chip = ( {
30
  text,
assets/js/base/components/chip/removable-chip.js CHANGED
@@ -14,6 +14,16 @@ import { Chip } from './index.js';
14
  /**
15
  * Component used to render a "chip" -- an item containing some text with
16
  * an X button to remove/dismiss each chip.
 
 
 
 
 
 
 
 
 
 
17
  */
18
  const RemovableChip = ( {
19
  ariaLabel = '',
14
  /**
15
  * Component used to render a "chip" -- an item containing some text with
16
  * an X button to remove/dismiss each chip.
17
+ *
18
+ * @param {Object} props Incoming props for the component.
19
+ * @param {string} props.ariaLabel Aria label content.
20
+ * @param {string} props.className CSS class used.
21
+ * @param {boolean} props.disabled Whether action is disabled or not.
22
+ * @param {function():any} props.onRemove Function to call when remove event is fired.
23
+ * @param {boolean} props.removeOnAnyClick Whether to expand click area for remove event.
24
+ * @param {string} props.text The text for the chip.
25
+ * @param {string} props.screenReaderText The screen reader text for the chip.
26
+ * @param {Object} props.props Rest of props passed into component.
27
  */
28
  const RemovableChip = ( {
29
  ariaLabel = '',
assets/js/base/components/dropdown-selector/index.js CHANGED
@@ -19,6 +19,17 @@ import './style.scss';
19
 
20
  /**
21
  * Component used to show an input box with a dropdown with suggestions.
 
 
 
 
 
 
 
 
 
 
 
22
  */
23
  const DropdownSelector = ( {
24
  attributeLabel = '',
19
 
20
  /**
21
  * Component used to show an input box with a dropdown with suggestions.
22
+ *
23
+ * @param {Object} props Incoming props for the component.
24
+ * @param {string} props.attributeLabel Label for the attributes.
25
+ * @param {string} props.className CSS class used.
26
+ * @param {Array} props.checked Which items are checked.
27
+ * @param {string} props.inputLabel Label used for the input.
28
+ * @param {boolean} props.isDisabled Whether the input is disabled or not.
29
+ * @param {boolean} props.isLoading Whether the input is loading.
30
+ * @param {boolean} props.multiple Whether multi-select is allowed.
31
+ * @param {function():any} props.onChange Function to be called when onChange event fires.
32
+ * @param {Array} props.options The option values to show in the select.
33
  */
34
  const DropdownSelector = ( {
35
  attributeLabel = '',
assets/js/base/components/dropdown-selector/menu.js CHANGED
@@ -38,6 +38,7 @@ const DropdownSelectorMenu = ( {
38
  item: option.value,
39
  'aria-label': selected
40
  ? sprintf(
 
41
  __(
42
  'Remove %s filter',
43
  'woo-gutenberg-products-block'
38
  item: option.value,
39
  'aria-label': selected
40
  ? sprintf(
41
+ /* Translators: %s is referring to the filter option being removed. */
42
  __(
43
  'Remove %s filter',
44
  'woo-gutenberg-products-block'
assets/js/base/components/dropdown-selector/selected-chip.js CHANGED
@@ -13,6 +13,7 @@ const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
13
  onRemoveItem( option.value );
14
  } }
15
  ariaLabel={ sprintf(
 
16
  __( 'Remove %s filter', 'woo-gutenberg-products-block' ),
17
  option.name
18
  ) }
13
  onRemoveItem( option.value );
14
  } }
15
  ariaLabel={ sprintf(
16
+ /* Translators: %s is referring to the filter option being removed. */
17
  __( 'Remove %s filter', 'woo-gutenberg-products-block' ),
18
  option.name
19
  ) }
assets/js/base/components/formatted-monetary-amount/index.js CHANGED
@@ -33,6 +33,11 @@ const currencyToNumberFormat = ( currency ) => {
33
  * Takes a price and returns a formatted price using the NumberFormat component.
34
  *
35
  * @param {Object} props Component props.
 
 
 
 
 
36
  */
37
  const FormattedMonetaryAmount = ( {
38
  className,
33
  * Takes a price and returns a formatted price using the NumberFormat component.
34
  *
35
  * @param {Object} props Component props.
36
+ * @param {string} props.className CSS class used.
37
+ * @param {number} props.value Value of money amount.
38
+ * @param {Object} props.currency Currency configuration object.
39
+ * @param {function():any} props.onValueChange Function to call when value changes.
40
+ * @param {Object} props.props Rest of props passed into component.
41
  */
42
  const FormattedMonetaryAmount = ( {
43
  className,
assets/js/base/components/label/index.js CHANGED
@@ -9,6 +9,12 @@ import classNames from 'classnames';
9
  * Component used to render an accessible text given a label and/or a
10
  * screenReaderLabel. The wrapper element and wrapper props can also be
11
  * specified via props.
 
 
 
 
 
 
12
  */
13
  const Label = ( {
14
  label,
9
  * Component used to render an accessible text given a label and/or a
10
  * screenReaderLabel. The wrapper element and wrapper props can also be
11
  * specified via props.
12
+ *
13
+ * @param {Object} props Incoming props for the component.
14
+ * @param {string} props.label Label content.
15
+ * @param {string} props.screenReaderLabel Content for screen readers.
16
+ * @param {string} props.wrapperElement What element is used to wrap the label.
17
+ * @param {Object} props.wrapperProps Props passed into wrapper element.
18
  */
19
  const Label = ( {
20
  label,
assets/js/base/components/payment-methods/express-payment-methods.js CHANGED
@@ -16,6 +16,11 @@ import {
16
  usePaymentMethodDataContext,
17
  } from '@woocommerce/base-context';
18
 
 
 
 
 
 
19
  const ExpressPaymentMethods = () => {
20
  const { isEditor } = useEditorContext();
21
  const {
@@ -59,9 +64,11 @@ const ExpressPaymentMethods = () => {
59
  <li key="noneRegistered">No registered Payment Methods</li>
60
  );
61
  return (
62
- <ul className="wc-block-components-express-payment__event-buttons">
63
- { content }
64
- </ul>
 
 
65
  );
66
  };
67
 
16
  usePaymentMethodDataContext,
17
  } from '@woocommerce/base-context';
18
 
19
+ /**
20
+ * Internal dependencies
21
+ */
22
+ import PaymentMethodErrorBoundary from './payment-method-error-boundary';
23
+
24
  const ExpressPaymentMethods = () => {
25
  const { isEditor } = useEditorContext();
26
  const {
64
  <li key="noneRegistered">No registered Payment Methods</li>
65
  );
66
  return (
67
+ <PaymentMethodErrorBoundary isEditor={ isEditor }>
68
+ <ul className="wc-block-components-express-payment__event-buttons">
69
+ { content }
70
+ </ul>
71
+ </PaymentMethodErrorBoundary>
72
  );
73
  };
74
 
assets/js/base/components/payment-methods/express-payment/cart-express-payment.js CHANGED
@@ -2,7 +2,10 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { useExpressPaymentMethods } from '@woocommerce/base-hooks';
 
 
 
6
  import { StoreNoticesProvider } from '@woocommerce/base-context';
7
 
8
  /**
@@ -13,6 +16,7 @@ import './style.scss';
13
 
14
  const CartExpressPayment = () => {
15
  const { paymentMethods, isInitialized } = useExpressPaymentMethods();
 
16
 
17
  if (
18
  ! isInitialized ||
@@ -25,7 +29,9 @@ const CartExpressPayment = () => {
25
  <>
26
  <div className="wc-block-components-express-payment wc-block-components-express-payment--cart">
27
  <div className="wc-block-components-express-payment__content">
28
- <StoreNoticesProvider context="wc/express-payment-area">
 
 
29
  <ExpressPaymentMethods />
30
  </StoreNoticesProvider>
31
  </div>
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import {
6
+ useEmitResponse,
7
+ useExpressPaymentMethods,
8
+ } from '@woocommerce/base-hooks';
9
  import { StoreNoticesProvider } from '@woocommerce/base-context';
10
 
11
  /**
16
 
17
  const CartExpressPayment = () => {
18
  const { paymentMethods, isInitialized } = useExpressPaymentMethods();
19
+ const { noticeContexts } = useEmitResponse();
20
 
21
  if (
22
  ! isInitialized ||
29
  <>
30
  <div className="wc-block-components-express-payment wc-block-components-express-payment--cart">
31
  <div className="wc-block-components-express-payment__content">
32
+ <StoreNoticesProvider
33
+ context={ noticeContexts.EXPRESS_PAYMENTS }
34
+ >
35
  <ExpressPaymentMethods />
36
  </StoreNoticesProvider>
37
  </div>
assets/js/base/components/payment-methods/express-payment/checkout-express-payment.js CHANGED
@@ -2,9 +2,16 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { useExpressPaymentMethods } from '@woocommerce/base-hooks';
6
- import { StoreNoticesProvider } from '@woocommerce/base-context';
 
 
 
 
 
 
7
  import Title from '@woocommerce/base-components/title';
 
8
 
9
  /**
10
  * Internal dependencies
@@ -14,11 +21,22 @@ import './style.scss';
14
 
15
  const CheckoutExpressPayment = () => {
16
  const { paymentMethods, isInitialized } = useExpressPaymentMethods();
 
 
17
 
18
  if (
19
  ! isInitialized ||
20
  ( isInitialized && Object.keys( paymentMethods ).length === 0 )
21
  ) {
 
 
 
 
 
 
 
 
 
22
  return null;
23
  }
24
 
@@ -37,7 +55,9 @@ const CheckoutExpressPayment = () => {
37
  </Title>
38
  </div>
39
  <div className="wc-block-components-express-payment__content">
40
- <StoreNoticesProvider context="wc/express-payment-area">
 
 
41
  <p>
42
  { __(
43
  'In a hurry? Use one of our express checkout options below:',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import {
6
+ useEmitResponse,
7
+ useExpressPaymentMethods,
8
+ } from '@woocommerce/base-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/block-settings';
15
 
16
  /**
17
  * Internal dependencies
21
 
22
  const CheckoutExpressPayment = () => {
23
  const { paymentMethods, isInitialized } = useExpressPaymentMethods();
24
+ const { isEditor } = useEditorContext();
25
+ const { noticeContexts } = useEmitResponse();
26
 
27
  if (
28
  ! isInitialized ||
29
  ( isInitialized && Object.keys( paymentMethods ).length === 0 )
30
  ) {
31
+ // Make sure errors are shown in the editor and for admins. For example,
32
+ // when a payment method fails to register.
33
+ if ( isEditor || CURRENT_USER_IS_ADMIN ) {
34
+ return (
35
+ <StoreNoticesProvider
36
+ context={ noticeContexts.EXPRESS_PAYMENTS }
37
+ ></StoreNoticesProvider>
38
+ );
39
+ }
40
  return null;
41
  }
42
 
55
  </Title>
56
  </div>
57
  <div className="wc-block-components-express-payment__content">
58
+ <StoreNoticesProvider
59
+ context={ noticeContexts.EXPRESS_PAYMENTS }
60
+ >
61
  <p>
62
  { __(
63
  'In a hurry? Use one of our express checkout options below:',
assets/js/base/components/payment-methods/payment-method-error-boundary.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Component } from 'react';
6
- import { Notice } from 'wordpress-components';
7
  import PropTypes from 'prop-types';
8
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
9
 
@@ -36,11 +36,15 @@ class PaymentMethodErrorBoundary extends Component {
36
  );
37
  }
38
  }
39
- return (
40
- <Notice isDismissible={ false } status="error">
41
- { errorText }
42
- </Notice>
43
- );
 
 
 
 
44
  }
45
 
46
  return this.props.children;
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Component } from 'react';
6
+ import { StoreNoticesContainer } from '@woocommerce/base-components/store-notices-container';
7
  import PropTypes from 'prop-types';
8
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
9
 
36
  );
37
  }
38
  }
39
+ const notices = [
40
+ {
41
+ id: '0',
42
+ content: errorText,
43
+ isDismissible: false,
44
+ status: 'error',
45
+ },
46
+ ];
47
+ return <StoreNoticesContainer notices={ notices } />;
48
  }
49
 
50
  return this.props.children;
assets/js/base/components/payment-methods/payment-methods.js CHANGED
@@ -11,7 +11,6 @@ import {
11
  cloneElement,
12
  useRef,
13
  useEffect,
14
- useState,
15
  useCallback,
16
  } from '@wordpress/element';
17
  import { __ } from '@wordpress/i18n';
@@ -56,6 +55,7 @@ const PaymentMethods = () => {
56
  const { isEditor } = useEditorContext();
57
  const {
58
  customerPaymentMethods = {},
 
59
  setActivePaymentMethod,
60
  shouldSavePayment,
61
  setShouldSavePayment,
@@ -67,7 +67,6 @@ const PaymentMethods = () => {
67
  ...paymentMethodInterface
68
  } = usePaymentMethodInterface();
69
  const currentPaymentMethodInterface = useRef( paymentMethodInterface );
70
- const [ selectedToken, setSelectedToken ] = useState( '0' );
71
  const { noticeContexts } = useEmitResponse();
72
  const { removeNotice } = useStoreNotices();
73
  const { customerId } = useCheckoutContext();
@@ -158,9 +157,7 @@ const PaymentMethods = () => {
158
  />
159
  );
160
 
161
- const renderedSavedPaymentOptions = (
162
- <SavedPaymentMethodOptions onSelect={ setSelectedToken } />
163
- );
164
 
165
  const renderedTabsAndSavedPaymentOptions = (
166
  <>
@@ -170,7 +167,7 @@ const PaymentMethods = () => {
170
  );
171
 
172
  return Object.keys( customerPaymentMethods ).length > 0 &&
173
- selectedToken !== '0'
174
  ? renderedSavedPaymentOptions
175
  : renderedTabsAndSavedPaymentOptions;
176
  };
11
  cloneElement,
12
  useRef,
13
  useEffect,
 
14
  useCallback,
15
  } from '@wordpress/element';
16
  import { __ } from '@wordpress/i18n';
55
  const { isEditor } = useEditorContext();
56
  const {
57
  customerPaymentMethods = {},
58
+ paymentMethodData,
59
  setActivePaymentMethod,
60
  shouldSavePayment,
61
  setShouldSavePayment,
67
  ...paymentMethodInterface
68
  } = usePaymentMethodInterface();
69
  const currentPaymentMethodInterface = useRef( paymentMethodInterface );
 
70
  const { noticeContexts } = useEmitResponse();
71
  const { removeNotice } = useStoreNotices();
72
  const { customerId } = useCheckoutContext();
157
  />
158
  );
159
 
160
+ const renderedSavedPaymentOptions = <SavedPaymentMethodOptions />;
 
 
161
 
162
  const renderedTabsAndSavedPaymentOptions = (
163
  <>
167
  );
168
 
169
  return Object.keys( customerPaymentMethods ).length > 0 &&
170
+ paymentMethodData.isSavedToken
171
  ? renderedSavedPaymentOptions
172
  : renderedTabsAndSavedPaymentOptions;
173
  };
assets/js/base/components/payment-methods/saved-payment-method-options.js CHANGED
@@ -8,6 +8,7 @@ import {
8
  usePaymentMethodDataContext,
9
  } from '@woocommerce/base-context';
10
  import RadioControl from '@woocommerce/base-components/radio-control';
 
11
 
12
  /**
13
  * @typedef {import('@woocommerce/type-defs/contexts').CustomerPaymentMethod} CustomerPaymentMethod
@@ -30,6 +31,7 @@ const getCcOrEcheckPaymentMethodOption = (
30
  return {
31
  value: tokenId + '',
32
  label: sprintf(
 
33
  __(
34
  '%1$s ending in %2$s (expires %3$s)',
35
  'woo-gutenberg-product-blocks'
@@ -68,6 +70,7 @@ const getDefaultPaymentMethodOptions = (
68
  return {
69
  value: tokenId + '',
70
  label: sprintf(
 
71
  __( 'Saved token for %s', 'woo-gutenberg-products-block' ),
72
  method.gateway
73
  ),
@@ -84,7 +87,7 @@ const getDefaultPaymentMethodOptions = (
84
  };
85
  };
86
 
87
- const SavedPaymentMethodOptions = ( { onSelect } ) => {
88
  const { isEditor } = useEditorContext();
89
  const {
90
  setPaymentStatus,
@@ -92,6 +95,7 @@ const SavedPaymentMethodOptions = ( { onSelect } ) => {
92
  setActivePaymentMethod,
93
  } = usePaymentMethodDataContext();
94
  const [ selectedToken, setSelectedToken ] = useState( '' );
 
95
 
96
  /**
97
  * @type {Object} Options
@@ -99,65 +103,53 @@ const SavedPaymentMethodOptions = ( { onSelect } ) => {
99
  */
100
  const currentOptions = useRef( [] );
101
  useEffect( () => {
102
- let options = [];
103
- const paymentMethodKeys = Object.keys( customerPaymentMethods );
104
- if ( paymentMethodKeys.length > 0 ) {
105
- paymentMethodKeys.forEach( ( type ) => {
106
- const paymentMethods = customerPaymentMethods[ type ];
107
- if ( paymentMethods.length > 0 ) {
108
- options = options.concat(
109
- paymentMethods.map( ( paymentMethod ) => {
110
- const option =
111
- type === 'cc' || type === 'echeck'
112
- ? getCcOrEcheckPaymentMethodOption(
113
- paymentMethod,
114
- setActivePaymentMethod,
115
- setPaymentStatus
116
- )
117
- : getDefaultPaymentMethodOptions(
118
- paymentMethod,
119
- setActivePaymentMethod,
120
- setPaymentStatus
121
- );
122
- if (
123
- paymentMethod.is_default &&
124
- selectedToken === ''
125
- ) {
126
- setSelectedToken( paymentMethod.tokenId + '' );
127
- option.onChange( paymentMethod.tokenId );
128
- }
129
- return option;
130
- } )
131
- );
132
- }
133
- } );
134
- if ( options.length > 0 ) {
135
- currentOptions.current = options;
136
- currentOptions.current.push( {
137
- value: '0',
138
- label: __(
139
- 'Use a new payment method',
140
- 'woo-gutenberg-product-blocks'
141
- ),
142
- name: `wc-saved-payment-method-token-new`,
143
  } );
144
- }
145
- }
 
146
  }, [
147
  customerPaymentMethods,
148
  selectedToken,
149
  setActivePaymentMethod,
150
  setPaymentStatus,
 
151
  ] );
 
152
  const updateToken = useCallback(
153
  ( token ) => {
154
  if ( token === '0' ) {
155
  setPaymentStatus().started();
156
  }
157
  setSelectedToken( token );
158
- onSelect( token );
159
  },
160
- [ setSelectedToken, setPaymentStatus, onSelect ]
161
  );
162
  useEffect( () => {
163
  if ( selectedToken && currentOptions.current.length > 0 ) {
@@ -167,12 +159,17 @@ const SavedPaymentMethodOptions = ( { onSelect } ) => {
167
 
168
  // In the editor, show `Use a new payment method` option as selected.
169
  const selectedOption = isEditor ? '0' : selectedToken + '';
 
 
 
 
 
170
  return currentOptions.current.length > 0 ? (
171
  <RadioControl
172
  id={ 'wc-payment-method-saved-tokens' }
173
  selected={ selectedOption }
174
  onChange={ updateToken }
175
- options={ currentOptions.current }
176
  />
177
  ) : null;
178
  };
8
  usePaymentMethodDataContext,
9
  } from '@woocommerce/base-context';
10
  import RadioControl from '@woocommerce/base-components/radio-control';
11
+ import { getPaymentMethods } from '@woocommerce/blocks-registry';
12
 
13
  /**
14
  * @typedef {import('@woocommerce/type-defs/contexts').CustomerPaymentMethod} CustomerPaymentMethod
31
  return {
32
  value: tokenId + '',
33
  label: sprintf(
34
+ /* Translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */
35
  __(
36
  '%1$s ending in %2$s (expires %3$s)',
37
  'woo-gutenberg-product-blocks'
70
  return {
71
  value: tokenId + '',
72
  label: sprintf(
73
+ // Translators: %s is the name of the payment method gateway.
74
  __( 'Saved token for %s', 'woo-gutenberg-products-block' ),
75
  method.gateway
76
  ),
87
  };
88
  };
89
 
90
+ const SavedPaymentMethodOptions = () => {
91
  const { isEditor } = useEditorContext();
92
  const {
93
  setPaymentStatus,
95
  setActivePaymentMethod,
96
  } = usePaymentMethodDataContext();
97
  const [ selectedToken, setSelectedToken ] = useState( '' );
98
+ const standardMethods = getPaymentMethods();
99
 
100
  /**
101
  * @type {Object} Options
103
  */
104
  const currentOptions = useRef( [] );
105
  useEffect( () => {
106
+ const types = Object.keys( customerPaymentMethods );
107
+ const options = types
108
+ .flatMap( ( type ) => {
109
+ const typeMethods = customerPaymentMethods[ type ];
110
+ return typeMethods.map( ( paymentMethod ) => {
111
+ const method =
112
+ standardMethods[ paymentMethod.method.gateway ];
113
+ if ( ! method?.supports?.savePaymentInfo ) {
114
+ return null;
115
+ }
116
+ const option =
117
+ type === 'cc' || type === 'echeck'
118
+ ? getCcOrEcheckPaymentMethodOption(
119
+ paymentMethod,
120
+ setActivePaymentMethod,
121
+ setPaymentStatus
122
+ )
123
+ : getDefaultPaymentMethodOptions(
124
+ paymentMethod,
125
+ setActivePaymentMethod,
126
+ setPaymentStatus
127
+ );
128
+ if ( paymentMethod.is_default && selectedToken === '' ) {
129
+ setSelectedToken( paymentMethod.tokenId + '' );
130
+ option.onChange( paymentMethod.tokenId );
131
+ }
132
+ return option;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  } );
134
+ } )
135
+ .filter( Boolean );
136
+ currentOptions.current = options;
137
  }, [
138
  customerPaymentMethods,
139
  selectedToken,
140
  setActivePaymentMethod,
141
  setPaymentStatus,
142
+ standardMethods,
143
  ] );
144
+
145
  const updateToken = useCallback(
146
  ( token ) => {
147
  if ( token === '0' ) {
148
  setPaymentStatus().started();
149
  }
150
  setSelectedToken( token );
 
151
  },
152
+ [ setSelectedToken, setPaymentStatus ]
153
  );
154
  useEffect( () => {
155
  if ( selectedToken && currentOptions.current.length > 0 ) {
159
 
160
  // In the editor, show `Use a new payment method` option as selected.
161
  const selectedOption = isEditor ? '0' : selectedToken + '';
162
+ const newPaymentMethodOption = {
163
+ value: '0',
164
+ label: __( 'Use a new payment method', 'woo-gutenberg-product-blocks' ),
165
+ name: `wc-saved-payment-method-token-new`,
166
+ };
167
  return currentOptions.current.length > 0 ? (
168
  <RadioControl
169
  id={ 'wc-payment-method-saved-tokens' }
170
  selected={ selectedOption }
171
  onChange={ updateToken }
172
+ options={ [ ...currentOptions.current, newPaymentMethodOption ] }
173
  />
174
  ) : null;
175
  };
assets/js/base/components/price-slider/index.js CHANGED
@@ -25,6 +25,17 @@ import FilterSubmitButton from '../filter-submit-button';
25
  * Price slider component.
26
  *
27
  * @param {Object} props Component props.
 
 
 
 
 
 
 
 
 
 
 
28
  */
29
  const PriceSlider = ( {
30
  minPrice,
25
  * Price slider component.
26
  *
27
  * @param {Object} props Component props.
28
+ * @param {number} props.minPrice Minimum price for slider.
29
+ * @param {number} props.maxPrice Maximum price for slider.
30
+ * @param {number} props.minConstraint Minimum constraint.
31
+ * @param {number} props.maxConstraint Maximum constraint.
32
+ * @param {function(any):any} props.onChange Function to call on the change event.
33
+ * @param {number} props.step What step values the slider uses.
34
+ * @param {Object} props.currency Currency configuration object.
35
+ * @param {boolean} props.showInputFields Whether to show input fields for the values or not.
36
+ * @param {boolean} props.showFilterButton Whether to show the filter button for the slider.
37
+ * @param {boolean} props.isLoading Whether values are loading or not.
38
+ * @param {function():any} props.onSubmit Function to call when submit event fires.
39
  */
40
  const PriceSlider = ( {
41
  minPrice,
assets/js/base/components/quantity-selector/index.js CHANGED
@@ -84,8 +84,8 @@ const QuantitySelector = ( {
84
  }
85
  } }
86
  aria-label={ sprintf(
 
87
  __(
88
- // translators: %s Item name.
89
  'Quantity of %s in your cart.',
90
  'woo-gutenberg-products-block'
91
  ),
@@ -104,8 +104,8 @@ const QuantitySelector = ( {
104
  onChange( newQuantity );
105
  speak(
106
  sprintf(
 
107
  __(
108
- // translators: %s Quantity amount.
109
  'Quantity reduced to %s.',
110
  'woo-gutenberg-products-block'
111
  ),
@@ -128,8 +128,8 @@ const QuantitySelector = ( {
128
  onChange( newQuantity );
129
  speak(
130
  sprintf(
 
131
  __(
132
- // translators: %s Quantity amount.
133
  'Quantity increased to %s.',
134
  'woo-gutenberg-products-block'
135
  ),
84
  }
85
  } }
86
  aria-label={ sprintf(
87
+ /* Translators: %s refers to the item name in the cart. */
88
  __(
 
89
  'Quantity of %s in your cart.',
90
  'woo-gutenberg-products-block'
91
  ),
104
  onChange( newQuantity );
105
  speak(
106
  sprintf(
107
+ /* Translators: %s refers to the item name in the cart. */
108
  __(
 
109
  'Quantity reduced to %s.',
110
  'woo-gutenberg-products-block'
111
  ),
128
  onChange( newQuantity );
129
  speak(
130
  sprintf(
131
+ /* Translators: %s refers to the item name in the cart. */
132
  __(
 
133
  'Quantity increased to %s.',
134
  'woo-gutenberg-products-block'
135
  ),
assets/js/base/components/reviews/review-list-item/index.js CHANGED
@@ -132,6 +132,7 @@ function getReviewRating( review ) {
132
  >
133
  <span style={ starStyle }>
134
  { sprintf(
 
135
  __(
136
  'Rated %f out of 5',
137
  'woo-gutenberg-products-block'
132
  >
133
  <span style={ starStyle }>
134
  { sprintf(
135
+ /* Translators: %f to the average rating for the review. */
136
  __(
137
  'Rated %f out of 5',
138
  'woo-gutenberg-products-block'
assets/js/base/components/select/style.scss CHANGED
@@ -86,7 +86,7 @@
86
  }
87
 
88
  .components-custom-select-control__menu {
89
- background-color: $select-dropdown-dark;
90
  margin: 0;
91
  max-height: 300px;
92
  overflow: auto;
86
  }
87
 
88
  .components-custom-select-control__menu {
89
+ background-color: $select-dropdown-light;
90
  margin: 0;
91
  max-height: 300px;
92
  overflow: auto;
assets/js/base/components/sort-select/index.js CHANGED
@@ -14,6 +14,17 @@ import './style.scss';
14
  /**
15
  * Component used for 'Order by' selectors, which renders a label
16
  * and a <select> with the options provided in the props.
 
 
 
 
 
 
 
 
 
 
 
17
  */
18
  const SortSelect = ( {
19
  className,
14
  /**
15
  * Component used for 'Order by' selectors, which renders a label
16
  * and a <select> with the options provided in the props.
17
+ *
18
+ * @param {Object} props Incoming props for the component.
19
+ * @param {string} props.className CSS class used.
20
+ * @param {string} props.instanceId Unique id for component instance.
21
+ * @param {string} props.defaultValue Default value for the select.
22
+ * @param {string} props.label Label for the select.
23
+ * @param {function():any} props.onChange Function to call on the change event.
24
+ * @param {Array} props.options Option values for the select.
25
+ * @param {string} props.screenReaderLabel Screen reader label.
26
+ * @param {boolean} props.readOnly Whether the select is read only or not.
27
+ * @param {string} props.value The selected value.
28
  */
29
  const SortSelect = ( {
30
  className,
assets/js/base/components/store-notices-container/snackbar-notices.js CHANGED
@@ -8,13 +8,15 @@ import { useEditorContext } from '@woocommerce/base-context';
8
  const NoticesContainer = () => {
9
  const { isEditor } = useEditorContext();
10
  const { notices, removeNotice } = useStoreNotices();
11
- const snackbarNotices = notices.filter(
12
- ( notice ) => notice.type === 'snackbar'
13
- );
14
 
15
  if ( isEditor ) {
16
  return null;
17
  }
 
 
 
 
 
18
  return (
19
  <SnackbarList
20
  notices={ snackbarNotices }
8
  const NoticesContainer = () => {
9
  const { isEditor } = useEditorContext();
10
  const { notices, removeNotice } = useStoreNotices();
 
 
 
11
 
12
  if ( isEditor ) {
13
  return null;
14
  }
15
+
16
+ const snackbarNotices = notices.filter(
17
+ ( notice ) => notice.type === 'snackbar'
18
+ );
19
+
20
  return (
21
  <SnackbarList
22
  notices={ snackbarNotices }
assets/js/base/components/store-notices-container/store-notices-container.js CHANGED
@@ -26,7 +26,6 @@ const getWooClassName = ( { status = 'default' } ) => {
26
 
27
  const StoreNoticesContainer = ( { className, notices } ) => {
28
  const { removeNotice } = useStoreNoticesContext();
29
- const wrapperClass = classnames( className, 'wc-block-components-notices' );
30
  const regularNotices = notices.filter(
31
  ( notice ) => notice.type !== 'snackbar'
32
  );
@@ -35,6 +34,8 @@ const StoreNoticesContainer = ( { className, notices } ) => {
35
  return null;
36
  }
37
 
 
 
38
  return (
39
  <div className={ wrapperClass }>
40
  { regularNotices.map( ( props ) => (
26
 
27
  const StoreNoticesContainer = ( { className, notices } ) => {
28
  const { removeNotice } = useStoreNoticesContext();
 
29
  const regularNotices = notices.filter(
30
  ( notice ) => notice.type !== 'snackbar'
31
  );
34
  return null;
35
  }
36
 
37
+ const wrapperClass = classnames( className, 'wc-block-components-notices' );
38
+
39
  return (
40
  <div className={ wrapperClass }>
41
  { regularNotices.map( ( props ) => (
assets/js/base/components/summary/utils.js CHANGED
@@ -6,7 +6,7 @@ import { autop } from '@wordpress/autop';
6
 
7
  /**
8
  * Generates the summary text from a string of text.
9
- *a
10
  * @param {string} source Source text.
11
  * @param {number} maxLength Limit number of countType returned if text has multiple paragraphs.
12
  * @param {string} countType What is being counted. One of words, characters_excluding_spaces, or characters_including_spaces.
6
 
7
  /**
8
  * Generates the summary text from a string of text.
9
+ *
10
  * @param {string} source Source text.
11
  * @param {number} maxLength Limit number of countType returned if text has multiple paragraphs.
12
  * @param {string} countType What is being counted. One of words, characters_excluding_spaces, or characters_including_spaces.
assets/js/base/components/title/index.js CHANGED
@@ -9,8 +9,16 @@ import PropTypes from 'prop-types';
9
  */
10
  import './style.scss';
11
 
 
 
12
  /**
13
  * Component that renders a block title.
 
 
 
 
 
 
14
  */
15
  const Title = ( { children, className, headingLevel, ...props } ) => {
16
  const buttonClassName = classNames(
9
  */
10
  import './style.scss';
11
 
12
+ /** @typedef {import('react')} React */
13
+
14
  /**
15
  * Component that renders a block title.
16
+ *
17
+ * @param {Object} props Incoming props for the component.
18
+ * @param {React.ReactChildren} props.children Children elements this component wraps.
19
+ * @param {string} props.className CSS class used.
20
+ * @param {string} props.headingLevel Heading level for title.
21
+ * @param {Object} props.props Rest of props passed through to component.
22
  */
23
  const Title = ( { children, className, headingLevel, ...props } ) => {
24
  const buttonClassName = classNames(
assets/js/base/context/add-to-cart-form/form-state/reducer.js CHANGED
@@ -31,6 +31,9 @@ const {
31
  *
32
  * @param {Object} state Current state.
33
  * @param {Object} action Incoming action object.
 
 
 
34
  */
35
  export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
36
  let newState;
31
  *
32
  * @param {Object} state Current state.
33
  * @param {Object} action Incoming action object.
34
+ * @param {number} action.quantity Incoming quantity.
35
+ * @param {string} action.type Type of action.
36
+ * @param {Object} action.data Incoming payload for action.
37
  */
38
  export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
39
  let newState;
assets/js/base/context/cart-checkout/checkout-state/reducer.js CHANGED
@@ -64,6 +64,11 @@ export const prepareResponseData = ( data ) => {
64
  *
65
  * @param {Object} state Current state.
66
  * @param {Object} action Incoming action object.
 
 
 
 
 
67
  */
68
  export const reducer = (
69
  state = DEFAULT_STATE,
64
  *
65
  * @param {Object} state Current state.
66
  * @param {Object} action Incoming action object.
67
+ * @param {string} action.url URL passed in.
68
+ * @param {string} action.type Type of action.
69
+ * @param {string} action.orderId Order ID.
70
+ * @param {Array} action.orderNotes Order notes.
71
+ * @param {Object} action.data Other action payload.
72
  */
73
  export const reducer = (
74
  state = DEFAULT_STATE,
assets/js/base/context/cart-checkout/payment-methods/payment-method-data-context.js CHANGED
@@ -195,17 +195,17 @@ export const PaymentMethodDataProvider = ( { children } ) => {
195
  ( message ) => {
196
  if ( message ) {
197
  addErrorNotice( message, {
198
- context: 'wc/express-payment-area',
199
  id: 'wc-express-payment-error',
200
  } );
201
  } else {
202
  removeNotice(
203
  'wc-express-payment-error',
204
- 'wc/express-payment-area'
205
  );
206
  }
207
  },
208
- [ addErrorNotice, removeNotice ]
209
  );
210
  // ensure observers are always current.
211
  useEffect( () => {
@@ -337,6 +337,10 @@ export const PaymentMethodDataProvider = ( { children } ) => {
337
  // Set active (selected) payment method as needed.
338
  useEffect( () => {
339
  const paymentMethodKeys = Object.keys( paymentData.paymentMethods );
 
 
 
 
340
  if ( ! paymentMethodsInitialized || ! paymentMethodKeys.length ) {
341
  return;
342
  }
@@ -344,16 +348,24 @@ export const PaymentMethodDataProvider = ( { children } ) => {
344
  setActive( ( currentActivePaymentMethod ) => {
345
  // If there's no active payment method, or the active payment method has
346
  // been removed (e.g. COD vs shipping methods), set one as active.
 
 
 
347
  if (
348
  ! currentActivePaymentMethod ||
349
- ! paymentMethodKeys.includes( currentActivePaymentMethod )
350
  ) {
351
  dispatch( statusOnly( PRISTINE ) );
352
  return Object.keys( paymentData.paymentMethods )[ 0 ];
353
  }
354
  return currentActivePaymentMethod;
355
  } );
356
- }, [ paymentMethodsInitialized, paymentData.paymentMethods, setActive ] );
 
 
 
 
 
357
 
358
  // emit events.
359
  useEffect( () => {
195
  ( message ) => {
196
  if ( message ) {
197
  addErrorNotice( message, {
198
+ context: noticeContexts.EXPRESS_PAYMENTS,
199
  id: 'wc-express-payment-error',
200
  } );
201
  } else {
202
  removeNotice(
203
  'wc-express-payment-error',
204
+ noticeContexts.EXPRESS_PAYMENTS
205
  );
206
  }
207
  },
208
+ [ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
209
  );
210
  // ensure observers are always current.
211
  useEffect( () => {
337
  // Set active (selected) payment method as needed.
338
  useEffect( () => {
339
  const paymentMethodKeys = Object.keys( paymentData.paymentMethods );
340
+ const allPaymentMethodKeys = [
341
+ ...paymentMethodKeys,
342
+ ...Object.keys( paymentData.expressPaymentMethods ),
343
+ ];
344
  if ( ! paymentMethodsInitialized || ! paymentMethodKeys.length ) {
345
  return;
346
  }
348
  setActive( ( currentActivePaymentMethod ) => {
349
  // If there's no active payment method, or the active payment method has
350
  // been removed (e.g. COD vs shipping methods), set one as active.
351
+ // Note: It's possible that the active payment method might be an
352
+ // express payment method. So registered express payment methods are
353
+ // included in the check here.
354
  if (
355
  ! currentActivePaymentMethod ||
356
+ ! allPaymentMethodKeys.includes( currentActivePaymentMethod )
357
  ) {
358
  dispatch( statusOnly( PRISTINE ) );
359
  return Object.keys( paymentData.paymentMethods )[ 0 ];
360
  }
361
  return currentActivePaymentMethod;
362
  } );
363
+ }, [
364
+ paymentMethodsInitialized,
365
+ paymentData.paymentMethods,
366
+ paymentData.expressPaymentMethods,
367
+ setActive,
368
+ ] );
369
 
370
  // emit events.
371
  useEffect( () => {
assets/js/base/context/cart-checkout/payment-methods/reducer.js CHANGED
@@ -26,6 +26,11 @@ const hasSavedPaymentToken = ( paymentMethodData ) => {
26
  *
27
  * @param {Object} state Current state.
28
  * @param {Object} action Current action.
 
 
 
 
 
29
  */
30
  const reducer = (
31
  state = DEFAULT_PAYMENT_DATA,
26
  *
27
  * @param {Object} state Current state.
28
  * @param {Object} action Current action.
29
+ * @param {string} action.type Action type.
30
+ * @param {Object} action.paymentMethodData Payment method data payload.
31
+ * @param {boolean} action.shouldSavePaymentMethod Should save payment method flag.
32
+ * @param {string} action.errorMessage Error message to store in state.
33
+ * @param {Object} action.paymentMethods Registered payment methods.
34
  */
35
  const reducer = (
36
  state = DEFAULT_PAYMENT_DATA,
assets/js/base/context/cart-checkout/payment-methods/test/payment-method-data-context.js ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen, fireEvent, waitFor } from '@testing-library/react';
5
+ import { previewCart } from '@woocommerce/resource-previews';
6
+ import { dispatch } from '@wordpress/data';
7
+ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
8
+ import {
9
+ registerPaymentMethod,
10
+ registerExpressPaymentMethod,
11
+ __experimentalDeRegisterPaymentMethod,
12
+ __experimentalDeRegisterExpressPaymentMethod,
13
+ } from '@woocommerce/blocks-registry';
14
+ import { CheckoutExpressPayment } from '@woocommerce/base-components/payment-methods';
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import {
19
+ usePaymentMethodDataContext,
20
+ PaymentMethodDataProvider,
21
+ } from '../payment-method-data-context';
22
+ import { defaultCartState } from '../../../../../data/default-states';
23
+
24
+ const registerMockPaymentMethods = () => {
25
+ [ 'cheque', 'bacs' ].forEach( ( name ) => {
26
+ registerPaymentMethod(
27
+ ( Config ) =>
28
+ new Config( {
29
+ name,
30
+ label: name,
31
+ content: <div>A payment method</div>,
32
+ edit: <div>A payment method</div>,
33
+ icons: null,
34
+ canMakePayment: () => true,
35
+ ariaLabel: name,
36
+ } )
37
+ );
38
+ } );
39
+ [ 'express-payment' ].forEach( ( name ) => {
40
+ registerExpressPaymentMethod( ( Config ) => {
41
+ const Content = ( {
42
+ onClose = () => void null,
43
+ onClick = () => void null,
44
+ } ) => {
45
+ return (
46
+ <>
47
+ <button onClick={ onClick }>
48
+ { name + ' express payment method' }
49
+ </button>
50
+ <button onClick={ onClose }>
51
+ { name + ' express payment method close' }
52
+ </button>
53
+ </>
54
+ );
55
+ };
56
+ return new Config( {
57
+ name,
58
+ content: <Content />,
59
+ edit: <div>An express payment method</div>,
60
+ canMakePayment: () => true,
61
+ paymentMethodId: name,
62
+ } );
63
+ } );
64
+ } );
65
+ };
66
+
67
+ const resetMockPaymentMethods = () => {
68
+ [ 'cheque', 'bacs' ].forEach( ( name ) => {
69
+ __experimentalDeRegisterPaymentMethod( name );
70
+ } );
71
+ [ 'express-payment' ].forEach( ( name ) => {
72
+ __experimentalDeRegisterExpressPaymentMethod( name );
73
+ } );
74
+ };
75
+
76
+ describe( 'Testing Payment Method Data Context Provider', () => {
77
+ beforeEach( async () => {
78
+ registerMockPaymentMethods();
79
+ fetchMock.mockResponse( ( req ) => {
80
+ if ( req.url.match( /wc\/store\/cart/ ) ) {
81
+ return Promise.resolve( JSON.stringify( previewCart ) );
82
+ }
83
+ } );
84
+ // need to clear the store resolution state between tests.
85
+ await dispatch( storeKey ).invalidateResolutionForStore();
86
+ await dispatch( storeKey ).receiveCart( defaultCartState );
87
+ } );
88
+ afterEach( async () => {
89
+ resetMockPaymentMethods();
90
+ fetchMock.resetMocks();
91
+ } );
92
+ it( 'toggles active payment method correctly for express payment activation and close', async () => {
93
+ const TriggerActiveExpressPaymentMethod = () => {
94
+ const { activePaymentMethod } = usePaymentMethodDataContext();
95
+ return (
96
+ <>
97
+ <CheckoutExpressPayment />
98
+ { 'Active Payment Method: ' + activePaymentMethod }
99
+ </>
100
+ );
101
+ };
102
+ const TestComponent = () => {
103
+ return (
104
+ <PaymentMethodDataProvider>
105
+ <TriggerActiveExpressPaymentMethod />
106
+ </PaymentMethodDataProvider>
107
+ );
108
+ };
109
+ render( <TestComponent /> );
110
+ // should initialize by default the first payment method.
111
+ await waitFor( () => {
112
+ const activePaymentMethod = screen.queryByText(
113
+ /Active Payment Method: cheque/
114
+ );
115
+ expect( activePaymentMethod ).not.toBeNull();
116
+ } );
117
+ // Express payment method clicked.
118
+ fireEvent.click(
119
+ screen.getByText( 'express-payment express payment method' )
120
+ );
121
+ await waitFor( () => {
122
+ const activePaymentMethod = screen.queryByText(
123
+ /Active Payment Method: express-payment/
124
+ );
125
+ expect( activePaymentMethod ).not.toBeNull();
126
+ } );
127
+ // Express payment method closed.
128
+ fireEvent.click(
129
+ screen.getByText( 'express-payment express payment method close' )
130
+ );
131
+ await waitFor( () => {
132
+ const activePaymentMethod = screen.queryByText(
133
+ /Active Payment Method: cheque/
134
+ );
135
+ expect( activePaymentMethod ).not.toBeNull();
136
+ } );
137
+ } );
138
+ } );
assets/js/base/context/cart-checkout/payment-methods/use-payment-method-registration.js CHANGED
@@ -11,32 +11,17 @@ import {
11
  useEditorContext,
12
  useShippingDataContext,
13
  } from '@woocommerce/base-context';
14
- import { useStoreCart, useShallowEqual } from '@woocommerce/base-hooks';
 
 
 
 
 
15
  import {
16
  CURRENT_USER_IS_ADMIN,
17
  PAYMENT_GATEWAY_SORT_ORDER,
18
  } from '@woocommerce/block-settings';
19
 
20
- /**
21
- * If there was an error registering a payment method, alert the admin.
22
- *
23
- * @param {Object} error Error object.
24
- */
25
- const handleRegistrationError = ( error ) => {
26
- if ( CURRENT_USER_IS_ADMIN ) {
27
- throw new Error(
28
- sprintf(
29
- __(
30
- // translators: %s is the error method returned by the payment method.
31
- 'Problem with payment method initialization: %s',
32
- 'woo-gutenberg-products-block'
33
- ),
34
- error.message
35
- )
36
- );
37
- }
38
- };
39
-
40
  /**
41
  * This hook handles initializing registered payment methods and exposing all
42
  * registered payment methods that can be used in the current environment (via
@@ -50,6 +35,8 @@ const handleRegistrationError = ( error ) => {
50
  * @param {Array} paymentMethodsSortOrder Array of payment method names to
51
  * sort by. This should match keys of
52
  * registeredPaymentMethods.
 
 
53
  *
54
  * @return {boolean} Whether the payment methods have been initialized or not. True when all payment
55
  * methods have been initialized.
@@ -57,7 +44,8 @@ const handleRegistrationError = ( error ) => {
57
  const usePaymentMethodRegistration = (
58
  dispatcher,
59
  registeredPaymentMethods,
60
- paymentMethodsSortOrder
 
61
  ) => {
62
  const [ isInitialized, setIsInitialized ] = useState( false );
63
  const { isEditor } = useEditorContext();
@@ -71,6 +59,7 @@ const usePaymentMethodRegistration = (
71
  shippingAddress,
72
  selectedShippingMethods,
73
  } );
 
74
 
75
  useEffect( () => {
76
  canPayArgument.current = {
@@ -102,12 +91,6 @@ const usePaymentMethodRegistration = (
102
  continue;
103
  }
104
 
105
- // In editor, shortcut so all payment methods show as available.
106
- if ( isEditor ) {
107
- addAvailablePaymentMethod( paymentMethod );
108
- continue;
109
- }
110
-
111
  // In front end, ask payment method if it should be available.
112
  try {
113
  const canPay = await Promise.resolve(
@@ -120,8 +103,20 @@ const usePaymentMethodRegistration = (
120
  addAvailablePaymentMethod( paymentMethod );
121
  }
122
  } catch ( e ) {
123
- // If user is admin, show payment `canMakePayment` errors as a notice.
124
- handleRegistrationError( e );
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
  }
127
 
@@ -133,10 +128,12 @@ const usePaymentMethodRegistration = (
133
  // That's why we track "is initialised" state here.
134
  setIsInitialized( true );
135
  }, [
 
136
  dispatcher,
137
  isEditor,
138
- registeredPaymentMethods,
139
  paymentMethodsOrder,
 
140
  ] );
141
 
142
  // Determine which payment methods are available initially and whenever
@@ -158,6 +155,7 @@ const usePaymentMethodRegistration = (
158
  */
159
  export const usePaymentMethods = ( dispatcher ) => {
160
  const standardMethods = getPaymentMethods();
 
161
  // Ensure all methods are present in order.
162
  // Some payment methods may not be present in PAYMENT_GATEWAY_SORT_ORDER if they
163
  // depend on state, e.g. COD can depend on shipping method.
@@ -168,7 +166,8 @@ export const usePaymentMethods = ( dispatcher ) => {
168
  return usePaymentMethodRegistration(
169
  dispatcher,
170
  standardMethods,
171
- Array.from( displayOrder )
 
172
  );
173
  };
174
 
@@ -181,9 +180,11 @@ export const usePaymentMethods = ( dispatcher ) => {
181
  */
182
  export const useExpressPaymentMethods = ( dispatcher ) => {
183
  const expressMethods = getExpressPaymentMethods();
 
184
  return usePaymentMethodRegistration(
185
  dispatcher,
186
  expressMethods,
187
- Object.keys( expressMethods )
 
188
  );
189
  };
11
  useEditorContext,
12
  useShippingDataContext,
13
  } from '@woocommerce/base-context';
14
+ import {
15
+ useEmitResponse,
16
+ useShallowEqual,
17
+ useStoreCart,
18
+ useStoreNotices,
19
+ } from '@woocommerce/base-hooks';
20
  import {
21
  CURRENT_USER_IS_ADMIN,
22
  PAYMENT_GATEWAY_SORT_ORDER,
23
  } from '@woocommerce/block-settings';
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  /**
26
  * This hook handles initializing registered payment methods and exposing all
27
  * registered payment methods that can be used in the current environment (via
35
  * @param {Array} paymentMethodsSortOrder Array of payment method names to
36
  * sort by. This should match keys of
37
  * registeredPaymentMethods.
38
+ * @param {string} noticeContext Id of the context to append
39
+ * notices to.
40
  *
41
  * @return {boolean} Whether the payment methods have been initialized or not. True when all payment
42
  * methods have been initialized.
44
  const usePaymentMethodRegistration = (
45
  dispatcher,
46
  registeredPaymentMethods,
47
+ paymentMethodsSortOrder,
48
+ noticeContext
49
  ) => {
50
  const [ isInitialized, setIsInitialized ] = useState( false );
51
  const { isEditor } = useEditorContext();
59
  shippingAddress,
60
  selectedShippingMethods,
61
  } );
62
+ const { addErrorNotice } = useStoreNotices();
63
 
64
  useEffect( () => {
65
  canPayArgument.current = {
91
  continue;
92
  }
93
 
 
 
 
 
 
 
94
  // In front end, ask payment method if it should be available.
95
  try {
96
  const canPay = await Promise.resolve(
103
  addAvailablePaymentMethod( paymentMethod );
104
  }
105
  } catch ( e ) {
106
+ if ( CURRENT_USER_IS_ADMIN || isEditor ) {
107
+ const errorText = sprintf(
108
+ /* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
109
+ __(
110
+ `There was an error registering the payment method with id '%s': `,
111
+ 'woo-gutenberg-products-block'
112
+ ),
113
+ paymentMethod.paymentMethodId
114
+ );
115
+ addErrorNotice( `${ errorText } ${ e }`, {
116
+ context: noticeContext,
117
+ id: `wc-${ paymentMethod.paymentMethodId }-registration-error`,
118
+ } );
119
+ }
120
  }
121
  }
122
 
128
  // That's why we track "is initialised" state here.
129
  setIsInitialized( true );
130
  }, [
131
+ addErrorNotice,
132
  dispatcher,
133
  isEditor,
134
+ noticeContext,
135
  paymentMethodsOrder,
136
+ registeredPaymentMethods,
137
  ] );
138
 
139
  // Determine which payment methods are available initially and whenever
155
  */
156
  export const usePaymentMethods = ( dispatcher ) => {
157
  const standardMethods = getPaymentMethods();
158
+ const { noticeContexts } = useEmitResponse();
159
  // Ensure all methods are present in order.
160
  // Some payment methods may not be present in PAYMENT_GATEWAY_SORT_ORDER if they
161
  // depend on state, e.g. COD can depend on shipping method.
166
  return usePaymentMethodRegistration(
167
  dispatcher,
168
  standardMethods,
169
+ Array.from( displayOrder ),
170
+ noticeContexts.PAYMENTS
171
  );
172
  };
173
 
180
  */
181
  export const useExpressPaymentMethods = ( dispatcher ) => {
182
  const expressMethods = getExpressPaymentMethods();
183
+ const { noticeContexts } = useEmitResponse();
184
  return usePaymentMethodRegistration(
185
  dispatcher,
186
  expressMethods,
187
+ Object.keys( expressMethods ),
188
+ noticeContexts.EXPRESS_PAYMENTS
189
  );
190
  };
assets/js/base/context/cart-checkout/shipping/index.js CHANGED
@@ -33,6 +33,7 @@ import {
33
 
34
  /**
35
  * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
 
36
  */
37
 
38
  const { NONE, INVALID_ADDRESS, UNKNOWN } = ERROR_TYPES;
@@ -42,6 +43,7 @@ const { NONE, INVALID_ADDRESS, UNKNOWN } = ERROR_TYPES;
42
  *
43
  * @param {string} state The current status.
44
  * @param {Object} action The incoming action.
 
45
  */
46
  const errorStatusReducer = ( state, { type } ) => {
47
  if ( Object.values( ERROR_TYPES ).includes( type ) ) {
@@ -77,6 +79,7 @@ const hasInvalidShippingAddress = ( errors ) => {
77
  * checkout/cart.
78
  *
79
  * @param {Object} props Incoming props for provider
 
80
  */
81
  export const ShippingDataProvider = ( { children } ) => {
82
  const { dispatchActions } = useCheckoutContext();
33
 
34
  /**
35
  * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
36
+ * @typedef {import('react')} React
37
  */
38
 
39
  const { NONE, INVALID_ADDRESS, UNKNOWN } = ERROR_TYPES;
43
  *
44
  * @param {string} state The current status.
45
  * @param {Object} action The incoming action.
46
+ * @param {string} action.type The type of action.
47
  */
48
  const errorStatusReducer = ( state, { type } ) => {
49
  if ( Object.values( ERROR_TYPES ).includes( type ) ) {
79
  * checkout/cart.
80
  *
81
  * @param {Object} props Incoming props for provider
82
+ * @param {React.ReactElement} props.children
83
  */
84
  export const ShippingDataProvider = ( { children } ) => {
85
  const { dispatchActions } = useCheckoutContext();
assets/js/base/context/container-width-context.js CHANGED
@@ -8,6 +8,7 @@ import classNames from 'classnames';
8
 
9
  /**
10
  * @typedef {import('@woocommerce/type-defs/contexts').ContainerWidthContext} ContainerWidthContext
 
11
  */
12
 
13
  const ContainerWidthContext = createContext( {
@@ -29,6 +30,10 @@ export const useContainerWidthContext = () => {
29
  /**
30
  * Provides an interface to useContainerQueries so children can see what size is being used by the
31
  * container.
 
 
 
 
32
  */
33
  export const ContainerWidthContextProvider = ( {
34
  children,
8
 
9
  /**
10
  * @typedef {import('@woocommerce/type-defs/contexts').ContainerWidthContext} ContainerWidthContext
11
+ * @typedef {import('react')} React
12
  */
13
 
14
  const ContainerWidthContext = createContext( {
30
  /**
31
  * Provides an interface to useContainerQueries so children can see what size is being used by the
32
  * container.
33
+ *
34
+ * @param {Object} props Incoming props for the component.
35
+ * @param {React.ReactChildren} props.children React elements wrapped by the component.
36
+ * @param {string} props.className CSS class in use.
37
  */
38
  export const ContainerWidthContextProvider = ( {
39
  children,
assets/js/base/context/shared/event-emit/reducer.js CHANGED
@@ -32,6 +32,11 @@ export const actions = {
32
  *
33
  * @param {Object} state Current state.
34
  * @param {Object} action Incoming action object
 
 
 
 
 
35
  */
36
  export const reducer = (
37
  state = {},
32
  *
33
  * @param {Object} state Current state.
34
  * @param {Object} action Incoming action object
35
+ * @param {string} action.type The type of action.
36
+ * @param {string} action.eventType What type of event is emitted.
37
+ * @param {string} action.id The id for the event.
38
+ * @param {function(any):any} action.callback The registered callback for the event.
39
+ * @param {number} action.priority The priority for the event.
40
  */
41
  export const reducer = (
42
  state = {},
assets/js/base/context/shared/validation/index.js CHANGED
@@ -12,6 +12,7 @@ import isShallowEqual from '@wordpress/is-shallow-equal';
12
 
13
  /**
14
  * @typedef { import('@woocommerce/type-defs/contexts').ValidationContext } ValidationContext
 
15
  */
16
 
17
  const ValidationContext = createContext( {
@@ -38,6 +39,9 @@ export const useValidationContext = () => {
38
  *
39
  * Any children of this context will be exposed to validation state and helpers
40
  * for tracking validation.
 
 
 
41
  */
42
  export const ValidationContextProvider = ( { children } ) => {
43
  const [ validationErrors, updateValidationErrors ] = useState( {} );
12
 
13
  /**
14
  * @typedef { import('@woocommerce/type-defs/contexts').ValidationContext } ValidationContext
15
+ * @typedef {import('react')} React
16
  */
17
 
18
  const ValidationContext = createContext( {
39
  *
40
  * Any children of this context will be exposed to validation state and helpers
41
  * for tracking validation.
42
+ *
43
+ * @param {Object} props Incoming props for the component.
44
+ * @param {React.ReactChildren} props.children What react elements are wrapped by this component.
45
  */
46
  export const ValidationContextProvider = ( { children } ) => {
47
  const [ validationErrors, updateValidationErrors ] = useState( {} );
assets/js/base/context/store-notices-context.js CHANGED
@@ -16,6 +16,7 @@ import {
16
 
17
  /**
18
  * @typedef {import('@woocommerce/type-defs/contexts').NoticeContext} NoticeContext
 
19
  */
20
 
21
  const StoreNoticesContext = createContext( {
@@ -45,6 +46,12 @@ export const useStoreNoticesContext = () => {
45
  * - Warning
46
  * - Info
47
  * - Success
 
 
 
 
 
 
48
  */
49
  export const StoreNoticesProvider = ( {
50
  children,
16
 
17
  /**
18
  * @typedef {import('@woocommerce/type-defs/contexts').NoticeContext} NoticeContext
19
+ * @typedef {import('react')} React
20
  */
21
 
22
  const StoreNoticesContext = createContext( {
46
  * - Warning
47
  * - Info
48
  * - Success
49
+ *
50
+ * @param {Object} props Incoming props for the component.
51
+ * @param {React.ReactChildren} props.children The Elements wrapped by this component.
52
+ * @param {string} props.className CSS class used.
53
+ * @param {boolean} props.createNoticeContainer Whether to create a notice container or not.
54
+ * @param {string} props.context The notice context for notices being rendered.
55
  */
56
  export const StoreNoticesProvider = ( {
57
  children,
assets/js/base/hooks/cart/use-store-cart-coupons.js CHANGED
@@ -18,7 +18,7 @@ import { useStoreNotices } from '../use-store-notices';
18
  /**
19
  * This is a custom hook for loading the Store API /cart/coupons endpoint and an
20
  * action for adding a coupon _to_ the cart.
21
- * See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
22
  *
23
  * @return {StoreCartCoupon} An object exposing data and actions from/for the
24
  * store api /cart/coupons endpoint.
18
  /**
19
  * This is a custom hook for loading the Store API /cart/coupons endpoint and an
20
  * action for adding a coupon _to_ the cart.
21
+ * See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
22
  *
23
  * @return {StoreCartCoupon} An object exposing data and actions from/for the
24
  * store api /cart/coupons endpoint.
assets/js/base/hooks/cart/use-store-cart-item-quantity.js CHANGED
@@ -23,7 +23,7 @@ import { useStoreCart } from './use-store-cart';
23
  * This is a custom hook for loading the Store API /cart/ endpoint and
24
  * actions for removing or changing item quantity.
25
  *
26
- * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
27
  *
28
  * @param {CartItem} cartItem The cartItem to get quantity info from and
29
  * will have quantity updated on.
23
  * This is a custom hook for loading the Store API /cart/ endpoint and
24
  * actions for removing or changing item quantity.
25
  *
26
+ * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
27
  *
28
  * @param {CartItem} cartItem The cartItem to get quantity info from and
29
  * will have quantity updated on.
assets/js/base/hooks/shipping/use-select-shipping-rate.js CHANGED
@@ -8,7 +8,7 @@ import { useThrowError } from '@woocommerce/base-hooks';
8
 
9
  /**
10
  * This is a custom hook for loading the selected shipping rate from the cart store and actions for selecting a rate.
11
- See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
12
  *
13
  * @param {Array} shippingRates an array of packages with shipping rates.
14
  * @return {Object} This hook will return an object with two properties:
8
 
9
  /**
10
  * This is a custom hook for loading the selected shipping rate from the cart store and actions for selecting a rate.
11
+ See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
12
  *
13
  * @param {Array} shippingRates an array of packages with shipping rates.
14
  * @return {Object} This hook will return an object with two properties:
assets/js/base/hooks/test/use-store-notices.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, act } from '@testing-library/react';
5
+ import { StoreNoticesProvider } from '@woocommerce/base-context';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { useStoreNotices } from '../use-store-notices';
11
+
12
+ describe( 'useStoreNotices', () => {
13
+ function setup() {
14
+ const returnVal = {};
15
+
16
+ function TestComponent() {
17
+ Object.assign( returnVal, useStoreNotices() );
18
+
19
+ return null;
20
+ }
21
+
22
+ render(
23
+ <StoreNoticesProvider>
24
+ <TestComponent />
25
+ </StoreNoticesProvider>
26
+ );
27
+
28
+ return returnVal;
29
+ }
30
+
31
+ test( 'allows adding and removing notices and checking if there are notices of a specific type', () => {
32
+ const storeNoticesData = setup();
33
+
34
+ // Assert initial state.
35
+ expect( storeNoticesData.notices ).toEqual( [] );
36
+ expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );
37
+ expect( storeNoticesData.hasNoticesOfType( 'snackbar' ) ).toBe( false );
38
+
39
+ // Add error notice.
40
+ act( () => {
41
+ storeNoticesData.addErrorNotice( 'Error notice' );
42
+ } );
43
+
44
+ expect( storeNoticesData.notices.length ).toBe( 1 );
45
+ expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( true );
46
+ expect( storeNoticesData.hasNoticesOfType( 'snackbar' ) ).toBe( false );
47
+
48
+ // Add snackbar notice.
49
+ act( () => {
50
+ storeNoticesData.addSnackbarNotice( 'Snackbar notice' );
51
+ } );
52
+
53
+ expect( storeNoticesData.notices.length ).toBe( 2 );
54
+ expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( true );
55
+ expect( storeNoticesData.hasNoticesOfType( 'snackbar' ) ).toBe( true );
56
+
57
+ // Remove error notice.
58
+ act( () => {
59
+ storeNoticesData.removeNotices( 'error' );
60
+ } );
61
+
62
+ expect( storeNoticesData.notices.length ).toBe( 1 );
63
+ expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );
64
+ expect( storeNoticesData.hasNoticesOfType( 'snackbar' ) ).toBe( true );
65
+
66
+ // Remove all remaining notices.
67
+ act( () => {
68
+ storeNoticesData.removeNotices();
69
+ } );
70
+
71
+ expect( storeNoticesData.notices.length ).toBe( 0 );
72
+ expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );
73
+ expect( storeNoticesData.hasNoticesOfType( 'snackbar' ) ).toBe( false );
74
+ } );
75
+ } );
assets/js/base/hooks/use-position-relative-to-viewport.js CHANGED
@@ -4,6 +4,8 @@
4
  import { useRef, useLayoutEffect, useState } from '@wordpress/element';
5
  import { getIntersectionObserver } from '@woocommerce/base-utils';
6
 
 
 
7
  /** @type {React.CSSProperties} */
8
  const style = {
9
  bottom: 0,
4
  import { useRef, useLayoutEffect, useState } from '@wordpress/element';
5
  import { getIntersectionObserver } from '@woocommerce/base-utils';
6
 
7
+ /** @typedef {import('react')} React */
8
+
9
  /** @type {React.CSSProperties} */
10
  const style = {
11
  bottom: 0,
assets/js/base/hooks/use-store-notices.js CHANGED
@@ -29,11 +29,10 @@ export const useStoreNotices = () => {
29
  );
30
  },
31
  removeNotices: ( status = null ) => {
32
- currentNotices.current.map( ( notice ) => {
33
  if ( status === null || notice.status === status ) {
34
  removeNotice( notice.id );
35
  }
36
- return true;
37
  } );
38
  },
39
  removeNotice,
29
  );
30
  },
31
  removeNotices: ( status = null ) => {
32
+ currentNotices.current.forEach( ( notice ) => {
33
  if ( status === null || notice.status === status ) {
34
  removeNotice( notice.id );
35
  }
 
36
  } );
37
  },
38
  removeNotice,
assets/js/base/utils/address.js CHANGED
@@ -3,6 +3,10 @@
3
  * shipping, so we can track when one of them change to update rates.
4
  *
5
  * @param {Object} address An object containing all address information
 
 
 
 
6
  *
7
  * @return {Object} pluckedAddress An object containing shipping address that are needed to fetch an address.
8
  */
3
  * shipping, so we can track when one of them change to update rates.
4
  *
5
  * @param {Object} address An object containing all address information
6
+ * @param {string} address.country The country.
7
+ * @param {string} address.state The state.
8
+ * @param {string} address.city The city.
9
+ * @param {string} address.postcode The postal code.
10
  *
11
  * @return {Object} pluckedAddress An object containing shipping address that are needed to fetch an address.
12
  */
assets/js/base/utils/get-intersection-observer.js CHANGED
@@ -1,3 +1,5 @@
 
 
1
  /**
2
  * Util that returns an IntersectionObserver if supported by the browser. If
3
  * it's not supported, it returns a shim object with the methods to prevent JS
@@ -6,8 +8,8 @@
6
  *
7
  * @param {IntersectionObserverCallback} callback Callback function for the
8
  * Intersection Observer.
9
- * @param {object} options Intersection Observer options.
10
- * @return {object|IntersectionObserver} Intersection Observer if available,
11
  * otherwise a shim object.
12
  *
13
  * @todo Remove IntersectionObserver shim when we drop IE11 support.
1
+ /** @typedef {import('window').IntersectionObserverCallback} IntersectionObserverCallback */
2
+
3
  /**
4
  * Util that returns an IntersectionObserver if supported by the browser. If
5
  * it's not supported, it returns a shim object with the methods to prevent JS
8
  *
9
  * @param {IntersectionObserverCallback} callback Callback function for the
10
  * Intersection Observer.
11
+ * @param {Object} options Intersection Observer options.
12
+ * @return {Object|IntersectionObserver} Intersection Observer if available,
13
  * otherwise a shim object.
14
  *
15
  * @todo Remove IntersectionObserver shim when we drop IE11 support.
assets/js/base/utils/legacy-events.js CHANGED
@@ -1,5 +1,7 @@
1
  const Event = window.Event || null;
2
 
 
 
3
  /**
4
  * Wrapper function to dispatch an event so it's compatible with IE11.
5
  *
@@ -48,7 +50,7 @@ export const triggerFragmentRefresh = () => {
48
  * @param {boolean} bubbles Whether the event bubbles.
49
  * @param {boolean} cancelable Whether the event is cancelable.
50
  *
51
- * @returns {Function} Function to remove the jQuery event handler. Ideally it
52
  * should be used when the component is unmounted.
53
  */
54
  export const translateJQueryEventToNative = (
1
  const Event = window.Event || null;
2
 
3
+ /** @typedef {import('window').HTMLNode} HTMLNode */
4
+
5
  /**
6
  * Wrapper function to dispatch an event so it's compatible with IE11.
7
  *
50
  * @param {boolean} bubbles Whether the event bubbles.
51
  * @param {boolean} cancelable Whether the event is cancelable.
52
  *
53
+ * @return {Function} Function to remove the jQuery event handler. Ideally it
54
  * should be used when the component is unmounted.
55
  */
56
  export const translateJQueryEventToNative = (
assets/js/blocks-registry/block-components/get-registered-block-components.js CHANGED
@@ -16,7 +16,6 @@ import { registeredBlockComponents } from './registered-block-components-init';
16
  *
17
  * This gets all registered Block Components so we know which Blocks map to which React Components.
18
  *
19
- * @export
20
  * @param {string} context Current context (a named parent Block). If Block Components were only
21
  * registered under a certain context, those Components will be returned,
22
  * as well as any Components registered under all contexts.
@@ -38,7 +37,6 @@ export function getRegisteredBlockComponents( context ) {
38
  /**
39
  * Alias of getRegisteredBlockComponents kept for backwards compatibility.
40
  *
41
- * @export
42
  * @param {string} main Name of the parent block to retrieve children of.
43
  * @return {Object} List of registered inner blocks.
44
  */
16
  *
17
  * This gets all registered Block Components so we know which Blocks map to which React Components.
18
  *
 
19
  * @param {string} context Current context (a named parent Block). If Block Components were only
20
  * registered under a certain context, those Components will be returned,
21
  * as well as any Components registered under all contexts.
37
  /**
38
  * Alias of getRegisteredBlockComponents kept for backwards compatibility.
39
  *
 
40
  * @param {string} main Name of the parent block to retrieve children of.
41
  * @return {Object} List of registered inner blocks.
42
  */
assets/js/blocks-registry/block-components/register-block-component.js CHANGED
@@ -17,7 +17,6 @@ import { registeredBlockComponents } from './registered-block-components-init';
17
  * Registering a Block Component allows you to define which React Component should be used in place
18
  * of a registered Block. The Component, when rendered, will be passed all Block Attributes.
19
  *
20
- * @export
21
  * @param {Object} options Options to use when registering the block.
22
  * @param {Function} options.component React component that will be rendered, or the return value from React.lazy if
23
  * dynamically imported.
@@ -87,7 +86,6 @@ const assertOption = ( options, optionName, expectedType ) => {
87
  /**
88
  * Alias of registerBlockComponent kept for backwards compatibility.
89
  *
90
- * @export
91
  * @param {Object} options Options to use when registering the block.
92
  * @param {string} options.main Name of the parent block.
93
  * @param {string} options.blockName Name of the child block being registered.
17
  * Registering a Block Component allows you to define which React Component should be used in place
18
  * of a registered Block. The Component, when rendered, will be passed all Block Attributes.
19
  *
 
20
  * @param {Object} options Options to use when registering the block.
21
  * @param {Function} options.component React component that will be rendered, or the return value from React.lazy if
22
  * dynamically imported.
86
  /**
87
  * Alias of registerBlockComponent kept for backwards compatibility.
88
  *
 
89
  * @param {Object} options Options to use when registering the block.
90
  * @param {string} options.main Name of the parent block.
91
  * @param {string} options.blockName Name of the child block being registered.
assets/js/blocks-registry/payment-methods/registry.js CHANGED
@@ -32,6 +32,16 @@ export const registerExpressPaymentMethod = ( expressPaymentMethodCreator ) => {
32
  }
33
  };
34
 
 
 
 
 
 
 
 
 
 
 
35
  export const getPaymentMethods = () => {
36
  return paymentMethods;
37
  };
32
  }
33
  };
34
 
35
+ export const __experimentalDeRegisterPaymentMethod = ( paymentMethodName ) => {
36
+ delete paymentMethods[ paymentMethodName ];
37
+ };
38
+
39
+ export const __experimentalDeRegisterExpressPaymentMethod = (
40
+ paymentMethodName
41
+ ) => {
42
+ delete expressPaymentMethods[ paymentMethodName ];
43
+ };
44
+
45
  export const getPaymentMethods = () => {
46
  return paymentMethods;
47
  };
assets/js/blocks/active-filters/active-attribute-filters.js CHANGED
@@ -13,6 +13,12 @@ import { removeAttributeFilterBySlug } from '../../utils/attributes-query';
13
 
14
  /**
15
  * Component that renders active attribute (terms) filters.
 
 
 
 
 
 
16
  */
17
  const ActiveAttributeFilters = ( {
18
  attributeObject = {},
13
 
14
  /**
15
  * Component that renders active attribute (terms) filters.
16
+ *
17
+ * @param {Object} props Incoming props for the component.
18
+ * @param {Object} props.attributeObject The attribute object.
19
+ * @param {Array} props.slugs The slugs for attributes.
20
+ * @param {string} props.operator The operator for the filter.
21
+ * @param {string} props.displayStyle The style used for displaying the filters.
22
  */
23
  const ActiveAttributeFilters = ( {
24
  attributeObject = {},
assets/js/blocks/active-filters/block.js CHANGED
@@ -18,6 +18,10 @@ import ActiveAttributeFilters from './active-attribute-filters';
18
 
19
  /**
20
  * Component displaying active filters.
 
 
 
 
21
  */
22
  const ActiveFiltersBlock = ( {
23
  attributes: blockAttributes,
18
 
19
  /**
20
  * Component displaying active filters.
21
+ *
22
+ * @param {Object} props Incoming props for the component.
23
+ * @param {Object} props.attributes Incoming attributes for the block.
24
+ * @param {boolean} props.isEditor Whether or not in the editor context.
25
  */
26
  const ActiveFiltersBlock = ( {
27
  attributes: blockAttributes,
assets/js/blocks/active-filters/index.js CHANGED
@@ -45,9 +45,7 @@ registerBlockType( 'woocommerce/active-filters', {
45
  },
46
  },
47
  edit,
48
- /**
49
- * Save the props to post content.
50
- */
51
  save( { attributes } ) {
52
  const { className, displayStyle, heading, headingLevel } = attributes;
53
  const data = {
45
  },
46
  },
47
  edit,
48
+ // Save the props to post content.
 
 
49
  save( { attributes } ) {
50
  const { className, displayStyle, heading, headingLevel } = attributes;
51
  const data = {
assets/js/blocks/active-filters/utils.js CHANGED
@@ -14,8 +14,8 @@ import { RemovableChip } from '@woocommerce/base-components/chip';
14
  export const formatPriceRange = ( minPrice, maxPrice ) => {
15
  if ( Number.isFinite( minPrice ) && Number.isFinite( maxPrice ) ) {
16
  return sprintf(
17
- /* translators: %s min price, %s max price */
18
- __( 'Between %s and %s', 'woo-gutenberg-products-block' ),
19
  formatPrice( minPrice ),
20
  formatPrice( maxPrice )
21
  );
14
  export const formatPriceRange = ( minPrice, maxPrice ) => {
15
  if ( Number.isFinite( minPrice ) && Number.isFinite( maxPrice ) ) {
16
  return sprintf(
17
+ /* translators: %1$s min price, %2$s max price */
18
+ __( 'Between %1$s and %2$s', 'woo-gutenberg-products-block' ),
19
  formatPrice( minPrice ),
20
  formatPrice( maxPrice )
21
  );
assets/js/blocks/attribute-filter/block.js CHANGED
@@ -34,6 +34,10 @@ import './style.scss';
34
 
35
  /**
36
  * Component displaying an attribute filter.
 
 
 
 
37
  */
38
  const AttributeFilterBlock = ( {
39
  attributes: blockAttributes,
@@ -252,9 +256,9 @@ const AttributeFilterBlock = ( {
252
  if ( filterAddedName && filterRemovedName ) {
253
  speak(
254
  sprintf(
 
255
  __(
256
- // translators: %s attribute terms (for example: 'red', 'blue', 'large'...)
257
- '%s filter replaced with %s.',
258
  'woo-gutenberg-products-block'
259
  ),
260
  filterAddedName,
@@ -264,7 +268,7 @@ const AttributeFilterBlock = ( {
264
  } else if ( filterAddedName ) {
265
  speak(
266
  sprintf(
267
- // translators: %s attribute term (for example: 'red', 'blue', 'large'...)
268
  __(
269
  '%s filter added.',
270
  'woo-gutenberg-products-block'
@@ -275,7 +279,7 @@ const AttributeFilterBlock = ( {
275
  } else if ( filterRemovedName ) {
276
  speak(
277
  sprintf(
278
- // translators: %s attribute term (for example: 'red', 'blue', 'large'...)
279
  __(
280
  '%s filter removed.',
281
  'woo-gutenberg-products-block'
34
 
35
  /**
36
  * Component displaying an attribute filter.
37
+ *
38
+ * @param {Object} props Incoming props for the component.
39
+ * @param {Object} props.attributes Incoming block attributes.
40
+ * @param {boolean} props.isEditor
41
  */
42
  const AttributeFilterBlock = ( {
43
  attributes: blockAttributes,
256
  if ( filterAddedName && filterRemovedName ) {
257
  speak(
258
  sprintf(
259
+ /* Translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
260
  __(
261
+ '%1$s filter replaced with %2$s.',
 
262
  'woo-gutenberg-products-block'
263
  ),
264
  filterAddedName,
268
  } else if ( filterAddedName ) {
269
  speak(
270
  sprintf(
271
+ /* Translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
272
  __(
273
  '%s filter added.',
274
  'woo-gutenberg-products-block'
279
  } else if ( filterRemovedName ) {
280
  speak(
281
  sprintf(
282
+ /* Translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
283
  __(
284
  '%s filter removed.',
285
  'woo-gutenberg-products-block'
assets/js/blocks/attribute-filter/edit.js CHANGED
@@ -315,6 +315,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
315
  ),
316
  selected: ( n ) =>
317
  sprintf(
 
318
  _n(
319
  '%d attribute selected',
320
  '%d attributes selected',
315
  ),
316
  selected: ( n ) =>
317
  sprintf(
318
+ // Translators: %d is the number of attributes selected.
319
  _n(
320
  '%d attribute selected',
321
  '%d attributes selected',
assets/js/blocks/attribute-filter/index.js CHANGED
@@ -72,9 +72,7 @@ registerBlockType( 'woocommerce/attribute-filter', {
72
  },
73
  },
74
  edit,
75
- /**
76
- * Save the props to post content.
77
- */
78
  save( { attributes } ) {
79
  const {
80
  className,
72
  },
73
  },
74
  edit,
75
+ // Save the props to post content.
 
 
76
  save( { attributes } ) {
77
  const {
78
  className,
assets/js/blocks/attribute-filter/label.js CHANGED
@@ -7,6 +7,10 @@ import Label from '@woocommerce/base-components/label';
7
 
8
  /**
9
  * The label for an attribute term filter.
 
 
 
 
10
  */
11
  const AttributeFilterLabel = ( { name, count } ) => {
12
  return (
7
 
8
  /**
9
  * The label for an attribute term filter.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {string} props.name The name for the label.
13
+ * @param {number} props.count The count of products this attribute is attached to.
14
  */
15
  const AttributeFilterLabel = ( { name, count } ) => {
16
  return (
assets/js/blocks/cart-checkout/cart/checkout-button/index.js CHANGED
@@ -28,6 +28,9 @@ const getIconsFromPaymentMethods = ( paymentMethods ) => {
28
 
29
  /**
30
  * Checkout button rendered in the full cart page.
 
 
 
31
  */
32
  const CheckoutButton = ( { link } ) => {
33
  const { isCalculating } = useCheckoutContext();
28
 
29
  /**
30
  * Checkout button rendered in the full cart page.
31
+ *
32
+ * @param {Object} props Incoming props for the component.
33
+ * @param {string} props.link What the button is linked to.
34
  */
35
  const CheckoutButton = ( { link } ) => {
36
  const { isCalculating } = useCheckoutContext();
assets/js/blocks/cart-checkout/cart/edit.js CHANGED
@@ -21,7 +21,7 @@ import {
21
  useEditorContext,
22
  CartProvider,
23
  } from '@woocommerce/base-context';
24
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
25
  import { useRef } from '@wordpress/element';
26
  import { getAdminLink } from '@woocommerce/settings';
27
  import { previewCart } from '@woocommerce/resource-previews';
@@ -50,7 +50,7 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
50
  isDismissible={ false }
51
  status="warning"
52
  >
53
- { __experimentalCreateInterpolateElement(
54
  __(
55
  'If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.',
56
  'woo-gutenberg-products-block'
@@ -161,6 +161,11 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
161
  * if the user saves the page without having triggered the 'Empty Cart'
162
  * view, inner blocks would not be saved and they wouldn't be visible
163
  * in the frontend.
 
 
 
 
 
164
  */
165
  const CartEditor = ( { className, attributes, setAttributes } ) => {
166
  return (
21
  useEditorContext,
22
  CartProvider,
23
  } from '@woocommerce/base-context';
24
+ import { createInterpolateElement } from 'wordpress-element';
25
  import { useRef } from '@wordpress/element';
26
  import { getAdminLink } from '@woocommerce/settings';
27
  import { previewCart } from '@woocommerce/resource-previews';
50
  isDismissible={ false }
51
  status="warning"
52
  >
53
+ { createInterpolateElement(
54
  __(
55
  'If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.',
56
  'woo-gutenberg-products-block'
161
  * if the user saves the page without having triggered the 'Empty Cart'
162
  * view, inner blocks would not be saved and they wouldn't be visible
163
  * in the frontend.
164
+ *
165
+ * @param {Object} props Incoming props for the component.
166
+ * @param {string} props.className CSS class used.
167
+ * @param {Object} props.attributes Attributes available.
168
+ * @param {function(any):any} props.setAttributes Setter for attributes.
169
  */
170
  const CartEditor = ( { className, attributes, setAttributes } ) => {
171
  return (
assets/js/blocks/cart-checkout/cart/empty-cart-edit/index.js CHANGED
@@ -14,6 +14,9 @@ import './style.scss';
14
 
15
  /**
16
  * Component to handle edit mode for the Cart block when cart is empty.
 
 
 
17
  */
18
  const EmptyCartEdit = ( { hidden = false } ) => {
19
  return (
@@ -46,6 +49,7 @@ const EmptyCartEdit = ( { hidden = false } ) => {
46
  {
47
  align: 'center',
48
  content: sprintf(
 
49
  __(
50
  '<a href="%s">Browse store</a>.',
51
  'woo-gutenberg-products-block'
14
 
15
  /**
16
  * Component to handle edit mode for the Cart block when cart is empty.
17
+ *
18
+ * @param {Object} props Incoming props for the component.
19
+ * @param {boolean} props.hidden Whether this component is hidden or not.
20
  */
21
  const EmptyCartEdit = ( { hidden = false } ) => {
22
  return (
49
  {
50
  align: 'center',
51
  content: sprintf(
52
+ // Translators: %s is the link to the store product directory.
53
  __(
54
  '<a href="%s">Browse store</a>.',
55
  'woo-gutenberg-products-block'
assets/js/blocks/cart-checkout/cart/frontend.js CHANGED
@@ -8,7 +8,7 @@ import {
8
  import { __ } from '@wordpress/i18n';
9
  import { StoreNoticesProvider } from '@woocommerce/base-context';
10
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
11
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
12
  import {
13
  renderFrontend,
14
  getValidBlockAttributes,
@@ -44,7 +44,7 @@ const getProps = ( el ) => {
44
  const getErrorBoundaryProps = () => {
45
  return {
46
  header: __( 'Something went wrong…', 'woo-gutenberg-products-block' ),
47
- text: __experimentalCreateInterpolateElement(
48
  __(
49
  'The cart has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
50
  'woo-gutenberg-products-block'
8
  import { __ } from '@wordpress/i18n';
9
  import { StoreNoticesProvider } from '@woocommerce/base-context';
10
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
11
+ import { createInterpolateElement } from 'wordpress-element';
12
  import {
13
  renderFrontend,
14
  getValidBlockAttributes,
44
  const getErrorBoundaryProps = () => {
45
  return {
46
  header: __( 'Something went wrong…', 'woo-gutenberg-products-block' ),
47
+ text: createInterpolateElement(
48
  __(
49
  'The cart has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
50
  'woo-gutenberg-products-block'
assets/js/blocks/cart-checkout/cart/full-cart/cart-line-items-title.js CHANGED
@@ -9,6 +9,7 @@ const CartLineItemsTitle = ( { itemCount = 1 } ) => {
9
  return (
10
  <Title headingLevel="2">
11
  { sprintf(
 
12
  _n(
13
  'Your cart (%d item)',
14
  'Your cart (%d items)',
9
  return (
10
  <Title headingLevel="2">
11
  { sprintf(
12
+ // Translators: %d is the count of items in the cart.
13
  _n(
14
  'Your cart (%d item)',
15
  'Your cart (%d items)',
assets/js/blocks/cart-checkout/cart/full-cart/index.js CHANGED
@@ -46,6 +46,9 @@ import './style.scss';
46
 
47
  /**
48
  * Component that renders the Cart block when user has something in cart aka "full".
 
 
 
49
  */
50
  const Cart = ( { attributes } ) => {
51
  const {
46
 
47
  /**
48
  * Component that renders the Cart block when user has something in cart aka "full".
49
+ *
50
+ * @param {Object} props Incoming props for the component.
51
+ * @param {Object} props.attributes Incoming attributes for block.
52
  */
53
  const Cart = ( { attributes } ) => {
54
  const {
assets/js/blocks/cart-checkout/cart/index.js CHANGED
@@ -38,9 +38,7 @@ const settings = {
38
  attributes: blockAttributes,
39
  edit,
40
 
41
- /**
42
- * Save the props to post content.
43
- */
44
  save( { attributes } ) {
45
  return (
46
  <div className={ classnames( 'is-loading', attributes.className ) }>
38
  attributes: blockAttributes,
39
  edit,
40
 
41
+ // Save the props to post content.
 
 
42
  save( { attributes } ) {
43
  return (
44
  <div className={ classnames( 'is-loading', attributes.className ) }>
assets/js/blocks/cart-checkout/cart/test/block.js CHANGED
@@ -37,7 +37,7 @@ describe( 'Testing cart', () => {
37
  );
38
  await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
39
  expect(
40
- await screen.getByText( /Proceed to Checkout/i )
41
  ).toBeInTheDocument();
42
 
43
  /**
@@ -65,7 +65,7 @@ describe( 'Testing cart', () => {
65
  );
66
 
67
  await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
68
- expect( await screen.getByText( /Empty Cart/i ) ).toBeInTheDocument();
69
  expect( fetchMock ).toHaveBeenCalledTimes( 1 );
70
  } );
71
  } );
37
  );
38
  await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
39
  expect(
40
+ screen.getByText( /Proceed to Checkout/i )
41
  ).toBeInTheDocument();
42
 
43
  /**
65
  );
66
 
67
  await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
68
+ expect( screen.getByText( /Empty Cart/i ) ).toBeInTheDocument();
69
  expect( fetchMock ).toHaveBeenCalledTimes( 1 );
70
  } );
71
  } );
assets/js/blocks/cart-checkout/checkout/block.js CHANGED
@@ -53,7 +53,8 @@ const Block = ( props ) => {
53
  * Main Checkout Component.
54
  *
55
  * @param {Object} props Component props.
56
- * @return {*} The component.
 
57
  */
58
  const Checkout = ( { attributes, scrollToTop } ) => {
59
  const { isEditor } = useEditorContext();
53
  * Main Checkout Component.
54
  *
55
  * @param {Object} props Component props.
56
+ * @param {Object} props.attributes Incoming block attributes.
57
+ * @param {function(any):any} props.scrollToTop Function for scrolling to top.
58
  */
59
  const Checkout = ( { attributes, scrollToTop } ) => {
60
  const { isEditor } = useEditorContext();
assets/js/blocks/cart-checkout/checkout/checkout-order-error/index.js CHANGED
@@ -63,7 +63,8 @@ const CheckoutOrderError = () => {
63
  /**
64
  * Get the error message to display.
65
  *
66
- * @param {Object} errorData Object containing code and message.
 
67
  */
68
  const ErrorTitle = ( { errorData } ) => {
69
  let heading = __( 'Checkout error', 'woo-gutenberg-products-block' );
@@ -83,7 +84,8 @@ const ErrorTitle = ( { errorData } ) => {
83
  /**
84
  * Get the error message to display.
85
  *
86
- * @param {Object} errorData Object containing code and message.
 
87
  */
88
  const ErrorMessage = ( { errorData } ) => {
89
  let message = errorData.message;
@@ -104,7 +106,8 @@ const ErrorMessage = ( { errorData } ) => {
104
  /**
105
  * Get the CTA button to display.
106
  *
107
- * @param {Object} errorData Object containing code and message.
 
108
  */
109
  const ErrorButton = ( { errorData } ) => {
110
  let buttonText = __( 'Retry', 'woo-gutenberg-products-block' );
63
  /**
64
  * Get the error message to display.
65
  *
66
+ * @param {Object} props Incoming props for the component.
67
+ * @param {Object} props.errorData Object containing code and message.
68
  */
69
  const ErrorTitle = ( { errorData } ) => {
70
  let heading = __( 'Checkout error', 'woo-gutenberg-products-block' );
84
  /**
85
  * Get the error message to display.
86
  *
87
+ * @param {Object} props Incoming props for the component.
88
+ * @param {Object} props.errorData Object containing code and message.
89
  */
90
  const ErrorMessage = ( { errorData } ) => {
91
  let message = errorData.message;
106
  /**
107
  * Get the CTA button to display.
108
  *
109
+ * @param {Object} props Incoming props for the component.
110
+ * @param {Object} props.errorData Object containing code and message.
111
  */
112
  const ErrorButton = ( { errorData } ) => {
113
  let buttonText = __( 'Retry', 'woo-gutenberg-products-block' );
assets/js/blocks/cart-checkout/checkout/edit.js CHANGED
@@ -19,9 +19,13 @@ import {
19
  CHECKOUT_PAGE_ID,
20
  } from '@woocommerce/block-settings';
21
  import { getAdminLink } from '@woocommerce/settings';
22
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
23
  import { useRef } from '@wordpress/element';
24
- import { EditorProvider, useEditorContext } from '@woocommerce/base-context';
 
 
 
 
25
  import PageSelector from '@woocommerce/editor-components/page-selector';
26
  import {
27
  previewCart,
@@ -57,7 +61,7 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
57
  isDismissible={ false }
58
  status="warning"
59
  >
60
- { __experimentalCreateInterpolateElement(
61
  __(
62
  'If you would like to use this block as your default checkout you must update your <a>page settings in WooCommerce</a>.',
63
  'woo-gutenberg-products-block'
@@ -199,7 +203,7 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
199
  className="wc-block-base-control-notice"
200
  isDismissible={ false }
201
  >
202
- { __experimentalCreateInterpolateElement(
203
  __(
204
  'Pages must be first setup in store settings: <a1>Privacy policy</a1>, <a2>Terms and conditions</a2>.',
205
  'woo-gutenberg-products-block'
@@ -320,9 +324,11 @@ const CheckoutEditor = ( { attributes, setAttributes } ) => {
320
  'woo-gutenberg-products-block'
321
  ) }
322
  >
323
- <Disabled>
324
- <Block attributes={ attributes } />
325
- </Disabled>
 
 
326
  </BlockErrorBoundary>
327
  </div>
328
  </EditorProvider>
19
  CHECKOUT_PAGE_ID,
20
  } from '@woocommerce/block-settings';
21
  import { getAdminLink } from '@woocommerce/settings';
22
+ import { createInterpolateElement } from 'wordpress-element';
23
  import { useRef } from '@wordpress/element';
24
+ import {
25
+ EditorProvider,
26
+ useEditorContext,
27
+ StoreNoticesProvider,
28
+ } from '@woocommerce/base-context';
29
  import PageSelector from '@woocommerce/editor-components/page-selector';
30
  import {
31
  previewCart,
61
  isDismissible={ false }
62
  status="warning"
63
  >
64
+ { createInterpolateElement(
65
  __(
66
  'If you would like to use this block as your default checkout you must update your <a>page settings in WooCommerce</a>.',
67
  'woo-gutenberg-products-block'
203
  className="wc-block-base-control-notice"
204
  isDismissible={ false }
205
  >
206
+ { createInterpolateElement(
207
  __(
208
  'Pages must be first setup in store settings: <a1>Privacy policy</a1>, <a2>Terms and conditions</a2>.',
209
  'woo-gutenberg-products-block'
324
  'woo-gutenberg-products-block'
325
  ) }
326
  >
327
+ <StoreNoticesProvider context="wc/checkout">
328
+ <Disabled>
329
+ <Block attributes={ attributes } />
330
+ </Disabled>
331
+ </StoreNoticesProvider>
332
  </BlockErrorBoundary>
333
  </div>
334
  </EditorProvider>
assets/js/blocks/cart-checkout/checkout/form/payment-method-step.js CHANGED
@@ -7,13 +7,18 @@ import {
7
  useCheckoutContext,
8
  StoreNoticesProvider,
9
  } from '@woocommerce/base-context';
10
- import { usePaymentMethods, useStoreCart } from '@woocommerce/base-hooks';
 
 
 
 
11
  import { PaymentMethods } from '@woocommerce/base-components/payment-methods';
12
 
13
  const PaymentMethodStep = () => {
14
  const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
15
  const { cartNeedsPayment } = useStoreCart();
16
  const { paymentMethods } = usePaymentMethods();
 
17
 
18
  if ( ! cartNeedsPayment ) {
19
  return null;
@@ -34,7 +39,7 @@ const PaymentMethodStep = () => {
34
  : ''
35
  }
36
  >
37
- <StoreNoticesProvider context="wc/payment-area">
38
  <PaymentMethods />
39
  </StoreNoticesProvider>
40
  </FormStep>
7
  useCheckoutContext,
8
  StoreNoticesProvider,
9
  } from '@woocommerce/base-context';
10
+ import {
11
+ useEmitResponse,
12
+ usePaymentMethods,
13
+ useStoreCart,
14
+ } from '@woocommerce/base-hooks';
15
  import { PaymentMethods } from '@woocommerce/base-components/payment-methods';
16
 
17
  const PaymentMethodStep = () => {
18
  const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
19
  const { cartNeedsPayment } = useStoreCart();
20
  const { paymentMethods } = usePaymentMethods();
21
+ const { noticeContexts } = useEmitResponse();
22
 
23
  if ( ! cartNeedsPayment ) {
24
  return null;
39
  : ''
40
  }
41
  >
42
+ <StoreNoticesProvider context={ noticeContexts.PAYMENTS }>
43
  <PaymentMethods />
44
  </StoreNoticesProvider>
45
  </FormStep>
assets/js/blocks/cart-checkout/checkout/frontend.js CHANGED
@@ -13,7 +13,7 @@ import {
13
  } from '@woocommerce/base-context';
14
  import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
15
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
16
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
17
  import {
18
  renderFrontend,
19
  getValidBlockAttributes,
@@ -46,7 +46,7 @@ const CheckoutFrontend = ( props ) => {
46
  'Something went wrong…',
47
  'woo-gutenberg-products-block'
48
  ) }
49
- text={ __experimentalCreateInterpolateElement(
50
  __(
51
  'The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
52
  'woo-gutenberg-products-block'
@@ -82,7 +82,7 @@ const getProps = ( el ) => {
82
  const getErrorBoundaryProps = () => {
83
  return {
84
  header: __( 'Something went wrong…', 'woo-gutenberg-products-block' ),
85
- text: __experimentalCreateInterpolateElement(
86
  __(
87
  'The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
88
  'woo-gutenberg-products-block'
13
  } from '@woocommerce/base-context';
14
  import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
15
  import { CURRENT_USER_IS_ADMIN } from '@woocommerce/block-settings';
16
+ import { createInterpolateElement } from 'wordpress-element';
17
  import {
18
  renderFrontend,
19
  getValidBlockAttributes,
46
  'Something went wrong…',
47
  'woo-gutenberg-products-block'
48
  ) }
49
+ text={ createInterpolateElement(
50
  __(
51
  'The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
52
  'woo-gutenberg-products-block'
82
  const getErrorBoundaryProps = () => {
83
  return {
84
  header: __( 'Something went wrong…', 'woo-gutenberg-products-block' ),
85
+ text: createInterpolateElement(
86
  __(
87
  'The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
88
  'woo-gutenberg-products-block'
assets/js/blocks/cart-checkout/checkout/index.js CHANGED
@@ -37,9 +37,8 @@ const settings = {
37
  },
38
  attributes: blockAttributes,
39
  edit,
40
- /**
41
- * Save the props to post content.
42
- */
43
  save( { attributes } ) {
44
  return (
45
  <div
37
  },
38
  attributes: blockAttributes,
39
  edit,
40
+
41
+ //Save the props to post content.
 
42
  save( { attributes } ) {
43
  return (
44
  <div
assets/js/blocks/featured-category/block.js CHANGED
@@ -48,6 +48,18 @@ import { withCategory } from '../../hocs';
48
 
49
  /**
50
  * Component to handle edit mode of "Featured Category".
 
 
 
 
 
 
 
 
 
 
 
 
51
  */
52
  const FeaturedCategory = ( {
53
  attributes,
48
 
49
  /**
50
  * Component to handle edit mode of "Featured Category".
51
+ *
52
+ * @param {Object} props Incoming props for the component.
53
+ * @param {Object} props.attributes Incoming block attributes.
54
+ * @param {boolean} props.isSelected Whether block is selected or not.
55
+ * @param {function(any):any} props.setAttributes Function for setting new attributes.
56
+ * @param {string} props.error Error message
57
+ * @param {function(any):any} props.getCategory Function for getting category details.
58
+ * @param {boolean} props.isLoading Whether loading or not.
59
+ * @param {Object} props.category The product category object.
60
+ * @param {Object} props.overlayColor Overlay color object for content.
61
+ * @param {function(any):any} props.setOverlayColor Setter for overlay color.
62
+ * @param {function(any):any} props.debouncedSpeak Function for delayed speak.
63
  */
64
  const FeaturedCategory = ( {
65
  attributes,
assets/js/blocks/featured-product/block.js CHANGED
@@ -49,6 +49,19 @@ import {
49
 
50
  /**
51
  * Component to handle edit mode of "Featured Product".
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  */
53
  const FeaturedProduct = ( {
54
  attributes,
49
 
50
  /**
51
  * Component to handle edit mode of "Featured Product".
52
+ *
53
+ * @param {Object} props Incoming props for the component.
54
+ * @param {Object} props.attributes Incoming block attributes.
55
+ * @param {function(any):any} props.debouncedSpeak Function for delayed speak.
56
+ * @param {string} props.error Error message.
57
+ * @param {function(any):any} props.getProduct Function for getting the product.
58
+ * @param {boolean} props.isLoading Whether product is loading or not.
59
+ * @param {boolean} props.isSelected Whether block is selected or not.
60
+ * @param {Object} props.overlayColor Overlay color object.
61
+ * @param {Object} props.product Product object.
62
+ * @param {function(any):any} props.setAttributes Setter for attributes.
63
+ * @param {function(any):any} props.setOverlayColor Setter for overlay color.
64
+ * @param {function(any):any} props.triggerUrlUpdate Function for triggering a url update for product.
65
  */
66
  const FeaturedProduct = ( {
67
  attributes,
assets/js/blocks/price-filter/block.js CHANGED
@@ -21,6 +21,8 @@ import usePriceConstraints from './use-price-constraints.js';
21
  * Component displaying a price filter.
22
  *
23
  * @param {Object} props Component props.
 
 
24
  */
25
  const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
26
  const [ minPriceQuery, setMinPriceQuery ] = useQueryStateByKey(
21
  * Component displaying a price filter.
22
  *
23
  * @param {Object} props Component props.
24
+ * @param {Object} props.attributes Incoming block attributes.
25
+ * @param {boolean} props.isEditor Whether in editor context or not.
26
  */
27
  const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
28
  const [ minPriceQuery, setMinPriceQuery ] = useQueryStateByKey(
assets/js/blocks/price-filter/index.js CHANGED
@@ -49,9 +49,7 @@ registerBlockType( 'woocommerce/price-filter', {
49
 
50
  edit,
51
 
52
- /**
53
- * Save the props to post content.
54
- */
55
  save( { attributes } ) {
56
  const {
57
  className,
49
 
50
  edit,
51
 
52
+ // Save the props to post content.
 
 
53
  save( { attributes } ) {
54
  const {
55
  className,
assets/js/blocks/product-categories/block.js CHANGED
@@ -28,6 +28,11 @@ const EmptyPlaceholder = () => (
28
 
29
  /**
30
  * Component displaying the categories as dropdown or list.
 
 
 
 
 
31
  */
32
  const ProductCategoriesBlock = ( { attributes, setAttributes, name } ) => {
33
  const getInspectorControls = () => {
28
 
29
  /**
30
  * Component displaying the categories as dropdown or list.
31
+ *
32
+ * @param {Object} props Incoming props for the component.
33
+ * @param {Object} props.attributes Incoming block attributes.
34
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
35
+ * @param {string} props.name Name for block.
36
  */
37
  const ProductCategoriesBlock = ( { attributes, setAttributes, name } ) => {
38
  const getInspectorControls = () => {
assets/js/blocks/product-search/block.js CHANGED
@@ -14,6 +14,15 @@ import './style.scss';
14
 
15
  /**
16
  * Component displaying a product search form.
 
 
 
 
 
 
 
 
 
17
  */
18
  const ProductSearchBlock = ( {
19
  attributes: { label, placeholder, formId, className, hasLabel, align },
14
 
15
  /**
16
  * Component displaying a product search form.
17
+ *
18
+ * @param {Object} props Incoming props for the component.
19
+ * @param {Object} props.attributes Incoming block attributes.
20
+ * @param {string} props.attributes.label
21
+ * @param {string} props.attributes.placeholder
22
+ * @param {string} props.attributes.formId
23
+ * @param {string} props.attributes.className
24
+ * @param {boolean} props.attributes.hasLabel
25
+ * @param {string} props.attributes.align
26
  */
27
  const ProductSearchBlock = ( {
28
  attributes: { label, placeholder, formId, className, hasLabel, align },
assets/js/blocks/product-search/edit.js CHANGED
@@ -16,6 +16,17 @@ import './style.scss';
16
 
17
  /**
18
  * Component displaying a product search form.
 
 
 
 
 
 
 
 
 
 
 
19
  */
20
  const Edit = ( {
21
  attributes: { label, placeholder, formId, className, hasLabel, align },
16
 
17
  /**
18
  * Component displaying a product search form.
19
+ *
20
+ * @param {Object} props Incoming props for the component.
21
+ * @param {Object} props.attributes Incoming block attributes.
22
+ * @param {string} props.attributes.label
23
+ * @param {string} props.attributes.placeholder
24
+ * @param {string} props.attributes.formId
25
+ * @param {string} props.attributes.className
26
+ * @param {boolean} props.attributes.hasLabel
27
+ * @param {string} props.attributes.align
28
+ * @param {string} props.instanceId
29
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
30
  */
31
  const Edit = ( {
32
  attributes: { label, placeholder, formId, className, hasLabel, align },
assets/js/blocks/products/all-products/index.js CHANGED
@@ -46,11 +46,7 @@ const blockSettings = {
46
  edit( props ) {
47
  return <Editor { ...props } />;
48
  },
49
- /**
50
- * Save the props to post content.
51
- *
52
- * @param {Object} attributes Attributes to save.
53
- */
54
  save( { attributes } ) {
55
  const dataAttributes = {};
56
  Object.keys( attributes )
46
  edit( props ) {
47
  return <Editor { ...props } />;
48
  },
49
+ // Save the props to post content.
 
 
 
 
50
  save( { attributes } ) {
51
  const dataAttributes = {};
52
  Object.keys( attributes )
assets/js/blocks/reviews/all-reviews/edit.js CHANGED
@@ -20,6 +20,10 @@ import {
20
 
21
  /**
22
  * Component to handle edit mode of "All Reviews".
 
 
 
 
23
  */
24
  const AllReviewsEditor = ( { attributes, setAttributes } ) => {
25
  const getInspectorControls = () => {
20
 
21
  /**
22
  * Component to handle edit mode of "All Reviews".
23
+ *
24
+ * @param {Object} props Incoming props for the component.
25
+ * @param {Object} props.attributes Incoming block attributes.
26
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
27
  */
28
  const AllReviewsEditor = ( { attributes, setAttributes } ) => {
29
  const getInspectorControls = () => {
assets/js/blocks/reviews/edit-utils.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalCreateInterpolateElement } from 'wordpress-element';
6
  import {
7
  Notice,
8
  ToggleControl,
@@ -50,7 +50,7 @@ export const getSharedReviewContentControls = ( attributes, setAttributes ) => {
50
  className="wc-block-base-control-notice"
51
  isDismissible={ false }
52
  >
53
- { __experimentalCreateInterpolateElement(
54
  __(
55
  'Product rating is disabled in your <a>store settings</a>.',
56
  'woo-gutenberg-products-block'
@@ -139,7 +139,7 @@ export const getSharedReviewContentControls = ( attributes, setAttributes ) => {
139
  className="wc-block-base-control-notice"
140
  isDismissible={ false }
141
  >
142
- { __experimentalCreateInterpolateElement(
143
  __(
144
  'Reviewer photo is disabled in your <a>site settings</a>.',
145
  'woo-gutenberg-products-block'
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { createInterpolateElement } from 'wordpress-element';
6
  import {
7
  Notice,
8
  ToggleControl,
50
  className="wc-block-base-control-notice"
51
  isDismissible={ false }
52
  >
53
+ { createInterpolateElement(
54
  __(
55
  'Product rating is disabled in your <a>store settings</a>.',
56
  'woo-gutenberg-products-block'
139
  className="wc-block-base-control-notice"
140
  isDismissible={ false }
141
  >
142
+ { createInterpolateElement(
143
  __(
144
  'Reviewer photo is disabled in your <a>site settings</a>.',
145
  'woo-gutenberg-products-block'
assets/js/blocks/reviews/frontend-block.js CHANGED
@@ -14,6 +14,13 @@ import withReviews from '@woocommerce/base-hocs/with-reviews';
14
 
15
  /**
16
  * Block rendered in the frontend.
 
 
 
 
 
 
 
17
  */
18
  const FrontendBlock = ( {
19
  attributes,
14
 
15
  /**
16
  * Block rendered in the frontend.
17
+ *
18
+ * @param {Object} props Incoming props for the component.
19
+ * @param {Object} props.attributes Incoming block attributes.
20
+ * @param {function(any):any} props.onAppendReviews Function called when appending review.
21
+ * @param {function(any):any} props.onChangeOrderby
22
+ * @param {Array} props.reviews
23
+ * @param {number} props.totalReviews
24
  */
25
  const FrontendBlock = ( {
26
  attributes,
assets/js/blocks/reviews/frontend-container-block.js CHANGED
@@ -51,6 +51,7 @@ class FrontendContainerBlock extends Component {
51
  onReviewsAppended( { newReviews } ) {
52
  speak(
53
  sprintf(
 
54
  _n(
55
  '%d review loaded.',
56
  '%d reviews loaded.',
51
  onReviewsAppended( { newReviews } ) {
52
  speak(
53
  sprintf(
54
+ // Translators: %d is the count of reviews loaded.
55
  _n(
56
  '%d review loaded.',
57
  '%d reviews loaded.',
assets/js/blocks/reviews/reviews-by-category/edit.js CHANGED
@@ -29,6 +29,11 @@ import {
29
 
30
  /**
31
  * Component to handle edit mode of "Reviews by Category".
 
 
 
 
 
32
  */
33
  const ReviewsByCategoryEditor = ( {
34
  attributes,
@@ -57,9 +62,10 @@ const ReviewsByCategoryEditor = ( {
57
  { ...args }
58
  showCount
59
  aria-label={ sprintf(
 
60
  _n(
61
- '%s, has %d product',
62
- '%s, has %d products',
63
  item.count,
64
  'woo-gutenberg-products-block'
65
  ),
29
 
30
  /**
31
  * Component to handle edit mode of "Reviews by Category".
32
+ *
33
+ * @param {Object} props Incoming props for the component.
34
+ * @param {Object} props.attributes Incoming block attributes.
35
+ * @param {function(any):any} props.debouncedSpeak
36
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
37
  */
38
  const ReviewsByCategoryEditor = ( {
39
  attributes,
62
  { ...args }
63
  showCount
64
  aria-label={ sprintf(
65
+ // Translators: %1$s is the search term name, %2$d is the number of products returned for search query.
66
  _n(
67
+ '%1$s, has %2$d product',
68
+ '%1$s, has %2$d products',
69
  item.count,
70
  'woo-gutenberg-products-block'
71
  ),
assets/js/blocks/reviews/reviews-by-product/edit.js CHANGED
@@ -28,6 +28,11 @@ import {
28
 
29
  /**
30
  * Component to handle edit mode of "Reviews by Product".
 
 
 
 
 
31
  */
32
  const ReviewsByProductEditor = ( {
33
  attributes,
@@ -43,6 +48,7 @@ const ReviewsByProductEditor = ( {
43
  <SearchListItem
44
  { ...args }
45
  countLabel={ sprintf(
 
46
  _n(
47
  '%d Review',
48
  '%d Reviews',
@@ -53,9 +59,10 @@ const ReviewsByProductEditor = ( {
53
  ) }
54
  showCount
55
  aria-label={ sprintf(
 
56
  _n(
57
- '%s, has %d review',
58
- '%s, has %d reviews',
59
  item.review_count,
60
  'woo-gutenberg-products-block'
61
  ),
28
 
29
  /**
30
  * Component to handle edit mode of "Reviews by Product".
31
+ *
32
+ * @param {Object} props Incoming props for the component.
33
+ * @param {Object} props.attributes Incoming block attributes.
34
+ * @param {function(any):any} props.debouncedSpeak
35
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
36
  */
37
  const ReviewsByProductEditor = ( {
38
  attributes,
48
  <SearchListItem
49
  { ...args }
50
  countLabel={ sprintf(
51
+ // Translators: %d is the review count.
52
  _n(
53
  '%d Review',
54
  '%d Reviews',
59
  ) }
60
  showCount
61
  aria-label={ sprintf(
62
+ // Translators: %1$s is the item name, and %2$d is the number of reviews for the item.
63
  _n(
64
+ '%1$s, has %2$d review',
65
+ '%1$s, has %2$d reviews',
66
  item.review_count,
67
  'woo-gutenberg-products-block'
68
  ),
assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.js CHANGED
@@ -27,6 +27,7 @@ const NoReviewsPlaceholder = ( { error, getProduct, isLoading, product } ) => {
27
  <Spinner />
28
  ) : (
29
  sprintf(
 
30
  __(
31
  "This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",
32
  'woo-gutenberg-products-block'
27
  <Spinner />
28
  ) : (
29
  sprintf(
30
+ // Translators: %s is the product name.
31
  __(
32
  "This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",
33
  'woo-gutenberg-products-block'
assets/js/blocks/single-product/block.js CHANGED
@@ -13,8 +13,15 @@ import { StoreNoticesProvider } from '@woocommerce/base-context';
13
  */
14
  import { BLOCK_NAME } from './constants';
15
 
 
 
16
  /**
17
  * The Single Product Block.
 
 
 
 
 
18
  */
19
  const Block = ( { isLoading, product, children } ) => {
20
  const className = 'wc-block-single-product wc-block-layout';
13
  */
14
  import { BLOCK_NAME } from './constants';
15
 
16
+ /** @typedef {import('react')} React */
17
+
18
  /**
19
  * The Single Product Block.
20
+ *
21
+ * @param {Object} props Incoming props for the component.
22
+ * @param {boolean} props.isLoading
23
+ * @param {Object} props.product
24
+ * @param {React.ReactChildren} props.children
25
  */
26
  const Block = ( { isLoading, product, children } ) => {
27
  const className = 'wc-block-single-product wc-block-layout';
assets/js/blocks/single-product/edit/api-error.js CHANGED
@@ -5,6 +5,11 @@ import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
5
 
6
  /**
7
  * Shown when there is an API error getting a product.
 
 
 
 
 
8
  */
9
  const ApiError = ( { error, isLoading, getProduct } ) => (
10
  <ErrorPlaceholder
5
 
6
  /**
7
  * Shown when there is an API error getting a product.
8
+ *
9
+ * @param {Object} props Incoming props for the component.
10
+ * @param {string} props.error
11
+ * @param {boolean} props.isLoading
12
+ * @param {function(any):any} props.getProduct
13
  */
14
  const ApiError = ( { error, isLoading, getProduct } ) => (
15
  <ErrorPlaceholder
assets/js/blocks/single-product/edit/editor-block-controls.js CHANGED
@@ -7,6 +7,10 @@ import { Toolbar } from '@wordpress/components';
7
 
8
  /**
9
  * Adds controls to the editor toolbar.
 
 
 
 
10
  */
11
  const EditorBlockControls = ( { isEditing, setIsEditing } ) => {
12
  return (
7
 
8
  /**
9
  * Adds controls to the editor toolbar.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {boolean} props.isEditing
13
+ * @param {function(boolean):any} props.setIsEditing
14
  */
15
  const EditorBlockControls = ( { isEditing, setIsEditing } ) => {
16
  return (
assets/js/blocks/single-product/edit/index.js CHANGED
@@ -22,6 +22,16 @@ import { BLOCK_TITLE, BLOCK_ICON, BLOCK_DESCRIPTION } from '../constants';
22
 
23
  /**
24
  * Component to handle edit mode of the "Single Product Block".
 
 
 
 
 
 
 
 
 
 
25
  */
26
  const Editor = ( {
27
  className,
22
 
23
  /**
24
  * Component to handle edit mode of the "Single Product Block".
25
+ *
26
+ * @param {Object} props Incoming props for the component.
27
+ * @param {string} props.className
28
+ * @param {Object} props.attributes Incoming block attributes.
29
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
30
+ * @param {string} props.error
31
+ * @param {function(any):any} props.getProduct
32
+ * @param {Object} props.product
33
+ * @param {boolean} props.isLoading
34
+ * @param {string} props.clientId
35
  */
36
  const Editor = ( {
37
  className,
assets/js/blocks/single-product/edit/layout-editor.js CHANGED
@@ -24,6 +24,11 @@ import {
24
 
25
  /**
26
  * Component to handle edit mode of the "Single Product Block".
 
 
 
 
 
27
  */
28
  const LayoutEditor = ( { isLoading, product, clientId } ) => {
29
  const baseClassName = 'wc-block-single-product wc-block-layout';
24
 
25
  /**
26
  * Component to handle edit mode of the "Single Product Block".
27
+ *
28
+ * @param {Object} props Incoming props for the component.
29
+ * @param {boolean} props.isLoading
30
+ * @param {Object} props.product
31
+ * @param {string} props.clientId
32
  */
33
  const LayoutEditor = ( { isLoading, product, clientId } ) => {
34
  const baseClassName = 'wc-block-single-product wc-block-layout';
assets/js/blocks/single-product/edit/shared-product-control.js CHANGED
@@ -5,6 +5,10 @@ import ProductControl from '@woocommerce/editor-components/product-control';
5
 
6
  /**
7
  * Allows a product to be selected for display.
 
 
 
 
8
  */
9
  const SharedProductControl = ( { attributes, setAttributes } ) => (
10
  <ProductControl
5
 
6
  /**
7
  * Allows a product to be selected for display.
8
+ *
9
+ * @param {Object} props Incoming props for the component.
10
+ * @param {Object} props.attributes Incoming block attributes.
11
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
12
  */
13
  const SharedProductControl = ( { attributes, setAttributes } ) => (
14
  <ProductControl
assets/js/data/schema/selectors.js CHANGED
@@ -63,7 +63,7 @@ export const getRoute = createRegistrySelector(
63
  if ( hasResolved ) {
64
  throw new Error(
65
  sprintf(
66
- 'While there is a route for the given namespace (%s) and resource name (%s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%s)',
67
  namespace,
68
  resourceName,
69
  JSON.stringify( state[ namespace ][ resourceName ] )
63
  if ( hasResolved ) {
64
  throw new Error(
65
  sprintf(
66
+ 'While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)',
67
  namespace,
68
  resourceName,
69
  JSON.stringify( state[ namespace ][ resourceName ] )
assets/js/editor-components/feedback-prompt/index.js CHANGED
@@ -12,6 +12,10 @@ import './style.scss';
12
 
13
  /**
14
  * Component to render a Feedback prompt in the sidebar.
 
 
 
 
15
  */
16
  const FeedbackPrompt = ( {
17
  text,
12
 
13
  /**
14
  * Component to render a Feedback prompt in the sidebar.
15
+ *
16
+ * @param {Object} props Incoming props for the component.
17
+ * @param {string} props.text
18
+ * @param {string} props.url
19
  */
20
  const FeedbackPrompt = ( {
21
  text,
assets/js/editor-components/grid-content-control/index.js CHANGED
@@ -8,6 +8,10 @@ import { ToggleControl } from '@wordpress/components';
8
 
9
  /**
10
  * A combination of toggle controls for content visibility in product grids.
 
 
 
 
11
  */
12
  const GridContentControl = ( { onChange, settings } ) => {
13
  const { button, price, rating, title } = settings;
8
 
9
  /**
10
  * A combination of toggle controls for content visibility in product grids.
11
+ *
12
+ * @param {Object} props Incoming props for the component.
13
+ * @param {function(any):any} props.onChange
14
+ * @param {Object} props.settings
15
  */
16
  const GridContentControl = ( { onChange, settings } ) => {
17
  const { button, price, rating, title } = settings;
assets/js/editor-components/grid-layout-control/index.js CHANGED
@@ -15,6 +15,12 @@ import {
15
 
16
  /**
17
  * A combination of range controls for product grid layout settings.
 
 
 
 
 
 
18
  */
19
  const GridLayoutControl = ( {
20
  columns,
15
 
16
  /**
17
  * A combination of range controls for product grid layout settings.
18
+ *
19
+ * @param {Object} props Incoming props for the component.
20
+ * @param {number} props.columns
21
+ * @param {number} props.rows
22
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
23
+ * @param {string} props.alignButtons
24
  */
25
  const GridLayoutControl = ( {
26
  columns,
assets/js/editor-components/product-attribute-term-control/index.js CHANGED
@@ -60,9 +60,10 @@ const ProductAttributeTermControl = ( {
60
  disabled={ item.count === '0' }
61
  aria-expanded={ expandedAttribute === item.id }
62
  aria-label={ sprintf(
 
63
  _n(
64
- '%s, has %d term',
65
- '%s, has %d terms',
66
  item.count,
67
  'woo-gutenberg-products-block'
68
  ),
@@ -113,6 +114,7 @@ const ProductAttributeTermControl = ( {
113
  ),
114
  selected: ( n ) =>
115
  sprintf(
 
116
  _n(
117
  '%d attribute selected',
118
  '%d attributes selected',
60
  disabled={ item.count === '0' }
61
  aria-expanded={ expandedAttribute === item.id }
62
  aria-label={ sprintf(
63
+ // Translators: %1$s is the item name, %2$d is the count of terms for the item.
64
  _n(
65
+ '%1$s, has %2$d term',
66
+ '%1$s, has %2$d terms',
67
  item.count,
68
  'woo-gutenberg-products-block'
69
  ),
114
  ),
115
  selected: ( n ) =>
116
  sprintf(
117
+ // Translators: %d is the count of attributes selected.
118
  _n(
119
  '%d attribute selected',
120
  '%d attributes selected',
assets/js/editor-components/product-category-control/index.js CHANGED
@@ -42,9 +42,10 @@ const ProductCategoryControl = ( {
42
 
43
  const listItemAriaLabel = showReviewCount
44
  ? sprintf(
 
45
  _n(
46
- '%s, has %d review',
47
- '%s, has %d reviews',
48
  item.review_count,
49
  'woo-gutenberg-products-block'
50
  ),
@@ -52,9 +53,10 @@ const ProductCategoryControl = ( {
52
  item.review_count
53
  )
54
  : sprintf(
 
55
  _n(
56
- '%s, has %d product',
57
- '%s, has %d products',
58
  item.count,
59
  'woo-gutenberg-products-block'
60
  ),
@@ -64,6 +66,7 @@ const ProductCategoryControl = ( {
64
 
65
  const listItemCountLabel = showReviewCount
66
  ? sprintf(
 
67
  _n(
68
  '%d Review',
69
  '%d Reviews',
@@ -73,6 +76,7 @@ const ProductCategoryControl = ( {
73
  item.review_count
74
  )
75
  : sprintf(
 
76
  _n(
77
  '%d Product',
78
  '%d Products',
@@ -108,6 +112,7 @@ const ProductCategoryControl = ( {
108
  ),
109
  selected: ( n ) =>
110
  sprintf(
 
111
  _n(
112
  '%d category selected',
113
  '%d categories selected',
42
 
43
  const listItemAriaLabel = showReviewCount
44
  ? sprintf(
45
+ // Translators: %1$s is the item name, %2$d is the count of reviews for the item.
46
  _n(
47
+ '%1$s, has %2$d review',
48
+ '%1$s, has %2$d reviews',
49
  item.review_count,
50
  'woo-gutenberg-products-block'
51
  ),
53
  item.review_count
54
  )
55
  : sprintf(
56
+ // Translators: %1$s is the item name, %2$d is the count of products for the item.
57
  _n(
58
+ '%1$s, has %2$d product',
59
+ '%1$s, has %2$d products',
60
  item.count,
61
  'woo-gutenberg-products-block'
62
  ),
66
 
67
  const listItemCountLabel = showReviewCount
68
  ? sprintf(
69
+ // Translators: %d is the count of reviews.
70
  _n(
71
  '%d Review',
72
  '%d Reviews',
76
  item.review_count
77
  )
78
  : sprintf(
79
+ // Translators: %d is the count of products.
80
  _n(
81
  '%d Product',
82
  '%d Products',
112
  ),
113
  selected: ( n ) =>
114
  sprintf(
115
+ // Translators: %d is the count of selected categories.
116
  _n(
117
  '%d category selected',
118
  '%d categories selected',
assets/js/editor-components/product-control/index.js CHANGED
@@ -128,6 +128,7 @@ const ProductControl = ( {
128
  { variationsCount ? (
129
  <span className="woocommerce-search-list__item-variation-count">
130
  { sprintf(
 
131
  _n(
132
  '%d variation',
133
  '%d variations',
128
  { variationsCount ? (
129
  <span className="woocommerce-search-list__item-variation-count">
130
  { sprintf(
131
+ // Translators: %d is the count of variations.
132
  _n(
133
  '%d variation',
134
  '%d variations',
assets/js/editor-components/product-orderby-control/index.js CHANGED
@@ -7,6 +7,10 @@ import PropTypes from 'prop-types';
7
 
8
  /**
9
  * A pre-configured SelectControl for product orderby settings.
 
 
 
 
10
  */
11
  const ProductOrderbyControl = ( { value, setAttributes } ) => {
12
  return (
7
 
8
  /**
9
  * A pre-configured SelectControl for product orderby settings.
10
+ *
11
+ * @param {Object} props Incoming props for the component.
12
+ * @param {string} props.value
13
+ * @param {function(any):any} props.setAttributes Setter for block attributes.
14
  */
15
  const ProductOrderbyControl = ( { value, setAttributes } ) => {
16
  return (
assets/js/editor-components/product-tag-control/index.js CHANGED
@@ -74,9 +74,10 @@ class ProductTagControl extends Component {
74
  { ...args }
75
  showCount
76
  aria-label={ sprintf(
 
77
  _n(
78
- '%d product tagged as %s',
79
- '%d products tagged as %s',
80
  item.count,
81
  'woo-gutenberg-products-block'
82
  ),
@@ -107,6 +108,7 @@ class ProductTagControl extends Component {
107
  ),
108
  selected: ( n ) =>
109
  sprintf(
 
110
  _n(
111
  '%d tag selected',
112
  '%d tags selected',
74
  { ...args }
75
  showCount
76
  aria-label={ sprintf(
77
+ // Translators: %1$d is the count of products, %2$s is the name of the tag.
78
  _n(
79
+ '%1$d product tagged as %2$s',
80
+ '%1$d products tagged as %2$s',
81
  item.count,
82
  'woo-gutenberg-products-block'
83
  ),
108
  ),
109
  selected: ( n ) =>
110
  sprintf(
111
+ // Translators: %d is the count of selected tags.
112
  _n(
113
  '%d tag selected',
114
  '%d tags selected',
assets/js/editor-components/products-control/index.js CHANGED
@@ -12,6 +12,7 @@ import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error
12
  * products.
13
  *
14
  * @param {Object} props Component props.
 
15
  * @param {Function} props.onChange Callback fired when the selected item changes
16
  * @param {Function} props.onSearch Callback fired when a search is triggered
17
  * @param {Array} props.selected An array of selected products.
@@ -41,6 +42,7 @@ const ProductsControl = ( {
41
  ),
42
  selected: ( n ) =>
43
  sprintf(
 
44
  _n(
45
  '%d product selected',
46
  '%d products selected',
12
  * products.
13
  *
14
  * @param {Object} props Component props.
15
+ * @param {string} props.error
16
  * @param {Function} props.onChange Callback fired when the selected item changes
17
  * @param {Function} props.onSearch Callback fired when a search is triggered
18
  * @param {Array} props.selected An array of selected products.
42
  ),
43
  selected: ( n ) =>
44
  sprintf(
45
+ // Translators: %d is the number of selected products.
46
  _n(
47
  '%d product selected',
48
  '%d products selected',
assets/js/editor-components/utils/index.js CHANGED
@@ -10,7 +10,7 @@ import { IS_LARGE_CATALOG, LIMIT_TAGS } from '@woocommerce/block-settings';
10
  * Get product query requests for the Store API.
11
  *
12
  * @param {Object} request A query object with the list of selected products and search term.
13
- * @param {string} request.selected Currently selected products.
14
  * @param {string} request.search Search string.
15
  * @param {Array} request.queryArgs Query args to pass in.
16
  */
@@ -47,7 +47,7 @@ const getProductsRequests = ( {
47
  * Get a promise that resolves to a list of products from the Store API.
48
  *
49
  * @param {Object} request A query object with the list of selected products and search term.
50
- * @param {string} request.selected Currently selected products.
51
  * @param {string} request.search Search string.
52
  * @param {Array} request.queryArgs Query args to pass in.
53
  */
@@ -107,7 +107,7 @@ export const getTerms = ( attribute ) => {
107
  * Get product tag query requests for the Store API.
108
  *
109
  * @param {Object} request A query object with the list of selected products and search term.
110
- * @param {string} request.selected Currently selected tags.
111
  * @param {string} request.search Search string.
112
  */
113
  const getProductTagsRequests = ( { selected = [], search } ) => {
@@ -135,7 +135,9 @@ const getProductTagsRequests = ( { selected = [], search } ) => {
135
  /**
136
  * Get a promise that resolves to a list of tags from the Store API.
137
  *
138
- * @param {Object} - A query object with the list of selected products and search term.
 
 
139
  */
140
  export const getProductTags = ( { selected = [], search } ) => {
141
  const requests = getProductTagsRequests( { selected, search } );
10
  * Get product query requests for the Store API.
11
  *
12
  * @param {Object} request A query object with the list of selected products and search term.
13
+ * @param {Array} request.selected Currently selected products.
14
  * @param {string} request.search Search string.
15
  * @param {Array} request.queryArgs Query args to pass in.
16
  */
47
  * Get a promise that resolves to a list of products from the Store API.
48
  *
49
  * @param {Object} request A query object with the list of selected products and search term.
50
+ * @param {Array} request.selected Currently selected products.
51
  * @param {string} request.search Search string.
52
  * @param {Array} request.queryArgs Query args to pass in.
53
  */
107
  * Get product tag query requests for the Store API.
108
  *
109
  * @param {Object} request A query object with the list of selected products and search term.
110
+ * @param {Array} request.selected Currently selected tags.
111
  * @param {string} request.search Search string.
112
  */
113
  const getProductTagsRequests = ( { selected = [], search } ) => {
135
  /**
136
  * Get a promise that resolves to a list of tags from the Store API.
137
  *
138
+ * @param {Object} props A query object with the list of selected products and search term.
139
+ * @param {Array} props.selected
140
+ * @param {string} props.search
141
  */
142
  export const getProductTags = ( { selected = [], search } ) => {
143
  const requests = getProductTagsRequests( { selected, search } );
assets/js/payment-method-extensions/payment-methods/cod/index.js CHANGED
@@ -39,8 +39,11 @@ const Label = ( props ) => {
39
  /**
40
  * Determine whether COD is available for this cart/order.
41
  *
42
- * @param boolean cartNeedsShipping True if the cart contains any physical/shippable products.
43
- * @return boolean True if COD payment method should be displayed as a payment option.
 
 
 
44
  */
45
  const canMakePayment = ( { cartNeedsShipping, selectedShippingMethods } ) => {
46
  if ( ! settings.enableForVirtual && ! cartNeedsShipping ) {
39
  /**
40
  * Determine whether COD is available for this cart/order.
41
  *
42
+ * @param {Object} props Incoming props for the component.
43
+ * @param {boolean} props.cartNeedsShipping True if the cart contains any physical/shippable products.
44
+ * @param {boolean} props.selectedShippingMethods
45
+ *
46
+ * @return {boolean} True if COD payment method should be displayed as a payment option.
47
  */
48
  const canMakePayment = ( { cartNeedsShipping, selectedShippingMethods } ) => {
49
  if ( ! settings.enableForVirtual && ! cartNeedsShipping ) {
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/elements.js CHANGED
@@ -15,10 +15,16 @@ import {
15
  */
16
  import { useElementOptions } from './use-element-options';
17
 
 
 
18
  const baseTextInputStyles = 'wc-block-gateway-input';
19
 
20
  /**
21
  * InlineCard component
 
 
 
 
22
  */
23
  export const InlineCard = ( {
24
  inputErrorComponent: ValidationInputError,
@@ -62,6 +68,10 @@ export const InlineCard = ( {
62
 
63
  /**
64
  * CardElements component.
 
 
 
 
65
  */
66
  export const CardElements = ( {
67
  onChange,
15
  */
16
  import { useElementOptions } from './use-element-options';
17
 
18
+ /** @typedef {import('react')} React */
19
+
20
  const baseTextInputStyles = 'wc-block-gateway-input';
21
 
22
  /**
23
  * InlineCard component
24
+ *
25
+ * @param {Object} props Incoming props for the component.
26
+ * @param {React.ReactElement} props.inputErrorComponent
27
+ * @param {function(any):any} props.onChange
28
  */
29
  export const InlineCard = ( {
30
  inputErrorComponent: ValidationInputError,
68
 
69
  /**
70
  * CardElements component.
71
+ *
72
+ * @param {Object} props
73
+ * @param {function(any):any} props.onChange
74
+ * @param {React.ReactElement} props.inputErrorComponent
75
  */
76
  export const CardElements = ( {
77
  onChange,
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/index.js CHANGED
@@ -32,6 +32,9 @@ function paymentRequestAvailable( currencyCode ) {
32
  isStripeInitialized = true;
33
  return canPay;
34
  }
 
 
 
35
  // Do a test payment to confirm if payment method is available.
36
  const paymentRequest = stripe.paymentRequest( {
37
  total: {
32
  isStripeInitialized = true;
33
  return canPay;
34
  }
35
+ if ( stripe.error && stripe.error instanceof Error ) {
36
+ throw stripe.error;
37
+ }
38
  // Do a test payment to confirm if payment method is available.
39
  const paymentRequest = stripe.paymentRequest( {
40
  total: {
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/type-defs.js CHANGED
@@ -265,6 +265,7 @@
265
 
266
  /**
267
  * @typedef {Object} Stripe Stripe api object.
 
268
  */
269
 
270
  /**
@@ -274,6 +275,8 @@
274
  * @property {string} alt Alt text for icon.
275
  */
276
 
 
 
277
  /**
278
  * @typedef {Object} StripeServerData
279
  *
@@ -299,6 +302,7 @@
299
  * @property {boolean} allowPaymentRequest True if merchant has enabled payment
300
  * request (Chrome/Apple Pay).
301
  */
 
302
 
303
  /**
304
  * @typedef {Object} StripeElementOptions
265
 
266
  /**
267
  * @typedef {Object} Stripe Stripe api object.
268
+ * @property {any} api Various api properties
269
  */
270
 
271
  /**
275
  * @property {string} alt Alt text for icon.
276
  */
277
 
278
+ /* eslint-disable jsdoc/valid-types */
279
+ // [k:string]:CreditCardIcon triggers the above rule even though VSCode interprets it fine.
280
  /**
281
  * @typedef {Object} StripeServerData
282
  *
302
  * @property {boolean} allowPaymentRequest True if merchant has enabled payment
303
  * request (Chrome/Apple Pay).
304
  */
305
+ /* eslint-enable jsdoc/valid-types */
306
 
307
  /**
308
  * @typedef {Object} StripeElementOptions
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/utils.js CHANGED
@@ -20,7 +20,7 @@ import { errorTypes, errorCodes } from './constants';
20
  /**
21
  * Stripe data comes form the server passed on a global object.
22
  *
23
- * @return {StripeServerData}
24
  */
25
  const getStripeServerData = () => {
26
  const stripeServerData = getSetting( 'stripe_data', null );
@@ -253,6 +253,10 @@ const getErrorMessageForTypeAndCode = ( type, code = '' ) => {
253
  * shipping, so we can track when one of them change to update rates.
254
  *
255
  * @param {Object} address An object containing all address information
 
 
 
 
256
  *
257
  * @return {Object} pluckedAddress An object containing shipping address that are needed to fetch an address.
258
  */
20
  /**
21
  * Stripe data comes form the server passed on a global object.
22
  *
23
+ * @return {StripeServerData} Stripe server data.
24
  */
25
  const getStripeServerData = () => {
26
  const stripeServerData = getSetting( 'stripe_data', null );
253
  * shipping, so we can track when one of them change to update rates.
254
  *
255
  * @param {Object} address An object containing all address information
256
+ * @param {string} address.country
257
+ * @param {string} address.state
258
+ * @param {string} address.city
259
+ * @param {string} address.postcode
260
  *
261
  * @return {Object} pluckedAddress An object containing shipping address that are needed to fetch an address.
262
  */
assets/js/previews/cart.js CHANGED
@@ -15,7 +15,7 @@ import { previewShippingRates } from './shipping-rates';
15
 
16
  // Sample data for cart block.
17
  // This closely resembles the data returned from the Store API /cart endpoint.
18
- // https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi#cart-api
19
  export const previewCart = {
20
  coupons: [],
21
  shipping_rates: SHIPPING_METHODS_EXIST ? previewShippingRates : [],
15
 
16
  // Sample data for cart block.
17
  // This closely resembles the data returned from the Store API /cart endpoint.
18
+ // https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi#cart-api
19
  export const previewCart = {
20
  coupons: [],
21
  shipping_rates: SHIPPING_METHODS_EXIST ? previewShippingRates : [],
assets/js/settings/shared/get-setting.js CHANGED
@@ -6,7 +6,6 @@ import { allSettings } from './settings-init';
6
  /**
7
  * Retrieves a setting value from the setting state.
8
  *
9
- * @export
10
  * @param {string} name The identifier for the setting.
11
  * @param {*} [fallback=false] The value to use as a fallback
12
  * if the setting is not in the
6
  /**
7
  * Retrieves a setting value from the setting state.
8
  *
 
9
  * @param {string} name The identifier for the setting.
10
  * @param {*} [fallback=false] The value to use as a fallback
11
  * if the setting is not in the
assets/js/settings/shared/set-setting.js CHANGED
@@ -1,17 +1,16 @@
1
  /**
2
- * Internal dependencies
3
  */
4
- import { allSettings } from './settings-init';
5
 
6
  /**
7
- * External dependencies
8
  */
9
- import deprecated from '@wordpress/deprecated';
10
 
11
  /**
12
  * Sets a value to a property on the settings state.
13
  *
14
- * @export
15
  * @param {string} name The setting property key for the
16
  * setting being mutated.
17
  * @param {*} value The value to set.
1
  /**
2
+ * External dependencies
3
  */
4
+ import deprecated from '@wordpress/deprecated';
5
 
6
  /**
7
+ * Internal dependencies
8
  */
9
+ import { allSettings } from './settings-init';
10
 
11
  /**
12
  * Sets a value to a property on the settings state.
13
  *
 
14
  * @param {string} name The setting property key for the
15
  * setting being mutated.
16
  * @param {*} value The value to set.
assets/js/type-defs/contexts.js CHANGED
@@ -115,17 +115,18 @@
115
  * CustomerPaymentMethod objects.
116
  *
117
  * @typedef {Object} SavedCustomerPaymentMethods
 
118
  */
119
 
120
  /**
121
  * @typedef {Object} PaymentStatusDispatchers
122
  *
123
- * @property {function()} started
124
- * @property {function()} processing
125
- * @property {function()} completed
126
- * @property {function(string)} error
127
- * @property {function(string, Object, Object=)} failed
128
- * @property {function(Object=,Object=,Object=)} success
129
  */
130
 
131
  /**
@@ -330,7 +331,7 @@
330
  * @property {string} context The current context
331
  * identifier for the notice
332
  * provider
333
- * @property {function(boolean):void} setSuppressed Consumers can use this
334
  * setter to suppress
335
  */
336
 
115
  * CustomerPaymentMethod objects.
116
  *
117
  * @typedef {Object} SavedCustomerPaymentMethods
118
+ * @property {any} any Various payment methods
119
  */
120
 
121
  /**
122
  * @typedef {Object} PaymentStatusDispatchers
123
  *
124
+ * @property {function()} started Sets started status.
125
+ * @property {function()} processing Sets processing status.
126
+ * @property {function()} completed Sets complete status.
127
+ * @property {function(string)} error Sets error status.
128
+ * @property {function(string, Object, Object=)} failed Sets failed status.
129
+ * @property {function(Object=,Object=,Object=)} success Sets success status.
130
  */
131
 
132
  /**
331
  * @property {string} context The current context
332
  * identifier for the notice
333
  * provider
334
+ * @property {function(boolean):void} setIsSuppressed Consumers can use this
335
  * setter to suppress
336
  */
337
 
assets/js/type-defs/hooks.js CHANGED
@@ -34,7 +34,7 @@
34
  * being loaded.
35
  * @property {boolean} hasShippingAddress Whether or not the cart
36
  * has a shipping address yet.
37
- * @property {function} receiveCart Dispatcher to receive
38
  * updated cart.
39
  */
40
 
@@ -90,6 +90,8 @@
90
  * @property {string} EXPRESS_PAYMENTS Notices for the express payments step.
91
  */
92
 
 
 
93
  /**
94
  * @typedef {NoticeContexts['PAYMENTS']|NoticeContexts['EXPRESS_PAYMENTS']} NoticeContextsEnum
95
  */
@@ -137,6 +139,7 @@
137
  * response. This varies between context
138
  * emitters.
139
  */
 
140
 
141
  /**
142
  * @typedef {Object} EmitResponseApi
34
  * being loaded.
35
  * @property {boolean} hasShippingAddress Whether or not the cart
36
  * has a shipping address yet.
37
+ * @property {function(Object):any} receiveCart Dispatcher to receive
38
  * updated cart.
39
  */
40
 
90
  * @property {string} EXPRESS_PAYMENTS Notices for the express payments step.
91
  */
92
 
93
+ /* eslint-disable jsdoc/valid-types */
94
+ // Enum format below triggers the above rule even though VSCode interprets it fine.
95
  /**
96
  * @typedef {NoticeContexts['PAYMENTS']|NoticeContexts['EXPRESS_PAYMENTS']} NoticeContextsEnum
97
  */
139
  * response. This varies between context
140
  * emitters.
141
  */
142
+ /* eslint-enable jsdoc/valid-types */
143
 
144
  /**
145
  * @typedef {Object} EmitResponseApi
assets/js/type-defs/registered-payment-method-props.js CHANGED
@@ -17,12 +17,12 @@
17
  *
18
  * @typedef {Object} PaymentStatusActions
19
  *
20
- * @property {Function} started
21
- * @property {Function} processing
22
- * @property {Function} completed
23
- * @property {Function} error
24
- * @property {Function} failed
25
- * @property {Function} success
26
  */
27
 
28
  /**
17
  *
18
  * @typedef {Object} PaymentStatusActions
19
  *
20
+ * @property {Function} started Set started status.
21
+ * @property {Function} processing Set processing status.
22
+ * @property {Function} completed Set completed status.
23
+ * @property {Function} error Set error status.
24
+ * @property {Function} failed Set failed status.
25
+ * @property {Function} success Set success status.
26
  */
27
 
28
  /**
build/active-filters-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '0a4f0c1b960e84d2823c13804dfa3a8d');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '623e892e33d4d4ee6c83dc15ac4d14f2');
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=214)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},106:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(11),o=r.n(n),c=r(6),i=r.n(c),a=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){i()(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 f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),f=l(l({},e.dataset),n.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()({},n,{attributes:f})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=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:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(f.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,i,a;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},109:function(e,t){},11: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},r.apply(this,arguments)}e.exports=r},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(13),c=r(0),i=r(85),a=r(37),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,b=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 d=Object(c.useRef)({results:[],isLoading:!0}),g=Object(a.a)(f),m=Object(a.a)(s),y=Object(i.a)(),O=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,g,m],i=o.getCollectionError.apply(o,c);return i&&y(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,m,g,b]);return null!==O&&(d.current=O),d.current}},122:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=r(49),u=function(e){var t=e.className,r=e.size,n=i()(e,["className","size"]);return React.createElement(a.a,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"}))},s=React.createElement(u,null);t.a=s},123:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(14),i=r.n(c),a=r(3);r(4);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,c=i()(e,["srcElement","size"]);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?u(Object(r),!0).forEach((function(t){o()(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},c))}},125:function(e,t,r){"use strict";var n=r(0),o=r(2),c=r(15),i=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(r.current){var n=e(c.SCHEMA_STORE_KEY),o=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(c.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},13:function(e,t){!function(){e.exports=this.wp.data}()},137:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(8),o=n.c.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}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},i=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},138:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(7),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})),i=c.length?c[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)){var a=i.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));a.length>0&&(i.slug=a.sort(),u.push(i)),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",i=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(i):(i.push({attribute:r.taxonomy,operator:c,slug:Object(n.map)(o,"slug").sort()}),t(Object(n.sortBy)(i,"attribute")))}},14:function(e,t,r){var n=r(56);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c}},142:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=(r(4),r(5)),u=r.n(a),s=r(1),l=r(123),f=r(122),p=(r(109),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,a=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,b=e.children,d=void 0===b?null:b,g=i()(e,["text","screenReaderText","element","className","radius","children"]),m=a,y=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+p),O=Boolean(n&&n!==t);return React.createElement(m,o()({className:y},g),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},n),d)});t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,a=e.disabled,b=void 0!==a&&a,d=e.onRemove,g=void 0===d?function(){}:d,m=e.removeOnAnyClick,y=void 0!==m&&m,O=e.text,v=e.screenReaderText,h=void 0===v?"":v,j=i()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=y?"span":"button";if(!r){var w=h&&"string"==typeof h?h:O;r="string"!=typeof w?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),w)}var E={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},S=y?E:{},R=y?{"aria-hidden":!0}:E;return React.createElement(p,o()({},j,S,{className:u()(c,"is-removable"),element:y?"button":j.element,screenReaderText:h,text:O}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},148:function(e,t,r){"use strict";r.d(t,"c",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return g}));var n=r(6),o=r.n(n),c=r(23),i=r.n(c),a=r(2);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 s(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){o()(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 l,f,p={code:a.CURRENCY.code,symbol:a.CURRENCY.symbol,thousandSeparator:a.CURRENCY.thousandSeparator,decimalSeparator:a.CURRENCY.decimalSeparator,minorUnit:a.CURRENCY.precision,prefix:(l=a.CURRENCY.symbol,f=a.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(a.CURRENCY.symbol,a.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==i()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,o=e.currency_decimal_separator,c=e.currency_minor_unit,a=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(c)?c:2,prefix:"string"==typeof a?a:"$",suffix:"string"==typeof u?u:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},g=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=d(t),o=r/Math.pow(10,n.minorUnit),c=n.prefix+o+n.suffix,i=document.createElement("textarea");return i.innerHTML=c,i.value}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},17:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},18: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}},2:function(e,t){!function(){e.exports=this.wc.wcSettings}()},20:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},214:function(e,t,r){e.exports=r(271)},215:function(e,t){},22:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(40);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Object(n.a)(e,t,r[t])}))}return e}},23:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},271:function(e,t,r){"use strict";r.r(t);var n=r(125),o=r(106),c=r(9),i=r.n(c),a=r(1),u=r(97),s=r(0),l=r(5),f=r.n(l),p=(r(4),r(29)),b=(r(215),r(137)),d=r(148),g=r(142),m=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(a.sprintf)(Object(a.__)("Between %s and %s","woo-gutenberg-products-block"),Object(d.a)(e),Object(d.a)(t)):Number.isFinite(e)?Object(a.sprintf)(Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.a)(e)):Object(a.sprintf)(Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.a)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,u=void 0===i||i,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,f=Object(a.sprintf)(Object(a.__)("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(g.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:f}):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},f)))},O=r(112),v=r(17),h=r(138),j=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,f=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),p=f.results,b=f.isLoading,d=Object(u.b)("attributes",[]),g=i()(d,2),m=g[0],j=g[1];if(b)return null;var _=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},_,":"),React.createElement("ul",null,o.map((function(e,t){var n=p.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(a.__)("and","woo-gutenberg-products-block"))),y({type:_,name:Object(v.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(h.a)(m,j,r,e)},showLabel:!1,displayStyle:l})}))))},_=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=i()(o,2),l=c[0],d=c[1],g=Object(u.b)("min_price"),O=i()(g,2),v=O[0],h=O[1],_=Object(u.b)("max_price"),w=i()(_,2),E=w[0],S=w[1],R=Object(s.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(E)?y({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:m(v,E),removeCallback:function(){h(void 0),S(void 0)},displayStyle:t.displayStyle}):null}),[v,E,m]),x=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(j,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(E)||n))return null;var k="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(s.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(s.Fragment,null,y({type:Object(a.__)("Size","woo-gutenberg-products-block"),name:Object(a.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(a.__)("Color","woo-gutenberg-products-block"),name:Object(a.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(s.Fragment,null,R,x)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){h(void 0),S(void 0),d([])}},React.createElement(p.a,{label:Object(a.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(_),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},29:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=(r(4),r(3)),i=r(5),a=r.n(i);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 s(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){o()(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 l=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=null!=r,l=null!=n;return!u&&l?(t=o||"span",i=s(s({},i),{},{className:a()(i.className,"screen-reader-text")}),React.createElement(t,i,n)):(t=o||c.Fragment,u&&l&&r!==n?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,i,r))};l.defaultProps={wrapperProps:{}},t.a=l},3:function(e,t){!function(){e.exports=this.React}()},30:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},31: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}},32:function(e,t,r){var n=r(60);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)}},33:function(e,t,r){var n=r(23),o=r(18);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},36:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(36),c=r.n(o),i=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},39:function(e,t){!function(){e.exports=this.wp.blocks}()},4:function(e,t,r){e.exports=r(61)()},40:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},44:function(e,t,r){"use strict";var n=r(30),o=r.n(n),c=r(31),i=r.n(c),a=r(18),u=r.n(a),s=r(32),l=r.n(s),f=r(33),p=r.n(f),b=r(20),d=r.n(b),g=r(6),m=r.n(g),y=(r(4),r(3)),O=r(1),v=r(8),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.D,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(O.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(O.__)("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),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)))};r(63);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 p()(this,r)}}var _=function(e){l()(r,e);var t=j(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),i=0;i<n;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),m()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=this.state,a=i.errorMessage;return i.hasError?React.createElement(h,{errorMessage:n?a: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(y.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);_.defaultProps={showErrorMessage:!0};t.a=_},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(22),o=r(7),c=r(0),i=function(e){var t=Object(n.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(c.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},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 i=o.apply(null,n);i&&e.push(i)}else if("object"===c)for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},54:function(e,t,r){var n=r(55);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}}},55: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}},56: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}},59: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},6: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}},60:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},61:function(e,t,r){"use strict";var n=r(62);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){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 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}},62:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},63:function(e,t){},7:function(e,t){!function(){e.exports=this.lodash}()},71:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},72:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw c}}return r}}},73: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.")}},8:function(e,t,r){"use strict";r.d(t,"i",(function(){return o})),r.d(t,"v",(function(){return c})),r.d(t,"z",(function(){return i})),r.d(t,"s",(function(){return a})),r.d(t,"m",(function(){return u})),r.d(t,"p",(function(){return s})),r.d(t,"h",(function(){return l})),r.d(t,"A",(function(){return f})),r.d(t,"k",(function(){return p})),r.d(t,"l",(function(){return b})),r.d(t,"j",(function(){return d})),r.d(t,"c",(function(){return g})),r.d(t,"n",(function(){return m})),r.d(t,"o",(function(){return y})),r.d(t,"D",(function(){return v})),r.d(t,"E",(function(){return h})),r.d(t,"w",(function(){return j})),r.d(t,"a",(function(){return _})),r.d(t,"x",(function(){return w})),r.d(t,"b",(function(){return E})),r.d(t,"r",(function(){return S})),r.d(t,"f",(function(){return R})),r.d(t,"y",(function(){return P})),r.d(t,"g",(function(){return C})),r.d(t,"u",(function(){return N})),r.d(t,"t",(function(){return T})),r.d(t,"C",(function(){return A})),r.d(t,"B",(function(){return D})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return L})),r.d(t,"q",(function(){return B})),r.d(t,"F",(function(){return F}));var n=r(2),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=(Object(n.getSetting)("max_columns",6),Object(n.getSetting)("min_columns",1),Object(n.getSetting)("default_columns",3),Object(n.getSetting)("max_rows",6),Object(n.getSetting)("min_rows",1),Object(n.getSetting)("default_rows",3),Object(n.getSetting)("min_height",500),Object(n.getSetting)("default_height",500),Object(n.getSetting)("placeholderImgSrc","")),u=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),s=Object(n.getSetting)("limitTags"),l=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0),Object(n.getSetting)("homeUrl",""),Object(n.getSetting)("couponsEnabled",!0)),f=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),p=Object(n.getSetting)("displayItemizedTaxes",!1),b=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),d=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),g=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),m=Object(n.getSetting)("isShippingCalculatorEnabled",!0),y=Object(n.getSetting)("isShippingCostHidden",!1),O=Object(n.getSetting)("woocommerceBlocksPhase",1),v=Object(n.getSetting)("wcBlocksAssetUrl",""),h=Object(n.getSetting)("wcBlocksBuildUrl",""),j=Object(n.getSetting)("shippingCountries",{}),_=Object(n.getSetting)("allowedCountries",{}),w=Object(n.getSetting)("shippingStates",{}),E=Object(n.getSetting)("allowedStates",{}),S=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("paymentGatewaySortOrder",[])),R=Object(n.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},k=Object(n.getSetting)("storePages",{shop:x,cart:x,checkout:x,privacy:x,terms:x}),P=k.shop.permalink,C=(k.checkout.id,k.checkout.permalink),N=k.privacy.permalink,T=k.privacy.title,A=k.terms.permalink,D=k.terms.title,U=(k.cart.id,k.cart.permalink),L=Object(n.getSetting)("checkoutAllowsGuest",!1),B=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),F=(r(39),function(){return O>1})},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(9),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},9:function(e,t,r){var n=r(71),o=r(72),c=r(54),i=r(73);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(9),o=r.n(n),c=r(15),i=r(13),a=r(0),u=r(59),s=r(7),l=r(37),f=function(e){var t=Object(u.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(u.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){s(r,e,t)}),[r,e])]},b=function(e,t){var r=Object(u.a)(),n=f(t=t||r),c=o()(n,2),i=c[0],p=c[1],b=Object(l.a)(e),d=Object(a.useRef)(!1);return Object(a.useEffect)((function(){p(Object(s.assign)({},i,b)),d.current=!0}),[b]),d.current?[i,p]:[e,p]}}});
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=217)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,r){var n=r(71),o=r(72),c=r(54),i=r(73);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(11),o=r.n(n),c=r(6),i=r.n(c),a=r(0),u=r(45);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){i()(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 f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),f=l(l({},e.dataset),n.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()({},n,{attributes:f})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=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:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(f.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,i,a;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},11: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},r.apply(this,arguments)}e.exports=r},110:function(e,t){},113:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(13),c=r(0),i=r(85),a=r(37),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,b=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 d=Object(c.useRef)({results:[],isLoading:!0}),g=Object(a.a)(f),m=Object(a.a)(s),y=Object(i.a)(),O=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,g,m],i=o.getCollectionError.apply(o,c);return i&&y(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,m,g,b]);return null!==O&&(d.current=O),d.current}},125:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=r(50),u=function(e){var t=e.className,r=e.size,n=i()(e,["className","size"]);return React.createElement(a.a,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"}))},s=React.createElement(u,null);t.a=s},126:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(14),i=r.n(c),a=r(3);r(4);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,c=i()(e,["srcElement","size"]);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?u(Object(r),!0).forEach((function(t){o()(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},c))}},128:function(e,t,r){"use strict";var n=r(0),o=r(2),c=r(15),i=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(r.current){var n=e(c.SCHEMA_STORE_KEY),o=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(c.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},13:function(e,t){!function(){e.exports=this.wp.data}()},14:function(e,t,r){var n=r(56);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c}},141:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(8),o=n.c.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}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},i=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(7),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})),i=c.length?c[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)){var a=i.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));a.length>0&&(i.slug=a.sort(),u.push(i)),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",i=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(i):(i.push({attribute:r.taxonomy,operator:c,slug:Object(n.map)(o,"slug").sort()}),t(Object(n.sortBy)(i,"attribute")))}},146:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=(r(4),r(5)),u=r.n(a),s=r(1),l=r(126),f=r(125),p=(r(110),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,a=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,b=e.children,d=void 0===b?null:b,g=i()(e,["text","screenReaderText","element","className","radius","children"]),m=a,y=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+p),O=Boolean(n&&n!==t);return React.createElement(m,o()({className:y},g),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},n),d)});t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,a=e.disabled,b=void 0!==a&&a,d=e.onRemove,g=void 0===d?function(){}:d,m=e.removeOnAnyClick,y=void 0!==m&&m,O=e.text,v=e.screenReaderText,h=void 0===v?"":v,j=i()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=y?"span":"button";if(!r){var w=h&&"string"==typeof h?h:O;r="string"!=typeof w?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),w)}var E={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},S=y?E:{},R=y?{"aria-hidden":!0}:E;return React.createElement(p,o()({},j,S,{className:u()(c,"is-removable"),element:y?"button":j.element,screenReaderText:h,text:O}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},152:function(e,t,r){"use strict";r.d(t,"c",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return g}));var n=r(6),o=r.n(n),c=r(23),i=r.n(c),a=r(2);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 s(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){o()(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 l,f,p={code:a.CURRENCY.code,symbol:a.CURRENCY.symbol,thousandSeparator:a.CURRENCY.thousandSeparator,decimalSeparator:a.CURRENCY.decimalSeparator,minorUnit:a.CURRENCY.precision,prefix:(l=a.CURRENCY.symbol,f=a.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(a.CURRENCY.symbol,a.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==i()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,o=e.currency_decimal_separator,c=e.currency_minor_unit,a=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(c)?c:2,prefix:"string"==typeof a?a:"$",suffix:"string"==typeof u?u:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},g=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=d(t),o=r/Math.pow(10,n.minorUnit),c=n.prefix+o+n.suffix,i=document.createElement("textarea");return i.innerHTML=c,i.value}},17:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},18: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}},19:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},2:function(e,t){!function(){e.exports=this.wc.wcSettings}()},217:function(e,t,r){e.exports=r(273)},218:function(e,t){},22:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(40);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Object(n.a)(e,t,r[t])}))}return e}},23:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},273:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),c=r(10),i=r.n(c),a=r(1),u=r(98),s=r(0),l=r(5),f=r.n(l),p=(r(4),r(33)),b=(r(218),r(141)),d=r(152),g=r(146),m=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(a.sprintf)(Object(a.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.a)(e),Object(d.a)(t)):Number.isFinite(e)?Object(a.sprintf)(Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.a)(e)):Object(a.sprintf)(Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.a)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,u=void 0===i||i,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,f=Object(a.sprintf)(Object(a.__)("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(g.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:f}):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},f)))},O=r(113),v=r(17),h=r(142),j=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,f=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),p=f.results,b=f.isLoading,d=Object(u.b)("attributes",[]),g=i()(d,2),m=g[0],j=g[1];if(b)return null;var _=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},_,":"),React.createElement("ul",null,o.map((function(e,t){var n=p.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(a.__)("and","woo-gutenberg-products-block"))),y({type:_,name:Object(v.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(h.a)(m,j,r,e)},showLabel:!1,displayStyle:l})}))))},_=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=i()(o,2),l=c[0],d=c[1],g=Object(u.b)("min_price"),O=i()(g,2),v=O[0],h=O[1],_=Object(u.b)("max_price"),w=i()(_,2),E=w[0],S=w[1],R=Object(s.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(E)?y({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:m(v,E),removeCallback:function(){h(void 0),S(void 0)},displayStyle:t.displayStyle}):null}),[v,E,m]),x=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(j,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(E)||n))return null;var k="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(s.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(s.Fragment,null,y({type:Object(a.__)("Size","woo-gutenberg-products-block"),name:Object(a.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(a.__)("Color","woo-gutenberg-products-block"),name:Object(a.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(s.Fragment,null,R,x)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){h(void 0),S(void 0),d([])}},React.createElement(p.a,{label:Object(a.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(_),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},29:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},3:function(e,t){!function(){e.exports=this.React}()},30: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}},31:function(e,t,r){var n=r(60);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)}},32:function(e,t,r){var n=r(23),o=r(18);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},33:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=(r(4),r(3)),i=r(5),a=r.n(i);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 s(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){o()(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 l=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=null!=r,l=null!=n;return!u&&l?(t=o||"span",i=s(s({},i),{},{className:a()(i.className,"screen-reader-text")}),React.createElement(t,i,n)):(t=o||c.Fragment,u&&l&&r!==n?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,i,r))};l.defaultProps={wrapperProps:{}},t.a=l},36:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(36),c=r.n(o),i=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},39:function(e,t){!function(){e.exports=this.wp.blocks}()},4:function(e,t,r){e.exports=r(61)()},40:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},45:function(e,t,r){"use strict";var n=r(29),o=r.n(n),c=r(30),i=r.n(c),a=r(18),u=r.n(a),s=r(31),l=r.n(s),f=r(32),p=r.n(f),b=r(19),d=r.n(b),g=r(6),m=r.n(g),y=(r(4),r(3)),O=r(1),v=r(8),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.D,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(O.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(O.__)("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),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)))};r(63);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 p()(this,r)}}var _=function(e){l()(r,e);var t=j(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),i=0;i<n;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),m()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=this.state,a=i.errorMessage;return i.hasError?React.createElement(h,{errorMessage:n?a: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(y.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);_.defaultProps={showErrorMessage:!0};t.a=_},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 i=o.apply(null,n);i&&e.push(i)}else if("object"===c)for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(22),o=r(7),c=r(0),i=function(e){var t=Object(n.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(c.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},54:function(e,t,r){var n=r(55);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}}},55: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}},56: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}},59: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},6: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}},60:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},61:function(e,t,r){"use strict";var n=r(62);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){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 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}},62:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},63:function(e,t){},7:function(e,t){!function(){e.exports=this.lodash}()},71:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},72:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw c}}return r}}},73: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.")}},8:function(e,t,r){"use strict";r.d(t,"i",(function(){return o})),r.d(t,"v",(function(){return c})),r.d(t,"z",(function(){return i})),r.d(t,"s",(function(){return a})),r.d(t,"m",(function(){return u})),r.d(t,"p",(function(){return s})),r.d(t,"h",(function(){return l})),r.d(t,"A",(function(){return f})),r.d(t,"k",(function(){return p})),r.d(t,"l",(function(){return b})),r.d(t,"j",(function(){return d})),r.d(t,"c",(function(){return g})),r.d(t,"n",(function(){return m})),r.d(t,"o",(function(){return y})),r.d(t,"D",(function(){return v})),r.d(t,"E",(function(){return h})),r.d(t,"w",(function(){return j})),r.d(t,"a",(function(){return _})),r.d(t,"x",(function(){return w})),r.d(t,"b",(function(){return E})),r.d(t,"r",(function(){return S})),r.d(t,"f",(function(){return R})),r.d(t,"y",(function(){return P})),r.d(t,"g",(function(){return C})),r.d(t,"u",(function(){return N})),r.d(t,"t",(function(){return T})),r.d(t,"C",(function(){return A})),r.d(t,"B",(function(){return D})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return L})),r.d(t,"q",(function(){return B})),r.d(t,"F",(function(){return F}));var n=r(2),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=(Object(n.getSetting)("max_columns",6),Object(n.getSetting)("min_columns",1),Object(n.getSetting)("default_columns",3),Object(n.getSetting)("max_rows",6),Object(n.getSetting)("min_rows",1),Object(n.getSetting)("default_rows",3),Object(n.getSetting)("min_height",500),Object(n.getSetting)("default_height",500),Object(n.getSetting)("placeholderImgSrc","")),u=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),s=Object(n.getSetting)("limitTags"),l=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0),Object(n.getSetting)("homeUrl",""),Object(n.getSetting)("couponsEnabled",!0)),f=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),p=Object(n.getSetting)("displayItemizedTaxes",!1),b=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),d=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),g=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),m=Object(n.getSetting)("isShippingCalculatorEnabled",!0),y=Object(n.getSetting)("isShippingCostHidden",!1),O=Object(n.getSetting)("woocommerceBlocksPhase",1),v=Object(n.getSetting)("wcBlocksAssetUrl",""),h=Object(n.getSetting)("wcBlocksBuildUrl",""),j=Object(n.getSetting)("shippingCountries",{}),_=Object(n.getSetting)("allowedCountries",{}),w=Object(n.getSetting)("shippingStates",{}),E=Object(n.getSetting)("allowedStates",{}),S=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("paymentGatewaySortOrder",[])),R=Object(n.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},k=Object(n.getSetting)("storePages",{shop:x,cart:x,checkout:x,privacy:x,terms:x}),P=k.shop.permalink,C=(k.checkout.id,k.checkout.permalink),N=k.privacy.permalink,T=k.privacy.title,A=k.terms.permalink,D=k.terms.title,U=(k.cart.id,k.cart.permalink),L=Object(n.getSetting)("checkoutAllowsGuest",!1),B=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),F=(r(39),function(){return O>1})},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(10),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(10),o=r.n(n),c=r(15),i=r(13),a=r(0),u=r(59),s=r(7),l=r(37),f=function(e){var t=Object(u.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(u.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){s(r,e,t)}),[r,e])]},b=function(e,t){var r=Object(u.a)(),n=f(t=t||r),c=o()(n,2),i=c[0],p=c[1],b=Object(l.a)(e),d=Object(a.useRef)(!1);return Object(a.useEffect)((function(){p(Object(s.assign)({},i,b)),d.current=!0}),[b]),d.current?[i,p]:[e,p]}}});
build/active-filters.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', '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'), 'version' => '1a6bb5f1115bb8f272e61bddf241d612');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', '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'), 'version' => '9c84f205318b908395066aafeb793272');
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,o,a=t[0],u=t[1],l=t[2],b=0,f=[];b<a.length;b++)o=a[b],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&f.push(c[o][0]),c[o]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,a=1;a<n.length;a++){var u=n[a];0!==c[u]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},c={4:0},i=[];function o(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,o),n.l=!0,n.exports}o.m=e,o.c=r,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="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var s=u;return i.push([850,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},100:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(c)};c.Provider},121:function(e,t){},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},154:function(e,t,n){"use strict";var r=n(21),c=n.n(r),i=n(24),o=n.n(i),a=n(22),u=n.n(a),l=n(23),s=n.n(l),b=n(12),f=n.n(b),p=n(0),d=n(6),g=n(1),m=n(4);function v(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 h=function(e){u()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return o()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(v,{level:e}),title:Object(g.sprintf)(Object(g.__)("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,i=t.maxLevel,o=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.Toolbar,{isCollapsed:r,icon:Object(p.createElement)(v,{level:o}),controls:Object(d.range)(c,i).map((function(t){return e.createLevelControl(t,o,a)}))})}}]),n}(p.Component);t.a=h},157:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(11),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},17:function(e,t){!function(){e.exports=this.wp.blocks}()},172:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(11),c=n.n(r),i=n(41),o=n(36),a=n(0),u=n(100),l=n(6),s=n(60),b=function(e){var t=Object(u.a)();e=e||t;var n=Object(o.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e])]},f=function(e,t,n){var r=Object(u.a)();n=n||r;var c=Object(o.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e])]},p=function(e,t){var n=Object(u.a)(),r=b(t=t||n),i=c()(r,2),o=i[0],f=i[1],p=Object(s.a)(e),d=Object(a.useRef)(!1);return Object(a.useEffect)((function(){f(Object(l.assign)({},o,p)),d.current=!0}),[p]),d.current?[o,f]:[e,f]}},186:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(14)),i=n(7),o=n.n(i);n(256);t.a=function(e){var t=e.className,n=e.headingLevel,i=e.onChange,a=e.heading,u="h".concat(n);return Object(r.createElement)(u,null,Object(r.createElement)(c.PlainText,{className:o()("wc-block-editor-components-title",t),value:a,onChange:i}))}},203:function(e,t){},205:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(41),c=n(36),i=n(0),o=n(157),a=n(60),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,l=void 0===u?[]:u,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(i.useRef)({results:[],isLoading:!0}),g=Object(a.a)(b),m=Object(a.a)(l),v=Object(o.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),i=[t,n,g,m],o=c.getCollectionError.apply(c,i);return o&&v(o),{results:c.getCollection.apply(c,i),isLoading:!c.hasFinishedResolution("getCollection",i)}}),[t,n,m,g,p]);return null!==O&&(d.current=O),d.current}},25:function(e,t){!function(){e.exports=this.wp.compose}()},254:function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return g}));var r=n(8),c=n.n(r),i=n(52),o=n.n(i),a=n(3);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 l(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}var s,b,f={code:a.CURRENCY.code,symbol:a.CURRENCY.symbol,thousandSeparator:a.CURRENCY.thousandSeparator,decimalSeparator:a.CURRENCY.decimalSeparator,minorUnit:a.CURRENCY.precision,prefix:(s=a.CURRENCY.symbol,b=a.CURRENCY.symbolPosition,{left:s,left_space:" "+s,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(a.CURRENCY.symbol,a.CURRENCY.symbolPosition)},p=function(e){if(!e||"object"!==o()(e))return f;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,c=e.currency_decimal_separator,i=e.currency_minor_unit,a=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(i)?i:2,prefix:"string"==typeof a?a:"$",suffix:"string"==typeof u?u:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(l({},f),e)},g=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=d(t),c=n/Math.pow(10,r.minorUnit),i=r.prefix+c+r.suffix,o=document.createElement("textarea");return o.innerHTML=i,o.value}},256:function(e,t){},266:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(5),c=r.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 c.find((function(t){return t.id===e}))},o=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},267:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));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]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),o=i.length?i[0]:null;if(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)){var a=o.slug.filter((function(e){return e!==c})),u=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(o.slug=a.sort(),u.push(o)),t(Object(r.sortBy)(u,"attribute"))}},i=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]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",o=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(c,"slug").sort()}),t(Object(r.sortBy)(o,"attribute")))}},273:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(27),o=n.n(i),a=n(0),u=(n(2),n(7)),l=n.n(u),s=n(1),b=n(61),f=n(279),p=(n(203),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,u=void 0===i?"li":i,s=e.className,b=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,d=e.children,g=void 0===d?null:d,m=o()(e,["text","screenReaderText","element","className","radius","children"]),v=u,O=l()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+p),h=Boolean(r&&r!==t);return Object(a.createElement)(v,c()({className:O},m),Object(a.createElement)("span",{"aria-hidden":h,className:"wc-block-components-chip__text"},t),h&&Object(a.createElement)("span",{className:"screen-reader-text"},r),g)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,u=e.disabled,d=void 0!==u&&u,g=e.onRemove,m=void 0===g?function(){}:g,v=e.removeOnAnyClick,O=void 0!==v&&v,h=e.text,j=e.screenReaderText,y=void 0===j?"":j,w=o()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=O?"span":"button";if(!n){var E=y&&"string"==typeof y?y:h;n="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var S={"aria-label":n,disabled:d,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},k=O?S:{},x=O?{"aria-hidden":!0}:S;return Object(a.createElement)(p,c()({},w,k,{className:l()(i,"is-removable"),element:O?"button":w.element,screenReaderText:y,text:h}),Object(a.createElement)(_,c()({className:"wc-block-components-chip__remove"},x),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},279:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(27),o=n.n(i),a=n(0),u=n(56),l=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(u.a,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=l},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},36:function(e,t){!function(){e.exports=this.wp.data}()},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},48:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(0),o=(n(2),n(9)),a=n(7),u=n.n(a);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 s(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){c()(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 b=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,l=null!=n,b=null!=r;return!l&&b?(t=c||"span",a=s(s({},a),{},{className:u()(a.className,"screen-reader-text")}),Object(i.createElement)(t,a,r)):(t=c||o.Fragment,l&&b&&n!==r?Object(i.createElement)(t,a,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,a,n))};b.defaultProps={wrapperProps:{}},t.a=b},5:function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"J",(function(){return i})),n.d(t,"P",(function(){return o})),n.d(t,"z",(function(){return a})),n.d(t,"B",(function(){return u})),n.d(t,"l",(function(){return l})),n.d(t,"A",(function(){return s})),n.d(t,"D",(function(){return b})),n.d(t,"n",(function(){return f})),n.d(t,"C",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"F",(function(){return g})),n.d(t,"u",(function(){return m})),n.d(t,"x",(function(){return v})),n.d(t,"r",(function(){return O})),n.d(t,"s",(function(){return h})),n.d(t,"t",(function(){return j})),n.d(t,"j",(function(){return y})),n.d(t,"L",(function(){return w})),n.d(t,"Q",(function(){return _})),n.d(t,"p",(function(){return E})),n.d(t,"q",(function(){return S})),n.d(t,"o",(function(){return k})),n.d(t,"I",(function(){return x})),n.d(t,"c",(function(){return C})),n.d(t,"v",(function(){return R})),n.d(t,"w",(function(){return N})),n.d(t,"T",(function(){return L})),n.d(t,"U",(function(){return T})),n.d(t,"K",(function(){return H})),n.d(t,"a",(function(){return z})),n.d(t,"N",(function(){return D})),n.d(t,"b",(function(){return V})),n.d(t,"M",(function(){return B})),n.d(t,"E",(function(){return F})),n.d(t,"h",(function(){return U})),n.d(t,"O",(function(){return Y})),n.d(t,"g",(function(){return I})),n.d(t,"i",(function(){return Q})),n.d(t,"H",(function(){return K})),n.d(t,"G",(function(){return G})),n.d(t,"S",(function(){return W})),n.d(t,"R",(function(){return q})),n.d(t,"d",(function(){return J})),n.d(t,"e",(function(){return $})),n.d(t,"f",(function(){return X})),n.d(t,"y",(function(){return Z})),n.d(t,"X",(function(){return te})),n.d(t,"Y",(function(){return ne})),n.d(t,"V",(function(){return re})),n.d(t,"W",(function(){return ce}));var r=n(3),c=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),o=Object(r.getSetting)("showAvatars",!0),a=Object(r.getSetting)("max_columns",6),u=Object(r.getSetting)("min_columns",1),l=Object(r.getSetting)("default_columns",3),s=Object(r.getSetting)("max_rows",6),b=Object(r.getSetting)("min_rows",1),f=Object(r.getSetting)("default_rows",3),p=Object(r.getSetting)("min_height",500),d=Object(r.getSetting)("default_height",500),g=Object(r.getSetting)("placeholderImgSrc",""),m=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),v=Object(r.getSetting)("limitTags"),O=Object(r.getSetting)("hasProducts",!0),h=Object(r.getSetting)("hasTags",!0),j=Object(r.getSetting)("homeUrl",""),y=Object(r.getSetting)("couponsEnabled",!0),w=Object(r.getSetting)("shippingEnabled",!0),_=Object(r.getSetting)("taxesEnabled",!0),E=Object(r.getSetting)("displayItemizedTaxes",!1),S=Object(r.getSetting)("hasDarkEditorStyleSupport",!1),k=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),x=Object(r.getSetting)("productCount",0),C=Object(r.getSetting)("attributes",[]),R=Object(r.getSetting)("isShippingCalculatorEnabled",!0),N=Object(r.getSetting)("isShippingCostHidden",!1),P=Object(r.getSetting)("woocommerceBlocksPhase",1),L=Object(r.getSetting)("wcBlocksAssetUrl",""),T=Object(r.getSetting)("wcBlocksBuildUrl",""),H=Object(r.getSetting)("shippingCountries",{}),z=Object(r.getSetting)("allowedCountries",{}),D=Object(r.getSetting)("shippingStates",{}),V=Object(r.getSetting)("allowedStates",{}),B=Object(r.getSetting)("shippingMethodsExist",!1),F=Object(r.getSetting)("paymentGatewaySortOrder",[]),U=Object(r.getSetting)("checkoutShowLoginReminder",!0),M={id:0,title:"",permalink:""},A=Object(r.getSetting)("storePages",{shop:M,cart:M,checkout:M,privacy:M,terms:M}),Y=A.shop.permalink,I=A.checkout.id,Q=A.checkout.permalink,K=A.privacy.permalink,G=A.privacy.title,W=A.terms.permalink,q=A.terms.title,J=A.cart.id,$=A.cart.permalink,X=Object(r.getSetting)("checkoutAllowsGuest",!1),Z=(Object(r.getSetting)("checkoutAllowsSignup",!1),Object(r.getSetting)("loginUrl","/wp-login.php")),ee=n(17),te=function(e,t){if(P>2)return Object(ee.registerBlockType)(e,t)},ne=function(e,t){if(P>1)return Object(ee.registerBlockType)(e,t)},re=function(){return P>2},ce=function(){return P>1}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(46),i=n.n(c),o=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},61:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(27),o=n.n(i),a=n(9);n(2);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,i=o()(e,["srcElement","size"]);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},i))}},73:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(21),o=n.n(i),a=n(24),u=n.n(a),l=n(19),s=n.n(l),b=n(22),f=n.n(b),p=n(23),d=n.n(p),g=n(12),m=n.n(g),v=n(0),O=n(6),h=n(7),j=n.n(h),y=n(4),w=n(25);n(121);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 o()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return u()(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,i=n.checked,o=n.instanceId,a=n.className,u=n.help,l=n.options,s=n.value,b="inspector-toggle-button-control-".concat(o);return u&&(e=Object(O.isFunction)(u)?u(i):u),Object(v.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,n){var i={};return s===e.value?(i.isPrimary=!0,i["aria-pressed"]=!0):(i.isDefault=!0,i["aria-pressed"]=!1),Object(v.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},i),e.label)}))))}}]),n}(v.Component);t.a=Object(w.withInstanceId)(E)},850:function(e,t,n){e.exports=n(899)},851:function(e,t){},899:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),i=n(0),o=n(1),a=n(17),u=n(61),l=n(56),s=Object(i.createElement)(l.a,{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 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(14),d=n(4),g=n(154),m=n(186),v=n(73),O=n(11),h=n.n(O),j=n(172),y=(n(2),n(48)),w=(n(851),n(266)),_=n(254),E=n(273),S=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(Object(o.__)("Between %s and %s","woo-gutenberg-products-block"),Object(_.a)(e),Object(_.a)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(_.a)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(_.a)(t))},k=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,u=e.showLabel,l=void 0===u||u,s=e.displayStyle,b=r?Object(i.createElement)(i.Fragment,null,r," ",n):n,f=Object(o.sprintf)(Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(i.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},l&&Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(i.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(i.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},f)))},x=n(205),C=n(33),R=n(267),N=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,u=void 0===a?"in":a,l=e.displayStyle,s=Object(x.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=h()(p,2),g=d[0],m=d[1];if(f)return null;var v=n.label;return Object(i.createElement)("li",null,Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},v,":"),Object(i.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"===u&&(c=Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),k({type:v,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(R.a)(g,m,n,e)},showLabel:!1,displayStyle:l})}))))},P=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=h()(c,2),u=a[0],l=a[1],s=Object(j.b)("min_price"),b=h()(s,2),p=b[0],d=b[1],g=Object(j.b)("max_price"),m=h()(g,2),v=m[0],O=m[1],_=Object(i.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(v)?k({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:S(p,v),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,v,S]),E=Object(i.useMemo)((function(){return u.map((function(e){var n=Object(w.b)(e.attribute);return Object(i.createElement)(N,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[u]);if(!(u.length>0||Number.isFinite(p)||Number.isFinite(v)||r))return null;var x="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(i.createElement)(i.Fragment,null,!r&&t.heading&&Object(i.createElement)(x,null,t.heading),Object(i.createElement)("div",{className:"wc-block-active-filters"},Object(i.createElement)("ul",{className:C},r?Object(i.createElement)(i.Fragment,null,k({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),k({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(i.createElement)(i.Fragment,null,_,E)),Object(i.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),l([])}},Object(i.createElement)(y.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},L=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,u=t.headingLevel;return Object(i.createElement)("div",{className:r},Object(i.createElement)(p.InspectorControls,{key:"inspector"},Object(i.createElement)(d.PanelBody,{title:Object(o.__)("Block Settings","woo-gutenberg-products-block")},Object(i.createElement)(v.a,{label:Object(o.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(o.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(o.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(i.createElement)("p",null,Object(o.__)("Heading Level","woo-gutenberg-products-block")),Object(i.createElement)(g.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:u,onChange:function(e){return n({headingLevel:e})}}))),Object(i.createElement)(m.a,{headingLevel:u,heading:a,onChange:function(e){return n({heading:e})}}),Object(i.createElement)(d.Disabled,null,Object(i.createElement)(P,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(o.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(u.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(o.__)("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(o.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:L,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(i.createElement)("div",c()({className:f()("is-loading",n)},r),Object(i.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},9:function(e,t){!function(){e.exports=this.React}()}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,o,a=t[0],u=t[1],l=t[2],b=0,f=[];b<a.length;b++)o=a[b],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&f.push(c[o][0]),c[o]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,a=1;a<n.length;a++){var u=n[a];0!==c[u]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},c={4:0},i=[];function o(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,o),n.l=!0,n.exports}o.m=e,o.c=r,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="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var s=u;return i.push([858,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},102:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(c)};c.Provider},122:function(e,t){},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},152:function(e,t,n){"use strict";var r=n(21),c=n.n(r),i=n(24),o=n.n(i),a=n(22),u=n.n(a),l=n(23),s=n.n(l),b=n(12),f=n.n(b),p=n(0),d=n(6),g=n(1),m=n(4);function v(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 h=function(e){u()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return o()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(v,{level:e}),title:Object(g.sprintf)(Object(g.__)("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,i=t.maxLevel,o=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.Toolbar,{isCollapsed:r,icon:Object(p.createElement)(v,{level:o}),controls:Object(d.range)(c,i).map((function(t){return e.createLevelControl(t,o,a)}))})}}]),n}(p.Component);t.a=h},155:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(11),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},17:function(e,t){!function(){e.exports=this.wp.blocks}()},171:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(11),c=n.n(r),i=n(41),o=n(36),a=n(0),u=n(102),l=n(6),s=n(60),b=function(e){var t=Object(u.a)();e=e||t;var n=Object(o.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e])]},f=function(e,t,n){var r=Object(u.a)();n=n||r;var c=Object(o.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e])]},p=function(e,t){var n=Object(u.a)(),r=b(t=t||n),i=c()(r,2),o=i[0],f=i[1],p=Object(s.a)(e),d=Object(a.useRef)(!1);return Object(a.useEffect)((function(){f(Object(l.assign)({},o,p)),d.current=!0}),[p]),d.current?[o,f]:[e,f]}},185:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(14)),i=n(7),o=n.n(i);n(260);t.a=function(e){var t=e.className,n=e.headingLevel,i=e.onChange,a=e.heading,u="h".concat(n);return Object(r.createElement)(u,null,Object(r.createElement)(c.PlainText,{className:o()("wc-block-editor-components-title",t),value:a,onChange:i}))}},202:function(e,t){},206:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(41),c=n(36),i=n(0),o=n(155),a=n(60),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,l=void 0===u?[]:u,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(i.useRef)({results:[],isLoading:!0}),g=Object(a.a)(b),m=Object(a.a)(l),v=Object(o.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),i=[t,n,g,m],o=c.getCollectionError.apply(c,i);return o&&v(o),{results:c.getCollection.apply(c,i),isLoading:!c.hasFinishedResolution("getCollection",i)}}),[t,n,m,g,p]);return null!==O&&(d.current=O),d.current}},25:function(e,t){!function(){e.exports=this.wp.compose}()},258:function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return g}));var r=n(8),c=n.n(r),i=n(53),o=n.n(i),a=n(3);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 l(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}var s,b,f={code:a.CURRENCY.code,symbol:a.CURRENCY.symbol,thousandSeparator:a.CURRENCY.thousandSeparator,decimalSeparator:a.CURRENCY.decimalSeparator,minorUnit:a.CURRENCY.precision,prefix:(s=a.CURRENCY.symbol,b=a.CURRENCY.symbolPosition,{left:s,left_space:" "+s,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(a.CURRENCY.symbol,a.CURRENCY.symbolPosition)},p=function(e){if(!e||"object"!==o()(e))return f;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,c=e.currency_decimal_separator,i=e.currency_minor_unit,a=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(i)?i:2,prefix:"string"==typeof a?a:"$",suffix:"string"==typeof u?u:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(l({},f),e)},g=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=d(t),c=n/Math.pow(10,r.minorUnit),i=r.prefix+c+r.suffix,o=document.createElement("textarea");return o.innerHTML=i,o.value}},260:function(e,t){},270:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(5),c=r.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 c.find((function(t){return t.id===e}))},o=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},271:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));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]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),o=i.length?i[0]:null;if(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)){var a=o.slug.filter((function(e){return e!==c})),u=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(o.slug=a.sort(),u.push(o)),t(Object(r.sortBy)(u,"attribute"))}},i=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]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",o=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(c,"slug").sort()}),t(Object(r.sortBy)(o,"attribute")))}},276:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(27),o=n.n(i),a=n(0),u=(n(2),n(7)),l=n.n(u),s=n(1),b=n(61),f=n(283),p=(n(202),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,u=void 0===i?"li":i,s=e.className,b=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,d=e.children,g=void 0===d?null:d,m=o()(e,["text","screenReaderText","element","className","radius","children"]),v=u,O=l()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+p),h=Boolean(r&&r!==t);return Object(a.createElement)(v,c()({className:O},m),Object(a.createElement)("span",{"aria-hidden":h,className:"wc-block-components-chip__text"},t),h&&Object(a.createElement)("span",{className:"screen-reader-text"},r),g)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,u=e.disabled,d=void 0!==u&&u,g=e.onRemove,m=void 0===g?function(){}:g,v=e.removeOnAnyClick,O=void 0!==v&&v,h=e.text,j=e.screenReaderText,y=void 0===j?"":j,w=o()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=O?"span":"button";if(!n){var E=y&&"string"==typeof y?y:h;n="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var S={"aria-label":n,disabled:d,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},k=O?S:{},x=O?{"aria-hidden":!0}:S;return Object(a.createElement)(p,c()({},w,k,{className:l()(i,"is-removable"),element:O?"button":w.element,screenReaderText:y,text:h}),Object(a.createElement)(_,c()({className:"wc-block-components-chip__remove"},x),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},283:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(27),o=n.n(i),a=n(0),u=n(58),l=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(u.a,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=l},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},36:function(e,t){!function(){e.exports=this.wp.data}()},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},48:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(0),o=(n(2),n(9)),a=n(7),u=n.n(a);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 s(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){c()(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 b=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,l=null!=n,b=null!=r;return!l&&b?(t=c||"span",a=s(s({},a),{},{className:u()(a.className,"screen-reader-text")}),Object(i.createElement)(t,a,r)):(t=c||o.Fragment,l&&b&&n!==r?Object(i.createElement)(t,a,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,a,n))};b.defaultProps={wrapperProps:{}},t.a=b},5:function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"J",(function(){return i})),n.d(t,"P",(function(){return o})),n.d(t,"z",(function(){return a})),n.d(t,"B",(function(){return u})),n.d(t,"l",(function(){return l})),n.d(t,"A",(function(){return s})),n.d(t,"D",(function(){return b})),n.d(t,"n",(function(){return f})),n.d(t,"C",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"F",(function(){return g})),n.d(t,"u",(function(){return m})),n.d(t,"x",(function(){return v})),n.d(t,"r",(function(){return O})),n.d(t,"s",(function(){return h})),n.d(t,"t",(function(){return j})),n.d(t,"j",(function(){return y})),n.d(t,"L",(function(){return w})),n.d(t,"Q",(function(){return _})),n.d(t,"p",(function(){return E})),n.d(t,"q",(function(){return S})),n.d(t,"o",(function(){return k})),n.d(t,"I",(function(){return x})),n.d(t,"c",(function(){return C})),n.d(t,"v",(function(){return R})),n.d(t,"w",(function(){return N})),n.d(t,"T",(function(){return L})),n.d(t,"U",(function(){return T})),n.d(t,"K",(function(){return H})),n.d(t,"a",(function(){return z})),n.d(t,"N",(function(){return D})),n.d(t,"b",(function(){return V})),n.d(t,"M",(function(){return B})),n.d(t,"E",(function(){return F})),n.d(t,"h",(function(){return U})),n.d(t,"O",(function(){return Y})),n.d(t,"g",(function(){return I})),n.d(t,"i",(function(){return Q})),n.d(t,"H",(function(){return K})),n.d(t,"G",(function(){return G})),n.d(t,"S",(function(){return W})),n.d(t,"R",(function(){return $})),n.d(t,"d",(function(){return q})),n.d(t,"e",(function(){return J})),n.d(t,"f",(function(){return X})),n.d(t,"y",(function(){return Z})),n.d(t,"X",(function(){return te})),n.d(t,"Y",(function(){return ne})),n.d(t,"V",(function(){return re})),n.d(t,"W",(function(){return ce}));var r=n(3),c=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),o=Object(r.getSetting)("showAvatars",!0),a=Object(r.getSetting)("max_columns",6),u=Object(r.getSetting)("min_columns",1),l=Object(r.getSetting)("default_columns",3),s=Object(r.getSetting)("max_rows",6),b=Object(r.getSetting)("min_rows",1),f=Object(r.getSetting)("default_rows",3),p=Object(r.getSetting)("min_height",500),d=Object(r.getSetting)("default_height",500),g=Object(r.getSetting)("placeholderImgSrc",""),m=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),v=Object(r.getSetting)("limitTags"),O=Object(r.getSetting)("hasProducts",!0),h=Object(r.getSetting)("hasTags",!0),j=Object(r.getSetting)("homeUrl",""),y=Object(r.getSetting)("couponsEnabled",!0),w=Object(r.getSetting)("shippingEnabled",!0),_=Object(r.getSetting)("taxesEnabled",!0),E=Object(r.getSetting)("displayItemizedTaxes",!1),S=Object(r.getSetting)("hasDarkEditorStyleSupport",!1),k=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),x=Object(r.getSetting)("productCount",0),C=Object(r.getSetting)("attributes",[]),R=Object(r.getSetting)("isShippingCalculatorEnabled",!0),N=Object(r.getSetting)("isShippingCostHidden",!1),P=Object(r.getSetting)("woocommerceBlocksPhase",1),L=Object(r.getSetting)("wcBlocksAssetUrl",""),T=Object(r.getSetting)("wcBlocksBuildUrl",""),H=Object(r.getSetting)("shippingCountries",{}),z=Object(r.getSetting)("allowedCountries",{}),D=Object(r.getSetting)("shippingStates",{}),V=Object(r.getSetting)("allowedStates",{}),B=Object(r.getSetting)("shippingMethodsExist",!1),F=Object(r.getSetting)("paymentGatewaySortOrder",[]),U=Object(r.getSetting)("checkoutShowLoginReminder",!0),M={id:0,title:"",permalink:""},A=Object(r.getSetting)("storePages",{shop:M,cart:M,checkout:M,privacy:M,terms:M}),Y=A.shop.permalink,I=A.checkout.id,Q=A.checkout.permalink,K=A.privacy.permalink,G=A.privacy.title,W=A.terms.permalink,$=A.terms.title,q=A.cart.id,J=A.cart.permalink,X=Object(r.getSetting)("checkoutAllowsGuest",!1),Z=(Object(r.getSetting)("checkoutAllowsSignup",!1),Object(r.getSetting)("loginUrl","/wp-login.php")),ee=n(17),te=function(e,t){if(P>2)return Object(ee.registerBlockType)(e,t)},ne=function(e,t){if(P>1)return Object(ee.registerBlockType)(e,t)},re=function(){return P>2},ce=function(){return P>1}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(46),i=n.n(c),o=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},61:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(27),o=n.n(i),a=n(9);n(2);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,i=o()(e,["srcElement","size"]);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},i))}},74:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(21),o=n.n(i),a=n(24),u=n.n(a),l=n(19),s=n.n(l),b=n(22),f=n.n(b),p=n(23),d=n.n(p),g=n(12),m=n.n(g),v=n(0),O=n(6),h=n(7),j=n.n(h),y=n(4),w=n(25);n(122);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 o()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return u()(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,i=n.checked,o=n.instanceId,a=n.className,u=n.help,l=n.options,s=n.value,b="inspector-toggle-button-control-".concat(o);return u&&(e=Object(O.isFunction)(u)?u(i):u),Object(v.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,n){var i={};return s===e.value?(i.isPrimary=!0,i["aria-pressed"]=!0):(i.isDefault=!0,i["aria-pressed"]=!1),Object(v.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},i),e.label)}))))}}]),n}(v.Component);t.a=Object(w.withInstanceId)(E)},858:function(e,t,n){e.exports=n(907)},859:function(e,t){},9:function(e,t){!function(){e.exports=this.React}()},907:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),i=n(0),o=n(1),a=n(17),u=n(61),l=n(58),s=Object(i.createElement)(l.a,{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 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(14),d=n(4),g=n(152),m=n(185),v=n(74),O=n(11),h=n.n(O),j=n(171),y=(n(2),n(48)),w=(n(859),n(270)),_=n(258),E=n(276),S=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(Object(o.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.a)(e),Object(_.a)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(_.a)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(_.a)(t))},k=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,u=e.showLabel,l=void 0===u||u,s=e.displayStyle,b=r?Object(i.createElement)(i.Fragment,null,r," ",n):n,f=Object(o.sprintf)(Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(i.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},l&&Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(i.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(i.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},f)))},x=n(206),C=n(33),R=n(271),N=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,u=void 0===a?"in":a,l=e.displayStyle,s=Object(x.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=h()(p,2),g=d[0],m=d[1];if(f)return null;var v=n.label;return Object(i.createElement)("li",null,Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},v,":"),Object(i.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"===u&&(c=Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),k({type:v,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(R.a)(g,m,n,e)},showLabel:!1,displayStyle:l})}))))},P=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=h()(c,2),u=a[0],l=a[1],s=Object(j.b)("min_price"),b=h()(s,2),p=b[0],d=b[1],g=Object(j.b)("max_price"),m=h()(g,2),v=m[0],O=m[1],_=Object(i.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(v)?k({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:S(p,v),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,v,S]),E=Object(i.useMemo)((function(){return u.map((function(e){var n=Object(w.b)(e.attribute);return Object(i.createElement)(N,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[u]);if(!(u.length>0||Number.isFinite(p)||Number.isFinite(v)||r))return null;var x="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(i.createElement)(i.Fragment,null,!r&&t.heading&&Object(i.createElement)(x,null,t.heading),Object(i.createElement)("div",{className:"wc-block-active-filters"},Object(i.createElement)("ul",{className:C},r?Object(i.createElement)(i.Fragment,null,k({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),k({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(i.createElement)(i.Fragment,null,_,E)),Object(i.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),l([])}},Object(i.createElement)(y.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},L=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,u=t.headingLevel;return Object(i.createElement)("div",{className:r},Object(i.createElement)(p.InspectorControls,{key:"inspector"},Object(i.createElement)(d.PanelBody,{title:Object(o.__)("Block Settings","woo-gutenberg-products-block")},Object(i.createElement)(v.a,{label:Object(o.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(o.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(o.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(i.createElement)("p",null,Object(o.__)("Heading Level","woo-gutenberg-products-block")),Object(i.createElement)(g.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:u,onChange:function(e){return n({headingLevel:e})}}))),Object(i.createElement)(m.a,{headingLevel:u,heading:a,onChange:function(e){return n({heading:e})}}),Object(i.createElement)(d.Disabled,null,Object(i.createElement)(P,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(o.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(u.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(o.__)("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(o.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:L,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(i.createElement)("div",c()({className:f()("is-loading",n)},r),Object(i.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})}});
build/all-products-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', '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-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => 'bdf90d416f2f50a478d1d01212497a07');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', '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-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => '7565e879b279a2abb10f40bd71958e50');
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=203)}([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.wc.wcSettings}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(61)()},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){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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"v",(function(){return c})),n.d(t,"z",(function(){return i})),n.d(t,"s",(function(){return a})),n.d(t,"m",(function(){return u})),n.d(t,"p",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"A",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return d})),n.d(t,"j",(function(){return m})),n.d(t,"c",(function(){return b})),n.d(t,"n",(function(){return h})),n.d(t,"o",(function(){return g})),n.d(t,"D",(function(){return y})),n.d(t,"E",(function(){return O})),n.d(t,"w",(function(){return j})),n.d(t,"a",(function(){return w})),n.d(t,"x",(function(){return k})),n.d(t,"b",(function(){return E})),n.d(t,"r",(function(){return S})),n.d(t,"f",(function(){return _})),n.d(t,"y",(function(){return P})),n.d(t,"g",(function(){return C})),n.d(t,"u",(function(){return N})),n.d(t,"t",(function(){return T})),n.d(t,"C",(function(){return A})),n.d(t,"B",(function(){return F})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return I})),n.d(t,"q",(function(){return D})),n.d(t,"F",(function(){return B}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),c=Object(r.getSetting)("reviewRatingsEnabled",!0),i=Object(r.getSetting)("showAvatars",!0),a=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),u=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),f=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),p=Object(r.getSetting)("displayItemizedTaxes",!1),d=Object(r.getSetting)("hasDarkEditorStyleSupport",!1),m=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),b=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),h=Object(r.getSetting)("isShippingCalculatorEnabled",!0),g=Object(r.getSetting)("isShippingCostHidden",!1),v=Object(r.getSetting)("woocommerceBlocksPhase",1),y=Object(r.getSetting)("wcBlocksAssetUrl",""),O=Object(r.getSetting)("wcBlocksBuildUrl",""),j=Object(r.getSetting)("shippingCountries",{}),w=Object(r.getSetting)("allowedCountries",{}),k=Object(r.getSetting)("shippingStates",{}),E=Object(r.getSetting)("allowedStates",{}),S=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("paymentGatewaySortOrder",[])),_=Object(r.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},R=Object(r.getSetting)("storePages",{shop:x,cart:x,checkout:x,privacy:x,terms:x}),P=R.shop.permalink,C=(R.checkout.id,R.checkout.permalink),N=R.privacy.permalink,T=R.privacy.title,A=R.terms.permalink,F=R.terms.title,M=(R.cart.id,R.cart.permalink),I=Object(r.getSetting)("checkoutAllowsGuest",!1),D=(Object(r.getSetting)("checkoutAllowsSignup",!1),Object(r.getSetting)("loginUrl","/wp-login.php")),B=(n(39),function(){return v>1})},function(e,t,n){var r=n(71),o=n(72),c=n(54),i=n(73);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()}},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){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},n.apply(this,arguments)}e.exports=n},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.wp.data}()},function(e,t,n){var r=n(56);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}},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},,function(e,t){!function(){e.exports=this.wp.htmlEntities}()},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}},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(40);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){Object(r.a)(e,t,n[t])}))}return e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(53);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}}(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(){e.exports=this.wp.compose}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(28);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,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,n){"use strict";var r=n(6),o=n.n(r),c=(n(4),n(3)),i=n(5),a=n.n(i);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(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=null!=n,l=null!=r;return!u&&l?(t=o||"span",i=s(s({},i),{},{className:a()(i.className,"screen-reader-text")}),React.createElement(t,i,r)):(t=o||c.Fragment,u&&l&&n!==r?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,i,n))};l.defaultProps={wrapperProps:{}},t.a=l},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},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}},function(e,t,n){var r=n(60);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)}},function(e,t,n){var r=n(23),o=n(18);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(45);var o=n(53);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(36),c=n.n(o),i=function(e){var t=Object(r.useRef)();return c()(e,t.current)||(t.current=e),t.current}},,function(e,t){!function(){e.exports=this.wp.blocks}()},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.a11y}()},function(e,t,n){"use strict";var r=n(30),o=n.n(r),c=n(31),i=n.n(c),a=n(18),u=n.n(a),s=n(32),l=n.n(s),f=n(33),p=n.n(f),d=n(20),m=n.n(d),b=n(6),h=n.n(b),g=(n(4),n(3)),v=n(1),y=n(8),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.D,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("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(63);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 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=this.state,a=i.errorMessage;return i.hasError?React.createElement(O,{errorMessage:r?a: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(g.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(g.Component);w.defaultProps={showErrorMessage:!0};t.a=w},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){!function(){e.exports=this.wp.dom}()},,function(e,t){!function(){e.exports=this.wp.keycodes}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(22),o=n(7),c=n(0),i=function(e){var t=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(c.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(45);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,n){var r=n(55);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}}},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}},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}},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 n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(62);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";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,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(11)),c=r(n(56)),i=n(3),a=r(i),u=r(n(108)),s=r(n(18)),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 m(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 b(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,g,v=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 v&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}return u(t,e),t}(v),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 v&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&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 v)&&(t[n]=r instanceof v?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function j(e,t){h={fn:e,transform:t}}function w(e){g=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},S=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function _(e){k=e}var x,R=function(){return Date.now()};function P(e){x=e}var C,N,T=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return g},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return S},injectFrame:function(e,t){E=e,S=t},get interpolation(){return k},injectStringInterpolator:_,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return x},injectDefaultElement:P,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return N},injectManualFrameloop:function(e){N=e}}),M=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),I=!1,D=new Set,B=function e(){if(!I)return!1;var t=R(),n=D,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 m=s.fromValues[p],b=s.toValues[p],h=d.lastPosition,g=b instanceof v,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(g&&(b=b.getValue()),s.immediate)d.setValue(b),d.done=!0;else if("string"!=typeof m&&"string"!=typeof b){if(void 0!==s.duration)h=m+s.easing((t-d.startTime)/s.duration)*(b-m),l=t>=d.startTime+s.duration;else if(s.decay)h=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(b=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-b)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(m<b?h>b:h<b),k=Math.abs(y)<=s.precision,S=0===s.tension||Math.abs(b-h)<=s.precision;l=w||k&&S,d.lastVelocity=y,d.lastTime=t}g&&!s.toValues[p].done&&(l=!1),l?(d.value!==b&&(h=b),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(b),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(D.delete(i),i.stop(!0))}return D.size?N?N():E(e):I=!1,I};function L(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return L({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=L(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=L(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var z=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}(v),q=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new z(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=b(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:m(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,D.has(t)||D.add(t),I||(I=!0,E(N||B));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,D.has(t)&&D.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,b(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,b(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,b=n.attach,h=n.reset,v=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=b&&b(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)&&!g[i],b=l.arr(i),y=!u&&!b&&!f,j=l.und(c[r])?i:c[r],w=u||b||f?i:1,E=m(s,r);O&&(w=O.animations[r].parent);var S,_=a.parent,x=a.interpolation,P=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var N,T=x&&x.getValue(),A=!l.und(_)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,T),M=!l.equ(C,a.previous),I=!l.equ(E,a.config);if(h||M&&F||I){var D;if(u||f)_=x=a.parent||new z(j);else if(b)_=x=a.parent||new q(j);else if(y){var B=a.interpolation&&a.interpolation.calc(a.parent.value);B=void 0===B||h?j:B,a.parent?(_=a.parent).setValue(0,!1):_=new z(0);var L={output:[B,i]};a.interpolation?(x=a.interpolation,a.interpolation.updateConfig(L)):x=_.interpolate(L)}return P=d(O?w.getPayload():w),S=d(_.getPayload()),h&&!y&&_.setValue(j,!1),t.hasChanged=!0,S.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()})),m(v,r)&&_.setValue(y?w:i,!1),o({},e,((D={})[r]=o({},a,{name:r,parent:_,interpolation:x,animatedValues:S,toValues:P,previous:C,config:E,fromValues:d(_.getValue()),immediate:m(v,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}),D))}return F?e:(y&&(_.setValue(1,!1),x.updateConfig({output:[C,C]})),_.done=!0,t.hasChanged=!0,o({},e,((N={})[r]=o({},e[r],{previous:C}),N)))}),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?m(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?m(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},K=0,Q=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Y=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:Q(t,r)},i)};function G(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 v||(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 me(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 be=/[+\-]?(?: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,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),ve={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||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).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}),ve);var je={};A((function(e){return new $(e)})),P("div"),_((function(e){var t=e.output.map((function(e){return e.replace(he,me)})).map((function(e){return e.replace(ge,me)})),n=t[0].match(be).map((function(){return[]}));t.forEach((function(e){e.match(be).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(be).map((function(t,r){return L(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(be,(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 M(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 T(p,u,r)})),d(t);var m,b=s.current.getValue(),g=(b.scrollTop,b.scrollLeft,c(b,["scrollTop","scrollLeft"])),v=(m=e,!l.fun(m)||m.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({},g,{ref:v}))}))},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)}),Se=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=B,t.animated=Se,t.a=Se,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=m(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:m(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:m(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=Y(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),b=(a.keys,a.items,a.onFrame),h=a.onRest,g=a.onStart,v=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=Y(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,b=a.update,h=a.trail,g=void 0===h?0:h,v=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Y(r),k=w.keys,E=w.items,S=o({},i.current),_=[].concat(i.deleted),x=Object.keys(S),R=new Set(x),P=new Set(s),C=s.filter((function(e){return!R.has(e)})),N=i.transitions.filter((function(e){return!e.destroyed&&!P.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return R.has(e)})),A=-g;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){v&&_.find((function(t){return t.originalKey===e}))&&(_=_.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";S[e]={slot:c,originalKey:e,key:v?String(e):K++,item:o,trail:A+=g,config:m(y,o,c),from:m(n&&void 0!==l?l||{}:f,o),to:m(p,o)}}));break;case"leave":N.forEach((function(e){var t=k.indexOf(e),n=E[t];_.unshift(o({},S[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=g,config:m(y,n,"leave"),to:m(d,n)})),delete S[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];S[e]=o({},S[e],{item:n,slot:"update",trail:A+=g,config:m(y,n,"update"),to:m(b,n)})}))}}var F=s.map((function(e){return S[e]}));return _.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||N.length||T.length,first:n&&0===C.length,transitions:F,current:S,deleted:_,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:v,onRest:function(n){w.current.mounted&&(e.destroyed&&(v||s||G(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(v||s)&&w.current.deleted.length>0&&G(w),h&&h(u,t,n))},onStart:g&&function(){return g(u,t)},onFrame:b&&function(e){return b(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(11),o=n.n(r),c=n(14),i=n.n(c),a=n(49),u=function(e){var t=e.className,n=e.size,r=void 0===n?20:n,c=i()(e,["className","size"]);return React.createElement(a.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},c),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},s=React.createElement(u,null),l=n(122),f=n(0);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=s;break;case"no-alt":t=l.a}return t?Object(f.cloneElement)(t,{size:e.size||20,className:e.className}):null}},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}}},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.")}},,function(e,t,n){"use strict";var r=n(22),o=n(10),c=n(27),i=n(0),a=n(68),u=n(49);t.a=function(e){var t=e.icon,n=void 0===t?null:t,s=e.size,l=Object(c.a)(e,["icon","size"]),f=s||20;if("string"==typeof n)return Object(i.createElement)(a.a,Object(o.a)({icon:n,size:f},l));if(n&&a.a===n.type)return Object(i.cloneElement)(n,Object(r.a)({size:f},l));var p=s||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,Object(r.a)({size:p},l)):n(Object(r.a)({size:p},l));if(n&&("svg"===n.type||n.type===u.a)){var d=Object(r.a)({width:p,height:p},n.props,l);return Object(i.createElement)(u.a,d)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,Object(r.a)({size:p},l)):n}},function(e,t,n){"use strict";var r=n(22),o=n(27),c=n(5),i=n.n(c),a=n(0);t.a=Object(a.forwardRef)((function(e,t){var n=e.href,c=e.target,u=e.isPrimary,s=e.isLarge,l=e.isSmall,f=e.isTertiary,p=e.isToggled,d=e.isBusy,m=e.isDefault,b=e.isLink,h=e.isDestructive,g=e.className,v=e.disabled,y=Object(o.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),O=i()("components-button",g,{"is-button":m||u||s||l,"is-default":m||!u&&(s||l),"is-primary":u,"is-large":s,"is-small":l,"is-tertiary":f,"is-toggled":p,"is-busy":d,"is-link":b,"is-destructive":h}),j=void 0===n||v?"button":"a",w="a"===j?{href:n,target:c}:{type:"button",disabled:v};return Object(a.createElement)(j,Object(r.a)({},w,y,{className:O,ref:t}))}))},,,function(e,t){!function(){e.exports=this.wp.autop}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),o=n.n(r),c=n(116),i=n(0);function a(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 u(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){o()(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 s=function(){var e=Object(c.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,o=e.createSnackbarNotice,a=e.setIsSuppressed,s=Object(i.useRef)(t);Object(i.useEffect)((function(){s.current=t}),[t]);var l=Object(i.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.map((function(t){return null!==e&&t.status!==e||r(t.id),!0}))},removeNotice:r}}),[r]),f=Object(i.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[n,o]);return u(u(u({notices:t},l),f),{},{setIsSuppressed:a})}},,function(e,t){!function(){e.exports=this.wp.deprecated}()},,,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 function(e){return t((function(){throw e}))}}},,,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return d}));var r=n(9),o=n.n(r),c=n(15),i=n(13),a=n(0),u=n(59),s=n(7),l=n(37),f=function(e){var t=Object(u.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])]},p=function(e,t,n){var r=Object(u.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){s(n,e,t)}),[n,e])]},d=function(e,t){var n=Object(u.a)(),r=f(t=t||n),c=o()(r,2),i=c[0],p=c[1],d=Object(l.a)(e),m=Object(a.useRef)(!1);return Object(a.useEffect)((function(){p(Object(s.assign)({},i,d)),m.current=!0}),[d]),m.current?[i,p]:[e,p]}},function(e,t,n){"use strict";var r=n(10),o=n(0),c=n(7);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){return Object(o.useMemo)((function(){return function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e)}),[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(11),o=n.n(r),c=n(30),i=n.n(c),a=n(31),u=n.n(a),s=n(18),l=n.n(s),f=n(32),p=n.n(f),d=n(33),m=n.n(d),b=n(20),h=n.n(b),g=n(6),v=n.n(g),y=n(3);n(124);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 m()(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),v()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),v()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),v()(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(y.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 m}));var r=n(11),o=n.n(r),c=n(6),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})},m=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){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(13),c=n(0),i=n(85),a=n(37),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 m=Object(c.useRef)({results:[],isLoading:!0}),b=Object(a.a)(f),h=Object(a.a)(s),g=Object(i.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,b,h],i=o.getCollectionError.apply(o,c);return i&&g(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,b,d]);return null!==v&&(m.current=v),m.current}},,,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:{}})),c=function(){return Object(r.useContext)(o)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return M})),n.d(t,"a",(function(){return I}));var r=n(6),o=n.n(r),c=n(9),i=n.n(c),a=(n(4),n(0)),u=n(13),s=n(11),l=n.n(s),f=n(5),p=n.n(f),d=n(173),m=(n(107),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""}),b=function(e){var t=e.className,n=e.notices,r=M().removeNotice,o=p()(t,"wc-block-components-notices"),c=n.filter((function(e){return"snackbar"!==e.type}));return c.length?React.createElement("div",{className:o},c.map((function(e){return React.createElement(d.a,l()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",m(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)}))):null},h=n(10),g=n(24),v=n.n(g);function y(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 O(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){y(c,r,o,i,a,"next",e)}function a(e){y(c,r,o,i,a,"throw",e)}i(void 0)}))}}var j=n(25),w=n(7),k=n(67),E=n(26),S=n(1),_=n(76);var x=Object(a.forwardRef)((function(e,t){var n=e.className,r=e.children,o=e.actions,c=void 0===o?[]:o,i=e.onRemove,u=void 0===i?w.noop:i;Object(a.useEffect)((function(){var e=setTimeout((function(){u()}),1e4);return function(){return clearTimeout(e)}}),[]);var s=p()(n,"components-snackbar");return c&&c.length>1&&(console.warn("Snackbar can only have 1 action, use Notice if your message require many messages"),c=[c[0]]),Object(a.createElement)("div",{ref:t,className:s,onClick:u,tabIndex:"0",role:"button",onKeyPress:u,label:Object(S.__)("Dismiss this notice")},Object(a.createElement)("div",{className:"components-snackbar__content"},r,c.map((function(e,t){var n=e.label,r=e.onClick,o=e.url;return Object(a.createElement)(_.a,{key:t,href:o,isTertiary:!0,onClick:function(e){e.stopPropagation(),r&&r(e)},className:"components-snackbar__action"},n)}))))}));var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?w.noop:o,i=Object(E.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(j.a)(u,1)[0],l=Object(k.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=O(v.a.mark((function t(n){return v.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=O(v.a.mark((function e(t){return v.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=p()("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)(k.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)(x,Object(h.a)({},Object(w.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},P=n(80),C=n(115),N=function(){var e=Object(C.a)().isEditor,t=Object(P.a)(),n=t.notices,r=t.removeNotice,o=n.filter((function(e){return"snackbar"===e.type}));return e?null:React.createElement(R,{notices:o,className:"wc-block-components-notices__snackbar",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 A(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 F=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),M=function(){return Object(a.useContext)(F)},I=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,s=e.context,l=void 0===s?"wc/core":s,f=Object(u.useDispatch)("core/notices"),p=f.createNotice,d=f.removeNotice,m=Object(a.useState)(!1),h=i()(m,2),g=h[0],v=h[1],y=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]:{};p(e,t,A(A({},n),{},{context:n.context||l}))}),[p,l]),O=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;d(e,t)}),[d,l]),j=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]:{};y("default",e,A(A({},t),{},{type:"snackbar"}))}),[y]),w={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:y,createSnackbarNotice:j,removeNotice:O,context:l,setIsSuppressed:v},k=g?null:React.createElement(b,{className:r,notices:w.notices}),E=g?null:React.createElement(N,null);return React.createElement(F.Provider,{value:w},c&&k,t,E)}},,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(14),i=n.n(c),a=n(49),u=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return React.createElement(a.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),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"}))},s=React.createElement(u,null);t.a=s},function(e,t,n){"use strict";var r=n(6),o=n.n(r),c=n(14),i=n.n(c),a=n(3);n(4);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,c=i()(e,["srcElement","size"]);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){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}({width:r,height:r},c))}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(2),c=n(15),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(n.current){var r=e(c.SCHEMA_STORE_KEY),o=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(c.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("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(4);var r=n(5),o=n.n(r),c=n(29),i=n(98);n(152);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.a,{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(35),o=n(0),c=n(8);n.p=c.E,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,295))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,305))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,304))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,296))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,297))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,298))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,282))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,299))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,300))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,301))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,302))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,303))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(7),c=n(5),i=n.n(c),a=n(1),u=n(76),s=n(10),l=n(27);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 m=n(65),b=n(12);function h(e,t){return!t||"object"!==Object(m.a)(t)&&"function"!=typeof t?Object(b.a)(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(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&&v(e,t)}var O=n(25),j=n(46),w=n(48),k=n(82),E=n.n(k),S=n(26),_=n(22),x=function(){return"rtl"===document.documentElement.dir};function R(e,t,n,r){var o=t.width;"left"===n&&x()?n="right":"right"===n&&x()&&(n="left");var c,i=Math.round(e.left+e.width/2),a={popoverLeft:i,contentWidth:(i-o/2>0?o/2:i)+(i+o/2>window.innerWidth?window.innerWidth-i:o/2)},u="middle"===r?e.left:i,s={popoverLeft:u,contentWidth:u-o>0?o:u},l="middle"===r?e.right:i,f={popoverLeft:l,contentWidth:l+o>window.innerWidth?window.innerWidth-l:o},p=null;if("center"===n&&a.contentWidth===o)c="center";else if("left"===n&&s.contentWidth===o)c="left";else if("right"===n&&f.contentWidth===o)c="right";else{var d="left"===(c=s.contentWidth>f.contentWidth?"left":"right")?s.contentWidth:f.contentWidth;p=d!==o?d:null}return{xAxis:c,popoverLeft:"center"===c?a.popoverLeft:"left"===c?s.popoverLeft:f.popoverLeft,contentWidth:p}}function P(e,t,n){var r,o=t.height,c=e.top+e.height/2,i={popoverTop:c,contentHeight:(c-o/2>0?o/2:c)+(c+o/2>window.innerHeight?window.innerHeight-c:o/2)},a={popoverTop:e.top,contentHeight:e.top-10-o>0?o:e.top-10},u={popoverTop:e.bottom,contentHeight:e.bottom+10+o>window.innerHeight?window.innerHeight-10-e.bottom:o},s=null;if("middle"===n&&i.contentHeight===o)r="middle";else if("top"===n&&a.contentHeight===o)r="top";else if("bottom"===n&&u.contentHeight===o)r="bottom";else{var l="top"===(r=a.contentHeight>u.contentHeight?"top":"bottom")?a.contentHeight:u.contentHeight;s=l!==o?l:null}return{yAxis:r,popoverTop:"middle"===r?i.popoverTop:"top"===r?a.popoverTop:u.popoverTop,contentHeight:s}}var C=n(34),N=Object(r.createContext)({focusHistory:[]}),T=N.Provider,A=N.Consumer;T.displayName="FocusReturnProvider",A.displayName="FocusReturnConsumer";r.Component;var F=Object(S.createHigherOrderComponent)((function e(t){if((c=t)instanceof r.Component||"function"==typeof c){var n=t;return e({})(n)}var c,i=t.onFocusReturn,a=void 0===i?o.stubTrue:i;return function(e){var t=function(t){function n(){var e;return f(this,n),(e=h(this,g(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 y(n,t),d(n,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==a())for(var r,c=[].concat(Object(C.a)(o.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(C.a)(n)))),[e]);r=c.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),n}(r.Component);return function(e){return Object(r.createElement)(A,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn"),M=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===w.TAB){var t=j.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(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),n}(r.Component)}),"withConstrainedTabbing"),I=["button","submit"];var D=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(b.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(b.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{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(o.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(o.includes)(I,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,Object(s.a)({ref:this.bindNode},this.props)))}}]),n}(r.Component)}),"withFocusOutside")(function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),t}(r.Component));var B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,c=void 0===o?"lockscroll":o,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](c),n.documentElement.classList[r](c),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),t}(r.Component)}();function L(e){e.stopPropagation()}var V=Object(r.forwardRef)((function(e,t){var n=e.children,o=Object(l.a)(e,["children"]);return Object(r.createElement)("div",Object(s.a)({},o,{ref:t,onMouseDown:L}),n)})),z=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),q=z.Provider,H=z.Consumer,W=(r.Component,0);function U(e){var t=e.name,n=e.children,c=e.registerFill,i=e.unregisterFill,a=function(e){var t=Object(r.useContext)(z),n=t.getSlot,o=t.subscribe,c=Object(r.useState)(n(e)),i=Object(O.a)(c,2),a=i[0],u=i[1];return Object(r.useEffect)((function(){return u(n(e)),o((function(){u(n(e))}))}),[e]),a}(t),u=Object(r.useRef)({name:t,children:n});return u.current.occurrence||(u.current.occurrence=++W),Object(r.useLayoutEffect)((function(){return c(t,u.current),function(){return i(t,u.current)}}),[]),Object(r.useLayoutEffect)((function(){u.current.children=n,a&&!a.props.bubblesVirtually&&a.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==u.current.name&&(i(u.current.name,u.current),u.current.name=t,c(t,u.current))}),[t]),a&&a.node&&a.props.bubblesVirtually?(Object(o.isFunction)(n)&&(n=n(a.props.fillProps)),Object(r.createPortal)(n,a.node)):null}var K=function(e){return Object(r.createElement)(H,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(U,Object(s.a)({},e,{registerFill:n,unregisterFill:o}))}))},Q=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e}return y(t,e),d(t,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(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:"render",value:function(){var e=this.props,t=e.children,n=e.name,c=e.bubblesVirtually,i=void 0!==c&&c,a=e.fillProps,u=void 0===a?{}:a,s=e.getFills,l=e.className;if(i)return Object(r.createElement)("div",{ref:this.bindNode,className:l});var f=Object(o.map)(s(n,this),(function(e){var t=e.occurrence,n=Object(o.isFunction)(e.children)?e.children(u):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(o.isString)(e))return e;var c="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:c})}))})).filter(Object(o.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(o.isFunction)(t)?t(f):f)}}]),t}(r.Component),Y=function(e){return Object(r.createElement)(H,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,c=t.getFills;return Object(r.createElement)(Q,Object(s.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:c}))}))},G=n(40);var $=function(e){var t=e.type,n=e.options,r=void 0===n?{}:n,o=e.children;if("appear"===t){var c,a=r.origin,u=(void 0===a?"top":a).split(" "),s=Object(O.a)(u,2),l=s[0],f=s[1],p=void 0===f?"center":f;return o({className:i()("components-animate__appear",(c={},Object(G.a)(c,"is-from-"+p,"center"!==p),Object(G.a)(c,"is-from-"+l,"middle"!==l),c))})}if("slide-in"===t){var d=r.origin,m=void 0===d?"left":d;return o({className:i()("components-animate__slide-in","is-from-"+m)})}return o("loading"===t?{className:i()("components-animate__loading")}:{})},J=M(F((function(e){return e.children})));function Z(e,t){var n=window.getComputedStyle(t),r=n.paddingTop,o=n.paddingBottom,c=n.paddingLeft,i=n.paddingRight,a=r?parseInt(r,10):0,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0;return{x:e.left+s,y:e.top+a,width:e.width-s-l,height:e.height-a-u,left:e.left+s,right:e.right-l,top:e.top+a,bottom:e.bottom-u}}function X(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function te(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var ne=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,f=void 0!==u&&u,p=e.position,d=void 0===p?"top":p,m=(e.range,e.focusOnMount),b=void 0===m?"firstElement":m,h=e.anchorRef,g=e.shouldAnchorIncludePadding,v=e.anchorVerticalBuffer,y=e.anchorHorizontalBuffer,k=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,N=e.animate,T=void 0===N||N,A=e.onClickOutside,F=e.onFocusOutside,M=Object(l.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),I=Object(r.useRef)(null),L=Object(r.useRef)(null),z=Object(r.useRef)(),q=Object(r.useRef)(),W=Object(S.useViewportMatch)("medium","<"),U=Object(r.useState)(),Q=Object(O.a)(U,2),Y=Q[0],G=Q[1],ne=C&&W;f=ne||f,Object(r.useEffect)((function(){var e=z.current,t=L.current;if(ne)return te(e,"is-without-arrow",f),X(e,"data-x-axis"),X(e,"data-y-axis"),ee(e,"top"),ee(e,"left"),ee(t,"maxHeight"),void ee(t,"maxWidth");var n=function(){var n=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)return;if(r instanceof window.Range)return Object(j.getRectangleFromRange)(r);var c=r.getBoundingClientRect();return o?c:Z(c,r)}if(e.current){var i=e.current.parentNode,a=i.getBoundingClientRect();return o?a:Z(a,i)}}(I,k,x,h,g);if(n){n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-n,y:e.top-t,width:e.width+2*n,height:e.height+2*t,left:e.left-n,right:e.right+n,top:e.top-t,bottom:e.bottom+t}}(n,v,y),q.current||(q.current=t.getBoundingClientRect());var r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=n.split(" "),o=Object(O.a)(r,2),c=o[0],i=o[1],a=void 0===i?"center":i,u=P(e,t,c),s=R(e,t,a,u.yAxis);return Object(_.a)({},s,u)}(n,q.current,d),o=r.popoverTop,c=r.popoverLeft,i=r.xAxis,a=r.yAxis,u=r.contentHeight,s=r.contentWidth;te(e,"is-without-arrow",f||"center"===i&&"middle"===a),X(e,"data-x-axis",i),X(e,"data-y-axis",a),ee(e,"top","number"==typeof o?o+"px":""),ee(e,"left","number"==typeof c?c+"px":""),ee(t,"maxHeight","number"==typeof u?u+"px":""),ee(t,"maxWidth","number"==typeof s?s+"px":"");G(({left:"right",right:"left"}[i]||"center")+" "+({top:"bottom",bottom:"top"}[a]||"middle"))}},r=window.setTimeout(n),o=window.setInterval(n,500);return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),function(){window.clearTimeout(r),window.clearInterval(o),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}}),[ne,k,x,h,g,v,y,d]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=j.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(b,L);var re=function(e){e.keyCode===w.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)};var oe=Object(r.createElement)(D,{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}}),E()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(r.createElement)($,{type:T&&Y?"appear":null,options:{origin:Y}},(function(e){var o=e.className;return Object(r.createElement)(V,Object(s.a)({className:i()("components-popover",a,o,{"is-expanded":ne,"is-without-arrow":f})},M,{onKeyDown:re,ref:z}),ne&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(ae,{className:"components-popover__close",icon:"no-alt",onClick:n})),Object(r.createElement)("div",{ref:L,className:"components-popover__content",tabIndex:"-1"},c))})));return b&&(oe=Object(r.createElement)(J,null,oe)),Object(r.createElement)(H,null,(function(e){var t=e.getSlot;return t&&t("Popover")&&(oe=Object(r.createElement)(K,{name:"Popover"},oe)),Object(r.createElement)("span",{ref:I},oe,W&&C&&Object(r.createElement)(B,null))}))};ne.Slot=function(){return Object(r.createElement)(Y,{bubblesVirtually:!0,name:"Popover"})};var re=ne;var oe=function(e){var t,n,c=e.shortcut,i=e.className;return c?(Object(o.isString)(c)&&(t=c),Object(o.isObject)(c)&&(t=c.display,n=c.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null},ce=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).delayedSetIsOver=Object(o.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return y(t,e),d(t,[{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===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.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 c=Object(o.includes)(["focus","mouseenter"],r.type);c!==n.state.isOver&&(t?n.delayedSetIsOver(c):n.setState({isOver:c}))}}}},{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,o=e.text,c=e.shortcut;if(1!==r.Children.count(t))return t;var i=r.Children.only(t),a=this.state.isOver;return Object(r.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(r.concatChildren)(i.props.children,a&&Object(r.createElement)(re,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1},o,Object(r.createElement)(oe,{className:"components-tooltip__shortcut",shortcut:c})))})}}]),t}(r.Component),ie=n(75);var ae=Object(r.forwardRef)((function(e,t){var n=e.icon,c=e.children,a=e.label,f=e.className,p=e.tooltip,d=e.shortcut,m=e.labelPosition,b=e.size,h=Object(l.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),g=i()("components-icon-button",f,{"has-text":c}),v=p||a,y=!h.disabled&&(p||d||!!a&&(!c||Object(o.isArray)(c)&&!c.length)&&!1!==p),O=Object(r.createElement)(u.a,Object(s.a)({"aria-label":a},h,{className:g,ref:t}),Object(r.createElement)(ie.a,{icon:n,size:b}),c);return y&&(O=Object(r.createElement)(ce,{text:v,shortcut:d,position:m},O)),O}));t.a=function(e){var t=e.className,n=e.status,c=e.children,s=e.onRemove,l=void 0===s?o.noop:s,f=e.isDismissible,p=void 0===f||f,d=e.actions,m=void 0===d?[]:d,b=e.__unstableHTML,h=i()(t,"components-notice","is-"+n,{"is-dismissible":p});return b&&(c=Object(r.createElement)(r.RawHTML,null,c)),Object(r.createElement)("div",{className:h},Object(r.createElement)("div",{className:"components-notice__content"},c,m.map((function(e,t){var n=e.className,o=e.label,c=e.noDefaultClasses,a=void 0!==c&&c,s=e.onClick,l=e.url;return Object(r.createElement)(u.a,{key:t,href:l,isDefault:!a&&!l,isLink:!a&&!!l,onClick:l?void 0:s,className:i()("components-notice__action",n)},o)}))),p&&Object(r.createElement)(ae,{className:"components-notice__dismiss",icon:"no-alt",label:Object(a.__)("Dismiss this notice"),onClick:l,tooltip:!1}))}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),o=function(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,n.current]),n.current}},,,,,,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(263)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(125),o=n(116),c=n(106),i=n(30),a=n.n(i),u=n(31),s=n.n(u),l=n(32),f=n.n(l),p=n(33),d=n.n(p),m=n(20),b=n.n(m),h=n(3),g=(n(4),n(9)),v=n.n(g),y=n(0),O=n(23),j=n.n(O),w=n(14),k=n.n(w),E=n(6),S=n.n(E),_=n(1),x=n(7),R=n(5),P=n.n(R),C=n(29),N=(n(206),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 m=[];if(u&&s)for(var b=u;b<=s;b++)m.push(b);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(C.a,{screenReaderLabel:Object(_.__)("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(_.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(C.a,{label:"<",screenReaderLabel:Object(_.__)("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(C.a,{label:1,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("…","woo-gutenberg-products-block")),m.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(C.a,{label:e,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("…","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(C.a,{label:i,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(C.a,{label:">",screenReaderLabel:Object(_.__)("Next page","woo-gutenberg-products-block")})))});N.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var T=N,A=n(133),F=(n(205),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement(A.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(_.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(_.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(_.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(_.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(_.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(_.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(_.__)("Order products by","woo-gutenberg-products-block"),value:o})}),M=n(69),I=n(98),D=n(11),B=n.n(D),L=n(141),V=Object(I.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(M.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(L.a)(t);return r.map((function(r,i){var a=v()(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,m=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:m.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,B()({},l,{children:f,product:n})))}))}}(a,t,o,r))})),z=n(97),q=n(112),H=n(15),W=n(13),U=n(37);function K(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 Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Y=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(q.a)(Q(Q({},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(U.a)(a),s=Object(U.a)(c),l=Object(W.useSelect)((function(t){var o=t(H.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",Q(Q({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},G=n(182),$=n(100),J=n(43),Z=(n(204),n(123)),X=n(49),ee=React.createElement(X.a,{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"})),te=function(){var e=Object(M.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(Z.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:ee,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(_.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(_.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ne=React.createElement(X.a,{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"})),re=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(M.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(Z.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:ne,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(_.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(_.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(_.__)("Reset Search","woo-gutenberg-products-block")))};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){S()(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=Object($.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=Object(z.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,c=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:o*c,page:n})}({attributes:t,sortValue:c,currentPage:n})),u=v()(a,1)[0],s=Y(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(M.useInnerBlockLayoutContext)().parentClassName,m=function(e){e.order,e.orderby,e.page,e.per_page;return k()(e,["order","orderby","page","per_page"])}(u),b=Object(z.b)("attributes",[]),h=v()(b,2),g=h[0],O=h[1],w=Object(z.b)("min_price"),E=v()(w,2),S=E[0],R=E[1],C=Object(z.b)("max_price"),N=v()(C,2),A=N[0],I=N[1],D=Object(G.a)({totalQuery:m,totalProducts:f},(function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(x.isEqual)(t,o)&&Number.isFinite(n)})),B="object"===j()(D)&&Object(x.isEqual)(m,D.totalQuery);Object(y.useEffect)((function(){B||(r(1),D&&function(e){Number.isFinite(e)&&(0===e?Object(J.speak)(Object(_.__)("No products found","woo-gutenberg-products-block")):Object(J.speak)(Object(_.sprintf)(Object(_._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[u]);var L,q,H,W,U,K=t.contentVisibility,Q=t.columns*t.rows,$=!Number.isFinite(f)&&B?Math.ceil(D.totalProducts/Q):Math.ceil(f/Q),Z=l.length?l:Array.from({length:Q}),X=0!==l.length||p,ee=g.length>0||Number.isFinite(S)||Number.isFinite(A);return React.createElement("div",{className:(L=t.columns,q=t.rows,H=t.alignButtons,W=t.align,U=void 0!==W?"align"+W:"",P()(d,U,"has-"+L+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":H}))},K.orderBy&&X&&React.createElement(F,{onChange:o,value:c}),!X&&ee&&React.createElement(re,{resetCallback:function(){O([]),R(null),I(null)}}),!X&&!ee&&React.createElement(te,null),X&&React.createElement("ul",{className:"".concat(d,"__products")},Z.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(V,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(T,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:$}))})),ae=function(e){var t=e.attributes,n=Object(y.useState)(1),r=v()(n,2),o=r[0],c=r[1],i=Object(y.useState)(t.orderby),a=v()(i,2),u=a[0],s=a[1];Object(y.useEffect)((function(){s(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,currentPage:o,onPageChange:function(e){c(e)},onSortChange:function(e){var t=e.target.value;s(t),c(1)},sortValue:u})},ue=n(8),se=React.createElement("img",{src:ue.D+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}});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=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var fe=function(e){f()(n,e);var t=le(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;return t.isPreview?se:React.createElement(M.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:n}))}}]),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(fe,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=206)}([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.wc.wcSettings}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(61)()},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){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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"v",(function(){return c})),n.d(t,"z",(function(){return i})),n.d(t,"s",(function(){return a})),n.d(t,"m",(function(){return u})),n.d(t,"p",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"A",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return d})),n.d(t,"j",(function(){return m})),n.d(t,"c",(function(){return b})),n.d(t,"n",(function(){return h})),n.d(t,"o",(function(){return g})),n.d(t,"D",(function(){return y})),n.d(t,"E",(function(){return O})),n.d(t,"w",(function(){return j})),n.d(t,"a",(function(){return w})),n.d(t,"x",(function(){return k})),n.d(t,"b",(function(){return E})),n.d(t,"r",(function(){return S})),n.d(t,"f",(function(){return _})),n.d(t,"y",(function(){return P})),n.d(t,"g",(function(){return C})),n.d(t,"u",(function(){return N})),n.d(t,"t",(function(){return T})),n.d(t,"C",(function(){return A})),n.d(t,"B",(function(){return F})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return I})),n.d(t,"q",(function(){return D})),n.d(t,"F",(function(){return B}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),c=Object(r.getSetting)("reviewRatingsEnabled",!0),i=Object(r.getSetting)("showAvatars",!0),a=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),u=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),f=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),p=Object(r.getSetting)("displayItemizedTaxes",!1),d=Object(r.getSetting)("hasDarkEditorStyleSupport",!1),m=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),b=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),h=Object(r.getSetting)("isShippingCalculatorEnabled",!0),g=Object(r.getSetting)("isShippingCostHidden",!1),v=Object(r.getSetting)("woocommerceBlocksPhase",1),y=Object(r.getSetting)("wcBlocksAssetUrl",""),O=Object(r.getSetting)("wcBlocksBuildUrl",""),j=Object(r.getSetting)("shippingCountries",{}),w=Object(r.getSetting)("allowedCountries",{}),k=Object(r.getSetting)("shippingStates",{}),E=Object(r.getSetting)("allowedStates",{}),S=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("paymentGatewaySortOrder",[])),_=Object(r.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},R=Object(r.getSetting)("storePages",{shop:x,cart:x,checkout:x,privacy:x,terms:x}),P=R.shop.permalink,C=(R.checkout.id,R.checkout.permalink),N=R.privacy.permalink,T=R.privacy.title,A=R.terms.permalink,F=R.terms.title,M=(R.cart.id,R.cart.permalink),I=Object(r.getSetting)("checkoutAllowsGuest",!1),D=(Object(r.getSetting)("checkoutAllowsSignup",!1),Object(r.getSetting)("loginUrl","/wp-login.php")),B=(n(39),function(){return v>1})},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,n){var r=n(71),o=n(72),c=n(54),i=n(73);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()}},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},n.apply(this,arguments)}e.exports=n},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.wp.data}()},function(e,t,n){var r=n(56);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}},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},,function(e,t){!function(){e.exports=this.wp.htmlEntities}()},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}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(40);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){Object(r.a)(e,t,n[t])}))}return e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(53);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}}(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(){e.exports=this.wp.compose}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(28);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,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){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},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}},function(e,t,n){var r=n(60);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)}},function(e,t,n){var r=n(23),o=n(18);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";var r=n(6),o=n.n(r),c=(n(4),n(3)),i=n(5),a=n.n(i);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(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=null!=n,l=null!=r;return!u&&l?(t=o||"span",i=s(s({},i),{},{className:a()(i.className,"screen-reader-text")}),React.createElement(t,i,r)):(t=o||c.Fragment,u&&l&&n!==r?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,i,n))};l.defaultProps={wrapperProps:{}},t.a=l},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(46);var o=n(53);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(36),c=n.n(o),i=function(e){var t=Object(r.useRef)();return c()(e,t.current)||(t.current=e),t.current}},,function(e,t){!function(){e.exports=this.wp.blocks}()},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.a11y}()},function(e,t,n){"use strict";var r=n(29),o=n.n(r),c=n(30),i=n.n(c),a=n(18),u=n.n(a),s=n(31),l=n.n(s),f=n(32),p=n.n(f),d=n(19),m=n.n(d),b=n(6),h=n.n(b),g=(n(4),n(3)),v=n(1),y=n(8),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.D,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("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(63);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 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=this.state,a=i.errorMessage;return i.hasError?React.createElement(O,{errorMessage:r?a: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(g.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(g.Component);w.defaultProps={showErrorMessage:!0};t.a=w},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){!function(){e.exports=this.wp.dom}()},,function(e,t){!function(){e.exports=this.wp.keycodes}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(22),o=n(7),c=n(0),i=function(e){var t=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(c.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(46);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,n){var r=n(55);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}}},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}},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}},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 n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(62);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";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,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(11)),c=r(n(56)),i=n(3),a=r(i),u=r(n(109)),s=r(n(18)),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 m(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 b(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,g,v=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 v&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}return u(t,e),t}(v),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 v&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&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 v)&&(t[n]=r instanceof v?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function j(e,t){h={fn:e,transform:t}}function w(e){g=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},S=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function _(e){k=e}var x,R=function(){return Date.now()};function P(e){x=e}var C,N,T=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return g},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return S},injectFrame:function(e,t){E=e,S=t},get interpolation(){return k},injectStringInterpolator:_,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return x},injectDefaultElement:P,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return N},injectManualFrameloop:function(e){N=e}}),M=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),I=!1,D=new Set,B=function e(){if(!I)return!1;var t=R(),n=D,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 m=s.fromValues[p],b=s.toValues[p],h=d.lastPosition,g=b instanceof v,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(g&&(b=b.getValue()),s.immediate)d.setValue(b),d.done=!0;else if("string"!=typeof m&&"string"!=typeof b){if(void 0!==s.duration)h=m+s.easing((t-d.startTime)/s.duration)*(b-m),l=t>=d.startTime+s.duration;else if(s.decay)h=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(b=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-b)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(m<b?h>b:h<b),k=Math.abs(y)<=s.precision,S=0===s.tension||Math.abs(b-h)<=s.precision;l=w||k&&S,d.lastVelocity=y,d.lastTime=t}g&&!s.toValues[p].done&&(l=!1),l?(d.value!==b&&(h=b),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(b),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(D.delete(i),i.stop(!0))}return D.size?N?N():E(e):I=!1,I};function L(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return L({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=L(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=L(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var z=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}(v),q=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new z(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=b(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:m(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,D.has(t)||D.add(t),I||(I=!0,E(N||B));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,D.has(t)&&D.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,b(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,b(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,b=n.attach,h=n.reset,v=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=b&&b(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)&&!g[i],b=l.arr(i),y=!u&&!b&&!f,j=l.und(c[r])?i:c[r],w=u||b||f?i:1,E=m(s,r);O&&(w=O.animations[r].parent);var S,_=a.parent,x=a.interpolation,P=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var N,T=x&&x.getValue(),A=!l.und(_)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,T),M=!l.equ(C,a.previous),I=!l.equ(E,a.config);if(h||M&&F||I){var D;if(u||f)_=x=a.parent||new z(j);else if(b)_=x=a.parent||new q(j);else if(y){var B=a.interpolation&&a.interpolation.calc(a.parent.value);B=void 0===B||h?j:B,a.parent?(_=a.parent).setValue(0,!1):_=new z(0);var L={output:[B,i]};a.interpolation?(x=a.interpolation,a.interpolation.updateConfig(L)):x=_.interpolate(L)}return P=d(O?w.getPayload():w),S=d(_.getPayload()),h&&!y&&_.setValue(j,!1),t.hasChanged=!0,S.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()})),m(v,r)&&_.setValue(y?w:i,!1),o({},e,((D={})[r]=o({},a,{name:r,parent:_,interpolation:x,animatedValues:S,toValues:P,previous:C,config:E,fromValues:d(_.getValue()),immediate:m(v,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}),D))}return F?e:(y&&(_.setValue(1,!1),x.updateConfig({output:[C,C]})),_.done=!0,t.hasChanged=!0,o({},e,((N={})[r]=o({},e[r],{previous:C}),N)))}),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?m(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?m(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},K=0,Q=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Y=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:Q(t,r)},i)};function G(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 v||(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 me(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 be=/[+\-]?(?: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,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),ve={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||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).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}),ve);var je={};A((function(e){return new $(e)})),P("div"),_((function(e){var t=e.output.map((function(e){return e.replace(he,me)})).map((function(e){return e.replace(ge,me)})),n=t[0].match(be).map((function(){return[]}));t.forEach((function(e){e.match(be).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(be).map((function(t,r){return L(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(be,(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 M(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 T(p,u,r)})),d(t);var m,b=s.current.getValue(),g=(b.scrollTop,b.scrollLeft,c(b,["scrollTop","scrollLeft"])),v=(m=e,!l.fun(m)||m.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({},g,{ref:v}))}))},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)}),Se=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=B,t.animated=Se,t.a=Se,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=m(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:m(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:m(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=Y(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),b=(a.keys,a.items,a.onFrame),h=a.onRest,g=a.onStart,v=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=Y(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,b=a.update,h=a.trail,g=void 0===h?0:h,v=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Y(r),k=w.keys,E=w.items,S=o({},i.current),_=[].concat(i.deleted),x=Object.keys(S),R=new Set(x),P=new Set(s),C=s.filter((function(e){return!R.has(e)})),N=i.transitions.filter((function(e){return!e.destroyed&&!P.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return R.has(e)})),A=-g;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){v&&_.find((function(t){return t.originalKey===e}))&&(_=_.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";S[e]={slot:c,originalKey:e,key:v?String(e):K++,item:o,trail:A+=g,config:m(y,o,c),from:m(n&&void 0!==l?l||{}:f,o),to:m(p,o)}}));break;case"leave":N.forEach((function(e){var t=k.indexOf(e),n=E[t];_.unshift(o({},S[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=g,config:m(y,n,"leave"),to:m(d,n)})),delete S[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];S[e]=o({},S[e],{item:n,slot:"update",trail:A+=g,config:m(y,n,"update"),to:m(b,n)})}))}}var F=s.map((function(e){return S[e]}));return _.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||N.length||T.length,first:n&&0===C.length,transitions:F,current:S,deleted:_,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:v,onRest:function(n){w.current.mounted&&(e.destroyed&&(v||s||G(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(v||s)&&w.current.deleted.length>0&&G(w),h&&h(u,t,n))},onStart:g&&function(){return g(u,t)},onFrame:b&&function(e){return b(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(11),o=n.n(r),c=n(14),i=n.n(c),a=n(50),u=function(e){var t=e.className,n=e.size,r=void 0===n?20:n,c=i()(e,["className","size"]);return React.createElement(a.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},c),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},s=React.createElement(u,null),l=n(125),f=n(0);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=s;break;case"no-alt":t=l.a}return t?Object(f.cloneElement)(t,{size:e.size||20,className:e.className}):null}},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}}},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.")}},,function(e,t,n){"use strict";var r=n(22),o=n(9),c=n(27),i=n(0),a=n(68),u=n(50);t.a=function(e){var t=e.icon,n=void 0===t?null:t,s=e.size,l=Object(c.a)(e,["icon","size"]),f=s||20;if("string"==typeof n)return Object(i.createElement)(a.a,Object(o.a)({icon:n,size:f},l));if(n&&a.a===n.type)return Object(i.cloneElement)(n,Object(r.a)({size:f},l));var p=s||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,Object(r.a)({size:p},l)):n(Object(r.a)({size:p},l));if(n&&("svg"===n.type||n.type===u.a)){var d=Object(r.a)({width:p,height:p},n.props,l);return Object(i.createElement)(u.a,d)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,Object(r.a)({size:p},l)):n}},function(e,t,n){"use strict";var r=n(22),o=n(27),c=n(5),i=n.n(c),a=n(0);t.a=Object(a.forwardRef)((function(e,t){var n=e.href,c=e.target,u=e.isPrimary,s=e.isLarge,l=e.isSmall,f=e.isTertiary,p=e.isToggled,d=e.isBusy,m=e.isDefault,b=e.isLink,h=e.isDestructive,g=e.className,v=e.disabled,y=Object(o.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),O=i()("components-button",g,{"is-button":m||u||s||l,"is-default":m||!u&&(s||l),"is-primary":u,"is-large":s,"is-small":l,"is-tertiary":f,"is-toggled":p,"is-busy":d,"is-link":b,"is-destructive":h}),j=void 0===n||v?"button":"a",w="a"===j?{href:n,target:c}:{type:"button",disabled:v};return Object(a.createElement)(j,Object(r.a)({},w,y,{className:O,ref:t}))}))},,,function(e,t){!function(){e.exports=this.wp.autop}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),o=n.n(r),c=n(88),i=n(0);function a(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 u(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){o()(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 s=function(){var e=Object(c.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,o=e.createSnackbarNotice,a=e.setIsSuppressed,s=Object(i.useRef)(t);Object(i.useEffect)((function(){s.current=t}),[t]);var l=Object(i.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),f=Object(i.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[n,o]);return u(u(u({notices:t},l),f),{},{setIsSuppressed:a})}},,function(e,t){!function(){e.exports=this.wp.deprecated}()},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},,,function(e,t,n){"use strict";n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return T}));var r=n(6),o=n.n(r),c=n(10),i=n.n(c),a=(n(4),n(0)),u=n(13),s=n(138),l=n(9),f=n(24),p=n.n(f);function d(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 m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){d(c,r,o,i,a,"next",e)}function a(e){d(c,r,o,i,a,"throw",e)}i(void 0)}))}}var b=n(25),h=n(5),g=n.n(h),v=n(7),y=n(67),O=n(26),j=n(1),w=n(76);var k=Object(a.forwardRef)((function(e,t){var n=e.className,r=e.children,o=e.actions,c=void 0===o?[]:o,i=e.onRemove,u=void 0===i?v.noop:i;Object(a.useEffect)((function(){var e=setTimeout((function(){u()}),1e4);return function(){return clearTimeout(e)}}),[]);var s=g()(n,"components-snackbar");return c&&c.length>1&&(console.warn("Snackbar can only have 1 action, use Notice if your message require many messages"),c=[c[0]]),Object(a.createElement)("div",{ref:t,className:s,onClick:u,tabIndex:"0",role:"button",onKeyPress:u,label:Object(j.__)("Dismiss this notice")},Object(a.createElement)("div",{className:"components-snackbar__content"},r,c.map((function(e,t){var n=e.label,r=e.onClick,o=e.url;return Object(a.createElement)(w.a,{key:t,href:o,isTertiary:!0,onClick:function(e){e.stopPropagation(),r&&r(e)},className:"components-snackbar__action"},n)}))))}));var E=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?v.noop:o,i=Object(O.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(b.a)(u,1)[0],f=Object(y.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=m(p.a.mark((function t(n){return p.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=m(p.a.mark((function e(t){return p.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=g()("components-snackbar-list",n);var d=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,f.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(y.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)(k,Object(l.a)({},Object(v.omit)(t,["content"]),{onRemove:d(t)}),t.content)))})))},S=n(80),_=n(117),x=function(){var e=Object(_.a)().isEditor,t=Object(S.a)(),n=t.notices,r=t.removeNotice;if(e)return null;var o=n.filter((function(e){return"snackbar"===e.type}));return React.createElement(E,{notices:o,className:"wc-block-components-notices__snackbar",onRemove:r})};function R(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 P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),N=function(){return Object(a.useContext)(C)},T=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,l=e.context,f=void 0===l?"wc/core":l,p=Object(u.useDispatch)("core/notices"),d=p.createNotice,m=p.removeNotice,b=Object(a.useState)(!1),h=i()(b,2),g=h[0],v=h[1],y=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]:{};d(e,t,P(P({},n),{},{context:n.context||f}))}),[d,f]),O=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;m(e,t)}),[m,f]),j=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]:{};y("default",e,P(P({},t),{},{type:"snackbar"}))}),[y]),w={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(f)}}),[f]).notices,createNotice:y,createSnackbarNotice:j,removeNotice:O,context:f,setIsSuppressed:v},k=g?null:React.createElement(s.a,{className:r,notices:w.notices}),E=g?null:React.createElement(x,null);return React.createElement(C.Provider,{value:w},c&&k,t,E)}},,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return d}));var r=n(10),o=n.n(r),c=n(15),i=n(13),a=n(0),u=n(59),s=n(7),l=n(37),f=function(e){var t=Object(u.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])]},p=function(e,t,n){var r=Object(u.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){s(n,e,t)}),[n,e])]},d=function(e,t){var n=Object(u.a)(),r=f(t=t||n),c=o()(r,2),i=c[0],p=c[1],d=Object(l.a)(e),m=Object(a.useRef)(!1);return Object(a.useEffect)((function(){p(Object(s.assign)({},i,d)),m.current=!0}),[d]),m.current?[i,p]:[e,p]}},function(e,t,n){"use strict";var r=n(9),o=n(0),c=n(7);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(11),o=n.n(r),c=n(29),i=n.n(c),a=n(30),u=n.n(a),s=n(18),l=n.n(s),f=n(31),p=n.n(f),d=n(32),m=n.n(d),b=n(19),h=n.n(b),g=n(6),v=n.n(g),y=n(3);n(127);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 m()(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),v()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),v()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),v()(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(y.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 m}));var r=n(11),o=n.n(r),c=n(6),i=n.n(c),a=n(0),u=n(45);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})},m=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){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(13),c=n(0),i=n(85),a=n(37),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 m=Object(c.useRef)({results:[],isLoading:!0}),b=Object(a.a)(f),h=Object(a.a)(s),g=Object(i.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,b,h],i=o.getCollectionError.apply(o,c);return i&&g(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,b,d]);return null!==v&&(m.current=v),m.current}},,,,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:{}})),c=function(){return Object(r.useContext)(o)}},function(e,t,n){"use strict";var r=n(0),o=n(7),c=n(5),i=n.n(c),a=n(1),u=n(76),s=n(9),l=n(27);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 m=n(65),b=n(12);function h(e,t){return!t||"object"!==Object(m.a)(t)&&"function"!=typeof t?Object(b.a)(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(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&&v(e,t)}var O=n(25),j=n(47),w=n(49),k=n(82),E=n.n(k),S=n(26),_=n(22),x=function(){return"rtl"===document.documentElement.dir};function R(e,t,n,r){var o=t.width;"left"===n&&x()?n="right":"right"===n&&x()&&(n="left");var c,i=Math.round(e.left+e.width/2),a={popoverLeft:i,contentWidth:(i-o/2>0?o/2:i)+(i+o/2>window.innerWidth?window.innerWidth-i:o/2)},u="middle"===r?e.left:i,s={popoverLeft:u,contentWidth:u-o>0?o:u},l="middle"===r?e.right:i,f={popoverLeft:l,contentWidth:l+o>window.innerWidth?window.innerWidth-l:o},p=null;if("center"===n&&a.contentWidth===o)c="center";else if("left"===n&&s.contentWidth===o)c="left";else if("right"===n&&f.contentWidth===o)c="right";else{var d="left"===(c=s.contentWidth>f.contentWidth?"left":"right")?s.contentWidth:f.contentWidth;p=d!==o?d:null}return{xAxis:c,popoverLeft:"center"===c?a.popoverLeft:"left"===c?s.popoverLeft:f.popoverLeft,contentWidth:p}}function P(e,t,n){var r,o=t.height,c=e.top+e.height/2,i={popoverTop:c,contentHeight:(c-o/2>0?o/2:c)+(c+o/2>window.innerHeight?window.innerHeight-c:o/2)},a={popoverTop:e.top,contentHeight:e.top-10-o>0?o:e.top-10},u={popoverTop:e.bottom,contentHeight:e.bottom+10+o>window.innerHeight?window.innerHeight-10-e.bottom:o},s=null;if("middle"===n&&i.contentHeight===o)r="middle";else if("top"===n&&a.contentHeight===o)r="top";else if("bottom"===n&&u.contentHeight===o)r="bottom";else{var l="top"===(r=a.contentHeight>u.contentHeight?"top":"bottom")?a.contentHeight:u.contentHeight;s=l!==o?l:null}return{yAxis:r,popoverTop:"middle"===r?i.popoverTop:"top"===r?a.popoverTop:u.popoverTop,contentHeight:s}}var C=n(35),N=Object(r.createContext)({focusHistory:[]}),T=N.Provider,A=N.Consumer;T.displayName="FocusReturnProvider",A.displayName="FocusReturnConsumer";r.Component;var F=Object(S.createHigherOrderComponent)((function e(t){if((c=t)instanceof r.Component||"function"==typeof c){var n=t;return e({})(n)}var c,i=t.onFocusReturn,a=void 0===i?o.stubTrue:i;return function(e){var t=function(t){function n(){var e;return f(this,n),(e=h(this,g(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 y(n,t),d(n,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==a())for(var r,c=[].concat(Object(C.a)(o.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(C.a)(n)))),[e]);r=c.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),n}(r.Component);return function(e){return Object(r.createElement)(A,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn"),M=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===w.TAB){var t=j.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(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),n}(r.Component)}),"withConstrainedTabbing"),I=["button","submit"];var D=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(b.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(b.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{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(o.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(o.includes)(I,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,Object(s.a)({ref:this.bindNode},this.props)))}}]),n}(r.Component)}),"withFocusOutside")(function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),t}(r.Component));var B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,c=void 0===o?"lockscroll":o,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](c),n.documentElement.classList[r](c),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),t}(r.Component)}();function L(e){e.stopPropagation()}var V=Object(r.forwardRef)((function(e,t){var n=e.children,o=Object(l.a)(e,["children"]);return Object(r.createElement)("div",Object(s.a)({},o,{ref:t,onMouseDown:L}),n)})),z=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),q=z.Provider,H=z.Consumer,W=(r.Component,0);function U(e){var t=e.name,n=e.children,c=e.registerFill,i=e.unregisterFill,a=function(e){var t=Object(r.useContext)(z),n=t.getSlot,o=t.subscribe,c=Object(r.useState)(n(e)),i=Object(O.a)(c,2),a=i[0],u=i[1];return Object(r.useEffect)((function(){return u(n(e)),o((function(){u(n(e))}))}),[e]),a}(t),u=Object(r.useRef)({name:t,children:n});return u.current.occurrence||(u.current.occurrence=++W),Object(r.useLayoutEffect)((function(){return c(t,u.current),function(){return i(t,u.current)}}),[]),Object(r.useLayoutEffect)((function(){u.current.children=n,a&&!a.props.bubblesVirtually&&a.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==u.current.name&&(i(u.current.name,u.current),u.current.name=t,c(t,u.current))}),[t]),a&&a.node&&a.props.bubblesVirtually?(Object(o.isFunction)(n)&&(n=n(a.props.fillProps)),Object(r.createPortal)(n,a.node)):null}var K=function(e){return Object(r.createElement)(H,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(U,Object(s.a)({},e,{registerFill:n,unregisterFill:o}))}))},Q=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e}return y(t,e),d(t,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(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:"render",value:function(){var e=this.props,t=e.children,n=e.name,c=e.bubblesVirtually,i=void 0!==c&&c,a=e.fillProps,u=void 0===a?{}:a,s=e.getFills,l=e.className;if(i)return Object(r.createElement)("div",{ref:this.bindNode,className:l});var f=Object(o.map)(s(n,this),(function(e){var t=e.occurrence,n=Object(o.isFunction)(e.children)?e.children(u):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(o.isString)(e))return e;var c="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:c})}))})).filter(Object(o.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(o.isFunction)(t)?t(f):f)}}]),t}(r.Component),Y=function(e){return Object(r.createElement)(H,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,c=t.getFills;return Object(r.createElement)(Q,Object(s.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:c}))}))},G=n(40);var $=function(e){var t=e.type,n=e.options,r=void 0===n?{}:n,o=e.children;if("appear"===t){var c,a=r.origin,u=(void 0===a?"top":a).split(" "),s=Object(O.a)(u,2),l=s[0],f=s[1],p=void 0===f?"center":f;return o({className:i()("components-animate__appear",(c={},Object(G.a)(c,"is-from-"+p,"center"!==p),Object(G.a)(c,"is-from-"+l,"middle"!==l),c))})}if("slide-in"===t){var d=r.origin,m=void 0===d?"left":d;return o({className:i()("components-animate__slide-in","is-from-"+m)})}return o("loading"===t?{className:i()("components-animate__loading")}:{})},J=M(F((function(e){return e.children})));function Z(e,t){var n=window.getComputedStyle(t),r=n.paddingTop,o=n.paddingBottom,c=n.paddingLeft,i=n.paddingRight,a=r?parseInt(r,10):0,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0;return{x:e.left+s,y:e.top+a,width:e.width-s-l,height:e.height-a-u,left:e.left+s,right:e.right-l,top:e.top+a,bottom:e.bottom-u}}function X(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function te(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var ne=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,f=void 0!==u&&u,p=e.position,d=void 0===p?"top":p,m=(e.range,e.focusOnMount),b=void 0===m?"firstElement":m,h=e.anchorRef,g=e.shouldAnchorIncludePadding,v=e.anchorVerticalBuffer,y=e.anchorHorizontalBuffer,k=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,N=e.animate,T=void 0===N||N,A=e.onClickOutside,F=e.onFocusOutside,M=Object(l.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),I=Object(r.useRef)(null),L=Object(r.useRef)(null),z=Object(r.useRef)(),q=Object(r.useRef)(),W=Object(S.useViewportMatch)("medium","<"),U=Object(r.useState)(),Q=Object(O.a)(U,2),Y=Q[0],G=Q[1],ne=C&&W;f=ne||f,Object(r.useEffect)((function(){var e=z.current,t=L.current;if(ne)return te(e,"is-without-arrow",f),X(e,"data-x-axis"),X(e,"data-y-axis"),ee(e,"top"),ee(e,"left"),ee(t,"maxHeight"),void ee(t,"maxWidth");var n=function(){var n=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)return;if(r instanceof window.Range)return Object(j.getRectangleFromRange)(r);var c=r.getBoundingClientRect();return o?c:Z(c,r)}if(e.current){var i=e.current.parentNode,a=i.getBoundingClientRect();return o?a:Z(a,i)}}(I,k,x,h,g);if(n){n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-n,y:e.top-t,width:e.width+2*n,height:e.height+2*t,left:e.left-n,right:e.right+n,top:e.top-t,bottom:e.bottom+t}}(n,v,y),q.current||(q.current=t.getBoundingClientRect());var r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=n.split(" "),o=Object(O.a)(r,2),c=o[0],i=o[1],a=void 0===i?"center":i,u=P(e,t,c),s=R(e,t,a,u.yAxis);return Object(_.a)({},s,u)}(n,q.current,d),o=r.popoverTop,c=r.popoverLeft,i=r.xAxis,a=r.yAxis,u=r.contentHeight,s=r.contentWidth;te(e,"is-without-arrow",f||"center"===i&&"middle"===a),X(e,"data-x-axis",i),X(e,"data-y-axis",a),ee(e,"top","number"==typeof o?o+"px":""),ee(e,"left","number"==typeof c?c+"px":""),ee(t,"maxHeight","number"==typeof u?u+"px":""),ee(t,"maxWidth","number"==typeof s?s+"px":"");G(({left:"right",right:"left"}[i]||"center")+" "+({top:"bottom",bottom:"top"}[a]||"middle"))}},r=window.setTimeout(n),o=window.setInterval(n,500);return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),function(){window.clearTimeout(r),window.clearInterval(o),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}}),[ne,k,x,h,g,v,y,d]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=j.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(b,L);var re=function(e){e.keyCode===w.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)};var oe=Object(r.createElement)(D,{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}}),E()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(r.createElement)($,{type:T&&Y?"appear":null,options:{origin:Y}},(function(e){var o=e.className;return Object(r.createElement)(V,Object(s.a)({className:i()("components-popover",a,o,{"is-expanded":ne,"is-without-arrow":f})},M,{onKeyDown:re,ref:z}),ne&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(ae,{className:"components-popover__close",icon:"no-alt",onClick:n})),Object(r.createElement)("div",{ref:L,className:"components-popover__content",tabIndex:"-1"},c))})));return b&&(oe=Object(r.createElement)(J,null,oe)),Object(r.createElement)(H,null,(function(e){var t=e.getSlot;return t&&t("Popover")&&(oe=Object(r.createElement)(K,{name:"Popover"},oe)),Object(r.createElement)("span",{ref:I},oe,W&&C&&Object(r.createElement)(B,null))}))};ne.Slot=function(){return Object(r.createElement)(Y,{bubblesVirtually:!0,name:"Popover"})};var re=ne;var oe=function(e){var t,n,c=e.shortcut,i=e.className;return c?(Object(o.isString)(c)&&(t=c),Object(o.isObject)(c)&&(t=c.display,n=c.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null},ce=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).delayedSetIsOver=Object(o.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return y(t,e),d(t,[{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===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.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 c=Object(o.includes)(["focus","mouseenter"],r.type);c!==n.state.isOver&&(t?n.delayedSetIsOver(c):n.setState({isOver:c}))}}}},{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,o=e.text,c=e.shortcut;if(1!==r.Children.count(t))return t;var i=r.Children.only(t),a=this.state.isOver;return Object(r.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(r.concatChildren)(i.props.children,a&&Object(r.createElement)(re,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1},o,Object(r.createElement)(oe,{className:"components-tooltip__shortcut",shortcut:c})))})}}]),t}(r.Component),ie=n(75);var ae=Object(r.forwardRef)((function(e,t){var n=e.icon,c=e.children,a=e.label,f=e.className,p=e.tooltip,d=e.shortcut,m=e.labelPosition,b=e.size,h=Object(l.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),g=i()("components-icon-button",f,{"has-text":c}),v=p||a,y=!h.disabled&&(p||d||!!a&&(!c||Object(o.isArray)(c)&&!c.length)&&!1!==p),O=Object(r.createElement)(u.a,Object(s.a)({"aria-label":a},h,{className:g,ref:t}),Object(r.createElement)(ie.a,{icon:n,size:b}),c);return y&&(O=Object(r.createElement)(ce,{text:v,shortcut:d,position:m},O)),O}));t.a=function(e){var t=e.className,n=e.status,c=e.children,s=e.onRemove,l=void 0===s?o.noop:s,f=e.isDismissible,p=void 0===f||f,d=e.actions,m=void 0===d?[]:d,b=e.__unstableHTML,h=i()(t,"components-notice","is-"+n,{"is-dismissible":p});return b&&(c=Object(r.createElement)(r.RawHTML,null,c)),Object(r.createElement)("div",{className:h},Object(r.createElement)("div",{className:"components-notice__content"},c,m.map((function(e,t){var n=e.className,o=e.label,c=e.noDefaultClasses,a=void 0!==c&&c,s=e.onClick,l=e.url;return Object(r.createElement)(u.a,{key:t,href:l,isDefault:!a&&!l,isLink:!a&&!!l,onClick:l?void 0:s,className:i()("components-notice__action",n)},o)}))),p&&Object(r.createElement)(ae,{className:"components-notice__dismiss",icon:"no-alt",label:Object(a.__)("Dismiss this notice"),onClick:l,tooltip:!1}))}},,,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(14),i=n.n(c),a=n(50),u=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return React.createElement(a.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),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"}))},s=React.createElement(u,null);t.a=s},function(e,t,n){"use strict";var r=n(6),o=n.n(r),c=n(14),i=n.n(c),a=n(3);n(4);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,c=i()(e,["srcElement","size"]);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){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}({width:r,height:r},c))}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(2),c=n(15),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(n.current){var r=e(c.SCHEMA_STORE_KEY),o=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(c.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("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(4);var r=n(5),o=n.n(r),c=n(33),i=n(99);n(155);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.a,{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";var r=n(11),o=n.n(r),c=(n(4),n(5)),i=n.n(c),a=n(118),u=n(88),s=(n(108),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""});t.a=function(e){var t=e.className,n=e.notices,r=Object(u.b)().removeNotice,c=n.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var l=i()(t,"wc-block-components-notices");return React.createElement("div",{className:l},c.map((function(e){return React.createElement(a.a,o()({key:"store-notice-"+e.id},e,{className:i()("wc-block-components-notices__notice","woocommerce-message",s(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(34),o=n(0),c=n(8);n.p=c.E,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,297))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,306))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,298))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,299))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,300))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,284))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,301))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,302))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,303))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,304))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,305))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),o=function(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,n.current]),n.current}},,,,,,,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(265)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(128),o=n(88),c=n(107),i=n(29),a=n.n(i),u=n(30),s=n.n(u),l=n(31),f=n.n(l),p=n(32),d=n.n(p),m=n(19),b=n.n(m),h=n(3),g=(n(4),n(10)),v=n.n(g),y=n(0),O=n(23),j=n.n(O),w=n(14),k=n.n(w),E=n(6),S=n.n(E),_=n(1),x=n(7),R=n(5),P=n.n(R),C=n(33),N=(n(209),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 m=[];if(u&&s)for(var b=u;b<=s;b++)m.push(b);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(C.a,{screenReaderLabel:Object(_.__)("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(_.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(C.a,{label:"<",screenReaderLabel:Object(_.__)("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(C.a,{label:1,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("…","woo-gutenberg-products-block")),m.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(C.a,{label:e,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("…","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(C.a,{label:i,screenReaderLabel:Object(_.sprintf)(Object(_.__)("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(_.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(C.a,{label:">",screenReaderLabel:Object(_.__)("Next page","woo-gutenberg-products-block")})))});N.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var T=N,A=n(136),F=(n(208),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement(A.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(_.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(_.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(_.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(_.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(_.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(_.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(_.__)("Order products by","woo-gutenberg-products-block"),value:o})}),M=n(69),I=n(99),D=n(11),B=n.n(D),L=n(145),V=Object(I.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(M.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(L.a)(t);return r.map((function(r,i){var a=v()(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,m=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:m.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,B()({},l,{children:f,product:n})))}))}}(a,t,o,r))})),z=n(98),q=n(113),H=n(15),W=n(13),U=n(37);function K(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 Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Y=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(q.a)(Q(Q({},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(U.a)(a),s=Object(U.a)(c),l=Object(W.useSelect)((function(t){var o=t(H.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",Q(Q({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},G=n(184),$=n(101),J=n(44),Z=(n(207),n(126)),X=n(50),ee=React.createElement(X.a,{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"})),te=function(){var e=Object(M.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(Z.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:ee,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(_.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(_.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ne=React.createElement(X.a,{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"})),re=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(M.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(Z.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:ne,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(_.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(_.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(_.__)("Reset Search","woo-gutenberg-products-block")))};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){S()(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=Object($.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=Object(z.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,c=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:o*c,page:n})}({attributes:t,sortValue:c,currentPage:n})),u=v()(a,1)[0],s=Y(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(M.useInnerBlockLayoutContext)().parentClassName,m=function(e){e.order,e.orderby,e.page,e.per_page;return k()(e,["order","orderby","page","per_page"])}(u),b=Object(z.b)("attributes",[]),h=v()(b,2),g=h[0],O=h[1],w=Object(z.b)("min_price"),E=v()(w,2),S=E[0],R=E[1],C=Object(z.b)("max_price"),N=v()(C,2),A=N[0],I=N[1],D=Object(G.a)({totalQuery:m,totalProducts:f},(function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(x.isEqual)(t,o)&&Number.isFinite(n)})),B="object"===j()(D)&&Object(x.isEqual)(m,D.totalQuery);Object(y.useEffect)((function(){B||(r(1),D&&function(e){Number.isFinite(e)&&(0===e?Object(J.speak)(Object(_.__)("No products found","woo-gutenberg-products-block")):Object(J.speak)(Object(_.sprintf)(Object(_._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[u]);var L,q,H,W,U,K=t.contentVisibility,Q=t.columns*t.rows,$=!Number.isFinite(f)&&B?Math.ceil(D.totalProducts/Q):Math.ceil(f/Q),Z=l.length?l:Array.from({length:Q}),X=0!==l.length||p,ee=g.length>0||Number.isFinite(S)||Number.isFinite(A);return React.createElement("div",{className:(L=t.columns,q=t.rows,H=t.alignButtons,W=t.align,U=void 0!==W?"align"+W:"",P()(d,U,"has-"+L+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":H}))},K.orderBy&&X&&React.createElement(F,{onChange:o,value:c}),!X&&ee&&React.createElement(re,{resetCallback:function(){O([]),R(null),I(null)}}),!X&&!ee&&React.createElement(te,null),X&&React.createElement("ul",{className:"".concat(d,"__products")},Z.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(V,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(T,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:$}))})),ae=function(e){var t=e.attributes,n=Object(y.useState)(1),r=v()(n,2),o=r[0],c=r[1],i=Object(y.useState)(t.orderby),a=v()(i,2),u=a[0],s=a[1];Object(y.useEffect)((function(){s(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,currentPage:o,onPageChange:function(e){c(e)},onSortChange:function(e){var t=e.target.value;s(t),c(1)},sortValue:u})},ue=n(8),se=React.createElement("img",{src:ue.D+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}});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=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var fe=function(e){f()(n,e);var t=le(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;return t.isPreview?se:React.createElement(M.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:n}))}}]),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(fe,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-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', '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-url', 'wp-viewport', 'wp-wordcount'), 'version' => '0887fda210babd5cf1a41aff84eccfa7');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', '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-url', 'wp-viewport', 'wp-wordcount'), 'version' => '995d5d9794da97b1dcac099d5ab317b0');
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={5:0,2:0,3:0,8:0,9:0,11:0,12:0,13:0,14:0,15:0,16: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/image~atomic-block-components/title",2:"atomic-block-components/add-to-cart~atomic-block-components/button",3:"atomic-block-components/sale-badge",7:"atomic-block-components/add-to-cart",10:"atomic-block-components/image",17:"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([831,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},100: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},107:function(e,t){},108:function(e,t){},109:function(e,t){},110:function(e,t){},111:function(e,t){},112:function(e,t){},113:function(e,t){},114:function(e,t){},115:function(e,t){},116:function(e,t){},117:function(e,t){},118:function(e,t){},119:function(e,t){},120:function(e,t){},121:function(e,t){},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},135:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(41),c=r(36),o=r(209),a=r(33),i=r(6),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),r=t.isEditor,u=t.previewData,l=(null==u?void 0:u.previewCart)||{},b=e.shouldSelect,p=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!b)return s;if(r)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var o=e(n.CART_STORE_KEY),u=o.getCartData(),p=o.getCartErrors(),d=o.getCartTotals(),f=!o.hasFinishedResolution("getCartData"),m=o.areShippingRatesLoading(),O=c(n.CART_STORE_KEY).receiveCart,g=Object(i.mapValues)(u.shippingAddress,(function(e){return Object(a.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:d,cartIsLoading:f,cartErrors:p,shippingAddress:g,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!g.country,receiveCart:O}}),[b]);return p}},136:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(61),a=r(168),i=r(3),s=r(14),u=r(44);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}},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(8),c=r.n(n),o=r(272),a=r(0);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(o.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(a.useRef)(t);Object(a.useEffect)((function(){u.current=t}),[t]);var l=Object(a.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.map((function(t){return null!==e&&t.status!==e||n(t.id),!0}))},removeNotice:n}}),[n]),b=Object(a.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})}},144:function(e,t){!function(){e.exports=this.wp.wordcount}()},145:function(e,t,r){"use strict";var n=r(58),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(6),l=(r(2),r(50)),b=r(4),p=r(7),d=r.n(p),f=r(21),m=r.n(f),O=r(24),g=r.n(O),j=r(22),h=r.n(j),v=r(23),y=r.n(v),w=r(12),E=r.n(w),_=r(25);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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Object(_.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=k(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected;return Object(i.createElement)(e,a()({},this.props,{selected:Object(u.isNil)(t)?[]:[t]}))}}]),n}(i.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),C=r(297),S=r(15),N=r.n(S),x=r(37),D=r.n(x),B=r(19),z=r.n(B),R=r(8),T=r.n(R),I=r(46),L=r.n(I),A=r(40),V=r(42);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){T()(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}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var q=Object(_.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=H(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)),T()(z()(e),"state",{error:null,loading:!1,variations:{}}),T()(z()(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 a=t.find((function(e){return e.id===o}));a.variations&&0!==a.variations.length?(e.setState({loading:!0}),Object(A.g)(o).then((function(t){var r=t.map((function(e){return M(M({},e),{},{parent:o})}));e.setState({variations:M(M({},e.state.variations),{},T()({},o,r)),loading:!1,error:null})})).catch(function(){var t=D()(N.a.mark((function t(r){var n;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},T()({},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:M(M({},e.state.variations),{},T()({},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&&(!L()(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,s=c.loading,u=c.variations;return Object(i.createElement)(e,a()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:u,variationsLoading:s}))}}]),n}(i.Component);return T()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),W=r(61),U=r(56),Q=Object(i.createElement)(U.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),Y=Object(i.createElement)(U.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),G=r(49);r(200);function K(e,t){if(!t)return e;var r=new RegExp(Object(u.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var X=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(i.createElement)(W.a,{srcElement:Q}):Object(i.createElement)(W.a,{srcElement:Y})},$={list:Object(s.__)("Products","woo-gutenberg-products-block"),noItems:Object(s.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(s.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(s.__)("Product search results updated.","woo-gutenberg-products-block")},J=function(e){var t=e.expandedProduct,r=e.error,n=e.isLoading,o=e.onChange,p=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,h=e.variationsLoading,v=function(e){var r=e.item,n=e.search,c=e.depth,o=void 0===c?0:c,p=e.isSelected,f=e.onSelect,m=r.variations&&Array.isArray(r.variations)?r.variations.length:0,O=d()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),{"is-searching":n.length>0,"is-skip-level":0===o&&0!==r.parent,"is-variable":m>0}),g=Object.assign({},e);delete g.isSingle;var j={role:"menuitemradio"};return r.breadcrumbs.length&&(j["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),m&&(j["aria-expanded"]=r.id===t),r.breadcrumbs.length?(Object(u.isEmpty)(r.variation)||(r.name=r.variation),Object(i.createElement)(l.b,a()({className:O},e,j))):[Object(i.createElement)(b.MenuItem,a()({key:"product-".concat(r.id),isSelected:p},g,j,{className:O,onClick:function(){f(r)()}}),Object(i.createElement)("span",{className:"woocommerce-search-list__item-state"},X(p)),Object(i.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(i.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:K(r.name,n)}})),m?Object(i.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(s.sprintf)(Object(s._n)("%d variation","%d variations",m,"woo-gutenberg-products-block"),m)):null),t===r.id&&m>0&&h&&Object(i.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(i.createElement)(b.Spinner,null))]};if(r)return Object(i.createElement)(G.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(i.createElement)(l.a,{className:"woocommerce-products",list:w,isLoading:n,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:o,renderItem:m||(g?v:null),onSearch:p,messages:$,isHierarchical:!0})};J.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=P(Object(C.a)(q(J)))},146:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},151:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(48),i=r(192);r(202);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.a,{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)}))))}))},152:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(8),c=r.n(n),o=r(6);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="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:s,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,o=t.id,a=t.callback,l=t.priority,b=new Map(e[n]);switch(r){case s:return b.set(o,{priority:l,callback:a}),i(i({},e),{},c()({},n,b));case u:return b.delete(o),i(i({},e),{},c()({},n,b))}return e}},154:function(e,t,r){"use strict";var n=r(21),c=r.n(n),o=r(24),a=r.n(o),i=r(22),s=r.n(i),u=r(23),l=r.n(u),b=r(12),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(4);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 h=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.Toolbar,{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=h},157:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},166:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(55),s=r(7),u=r.n(s),l=(r(2),r(233),function(e){var t=e.className,r=e.currency,n=e.maxPrice,c=e.minPrice,a=e.priceClassName,s=e.priceStyle;return Object(o.createElement)("span",{className:t},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:c,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:n,style:s}))}),b=function(e){var t=e.className,r=e.currency,n=e.regularPriceClassName,c=e.regularPriceStyle,s=e.regularPrice,l=e.priceClassName,b=e.priceStyle,p=e.price;return Object(o.createElement)("span",{className:t},Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:r,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",n),style:c},e)},value:s}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:r,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",l),style:b},e)},value:p}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.maxPrice,s=void 0===a?null:a,p=e.minPrice,d=void 0===p?null:p,f=e.price,m=void 0===f?null:f,O=e.priceClassName,g=e.priceStyle,j=e.regularPrice,h=e.regularPriceClassName,v=e.regularPriceStyle,y=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));return j&&m!==j?Object(o.createElement)(b,{className:y,currency:n,price:m,priceClassName:O,priceStyle:g,regularPrice:j,regularPriceClassName:h,regularPriceStyle:v}):null!==d&&null!==s?Object(o.createElement)(l,{className:y,currency:n,maxPrice:s,minPrice:d,priceClassName:O,priceStyle:g}):null!==m?Object(o.createElement)("span",{className:y},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",O),currency:n,value:m,style:g})):Object(o.createElement)("span",{className:y},Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",O)}))}},168:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},17:function(e,t){!function(){e.exports=this.wp.blocks}()},172:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(11),c=r.n(n),o=r(41),a=r(36),i=r(0),s=r(100),u=r(6),l=r(60),b=function(e){var t=Object(s.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])]},p=function(e,t,r){var n=Object(s.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){u(r,e,t)}),[r,e])]},d=function(e,t){var r=Object(s.a)(),n=b(t=t||r),o=c()(n,2),a=o[0],p=o[1],d=Object(l.a)(e),f=Object(i.useRef)(!1);return Object(i.useEffect)((function(){p(Object(u.assign)({},a,d)),f.current=!0}),[d]),f.current?[a,p]:[e,p]}},175:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(5),o=Object(n.createElement)("img",{src:c.T+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},176:function(e,t,r){"use strict";var n=r(0),c=r(144),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]:"&hellip;",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]:"&hellip;",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)}},18:function(e,t){!function(){e.exports=this.wp.url}()},185:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(24),s=r.n(i),u=r(19),l=r.n(u),b=r(22),p=r.n(b),d=r(23),f=r.n(d),m=r(12),O=r.n(m),g=r(8),j=r.n(g),h=r(0),v=r(9);r(255);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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(v.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(h.createElement)(v.Fragment,null,Object(h.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(h.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(v.Component);return t.displayName="withScrollToTop",t}},193:function(e,t){},200:function(e,t){},202:function(e,t){},205:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(41),c=r(36),o=r(0),a=r(157),i=r(60),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(i.a)(b),O=Object(i.a)(u),g=Object(a.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}},209: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(36),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),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={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),previewData:s};return Object(n.createElement)(o.Provider,{value:u},t)}},229:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(85),o=(r(2),r(236),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))})},233:function(e,t){},234:function(e,t){},235:function(e,t){},236:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.compose}()},254:function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(52),a=r.n(o),i=r(3);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,b,p={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(l=i.CURRENCY.symbol,b=i.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==a()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,c=e.currency_decimal_separator,o=e.currency_minor_unit,i=e.currency_prefix,s=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(o)?o:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof s?s:""}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(u({},p),e)},m=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=f(t),c=r/Math.pow(10,n.minorUnit),o=n.prefix+c+n.suffix,a=document.createElement("textarea");return a.innerHTML=o,a.value}},255:function(e,t){},262:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(48),l=r(44),b=r(72);r(546);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.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},263:function(e,t){!function(){e.exports=this.wp.deprecated}()},264:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(56),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=void 0===r?20:r,o=a()(e,["className","size"]);return Object(i.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},o),Object(i.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),l=r(279);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=u;break;case"no-alt":t=l.a}return t?Object(i.cloneElement)(t,{size:e.size||20,className:e.className}):null}},272:function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return _}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=(r(2),r(36)),u=r(10),l=r.n(u),b=r(7),p=r.n(b),d=r(932),f=(r(234),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,r=e.notices,n=E().removeNotice,c=p()(t,"wc-block-components-notices"),o=r.filter((function(e){return"snackbar"!==e.type}));return o.length?Object(i.createElement)("div",{className:c},o.map((function(e){return Object(i.createElement)(d.a,l()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",f(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)}))):null},O=r(936),g=r(143),j=r(209),h=function(){var e=Object(j.b)().isEditor,t=Object(g.a)(),r=t.notices,n=t.removeNotice,c=r.filter((function(e){return"snackbar"===e.type}));return e?null:Object(i.createElement)(O.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:n})};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 y(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){c()(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 w=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(i.useContext)(w)},_=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,u=e.context,l=void 0===u?"wc/core":u,b=Object(s.useDispatch)("core/notices"),p=b.createNotice,d=b.removeNotice,f=Object(i.useState)(!1),O=a()(f,2),g=O[0],j=O[1],v=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]:{};p(e,t,y(y({},r),{},{context:r.context||l}))}),[p,l]),E=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;d(e,t)}),[d,l]),_=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]:{};v("default",e,y(y({},t),{},{type:"snackbar"}))}),[v]),k={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:v,createSnackbarNotice:_,removeNotice:E,context:l,setIsSuppressed:j},P=g?null:Object(i.createElement)(m,{className:n,notices:k.notices}),C=g?null:Object(i.createElement)(h,null);return Object(i.createElement)(w.Provider,{value:k},o&&P,t,C)}},279:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(56),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return Object(i.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),Object(i.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=u},297:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(37),s=r.n(i),u=r(21),l=r.n(u),b=r(24),p=r.n(b),d=r(19),f=r.n(d),m=r(22),O=r.n(m),g=r(23),j=r.n(g),h=r(12),v=r.n(h),y=r(0),w=r(6),E=r(25),_=(r(2),r(5)),k=r(40),P=r(42);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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v()(e);if(t){var c=v()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return j()(this,r)}}var S=Object(E.createHigherOrderComponent)((function(e){var t=function(t){O()(o,t);var r,n=C(o);function o(){var e;return l()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(f()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(f()(e)),400),e}return p()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(k.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(k.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=s()(a.a.mark((function e(t){var r;return a.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(y.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.u?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(y.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},35:function(e,t){!function(){e.exports=this.moment}()},356:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},36:function(e,t){!function(){e.exports=this.wp.data}()},384:function(e,t){},386:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(5);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.W)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},387: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}}},388:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(5),b=r(44),p=r(72),d=r(6),f=r(262);r(547);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){c()(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=function(){return Object(i.createElement)("img",{src:l.F,alt:"",width:500,height:500})},j=function(e){var t=e.image,r=e.onLoad,n=e.loaded,c=e.showFullSize,o=t||{},a=o.thumbnail,s=o.src,u=o.srcset,l=o.sizes,b={alt:o.alt,onLoad:r,hidden:!n,src:a};return c&&(b=O(O({},b),{},{src:s,srcSet:u,sizes:l})),Object(i.createElement)(i.Fragment,null,Object(i.createElement)("img",b),!n&&Object(i.createElement)(g,null))};t.a=Object(p.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,o=e.productLink,s=void 0===o||o,l=e.showSaleBadge,p=e.saleBadgeAlign,m=void 0===p?"right":p,O=Object(b.useInnerBlockLayoutContext)().parentClassName,h=Object(b.useProductDataContext)().product,v=Object(i.useState)(!1),y=a()(v,2),w=y[0],E=y[1];if(!h.id)return Object(i.createElement)("div",{className:u()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",c()({},"".concat(O,"__product-image"),O))},Object(i.createElement)(g,null));var _=Object(d.isEmpty)(h.images)?null:h.images[0];return Object(i.createElement)("div",{className:u()(t,"wc-block-components-product-image",c()({},"".concat(O,"__product-image"),O))},s?Object(i.createElement)("a",{href:h.permalink,rel:"nofollow"},!!l&&Object(i.createElement)(f.default,{align:m,product:h}),Object(i.createElement)(j,{image:_,onLoad:function(){return E(!0)},loaded:w,showFullSize:"cropped"!==n})):Object(i.createElement)(i.Fragment,null,!!l&&Object(i.createElement)(f.default,{align:m,product:h}),Object(i.createElement)(j,{image:_,onLoad:function(){return E(!0)},loaded:w,showFullSize:"cropped"!==n})))}))},389:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},c={SUCCESS:"success",FAIL:"failure",ERROR:"error"},o={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},a=function(e){return n(e,c.SUCCESS)},i=function(e){return n(e,c.ERROR)},s=function(e){return n(e,c.FAIL)},u=function(){return{responseTypes:c,noticeContexts:o,isSuccessResponse:a,isErrorResponse:i,isFailResponse:s}}},390:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(152),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))}}}},391:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(15),c=r.n(n),o=r(52),a=r.n(o),i=r(37),s=r.n(i);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(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=e[Symbol.iterator]()},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 l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},p=function(){var e=s()(c.a.mark((function e(t,r,n){var o,i,s,l,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),i=[],s=u(o),e.prev=3,s.s();case 5:if((l=s.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"===a()(d)&&i.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),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!i.length||i);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)}}(),d=function(){var e=s()(c.a.mark((function e(t,r,n){var o,i,s,l,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),i=!0,s=u(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=24;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:if(d=e.sent,"object"!==a()(d)||void 0!==d.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(i="object"!==a()(d)||d)){e.next=16;break}return e.abrupt("return",i);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),s.e(e.t1);case 29:return e.prev=29,s.f(),e.finish(29);case 32:return e.abrupt("return",i);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},392:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},393:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(85),i=r(11),s=r.n(i),u=r(1),l=r(60),b=r(143),p=r(389),d=r(921),f="pristine",m="idle",O="disabled",g="processing",j="before_processing",h="after_processing",v={status:f,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",w="set_idle",E="set_disabled",_="set_processing",k="set_before_processing",P="set_after_processing",C="set_processing_response",S="set_has_error",N="set_no_error",x="set_quantity",D="set_request_params",B=y,z=w,R=E,T=_,I=k,L=P,A=C,V=S,F=N,M=x,H=D,q=function(){return{type:B}},W=function(){return{type:z}},U=function(){return{type:R}},Q=function(){return{type:T}},Y=function(){return{type:I}},G=function(){return{type:L}},K=function(e){return{type:A,data:e}},X=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?V:F;return{type:t}},$=function(e){return{type:M,quantity:e}},J=function(e){return{type:H,data:e}},Z=r(8),ee=r.n(Z);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 re(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){ee()(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 ne=y,ce=w,oe=E,ae=_,ie=k,se=P,ue=C,le=S,be=N,pe=x,de=D,fe=f,me=m,Oe=O,ge=g,je=j,he=h,ve=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ne:e=v;break;case ce:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case oe:e=t.status!==Oe?re(re({},t),{},{status:Oe}):t;break;case pe:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case de:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),o)});break;case ue:e=re(re({},t),{},{processingResponse:o});break;case ae:e=!1===(e=t.status!==ge?re(re({},t),{},{status:ge,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case ie:e=t.status!==je?re(re({},t),{},{status:je,hasError:!1}):t;break;case se:e=t.status!==he?re(re({},t),{},{status:he}):t;break;case le:e=t.hasError?t:re(re({},t),{},{hasError:!0}),e=t.status===ge||t.status===je?re(re({},e),{},{status:me}):e;break;case be:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&c!==ne&&e.status===fe&&(e.status=me),e},ye=r(152),we=r(390),Ee="add_to_cart_before_processing",_e="add_to_cart_after_processing_with_success",ke="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(we.a)(_e,e),onAddToCartProcessingWithError:Object(we.a)(ke,e),onAddToCartBeforeProcessing:Object(we.a)(Ee,e)}},Ce=r(391),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)(ve,v),i=s()(o,2),f=i[0],y=i[1],w=Object(n.useReducer)(ye.b,{}),E=s()(w,2),_=E[0],k=E[1],P=Object(l.a)(_),C=Object(b.a)(),S=C.addErrorNotice,N=C.removeNotices,x=Object(a.b)().setValidationErrors,D=Object(p.a)(),B=D.isSuccessResponse,z=D.isErrorResponse,R=D.isFailResponse,T=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(k).onAddToCartBeforeProcessing}}),[k]),I=Object(n.useMemo)((function(){return{resetForm:function(){y(q())},submitForm:function(){y(Y())},setQuantity:function(e){y($(e))},setHasError:function(e){y(X(e))},setRequestParams:function(e){y(J(e))},setAfterProcessing:function(e){y(K(e)),y(G())}}}),[]);Object(n.useEffect)((function(){var e=f.status,t=!r.id||!Object(d.a)(r);e!==O||t?e!==O&&t&&y(U()):y(W())}),[f.status,r,y]),Object(n.useEffect)((function(){f.status===j&&(N("error"),Object(Ce.a)(P,Ee,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&x(r)})),y(W())):y(Q())})))}),[f.status,x,S,N,y,P]),Object(n.useEffect)((function(){if(f.status===h){var e={processingResponse:f.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;S(e.message,t)}};if(f.hasError)return void Object(Ce.b)(P,ke,e).then((function(r){if(z(r)||R(r))t(r);else{var n,c=(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");S(c,{id:"add-to-cart"})}y(W())}));Object(Ce.b)(P,_e,e).then((function(e){z(e)||R(e)?(t(e),y(X(!0))):y(W())}))}}),[f.status,f.hasError,f.processingResponse,I,S,z,R,B,P]);var L=Object(d.b)(r),A={product:r,productType:r.type||"simple",productIsPurchasable:Object(d.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:L,showFormElements:c&&L,quantity:f.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:f.requestParams,isIdle:f.status===m,isDisabled:f.status===O,isProcessing:f.status===g,isBeforeProcessing:f.status===j,isAfterProcessing:f.status===h,hasError:f.hasError,eventRegistration:T,dispatchActions:I};return Object(n.createElement)(Se.Provider,{value:A},t)},De=r(13),Be=r.n(De),ze=r(135),Re=r(33),Te=r(529);function Ie(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 Le=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,i=e.hasError,l=e.isProcessing,p=e.requestParams,d=Object(a.b)(),f=d.hasValidationErrors,m=d.showAllValidationErrors,O=Object(b.a)(),g=O.addErrorNotice,j=O.removeNotice,h=Object(ze.a)().receiveCart,v=Object(n.useState)(!1),y=s()(v,2),w=y[0],E=y[1],_=!i&&l,k=Object(n.useCallback)((function(){return!f||(m(),{type:"error"})}),[f,m]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var P=Object(n.useCallback)((function(){E(!0),j("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},p);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?h(r):(r.body&&r.body.message?g(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):g(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1),Object(Te.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,g,j,h,t,c,p]);return Object(n.useEffect)((function(){_&&!w&&P()}),[_,P,w]),null},Ae=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(a.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Le,null)))},Ve=r(44),Fe=r(6),Me=r(72),He=(r(384),r(99)),qe=r(61),We=r(556),Ue=r(834),Qe=function(e){var t=e.className,r=e.href,c=e.text;return Object(n.createElement)(He.a,{className:t,href:r,rel:"nofollow"},c)},Ye=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)(He.a,{className:t,disabled:o,showSpinner:c,onClick:i},a&&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"),!!a&&Object(n.createElement)(qe.a,{srcElement:We.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,i=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ue.a)(o.id||0).cartQuantity,m=Object(n.useState)(!1),O=s()(m,2),g=O[0],j=O[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||j(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:f,isDisabled:i,isProcessing:l,isDone:g,onClick:function(){return d.submitForm()}}):Object(n.createElement)(Qe,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ke=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)}})},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 Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=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)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},Je=(r(555),r(58)),Ze=r.n(Je),et=r(4),tt=r(9),rt=r(229),nt={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,i=e.value,s=void 0===i?"":i,l=e.onChange,b=void 0===l?function(){}:l,p=e.errorMessage,d=void 0===p?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):p,f=Object(a.b)(),m=f.getValidationError,O=f.setValidationErrors,g=f.clearValidationError,j=t,h=m(j)||{};return Object(tt.useEffect)((function(){s?g(j):O(ee()({},j,{message:d,hidden:!0}))}),[s,j,d,g,O]),Object(tt.useEffect)((function(){return function(){g(j)}}),[j,g]),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:s||"",options:[nt].concat(Ze()(c)),onChange:b,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(rt.a,{propertyName:j,elementId:j}))};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){ee()(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),{},ee()({},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){ee()(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(l.a)(t),a=Object(l.a)(r),i=Object(n.useState)(0),u=s()(i,2),b=u[0],p=u[1],d=Object(n.useState)({}),f=s()(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),{},ee()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Fe.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)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("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)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},ft=function(){return Object(n.createElement)(Ge,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)($e,null):null:Object(n.createElement)(Ge,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ve.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Fe.isEmpty)(c)});return Object(n.createElement)(Ae,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},394:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(33),u=r(44),l=r(14),b=r(5),p=function(e){var t=e.color,r=e.fontSize;return Object(b.W)()?{color:t,fontSize:r}:{}},d=r(72);r(545),t.a=Object(d.withProductDataContext)((function(e){var t,r,n,a=e.className,d=e.headingLevel,f=void 0===d?2:d,m=e.productLink,O=void 0===m||m,g=e.align,j=e.color,h=e.customColor,v=e.fontSize,y=e.customFontSize,w=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,_="h".concat(f),k=Object(l.getColorClassName)("color",j),P=Object(l.getFontSizeClass)(v),C=i()((t={"has-text-color":j||h,"has-font-size":v||y},c()(t,k,k),c()(t,P,P),t));if(!E.id)return Object(o.createElement)(_,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(w,"__product-title"),w),c()(n,"wc-block-components-product-title--align-".concat(g),g&&Object(b.W)()),c()(n,C,Object(b.W)()),n)),style:p({color:h,fontSize:y})});var S=Object(s.decodeEntities)(E.name);return Object(o.createElement)(_,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(w,"__product-title"),w),c()(r,"wc-block-components-product-title--align-".concat(g),g&&Object(b.W)()),r))},O?Object(o.createElement)("a",{href:E.permalink,rel:"nofollow",className:i()(c()({},C,Object(b.W)())),style:p({color:h,fontSize:y})},S):Object(o.createElement)("span",{className:i()(c()({},C,Object(b.W)())),style:p({color:h,fontSize:y})},S))}))},4:function(e,t){!function(){e.exports=this.wp.components}()},40:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"f",(function(){return O})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return j})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(8),c=r.n(n),o=r(18),a=r(13),i=r.n(a),s=r(6),u=r(5);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=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,l=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={per_page:u.u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},l=[Object(o.addQueryArgs)("/wc/store/products",b(b({},s),i))];return u.u&&r.length&&l.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),l}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(l.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return b(b({},e),{},{parent:0})}))})).catch((function(e){throw e}))},d=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},m=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},O=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:u.x?100:0,orderby:u.x?"count":"name",order:u.x?"desc":"asc",search:n})];return u.x&&r.length&&c.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),c}({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")}))},g=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",b({per_page:0},e))})},j=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})})},v=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))}},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(15),c=r.n(n),o=r(37),a=r.n(o),i=function(){var e=a()(c.a.mark((function e(t){var r;return c.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)}}()},44:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(9)),i=r(7),s=r.n(i);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=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,u=null!=r,b=null!=n;return!u&&b?(t=c||"span",i=l(l({},i),{},{className:s()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,n)):(t=c||a.Fragment,u&&b&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))};b.defaultProps={wrapperProps:{}},t.a=b},49:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(47));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")))}},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"J",(function(){return o})),r.d(t,"P",(function(){return a})),r.d(t,"z",(function(){return i})),r.d(t,"B",(function(){return s})),r.d(t,"l",(function(){return u})),r.d(t,"A",(function(){return l})),r.d(t,"D",(function(){return b})),r.d(t,"n",(function(){return p})),r.d(t,"C",(function(){return d})),r.d(t,"m",(function(){return f})),r.d(t,"F",(function(){return m})),r.d(t,"u",(function(){return O})),r.d(t,"x",(function(){return g})),r.d(t,"r",(function(){return j})),r.d(t,"s",(function(){return h})),r.d(t,"t",(function(){return v})),r.d(t,"j",(function(){return y})),r.d(t,"L",(function(){return w})),r.d(t,"Q",(function(){return E})),r.d(t,"p",(function(){return _})),r.d(t,"q",(function(){return k})),r.d(t,"o",(function(){return P})),r.d(t,"I",(function(){return C})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return N})),r.d(t,"w",(function(){return x})),r.d(t,"T",(function(){return B})),r.d(t,"U",(function(){return z})),r.d(t,"K",(function(){return R})),r.d(t,"a",(function(){return T})),r.d(t,"N",(function(){return I})),r.d(t,"b",(function(){return L})),r.d(t,"M",(function(){return A})),r.d(t,"E",(function(){return V})),r.d(t,"h",(function(){return F})),r.d(t,"O",(function(){return q})),r.d(t,"g",(function(){return W})),r.d(t,"i",(function(){return U})),r.d(t,"H",(function(){return Q})),r.d(t,"G",(function(){return Y})),r.d(t,"S",(function(){return G})),r.d(t,"R",(function(){return K})),r.d(t,"d",(function(){return X})),r.d(t,"e",(function(){return $})),r.d(t,"f",(function(){return J})),r.d(t,"y",(function(){return Z})),r.d(t,"X",(function(){return te})),r.d(t,"Y",(function(){return re})),r.d(t,"V",(function(){return ne})),r.d(t,"W",(function(){return ce}));var n=r(3),c=Object(n.getSetting)("currentUserIsAdmin",!1),o=Object(n.getSetting)("reviewRatingsEnabled",!0),a=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),u=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),p=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),f=Object(n.getSetting)("default_height",500),m=Object(n.getSetting)("placeholderImgSrc",""),O=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),g=Object(n.getSetting)("limitTags"),j=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),v=Object(n.getSetting)("homeUrl",""),y=Object(n.getSetting)("couponsEnabled",!0),w=Object(n.getSetting)("shippingEnabled",!0),E=Object(n.getSetting)("taxesEnabled",!0),_=Object(n.getSetting)("displayItemizedTaxes",!1),k=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),P=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),C=Object(n.getSetting)("productCount",0),S=Object(n.getSetting)("attributes",[]),N=Object(n.getSetting)("isShippingCalculatorEnabled",!0),x=Object(n.getSetting)("isShippingCostHidden",!1),D=Object(n.getSetting)("woocommerceBlocksPhase",1),B=Object(n.getSetting)("wcBlocksAssetUrl",""),z=Object(n.getSetting)("wcBlocksBuildUrl",""),R=Object(n.getSetting)("shippingCountries",{}),T=Object(n.getSetting)("allowedCountries",{}),I=Object(n.getSetting)("shippingStates",{}),L=Object(n.getSetting)("allowedStates",{}),A=Object(n.getSetting)("shippingMethodsExist",!1),V=Object(n.getSetting)("paymentGatewaySortOrder",[]),F=Object(n.getSetting)("checkoutShowLoginReminder",!0),M={id:0,title:"",permalink:""},H=Object(n.getSetting)("storePages",{shop:M,cart:M,checkout:M,privacy:M,terms:M}),q=H.shop.permalink,W=H.checkout.id,U=H.checkout.permalink,Q=H.privacy.permalink,Y=H.privacy.title,G=H.terms.permalink,K=H.terms.title,X=H.cart.id,$=H.cart.permalink,J=Object(n.getSetting)("checkoutAllowsGuest",!1),Z=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),ee=r(17),te=function(e,t){if(D>2)return Object(ee.registerBlockType)(e,t)},re=function(e,t){if(D>1)return Object(ee.registerBlockType)(e,t)},ne=function(){return D>2},ce=function(){return D>1}},526:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(166),u=r(254),l=r(44),b=r(14),p=r(5),d=r(72);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,h=e.customFontSize,v=e.saleFontSize,y=e.customSaleFontSize,w=e.color,E=e.customColor,_=e.saleColor,k=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)(v),z=i()((t={"has-text-color":w||E,"has-font-size":j||h},c()(t,N,N),c()(t,x,x),t)),R=i()((r={"has-text-color":_||k,"has-font-size":v||y},c()(r,D,D),c()(r,B,B),r)),T={color:E,fontSize:h},I={color:k,fontSize:y},L=C.prices,A=Object(u.c)(L),V=L.price!==L.regular_price,F=V?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,R,Object(p.W)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,z,Object(p.W)()),a)),M=V?I:T;return Object(o.createElement)(s.a,{align:g,className:S,currency:A,price:L.price,priceClassName:F,priceStyle:Object(p.W)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,z,Object(p.W)()),m)),regularPriceStyle:Object(p.W)()?T:{}})}))},527:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(44),l=r(72),b=(r(548),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,"star-rating","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)))}))},528:function(e,t,r){"use strict";r.r(t);var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(834),p=r(33),d=r(529),f=r(44),m=r(72),O=(r(549),function(e){var t=e.product,r=Object(i.useRef)(!0),n=t.id,o=t.permalink,a=t.add_to_cart,s=t.has_options,f=t.is_purchasable,m=t.is_in_stock,O=Object(b.a)(n),g=O.cartQuantity,j=O.addingToCart,h=O.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(d.c)()}),[g]);var v=Number.isFinite(g)&&g>0,y=!s&&f&&m,w=Object(p.decodeEntities)((null==a?void 0:a.description)||""),E=v?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",k={};return y?k.onClick=function(){h()}:(k.href=o,k.rel="nofollow"),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:v}),disabled:j},k),E)}),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))}))},529:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return a}));var n=window.Event||null,c=function(e,t){var r=t.bubbles,c=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element;if(i||(i=document.body),"function"==typeof n){var s=new n(e,{bubbles:c,cancelable:a});i.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,a),i.dispatchEvent(u)}},o=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},530:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(176),u=r(3),l=r(44),b=r(72);r(550);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;if(!a)return null;var b=Object(u.getSetting)("wordCountType","words");return Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:b})}))},531:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(72);r(551);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}))},532:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(6),b=r(72);r(552);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))}))))}))},533:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(6),b=r(72);r(553);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))}))))}))},534:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(72),b=(r(554),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))}))},535:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(9),c=function(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,r.current]),r.current}},54:function(e,t){!function(){e.exports=this.wp.keycodes}()},545:function(e,t){},546:function(e,t){},547:function(e,t){},548:function(e,t){},549:function(e,t){},55:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(27),s=r.n(i),u=r(0),l=r(184),b=r(7),p=r.n(b);r(193);function d(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?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(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=s()(e,["className","value","currency","onValueChange"]);if("-"===r)return null;var i=r/Math.pow(10,n.minorUnit);if(!Number.isFinite(i))return null;var b=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),d=f(f(f({displayType:"text"},a),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}),m=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:b},d,{value:i,onValueChange:m}))}},550:function(e,t){},551:function(e,t){},552:function(e,t){},553:function(e,t){},554:function(e,t){},555:function(e,t){},556:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},59:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(46),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},61:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(27),a=r.n(o),i=r(9);r(2);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,o=a()(e,["srcElement","size"]);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){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}({width:n,height:n},o))}},72:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},73:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(24),s=r.n(i),u=r(19),l=r.n(u),b=r(22),p=r.n(b),d=r(23),f=r.n(d),m=r(12),O=r.n(m),g=r(0),j=r(6),h=r(7),v=r.n(h),y=r(4),w=r(25);r(121);function E(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 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=E(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:v()("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.isDefault=!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)(_)},74:function(e,t){!function(){e.exports=this.wp.hooks}()},77:function(e,t){!function(){e.exports=this.ReactDOM}()},78:function(e,t){!function(){e.exports=this.wp.dom}()},80:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(4)),i=r(5);t.a=function(e){var t=e.columns,r=e.rows,s=e.setAttributes,u=e.alignButtons;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,i.B,i.z);s({columns:Object(o.isNaN)(t)?"":t})},min:i.B,max:i.z}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,i.D,i.A);s({rows:Object(o.isNaN)(t)?"":t})},min:i.D,max:i.A}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:u?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:u,onChange:function(){return s({alignButtons:!u})}}))}},803:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},810:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},818:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},819:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(5),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.T+"img/pennant.jpg",thumbnail:c.T+"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}]},82:function(e,t){!function(){e.exports=this.wp.viewport}()},824:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},831:function(e,t,r){e.exports=r(891)},832:function(e,t){},833:function(e,t){},834:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),c=r.n(n),o=r(0),a=r(36),i=r(135),s=r(41),u=r(33),l=r(143),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)(s.CART_STORE_KEY).addItemToCart,r=Object(i.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],h=g[1],v=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==v.current&&(v.current=t)}),[n,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){f(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},836:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},837:function(e,t){},838:function(e,t){},839:function(e,t){},840:function(e,t){},85:function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(6),u=r(46),l=r.n(u);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=Object(i.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}}),f=function(){return Object(i.useContext)(d)},m=function(e){var t=e.children,r=Object(i.useState)({}),n=a()(r,2),o=n[0],u=n[1],b=Object(i.useCallback)((function(e){return o[e]}),[o]),f=Object(i.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),m=Object(i.useCallback)((function(e){u((function(t){return t[e]?Object(s.omit)(t,[e]):t}))}),[]),O=Object(i.useCallback)((function(){u({})}),[]),g=Object(i.useCallback)((function(e){e&&u((function(t){return e=Object(s.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:p(p({},t),e)}))}),[]),j=Object(i.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=p(p({},r[e]),t);return l()(r[e],n)?r:p(p({},r),{},c()({},e,n))}))}),[]),h={getValidationError:b,setValidationErrors:g,clearValidationError:m,clearAllValidationErrors:O,hideValidationError:Object(i.useCallback)((function(e){j(e,{hidden:!0})}),[j]),showValidationError:Object(i.useCallback)((function(e){j(e,{hidden:!1})}),[j]),showAllValidationErrors:Object(i.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=p(p({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:p(p({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:f};return Object(i.createElement)(d.Provider,{value:h},t)}},86:function(e,t){!function(){e.exports=this.wp.a11y}()},891:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(14),l=r(17),b=r(61),p=r(56),d=Object(i.createElement)(p.a,{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(5),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.V)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},h=r(386),v=r(4),y=r(25),w=r(154),E=r(394),_=r(11),k=r.n(_),P=r(145),C=r(27),S=r.n(C);r(833);var N=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(v.Button,a()({className:c},n))},x=r(44),D=(r(832),function(e){return function(t){return function(r){var n=Object(x.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=k()(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)(v.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)(v.Button,{isDefault:!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)(v.Toolbar,null,Object(i.createElement)(N,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.a,{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"})),z=Object(s.__)("Product Title","woo-gutenberg-products-block"),R=Object(i.createElement)(b.a,{srcElement:B}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),I=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.W)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.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.W)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(v.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)(v.Disabled,null,Object(i.createElement)(E.a,o)))},L=Object(f.W)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:R,label:z,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(I):I;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 V(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 F={title:z,description:T,icon:{src:R,foreground:"#874FB9"},attributes:h.a,edit:L};Object(l.registerBlockType)("woocommerce/product-title",V(V({},j),F));var M=r(526),H=r(356),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),W=Object(i.createElement)(b.a,{srcElement:H.a}),U=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),Q=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)(v.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},Y=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.W)()&&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.W)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(Q,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(Q,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},G=Object(f.W)()?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"}),D({icon:W,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(Y):Y;function K(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 X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $={productId:{type:"number",default:0}};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 Z(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){c()(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}Object(f.W)()&&($=X(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 ee={title:q,description:U,icon:{src:W,foreground:"#874FB9"},attributes:$,edit:G};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(387),re=r(191),ne=r(73),ce=r(3),oe=r(388),ae=Object(i.createElement)(p.a,{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"})),ie=Object(s.__)("Product Image","woo-gutenberg-products-block"),se=Object(i.createElement)(b.a,{srcElement:ae}),ue=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),le=D({icon:se,label:ie,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)(v.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.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)(v.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)(ne.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)(ne.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(re.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(ce.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)(v.Disabled,null,Object(i.createElement)(oe.a,t)))}));function be(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 pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var de={title:ie,description:ue,icon:{src:se,foreground:"#874FB9"},attributes:te.a,edit:le};Object(l.registerBlockType)("woocommerce/product-image",pe(pe({},j),de));var fe={productId:{type:"number",default:0}},me=r(527),Oe=r(818),ge=Object(s.__)("Product Rating","woo-gutenberg-products-block"),je=Object(i.createElement)(b.a,{srcElement:Oe.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 ve(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 ye={title:ge,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:je,foreground:"#874FB9"},attributes:fe,edit:D({icon:je,label:ge,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(me.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",ve(ve({},j),ye));var we={productId:{type:"number",default:0}},Ee=r(528),_e=r(836),ke=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:_e.a});function Ce(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 Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:ke,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:Pe,foreground:"#874FB9"},attributes:we,edit:D({icon:Pe,label:ke,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)(v.Disabled,null,Object(i.createElement)(Ee.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Se(Se({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(530),Be=Object(i.createElement)(p.a,{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"})),ze=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Re=Object(i.createElement)(b.a,{srcElement:Be});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 Ie(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 Le={title:ze,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Re,foreground:"#874FB9"},attributes:xe,edit:D({icon:Re,label:ze,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)(De.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Ie(Ie({},j),Le));var Ae={productId:{type:"number",default:0}},Ve=r(262),Fe=r(810),Me=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),He=Object(i.createElement)(b.a,{srcElement:Fe.a});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}function We(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){c()(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}var Ue={title:Me,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:He,foreground:"#874FB9"},supports:{html:!1},attributes:Ae,edit:D({icon:He,label:Me,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)(Ve.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",We(We({},j),Ue));var Qe={productId:{type:"number",default:0}},Ye=r(136),Ge=r(531),Ke=Object(i.createElement)(p.a,{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"})),Xe=Object(s.__)("Product SKU","woo-gutenberg-products-block"),$e=Object(i.createElement)(b.a,{srcElement:Ke});function Je(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 Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var et={title:Xe,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:$e,foreground:"#874FB9"},attributes:Qe,edit:D({icon:$e,label:Xe,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)(Ye.a,null),Object(i.createElement)(Ge.default,t))}))};Object(f.X)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(532),nt=r(803),ct=Object(s.__)("Product Category List","woo-gutenberg-products-block"),ot=Object(i.createElement)(b.a,{srcElement:nt.a});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){c()(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={title:ct,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:ot,foreground:"#874FB9"},attributes:tt,edit:D({icon:ot,label:ct,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)(Ye.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.X)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(533),bt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),pt=Object(i.createElement)(b.a,{srcElement:Fe.a});function dt(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?dt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mt={title:bt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:pt,foreground:"#874FB9"},attributes:ut,edit:D({icon:pt,label:bt,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)(Ye.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.X)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(534),jt=Object(i.createElement)(p.a,{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"),vt=Object(i.createElement)(b.a,{srcElement:jt});function yt(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 wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Et={title:ht,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:vt,foreground:"#874FB9"},attributes:Ot,edit:D({icon:vt,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)(Ye.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.X)("woocommerce/product-stock-indicator",wt(wt({},j),Et));var _t=r(921),kt=(r(384),r(393)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),Ct=Object(i.createElement)(b.a,{srcElement:_e.a});function St(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 Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xt={title:Pt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ct,foreground:"#874FB9"},edit:D({icon:Ct,label:Pt,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(x.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)(Ye.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(_t.b)(n)?Object(i.createElement)(v.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)(v.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)(v.Disabled,null,Object(i.createElement)(kt.a,t)))})),attributes:r(392).a};Object(f.X)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(21),Bt=r.n(Dt),zt=r(19),Rt=r.n(zt),Tt=r(22),It=r.n(Tt),Lt=r(23),At=r.n(Lt),Vt=r(12),Ft=r.n(Vt),Mt=r(36),Ht=(r(2),r(80)),qt=r(919),Wt=r(819),Ut=r(168),Qt=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})},Yt=function(e,t){return Object(i.createElement)(v.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)(v.Button,{className:"wc-block-products__add-product-button",isDefault:!0,isLarge:!0,href:ce.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)(v.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")))},Gt=function(e,t){return Object(i.createElement)(v.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 Kt(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?Kt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $t=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Jt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Xt(Xt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};r(837);function Zt(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 er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(v.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:er(er({},r),{},{orderBy:!r.orderBy})})}})},rr=function(e,t){return Object(i.createElement)(v.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})}})},nr=r(24),cr=r.n(nr),or=r(9),ar=r(52),ir=r.n(ar),sr=r(6),ur=r(48),lr=(r(840),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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});lr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var br=lr,pr=r(151),dr=(r(839),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})}),fr=r(192),mr=Object(fr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(x.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(qt.a)(t);return n.map((function(n,s){var u=k()(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))})),Or=r(172),gr=r(205),jr=r(41),hr=r(60);function vr(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 yr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(gr.a)(yr(yr({},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(hr.a)(i),u=Object(hr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(jr.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",yr(yr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},Er=r(535),_r=r(185),kr=r(86),Pr=(r(838),r(146)),Cr=function(){var e=Object(x.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:Pr.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")))},Sr=r(824),Nr=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(x.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:Sr.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")))};function xr(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 Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Br=Object(_r.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=Object(Or.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return Dr(Dr({},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*o,page:r})}({attributes:t,sortValue:o,currentPage:r})),l=k()(u,1)[0],b=wr(l),p=b.products,d=b.totalProducts,f=b.productsLoading,m=Object(x.useInnerBlockLayoutContext)().parentClassName,g=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,["order","orderby","page","per_page"])}(l),j=Object(Or.b)("attributes",[]),h=k()(j,2),v=h[0],y=h[1],w=Object(Or.b)("min_price"),E=k()(w,2),_=E[0],P=E[1],C=Object(Or.b)("max_price"),N=k()(C,2),D=N[0],B=N[1],z=Object(Er.a)({totalQuery:g,totalProducts:d},(function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(sr.isEqual)(t,c)&&Number.isFinite(r)})),R="object"===ir()(z)&&Object(sr.isEqual)(g,z.totalQuery);Object(i.useEffect)((function(){R||(n(1),z&&function(e){Number.isFinite(e)&&(0===e?Object(kr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(kr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[l]);var T,I,L,A,V,F=t.contentVisibility,M=t.columns*t.rows,H=!Number.isFinite(d)&&R?Math.ceil(z.totalProducts/M):Math.ceil(d/M),q=p.length?p:Array.from({length:M}),W=0!==p.length||f,U=v.length>0||Number.isFinite(_)||Number.isFinite(D);return Object(i.createElement)("div",{className:(T=t.columns,I=t.rows,L=t.alignButtons,A=t.align,V=void 0!==A?"align"+A:"",O()(m,V,"has-"+T+"-columns",{"has-multiple-rows":I>1,"has-aligned-buttons":L}))},F.orderBy&&W&&Object(i.createElement)(dr,{onChange:c,value:o}),!W&&U&&Object(i.createElement)(Nr,{resetCallback:function(){y([]),P(null),B(null)}}),!W&&!U&&Object(i.createElement)(Cr,null),W&&Object(i.createElement)("ul",{className:"".concat(m,"__products")},q.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)(mr,{key:e.id||r,attributes:t,product:e})}))),H>1&&Object(i.createElement)(br,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:H}))})),zr=function(e){var t=e.attributes,r=Object(i.useState)(1),n=k()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=k()(a,2),u=s[0],l=s[1];Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]);return Object(i.createElement)(Br,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},Rr=r(175);function Tr(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 r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return At()(this,r)}}var Ir=function(e){It()(r,e);var t=Tr(r);function r(){return Bt()(this,r),t.apply(this,arguments)}return cr()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?Rr.a:Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(zr,{attributes:t,urlParameterSuffix:r}))}}]),r}(or.Component);function Lr(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 r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return At()(this,r)}}var Ar=function(e){It()(r,e);var t=Lr(r);function r(){var e;Bt()(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()(Rt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Rt()(e),"blockMap",Object(qt.a)("woocommerce/all-products")),c()(Rt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Rt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Rt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Rt()(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()(Rt()(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)(v.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ht.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},tr(r,n),rr(r,n)))})),c()(Rt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(v.Toolbar,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Rt()(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)(v.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)(v.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)(x.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)(x.ProductDataContextProvider,{product:Wt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(v.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,isLarge:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Jt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(v.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)(v.IconButton,{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=[];$t.map((function(e){var t=k()(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()(Rt()(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)(v.Disabled,null,Object(i.createElement)(Ir,{attributes:t})):Gt(c,o)})),c()(Rt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return f.r?Object(i.createElement)("div",{className:Qt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):Yt(n,c)})),e}return r}(i.Component),Vr=Object(y.compose)(v.withSpokenMessages,Object(Mt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Mt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Ar),Fr={columns:f.l,rows:f.n,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:$t,isPreview:!1};function Mr(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 Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(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:Fr,edit:function(e){return Object(i.createElement)(Vr,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:Qt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Hr(Hr({},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:Qt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},9:function(e,t){!function(){e.exports=this.React}()},919:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(59),c=r(0),o=r(5);r.p=o.U,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(11)]).then(r.bind(null,526))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(3),r.e(10)]).then(r.bind(null,939))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(17)]).then(r.bind(null,940))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,527))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(2),r.e(8)]).then(r.bind(null,528))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,530))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,262))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,531))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,532))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,533))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,534))}))}),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(7)]).then(r.bind(null,941))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},921: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")}},93:function(e,t){!function(){e.exports=this.wp.date}()},94:function(e,t){!function(){e.exports=this.wp.autop}()},99:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(276),u=(r(2),r(7)),l=r.n(u);r(235);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,["className","showSpinner","children"]),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:b},u),n&&Object(i.createElement)("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}}});
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={5:0,2:0,3:0,8:0,9:0,11:0,12:0,13:0,14:0,15:0,16: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/image~atomic-block-components/title",2:"atomic-block-components/add-to-cart~atomic-block-components/button",3:"atomic-block-components/sale-badge",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sku",14:"atomic-block-components/stock-indicator",15:"atomic-block-components/summary",16:"atomic-block-components/tag-list",17:"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([839,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},102: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},108:function(e,t){},109:function(e,t){},110:function(e,t){},111:function(e,t){},112:function(e,t){},113:function(e,t){},114:function(e,t){},115:function(e,t){},116:function(e,t){},117:function(e,t){},118:function(e,t){},119:function(e,t){},120:function(e,t){},121:function(e,t){},122:function(e,t){},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(41),c=r(36),o=r(211),a=r(33),i=r(6),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),r=t.isEditor,u=t.previewData,l=(null==u?void 0:u.previewCart)||{},b=e.shouldSelect,p=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!b)return s;if(r)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var o=e(n.CART_STORE_KEY),u=o.getCartData(),p=o.getCartErrors(),d=o.getCartTotals(),f=!o.hasFinishedResolution("getCartData"),m=o.areShippingRatesLoading(),O=c(n.CART_STORE_KEY).receiveCart,g=Object(i.mapValues)(u.shippingAddress,(function(e){return Object(a.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:d,cartIsLoading:f,cartErrors:p,shippingAddress:g,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!g.country,receiveCart:O}}),[b]);return p}},135:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(61),a=r(167),i=r(3),s=r(14),u=r(44);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}},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},140:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(8),c=r.n(n),o=r(190),a=r(0);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(o.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(a.useRef)(t);Object(a.useEffect)((function(){u.current=t}),[t]);var l=Object(a.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(a.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})}},142:function(e,t){!function(){e.exports=this.wp.wordcount}()},143:function(e,t,r){"use strict";var n=r(51),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(6),l=(r(2),r(50)),b=r(4),p=r(7),d=r.n(p),f=r(21),m=r.n(f),O=r(24),g=r.n(O),j=r(22),h=r.n(j),v=r(23),y=r.n(v),w=r(12),E=r.n(w),_=r(25);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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Object(_.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=k(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected;return Object(i.createElement)(e,a()({},this.props,{selected:Object(u.isNil)(t)?[]:[t]}))}}]),n}(i.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),C=r(301),S=r(15),N=r.n(S),x=r(37),D=r.n(x),B=r(19),z=r.n(B),R=r(8),T=r.n(R),I=r(46),L=r.n(I),A=r(40),V=r(42);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){T()(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}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var q=Object(_.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=H(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)),T()(z()(e),"state",{error:null,loading:!1,variations:{}}),T()(z()(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 a=t.find((function(e){return e.id===o}));a.variations&&0!==a.variations.length?(e.setState({loading:!0}),Object(A.g)(o).then((function(t){var r=t.map((function(e){return M(M({},e),{},{parent:o})}));e.setState({variations:M(M({},e.state.variations),{},T()({},o,r)),loading:!1,error:null})})).catch(function(){var t=D()(N.a.mark((function t(r){var n;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},T()({},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:M(M({},e.state.variations),{},T()({},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&&(!L()(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,s=c.loading,u=c.variations;return Object(i.createElement)(e,a()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:u,variationsLoading:s}))}}]),n}(i.Component);return T()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),W=r(61),U=r(58),Q=Object(i.createElement)(U.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),Y=Object(i.createElement)(U.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),G=r(49);r(199);function K(e,t){if(!t)return e;var r=new RegExp(Object(u.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var X=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(i.createElement)(W.a,{srcElement:Q}):Object(i.createElement)(W.a,{srcElement:Y})},$={list:Object(s.__)("Products","woo-gutenberg-products-block"),noItems:Object(s.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(s.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(s.__)("Product search results updated.","woo-gutenberg-products-block")},J=function(e){var t=e.expandedProduct,r=e.error,n=e.isLoading,o=e.onChange,p=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,h=e.variationsLoading,v=function(e){var r=e.item,n=e.search,c=e.depth,o=void 0===c?0:c,p=e.isSelected,f=e.onSelect,m=r.variations&&Array.isArray(r.variations)?r.variations.length:0,O=d()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),{"is-searching":n.length>0,"is-skip-level":0===o&&0!==r.parent,"is-variable":m>0}),g=Object.assign({},e);delete g.isSingle;var j={role:"menuitemradio"};return r.breadcrumbs.length&&(j["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),m&&(j["aria-expanded"]=r.id===t),r.breadcrumbs.length?(Object(u.isEmpty)(r.variation)||(r.name=r.variation),Object(i.createElement)(l.b,a()({className:O},e,j))):[Object(i.createElement)(b.MenuItem,a()({key:"product-".concat(r.id),isSelected:p},g,j,{className:O,onClick:function(){f(r)()}}),Object(i.createElement)("span",{className:"woocommerce-search-list__item-state"},X(p)),Object(i.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(i.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:K(r.name,n)}})),m?Object(i.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(s.sprintf)(Object(s._n)("%d variation","%d variations",m,"woo-gutenberg-products-block"),m)):null),t===r.id&&m>0&&h&&Object(i.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(i.createElement)(b.Spinner,null))]};if(r)return Object(i.createElement)(G.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(i.createElement)(l.a,{className:"woocommerce-products",list:w,isLoading:n,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:o,renderItem:m||(g?v:null),onSearch:p,messages:$,isHierarchical:!0})};J.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=P(Object(C.a)(q(J)))},144:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},149:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(48),i=r(192);r(201);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.a,{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)}))))}))},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(8),c=r.n(n),o=r(6);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="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:s,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,o=t.id,a=t.callback,l=t.priority,b=new Map(e[n]);switch(r){case s:return b.set(o,{priority:l,callback:a}),i(i({},e),{},c()({},n,b));case u:return b.delete(o),i(i({},e),{},c()({},n,b))}return e}},152:function(e,t,r){"use strict";var n=r(21),c=r.n(n),o=r(24),a=r.n(o),i=r(22),s=r.n(i),u=r(23),l=r.n(u),b=r(12),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(4);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 h=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.Toolbar,{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=h},155:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},164:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(56),s=r(7),u=r.n(s),l=(r(2),r(236),function(e){var t=e.className,r=e.currency,n=e.maxPrice,c=e.minPrice,a=e.priceClassName,s=e.priceStyle;return Object(o.createElement)("span",{className:t},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:c,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:n,style:s}))}),b=function(e){var t=e.className,r=e.currency,n=e.regularPriceClassName,c=e.regularPriceStyle,s=e.regularPrice,l=e.priceClassName,b=e.priceStyle,p=e.price;return Object(o.createElement)("span",{className:t},Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:r,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",n),style:c},e)},value:s}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:r,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",l),style:b},e)},value:p}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.maxPrice,s=void 0===a?null:a,p=e.minPrice,d=void 0===p?null:p,f=e.price,m=void 0===f?null:f,O=e.priceClassName,g=e.priceStyle,j=e.regularPrice,h=e.regularPriceClassName,v=e.regularPriceStyle,y=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));return j&&m!==j?Object(o.createElement)(b,{className:y,currency:n,price:m,priceClassName:O,priceStyle:g,regularPrice:j,regularPriceClassName:h,regularPriceStyle:v}):null!==d&&null!==s?Object(o.createElement)(l,{className:y,currency:n,maxPrice:s,minPrice:d,priceClassName:O,priceStyle:g}):null!==m?Object(o.createElement)("span",{className:y},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",O),currency:n,value:m,style:g})):Object(o.createElement)("span",{className:y},Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",O)}))}},167:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},17:function(e,t){!function(){e.exports=this.wp.blocks}()},171:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(11),c=r.n(n),o=r(41),a=r(36),i=r(0),s=r(102),u=r(6),l=r(60),b=function(e){var t=Object(s.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])]},p=function(e,t,r){var n=Object(s.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){u(r,e,t)}),[r,e])]},d=function(e,t){var r=Object(s.a)(),n=b(t=t||r),o=c()(n,2),a=o[0],p=o[1],d=Object(l.a)(e),f=Object(i.useRef)(!1);return Object(i.useEffect)((function(){p(Object(u.assign)({},a,d)),f.current=!0}),[d]),f.current?[a,p]:[e,p]}},175:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(5),o=Object(n.createElement)("img",{src:c.T+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},176:function(e,t,r){"use strict";var n=r(0),c=r(142),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]:"&hellip;",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]:"&hellip;",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)}},18:function(e,t){!function(){e.exports=this.wp.url}()},184:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(24),s=r.n(i),u=r(19),l=r.n(u),b=r(22),p=r.n(b),d=r(23),f=r.n(d),m=r(12),O=r.n(m),g=r(8),j=r.n(g),h=r(0),v=r(9);r(259);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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(v.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(h.createElement)(v.Fragment,null,Object(h.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(h.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(v.Component);return t.displayName="withScrollToTop",t}},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return j}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=(r(2),r(36)),u=r(302),l=r(944),b=r(140),p=r(211),d=function(){var e=Object(p.b)().isEditor,t=Object(b.a)(),r=t.notices,n=t.removeNotice;if(e)return null;var c=r.filter((function(e){return"snackbar"===e.type}));return Object(i.createElement)(l.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:n})};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){c()(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}var O=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),g=function(){return Object(i.useContext)(O)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,l=e.context,b=void 0===l?"wc/core":l,p=Object(s.useDispatch)("core/notices"),f=p.createNotice,g=p.removeNotice,j=Object(i.useState)(!1),h=a()(j,2),v=h[0],y=h[1],w=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,m(m({},r),{},{context:r.context||b}))}),[f,b]),E=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;g(e,t)}),[g,b]),_=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]:{};w("default",e,m(m({},t),{},{type:"snackbar"}))}),[w]),k={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(b)}}),[b]).notices,createNotice:w,createSnackbarNotice:_,removeNotice:E,context:b,setIsSuppressed:y},P=v?null:Object(i.createElement)(u.a,{className:n,notices:k.notices}),C=v?null:Object(i.createElement)(d,null);return Object(i.createElement)(O.Provider,{value:k},o&&P,t,C)}},193:function(e,t){},199:function(e,t){},201:function(e,t){},206:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(41),c=r(36),o=r(0),a=r(155),i=r(60),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(i.a)(b),O=Object(i.a)(u),g=Object(a.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}},211: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(36),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),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={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),previewData:s};return Object(n.createElement)(o.Provider,{value:u},t)}},232:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(86),o=(r(2),r(239),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))})},236:function(e,t){},237:function(e,t){},238:function(e,t){},239:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.compose}()},258:function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(53),a=r.n(o),i=r(3);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,b,p={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(l=i.CURRENCY.symbol,b=i.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==a()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,c=e.currency_decimal_separator,o=e.currency_minor_unit,i=e.currency_prefix,s=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(o)?o:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof s?s:""}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(u({},p),e)},m=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=f(t),c=r/Math.pow(10,n.minorUnit),o=n.prefix+c+n.suffix,a=document.createElement("textarea");return a.innerHTML=o,a.value}},259:function(e,t){},266:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(48),l=r(44),b=r(73);r(553);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.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},267:function(e,t){!function(){e.exports=this.wp.deprecated}()},268:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(58),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=void 0===r?20:r,o=a()(e,["className","size"]);return Object(i.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},o),Object(i.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),l=r(283);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=u;break;case"no-alt":t=l.a}return t?Object(i.cloneElement)(t,{size:e.size||20,className:e.className}):null}},283:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(58),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return Object(i.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),Object(i.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=u},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},301:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(37),s=r.n(i),u=r(21),l=r.n(u),b=r(24),p=r.n(b),d=r(19),f=r.n(d),m=r(22),O=r.n(m),g=r(23),j=r.n(g),h=r(12),v=r.n(h),y=r(0),w=r(6),E=r(25),_=(r(2),r(5)),k=r(40),P=r(42);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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v()(e);if(t){var c=v()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return j()(this,r)}}var S=Object(E.createHigherOrderComponent)((function(e){var t=function(t){O()(o,t);var r,n=C(o);function o(){var e;return l()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(f()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(f()(e)),400),e}return p()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(k.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(k.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=s()(a.a.mark((function e(t){var r;return a.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(y.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.u?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(y.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},302:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(389),u=r(190),l=(r(237),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""});t.a=function(e){var t=e.className,r=e.notices,n=Object(u.b)().removeNotice,a=r.filter((function(e){return"snackbar"!==e.type}));if(!a.length)return null;var b=i()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:b},a.map((function(e){return Object(o.createElement)(s.a,c()({key:"store-notice-"+e.id},e,{className:i()("wc-block-components-notices__notice","woocommerce-message",l(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))}},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},35:function(e,t){!function(){e.exports=this.moment}()},36:function(e,t){!function(){e.exports=this.wp.data}()},361:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},390:function(e,t){},391:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(5);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.W)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},392: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}}},393:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(5),b=r(44),p=r(73),d=r(6),f=r(266);r(554);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){c()(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=function(){return Object(i.createElement)("img",{src:l.F,alt:"",width:500,height:500})},j=function(e){var t=e.image,r=e.onLoad,n=e.loaded,c=e.showFullSize,o=t||{},a=o.thumbnail,s=o.src,u=o.srcset,l=o.sizes,b={alt:o.alt,onLoad:r,hidden:!n,src:a};return c&&(b=O(O({},b),{},{src:s,srcSet:u,sizes:l})),Object(i.createElement)(i.Fragment,null,Object(i.createElement)("img",b),!n&&Object(i.createElement)(g,null))};t.a=Object(p.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,o=e.productLink,s=void 0===o||o,l=e.showSaleBadge,p=e.saleBadgeAlign,m=void 0===p?"right":p,O=Object(b.useInnerBlockLayoutContext)().parentClassName,h=Object(b.useProductDataContext)().product,v=Object(i.useState)(!1),y=a()(v,2),w=y[0],E=y[1];if(!h.id)return Object(i.createElement)("div",{className:u()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",c()({},"".concat(O,"__product-image"),O))},Object(i.createElement)(g,null));var _=Object(d.isEmpty)(h.images)?null:h.images[0];return Object(i.createElement)("div",{className:u()(t,"wc-block-components-product-image",c()({},"".concat(O,"__product-image"),O))},s?Object(i.createElement)("a",{href:h.permalink,rel:"nofollow"},!!l&&Object(i.createElement)(f.default,{align:m,product:h}),Object(i.createElement)(j,{image:_,onLoad:function(){return E(!0)},loaded:w,showFullSize:"cropped"!==n})):Object(i.createElement)(i.Fragment,null,!!l&&Object(i.createElement)(f.default,{align:m,product:h}),Object(i.createElement)(j,{image:_,onLoad:function(){return E(!0)},loaded:w,showFullSize:"cropped"!==n})))}))},394:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},c={SUCCESS:"success",FAIL:"failure",ERROR:"error"},o={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},a=function(e){return n(e,c.SUCCESS)},i=function(e){return n(e,c.ERROR)},s=function(e){return n(e,c.FAIL)},u=function(){return{responseTypes:c,noticeContexts:o,isSuccessResponse:a,isErrorResponse:i,isFailResponse:s}}},395:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(150),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))}}}},396:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(15),c=r.n(n),o=r(53),a=r.n(o),i=r(37),s=r.n(i);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(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=e[Symbol.iterator]()},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 l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},p=function(){var e=s()(c.a.mark((function e(t,r,n){var o,i,s,l,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),i=[],s=u(o),e.prev=3,s.s();case 5:if((l=s.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"===a()(d)&&i.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),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!i.length||i);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)}}(),d=function(){var e=s()(c.a.mark((function e(t,r,n){var o,i,s,l,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),i=!0,s=u(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=24;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:if(d=e.sent,"object"!==a()(d)||void 0!==d.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(i="object"!==a()(d)||d)){e.next=16;break}return e.abrupt("return",i);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),s.e(e.t1);case 29:return e.prev=29,s.f(),e.finish(29);case 32:return e.abrupt("return",i);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},397:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},398:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(86),i=r(11),s=r.n(i),u=r(1),l=r(60),b=r(140),p=r(394),d=r(929),f="pristine",m="idle",O="disabled",g="processing",j="before_processing",h="after_processing",v={status:f,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",w="set_idle",E="set_disabled",_="set_processing",k="set_before_processing",P="set_after_processing",C="set_processing_response",S="set_has_error",N="set_no_error",x="set_quantity",D="set_request_params",B=y,z=w,R=E,T=_,I=k,L=P,A=C,V=S,F=N,M=x,H=D,q=function(){return{type:B}},W=function(){return{type:z}},U=function(){return{type:R}},Q=function(){return{type:T}},Y=function(){return{type:I}},G=function(){return{type:L}},K=function(e){return{type:A,data:e}},X=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?V:F;return{type:t}},$=function(e){return{type:M,quantity:e}},J=function(e){return{type:H,data:e}},Z=r(8),ee=r.n(Z);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 re(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){ee()(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 ne=y,ce=w,oe=E,ae=_,ie=k,se=P,ue=C,le=S,be=N,pe=x,de=D,fe=f,me=m,Oe=O,ge=g,je=j,he=h,ve=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ne:e=v;break;case ce:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case oe:e=t.status!==Oe?re(re({},t),{},{status:Oe}):t;break;case pe:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case de:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),o)});break;case ue:e=re(re({},t),{},{processingResponse:o});break;case ae:e=!1===(e=t.status!==ge?re(re({},t),{},{status:ge,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case ie:e=t.status!==je?re(re({},t),{},{status:je,hasError:!1}):t;break;case se:e=t.status!==he?re(re({},t),{},{status:he}):t;break;case le:e=t.hasError?t:re(re({},t),{},{hasError:!0}),e=t.status===ge||t.status===je?re(re({},e),{},{status:me}):e;break;case be:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&c!==ne&&e.status===fe&&(e.status=me),e},ye=r(150),we=r(395),Ee="add_to_cart_before_processing",_e="add_to_cart_after_processing_with_success",ke="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(we.a)(_e,e),onAddToCartProcessingWithError:Object(we.a)(ke,e),onAddToCartBeforeProcessing:Object(we.a)(Ee,e)}},Ce=r(396),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)(ve,v),i=s()(o,2),f=i[0],y=i[1],w=Object(n.useReducer)(ye.b,{}),E=s()(w,2),_=E[0],k=E[1],P=Object(l.a)(_),C=Object(b.a)(),S=C.addErrorNotice,N=C.removeNotices,x=Object(a.b)().setValidationErrors,D=Object(p.a)(),B=D.isSuccessResponse,z=D.isErrorResponse,R=D.isFailResponse,T=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(k).onAddToCartBeforeProcessing}}),[k]),I=Object(n.useMemo)((function(){return{resetForm:function(){y(q())},submitForm:function(){y(Y())},setQuantity:function(e){y($(e))},setHasError:function(e){y(X(e))},setRequestParams:function(e){y(J(e))},setAfterProcessing:function(e){y(K(e)),y(G())}}}),[]);Object(n.useEffect)((function(){var e=f.status,t=!r.id||!Object(d.a)(r);e!==O||t?e!==O&&t&&y(U()):y(W())}),[f.status,r,y]),Object(n.useEffect)((function(){f.status===j&&(N("error"),Object(Ce.a)(P,Ee,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&x(r)})),y(W())):y(Q())})))}),[f.status,x,S,N,y,P]),Object(n.useEffect)((function(){if(f.status===h){var e={processingResponse:f.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;S(e.message,t)}};if(f.hasError)return void Object(Ce.b)(P,ke,e).then((function(r){if(z(r)||R(r))t(r);else{var n,c=(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");S(c,{id:"add-to-cart"})}y(W())}));Object(Ce.b)(P,_e,e).then((function(e){z(e)||R(e)?(t(e),y(X(!0))):y(W())}))}}),[f.status,f.hasError,f.processingResponse,I,S,z,R,B,P]);var L=Object(d.b)(r),A={product:r,productType:r.type||"simple",productIsPurchasable:Object(d.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:L,showFormElements:c&&L,quantity:f.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:f.requestParams,isIdle:f.status===m,isDisabled:f.status===O,isProcessing:f.status===g,isBeforeProcessing:f.status===j,isAfterProcessing:f.status===h,hasError:f.hasError,eventRegistration:T,dispatchActions:I};return Object(n.createElement)(Se.Provider,{value:A},t)},De=r(13),Be=r.n(De),ze=r(134),Re=r(33),Te=r(536);function Ie(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 Le=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,i=e.hasError,l=e.isProcessing,p=e.requestParams,d=Object(a.b)(),f=d.hasValidationErrors,m=d.showAllValidationErrors,O=Object(b.a)(),g=O.addErrorNotice,j=O.removeNotice,h=Object(ze.a)().receiveCart,v=Object(n.useState)(!1),y=s()(v,2),w=y[0],E=y[1],_=!i&&l,k=Object(n.useCallback)((function(){return!f||(m(),{type:"error"})}),[f,m]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var P=Object(n.useCallback)((function(){E(!0),j("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},p);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?h(r):(r.body&&r.body.message?g(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):g(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1),Object(Te.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,g,j,h,t,c,p]);return Object(n.useEffect)((function(){_&&!w&&P()}),[_,P,w]),null},Ae=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(a.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Le,null)))},Ve=r(44),Fe=r(6),Me=r(73),He=(r(390),r(99)),qe=r(61),We=r(563),Ue=r(842),Qe=function(e){var t=e.className,r=e.href,c=e.text;return Object(n.createElement)(He.a,{className:t,href:r,rel:"nofollow"},c)},Ye=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)(He.a,{className:t,disabled:o,showSpinner:c,onClick:i},a&&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"),!!a&&Object(n.createElement)(qe.a,{srcElement:We.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,i=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ue.a)(o.id||0).cartQuantity,m=Object(n.useState)(!1),O=s()(m,2),g=O[0],j=O[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||j(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:f,isDisabled:i,isProcessing:l,isDone:g,onClick:function(){return d.submitForm()}}):Object(n.createElement)(Qe,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ke=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)}})},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 Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=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)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},Je=(r(562),r(51)),Ze=r.n(Je),et=r(4),tt=r(9),rt=r(232),nt={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,i=e.value,s=void 0===i?"":i,l=e.onChange,b=void 0===l?function(){}:l,p=e.errorMessage,d=void 0===p?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):p,f=Object(a.b)(),m=f.getValidationError,O=f.setValidationErrors,g=f.clearValidationError,j=t,h=m(j)||{};return Object(tt.useEffect)((function(){s?g(j):O(ee()({},j,{message:d,hidden:!0}))}),[s,j,d,g,O]),Object(tt.useEffect)((function(){return function(){g(j)}}),[j,g]),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:s||"",options:[nt].concat(Ze()(c)),onChange:b,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(rt.a,{propertyName:j,elementId:j}))};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){ee()(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),{},ee()({},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){ee()(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(l.a)(t),a=Object(l.a)(r),i=Object(n.useState)(0),u=s()(i,2),b=u[0],p=u[1],d=Object(n.useState)({}),f=s()(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),{},ee()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Fe.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)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("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)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},ft=function(){return Object(n.createElement)(Ge,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)($e,null):null:Object(n.createElement)(Ge,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ve.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Fe.isEmpty)(c)});return Object(n.createElement)(Ae,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},399:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(33),u=r(44),l=r(14),b=r(5),p=function(e){var t=e.color,r=e.fontSize;return Object(b.W)()?{color:t,fontSize:r}:{}},d=r(73);r(552),t.a=Object(d.withProductDataContext)((function(e){var t,r,n,a=e.className,d=e.headingLevel,f=void 0===d?2:d,m=e.productLink,O=void 0===m||m,g=e.align,j=e.color,h=e.customColor,v=e.fontSize,y=e.customFontSize,w=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,_="h".concat(f),k=Object(l.getColorClassName)("color",j),P=Object(l.getFontSizeClass)(v),C=i()((t={"has-text-color":j||h,"has-font-size":v||y},c()(t,k,k),c()(t,P,P),t));if(!E.id)return Object(o.createElement)(_,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(w,"__product-title"),w),c()(n,"wc-block-components-product-title--align-".concat(g),g&&Object(b.W)()),c()(n,C,Object(b.W)()),n)),style:p({color:h,fontSize:y})});var S=Object(s.decodeEntities)(E.name);return Object(o.createElement)(_,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(w,"__product-title"),w),c()(r,"wc-block-components-product-title--align-".concat(g),g&&Object(b.W)()),r))},O?Object(o.createElement)("a",{href:E.permalink,rel:"nofollow",className:i()(c()({},C,Object(b.W)())),style:p({color:h,fontSize:y})},S):Object(o.createElement)("span",{className:i()(c()({},C,Object(b.W)())),style:p({color:h,fontSize:y})},S))}))},4:function(e,t){!function(){e.exports=this.wp.components}()},40:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"f",(function(){return O})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return j})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(8),c=r.n(n),o=r(18),a=r(13),i=r.n(a),s=r(6),u=r(5);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=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,l=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={per_page:u.u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},l=[Object(o.addQueryArgs)("/wc/store/products",b(b({},s),i))];return u.u&&r.length&&l.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),l}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(l.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return b(b({},e),{},{parent:0})}))})).catch((function(e){throw e}))},d=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},m=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},O=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:u.x?100:0,orderby:u.x?"count":"name",order:u.x?"desc":"asc",search:n})];return u.x&&r.length&&c.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),c}({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")}))},g=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",b({per_page:0},e))})},j=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})})},v=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))}},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(15),c=r.n(n),o=r(37),a=r.n(o),i=function(){var e=a()(c.a.mark((function e(t){var r;return c.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)}}()},44:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(9)),i=r(7),s=r.n(i);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=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,u=null!=r,b=null!=n;return!u&&b?(t=c||"span",i=l(l({},i),{},{className:s()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,n)):(t=c||a.Fragment,u&&b&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))};b.defaultProps={wrapperProps:{}},t.a=b},49:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(47));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")))}},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"J",(function(){return o})),r.d(t,"P",(function(){return a})),r.d(t,"z",(function(){return i})),r.d(t,"B",(function(){return s})),r.d(t,"l",(function(){return u})),r.d(t,"A",(function(){return l})),r.d(t,"D",(function(){return b})),r.d(t,"n",(function(){return p})),r.d(t,"C",(function(){return d})),r.d(t,"m",(function(){return f})),r.d(t,"F",(function(){return m})),r.d(t,"u",(function(){return O})),r.d(t,"x",(function(){return g})),r.d(t,"r",(function(){return j})),r.d(t,"s",(function(){return h})),r.d(t,"t",(function(){return v})),r.d(t,"j",(function(){return y})),r.d(t,"L",(function(){return w})),r.d(t,"Q",(function(){return E})),r.d(t,"p",(function(){return _})),r.d(t,"q",(function(){return k})),r.d(t,"o",(function(){return P})),r.d(t,"I",(function(){return C})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return N})),r.d(t,"w",(function(){return x})),r.d(t,"T",(function(){return B})),r.d(t,"U",(function(){return z})),r.d(t,"K",(function(){return R})),r.d(t,"a",(function(){return T})),r.d(t,"N",(function(){return I})),r.d(t,"b",(function(){return L})),r.d(t,"M",(function(){return A})),r.d(t,"E",(function(){return V})),r.d(t,"h",(function(){return F})),r.d(t,"O",(function(){return q})),r.d(t,"g",(function(){return W})),r.d(t,"i",(function(){return U})),r.d(t,"H",(function(){return Q})),r.d(t,"G",(function(){return Y})),r.d(t,"S",(function(){return G})),r.d(t,"R",(function(){return K})),r.d(t,"d",(function(){return X})),r.d(t,"e",(function(){return $})),r.d(t,"f",(function(){return J})),r.d(t,"y",(function(){return Z})),r.d(t,"X",(function(){return te})),r.d(t,"Y",(function(){return re})),r.d(t,"V",(function(){return ne})),r.d(t,"W",(function(){return ce}));var n=r(3),c=Object(n.getSetting)("currentUserIsAdmin",!1),o=Object(n.getSetting)("reviewRatingsEnabled",!0),a=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),u=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),p=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),f=Object(n.getSetting)("default_height",500),m=Object(n.getSetting)("placeholderImgSrc",""),O=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),g=Object(n.getSetting)("limitTags"),j=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),v=Object(n.getSetting)("homeUrl",""),y=Object(n.getSetting)("couponsEnabled",!0),w=Object(n.getSetting)("shippingEnabled",!0),E=Object(n.getSetting)("taxesEnabled",!0),_=Object(n.getSetting)("displayItemizedTaxes",!1),k=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),P=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),C=Object(n.getSetting)("productCount",0),S=Object(n.getSetting)("attributes",[]),N=Object(n.getSetting)("isShippingCalculatorEnabled",!0),x=Object(n.getSetting)("isShippingCostHidden",!1),D=Object(n.getSetting)("woocommerceBlocksPhase",1),B=Object(n.getSetting)("wcBlocksAssetUrl",""),z=Object(n.getSetting)("wcBlocksBuildUrl",""),R=Object(n.getSetting)("shippingCountries",{}),T=Object(n.getSetting)("allowedCountries",{}),I=Object(n.getSetting)("shippingStates",{}),L=Object(n.getSetting)("allowedStates",{}),A=Object(n.getSetting)("shippingMethodsExist",!1),V=Object(n.getSetting)("paymentGatewaySortOrder",[]),F=Object(n.getSetting)("checkoutShowLoginReminder",!0),M={id:0,title:"",permalink:""},H=Object(n.getSetting)("storePages",{shop:M,cart:M,checkout:M,privacy:M,terms:M}),q=H.shop.permalink,W=H.checkout.id,U=H.checkout.permalink,Q=H.privacy.permalink,Y=H.privacy.title,G=H.terms.permalink,K=H.terms.title,X=H.cart.id,$=H.cart.permalink,J=Object(n.getSetting)("checkoutAllowsGuest",!1),Z=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),ee=r(17),te=function(e,t){if(D>2)return Object(ee.registerBlockType)(e,t)},re=function(e,t){if(D>1)return Object(ee.registerBlockType)(e,t)},ne=function(){return D>2},ce=function(){return D>1}},533:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(164),u=r(258),l=r(44),b=r(14),p=r(5),d=r(73);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,h=e.customFontSize,v=e.saleFontSize,y=e.customSaleFontSize,w=e.color,E=e.customColor,_=e.saleColor,k=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)(v),z=i()((t={"has-text-color":w||E,"has-font-size":j||h},c()(t,N,N),c()(t,x,x),t)),R=i()((r={"has-text-color":_||k,"has-font-size":v||y},c()(r,D,D),c()(r,B,B),r)),T={color:E,fontSize:h},I={color:k,fontSize:y},L=C.prices,A=Object(u.c)(L),V=L.price!==L.regular_price,F=V?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,R,Object(p.W)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,z,Object(p.W)()),a)),M=V?I:T;return Object(o.createElement)(s.a,{align:g,className:S,currency:A,price:L.price,priceClassName:F,priceStyle:Object(p.W)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,z,Object(p.W)()),m)),regularPriceStyle:Object(p.W)()?T:{}})}))},534:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(44),l=r(73),b=(r(555),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,"star-rating","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)))}))},535:function(e,t,r){"use strict";r.r(t);var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(842),p=r(33),d=r(536),f=r(44),m=r(73),O=(r(556),function(e){var t=e.product,r=Object(i.useRef)(!0),n=t.id,o=t.permalink,a=t.add_to_cart,s=t.has_options,f=t.is_purchasable,m=t.is_in_stock,O=Object(b.a)(n),g=O.cartQuantity,j=O.addingToCart,h=O.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(d.c)()}),[g]);var v=Number.isFinite(g)&&g>0,y=!s&&f&&m,w=Object(p.decodeEntities)((null==a?void 0:a.description)||""),E=v?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",k={};return y?k.onClick=function(){h()}:(k.href=o,k.rel="nofollow"),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:v}),disabled:j},k),E)}),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))}))},536:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return a}));var n=window.Event||null,c=function(e,t){var r=t.bubbles,c=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element;if(i||(i=document.body),"function"==typeof n){var s=new n(e,{bubbles:c,cancelable:a});i.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,a),i.dispatchEvent(u)}},o=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},537:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(176),u=r(3),l=r(44),b=r(73);r(557);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;if(!a)return null;var b=Object(u.getSetting)("wordCountType","words");return Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:b})}))},538:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(73);r(558);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}))},539:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(6),b=r(73);r(559);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))}))))}))},540:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(6),b=r(73);r(560);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))}))))}))},541:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(44),l=r(73),b=(r(561),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))}))},542:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(9),c=function(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,r.current]),r.current}},55:function(e,t){!function(){e.exports=this.wp.keycodes}()},552:function(e,t){},553:function(e,t){},554:function(e,t){},555:function(e,t){},556:function(e,t){},557:function(e,t){},558:function(e,t){},559:function(e,t){},56:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(27),s=r.n(i),u=r(0),l=r(183),b=r(7),p=r.n(b);r(193);function d(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?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(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=s()(e,["className","value","currency","onValueChange"]);if("-"===r)return null;var i=r/Math.pow(10,n.minorUnit);if(!Number.isFinite(i))return null;var b=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),d=f(f(f({displayType:"text"},a),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}),m=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:b},d,{value:i,onValueChange:m}))}},560:function(e,t){},561:function(e,t){},562:function(e,t){},563:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},57:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(46),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},61:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(27),a=r.n(o),i=r(9);r(2);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,o=a()(e,["srcElement","size"]);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){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}({width:n,height:n},o))}},73:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},74:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(24),s=r.n(i),u=r(19),l=r.n(u),b=r(22),p=r.n(b),d=r(23),f=r.n(d),m=r(12),O=r.n(m),g=r(0),j=r(6),h=r(7),v=r.n(h),y=r(4),w=r(25);r(122);function E(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 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=E(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:v()("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.isDefault=!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)(_)},75:function(e,t){!function(){e.exports=this.wp.hooks}()},77:function(e,t){!function(){e.exports=this.ReactDOM}()},78:function(e,t){!function(){e.exports=this.wp.dom}()},81:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(4)),i=r(5);t.a=function(e){var t=e.columns,r=e.rows,s=e.setAttributes,u=e.alignButtons;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,i.B,i.z);s({columns:Object(o.isNaN)(t)?"":t})},min:i.B,max:i.z}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,i.D,i.A);s({rows:Object(o.isNaN)(t)?"":t})},min:i.D,max:i.A}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:u?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:u,onChange:function(){return s({alignButtons:!u})}}))}},811:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},818:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},826:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},827:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(5),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.T+"img/pennant.jpg",thumbnail:c.T+"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}]},83:function(e,t){!function(){e.exports=this.wp.viewport}()},832:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},839:function(e,t,r){e.exports=r(899)},840:function(e,t){},841:function(e,t){},842:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),c=r.n(n),o=r(0),a=r(36),i=r(134),s=r(41),u=r(33),l=r(140),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)(s.CART_STORE_KEY).addItemToCart,r=Object(i.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],h=g[1],v=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==v.current&&(v.current=t)}),[n,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){f(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},844:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},845:function(e,t){},846:function(e,t){},847:function(e,t){},848:function(e,t){},86:function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(6),u=r(46),l=r.n(u);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=Object(i.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}}),f=function(){return Object(i.useContext)(d)},m=function(e){var t=e.children,r=Object(i.useState)({}),n=a()(r,2),o=n[0],u=n[1],b=Object(i.useCallback)((function(e){return o[e]}),[o]),f=Object(i.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),m=Object(i.useCallback)((function(e){u((function(t){return t[e]?Object(s.omit)(t,[e]):t}))}),[]),O=Object(i.useCallback)((function(){u({})}),[]),g=Object(i.useCallback)((function(e){e&&u((function(t){return e=Object(s.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:p(p({},t),e)}))}),[]),j=Object(i.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=p(p({},r[e]),t);return l()(r[e],n)?r:p(p({},r),{},c()({},e,n))}))}),[]),h={getValidationError:b,setValidationErrors:g,clearValidationError:m,clearAllValidationErrors:O,hideValidationError:Object(i.useCallback)((function(e){j(e,{hidden:!0})}),[j]),showValidationError:Object(i.useCallback)((function(e){j(e,{hidden:!1})}),[j]),showAllValidationErrors:Object(i.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=p(p({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:p(p({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:f};return Object(i.createElement)(d.Provider,{value:h},t)}},87:function(e,t){!function(){e.exports=this.wp.a11y}()},899:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(14),l=r(17),b=r(61),p=r(58),d=Object(i.createElement)(p.a,{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(5),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.V)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},h=r(391),v=r(4),y=r(25),w=r(152),E=r(399),_=r(11),k=r.n(_),P=r(143),C=r(27),S=r.n(C);r(841);var N=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(v.Button,a()({className:c},n))},x=r(44),D=(r(840),function(e){return function(t){return function(r){var n=Object(x.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=k()(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)(v.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)(v.Button,{isDefault:!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)(v.Toolbar,null,Object(i.createElement)(N,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.a,{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"})),z=Object(s.__)("Product Title","woo-gutenberg-products-block"),R=Object(i.createElement)(b.a,{srcElement:B}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),I=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.W)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.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.W)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(v.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)(v.Disabled,null,Object(i.createElement)(E.a,o)))},L=Object(f.W)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:R,label:z,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(I):I;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 V(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 F={title:z,description:T,icon:{src:R,foreground:"#874FB9"},attributes:h.a,edit:L};Object(l.registerBlockType)("woocommerce/product-title",V(V({},j),F));var M=r(533),H=r(361),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),W=Object(i.createElement)(b.a,{srcElement:H.a}),U=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),Q=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)(v.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},Y=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.W)()&&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.W)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(Q,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(Q,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},G=Object(f.W)()?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"}),D({icon:W,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(Y):Y;function K(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 X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $={productId:{type:"number",default:0}};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 Z(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){c()(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}Object(f.W)()&&($=X(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 ee={title:q,description:U,icon:{src:W,foreground:"#874FB9"},attributes:$,edit:G};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(392),re=r(191),ne=r(74),ce=r(3),oe=r(393),ae=Object(i.createElement)(p.a,{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"})),ie=Object(s.__)("Product Image","woo-gutenberg-products-block"),se=Object(i.createElement)(b.a,{srcElement:ae}),ue=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),le=D({icon:se,label:ie,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)(v.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.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)(v.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)(ne.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)(ne.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(re.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(ce.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)(v.Disabled,null,Object(i.createElement)(oe.a,t)))}));function be(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 pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var de={title:ie,description:ue,icon:{src:se,foreground:"#874FB9"},attributes:te.a,edit:le};Object(l.registerBlockType)("woocommerce/product-image",pe(pe({},j),de));var fe={productId:{type:"number",default:0}},me=r(534),Oe=r(826),ge=Object(s.__)("Product Rating","woo-gutenberg-products-block"),je=Object(i.createElement)(b.a,{srcElement:Oe.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 ve(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 ye={title:ge,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:je,foreground:"#874FB9"},attributes:fe,edit:D({icon:je,label:ge,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(me.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",ve(ve({},j),ye));var we={productId:{type:"number",default:0}},Ee=r(535),_e=r(844),ke=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:_e.a});function Ce(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 Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:ke,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:Pe,foreground:"#874FB9"},attributes:we,edit:D({icon:Pe,label:ke,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)(v.Disabled,null,Object(i.createElement)(Ee.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Se(Se({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(537),Be=Object(i.createElement)(p.a,{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"})),ze=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Re=Object(i.createElement)(b.a,{srcElement:Be});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 Ie(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 Le={title:ze,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Re,foreground:"#874FB9"},attributes:xe,edit:D({icon:Re,label:ze,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)(De.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Ie(Ie({},j),Le));var Ae={productId:{type:"number",default:0}},Ve=r(266),Fe=r(818),Me=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),He=Object(i.createElement)(b.a,{srcElement:Fe.a});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}function We(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){c()(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}var Ue={title:Me,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:He,foreground:"#874FB9"},supports:{html:!1},attributes:Ae,edit:D({icon:He,label:Me,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)(Ve.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",We(We({},j),Ue));var Qe={productId:{type:"number",default:0}},Ye=r(135),Ge=r(538),Ke=Object(i.createElement)(p.a,{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"})),Xe=Object(s.__)("Product SKU","woo-gutenberg-products-block"),$e=Object(i.createElement)(b.a,{srcElement:Ke});function Je(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 Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var et={title:Xe,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:$e,foreground:"#874FB9"},attributes:Qe,edit:D({icon:$e,label:Xe,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)(Ye.a,null),Object(i.createElement)(Ge.default,t))}))};Object(f.X)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(539),nt=r(811),ct=Object(s.__)("Product Category List","woo-gutenberg-products-block"),ot=Object(i.createElement)(b.a,{srcElement:nt.a});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){c()(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={title:ct,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:ot,foreground:"#874FB9"},attributes:tt,edit:D({icon:ot,label:ct,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)(Ye.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.X)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(540),bt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),pt=Object(i.createElement)(b.a,{srcElement:Fe.a});function dt(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?dt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mt={title:bt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:pt,foreground:"#874FB9"},attributes:ut,edit:D({icon:pt,label:bt,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)(Ye.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.X)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(541),jt=Object(i.createElement)(p.a,{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"),vt=Object(i.createElement)(b.a,{srcElement:jt});function yt(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 wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Et={title:ht,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:vt,foreground:"#874FB9"},attributes:Ot,edit:D({icon:vt,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)(Ye.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.X)("woocommerce/product-stock-indicator",wt(wt({},j),Et));var _t=r(929),kt=(r(390),r(398)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),Ct=Object(i.createElement)(b.a,{srcElement:_e.a});function St(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 Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xt={title:Pt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ct,foreground:"#874FB9"},edit:D({icon:Ct,label:Pt,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(x.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)(Ye.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(_t.b)(n)?Object(i.createElement)(v.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)(v.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)(v.Disabled,null,Object(i.createElement)(kt.a,t)))})),attributes:r(397).a};Object(f.X)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(21),Bt=r.n(Dt),zt=r(19),Rt=r.n(zt),Tt=r(22),It=r.n(Tt),Lt=r(23),At=r.n(Lt),Vt=r(12),Ft=r.n(Vt),Mt=r(36),Ht=(r(2),r(81)),qt=r(927),Wt=r(827),Ut=r(167),Qt=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})},Yt=function(e,t){return Object(i.createElement)(v.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)(v.Button,{className:"wc-block-products__add-product-button",isDefault:!0,isLarge:!0,href:ce.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)(v.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")))},Gt=function(e,t){return Object(i.createElement)(v.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 Kt(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?Kt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $t=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Jt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Xt(Xt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};r(845);function Zt(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 er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(v.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:er(er({},r),{},{orderBy:!r.orderBy})})}})},rr=function(e,t){return Object(i.createElement)(v.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})}})},nr=r(24),cr=r.n(nr),or=r(9),ar=r(53),ir=r.n(ar),sr=r(6),ur=r(48),lr=(r(848),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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{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)(ur.a,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});lr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var br=lr,pr=r(149),dr=(r(847),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})}),fr=r(192),mr=Object(fr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(x.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(qt.a)(t);return n.map((function(n,s){var u=k()(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))})),Or=r(171),gr=r(206),jr=r(41),hr=r(60);function vr(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 yr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(gr.a)(yr(yr({},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(hr.a)(i),u=Object(hr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(jr.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",yr(yr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},Er=r(542),_r=r(184),kr=r(87),Pr=(r(846),r(144)),Cr=function(){var e=Object(x.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:Pr.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")))},Sr=r(832),Nr=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(x.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:Sr.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")))};function xr(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 Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Br=Object(_r.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=Object(Or.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return Dr(Dr({},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*o,page:r})}({attributes:t,sortValue:o,currentPage:r})),l=k()(u,1)[0],b=wr(l),p=b.products,d=b.totalProducts,f=b.productsLoading,m=Object(x.useInnerBlockLayoutContext)().parentClassName,g=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,["order","orderby","page","per_page"])}(l),j=Object(Or.b)("attributes",[]),h=k()(j,2),v=h[0],y=h[1],w=Object(Or.b)("min_price"),E=k()(w,2),_=E[0],P=E[1],C=Object(Or.b)("max_price"),N=k()(C,2),D=N[0],B=N[1],z=Object(Er.a)({totalQuery:g,totalProducts:d},(function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(sr.isEqual)(t,c)&&Number.isFinite(r)})),R="object"===ir()(z)&&Object(sr.isEqual)(g,z.totalQuery);Object(i.useEffect)((function(){R||(n(1),z&&function(e){Number.isFinite(e)&&(0===e?Object(kr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(kr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[l]);var T,I,L,A,V,F=t.contentVisibility,M=t.columns*t.rows,H=!Number.isFinite(d)&&R?Math.ceil(z.totalProducts/M):Math.ceil(d/M),q=p.length?p:Array.from({length:M}),W=0!==p.length||f,U=v.length>0||Number.isFinite(_)||Number.isFinite(D);return Object(i.createElement)("div",{className:(T=t.columns,I=t.rows,L=t.alignButtons,A=t.align,V=void 0!==A?"align"+A:"",O()(m,V,"has-"+T+"-columns",{"has-multiple-rows":I>1,"has-aligned-buttons":L}))},F.orderBy&&W&&Object(i.createElement)(dr,{onChange:c,value:o}),!W&&U&&Object(i.createElement)(Nr,{resetCallback:function(){y([]),P(null),B(null)}}),!W&&!U&&Object(i.createElement)(Cr,null),W&&Object(i.createElement)("ul",{className:"".concat(m,"__products")},q.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)(mr,{key:e.id||r,attributes:t,product:e})}))),H>1&&Object(i.createElement)(br,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:H}))})),zr=function(e){var t=e.attributes,r=Object(i.useState)(1),n=k()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=k()(a,2),u=s[0],l=s[1];Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]);return Object(i.createElement)(Br,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},Rr=r(175);function Tr(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 r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return At()(this,r)}}var Ir=function(e){It()(r,e);var t=Tr(r);function r(){return Bt()(this,r),t.apply(this,arguments)}return cr()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?Rr.a:Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(zr,{attributes:t,urlParameterSuffix:r}))}}]),r}(or.Component);function Lr(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 r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return At()(this,r)}}var Ar=function(e){It()(r,e);var t=Lr(r);function r(){var e;Bt()(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()(Rt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Rt()(e),"blockMap",Object(qt.a)("woocommerce/all-products")),c()(Rt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Rt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Rt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Rt()(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()(Rt()(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)(v.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ht.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(v.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},tr(r,n),rr(r,n)))})),c()(Rt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(v.Toolbar,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Rt()(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)(v.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)(v.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)(x.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)(x.ProductDataContextProvider,{product:Wt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(v.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,isLarge:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Jt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(v.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)(v.IconButton,{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=[];$t.map((function(e){var t=k()(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()(Rt()(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)(v.Disabled,null,Object(i.createElement)(Ir,{attributes:t})):Gt(c,o)})),c()(Rt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return f.r?Object(i.createElement)("div",{className:Qt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):Yt(n,c)})),e}return r}(i.Component),Vr=Object(y.compose)(v.withSpokenMessages,Object(Mt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Mt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Ar),Fr={columns:f.l,rows:f.n,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:$t,isPreview:!1};function Mr(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 Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(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:Fr,edit:function(e){return Object(i.createElement)(Vr,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:Qt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Hr(Hr({},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:Qt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},9:function(e,t){!function(){e.exports=this.React}()},927:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(57),c=r(0),o=r(5);r.p=o.U,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(11)]).then(r.bind(null,533))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(3),r.e(10)]).then(r.bind(null,947))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(17)]).then(r.bind(null,948))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,534))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(2),r.e(8)]).then(r.bind(null,535))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,537))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,266))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,538))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,539))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,540))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,541))}))}),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(7)]).then(r.bind(null,949))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},929: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")}},94:function(e,t){!function(){e.exports=this.wp.date}()},95:function(e,t){!function(){e.exports=this.wp.autop}()},99:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),i=r(0),s=r(279),u=(r(2),r(7)),l=r.n(u);r(238);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,["className","showSpinner","children"]),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:b},u),n&&Object(i.createElement)("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}}});
build/all-reviews.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', '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'), 'version' => 'f04b522b54fa91ca74169ba10cae86e4');
1
+ <?php return array('dependencies' => array('lodash', 'react', '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'), 'version' => 'e1d1c40be959407de135204fe6b50e5c');
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={6: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([820,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},121:function(e,t){},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},139: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 p}));var n=r(0),o=r(1),c=r(191),i=r(4),a=r(14),s=r(3),l=r(5),u=r(73),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){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&&!l.J&&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)(u.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&&!l.P&&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"})}))))},p=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}))}},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},146:function(e,t,r){"use strict";var n=r(0),o=r(56),c=Object(n.createElement)(o.a,{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},149:function(e,t){},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},151:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(48),a=r(192);r(202);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.a,{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)}))))}))},159:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(5),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.T+"img/avatar.jpg",96:o.T+"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.T+"img/avatar.jpg",96:o.T+"img/avatar.jpg"},rating:null,verified:!1}]}}},17:function(e,t){!function(){e.exports=this.wp.blocks}()},182: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}}},183:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),i=(r(201),r(69));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},188:function(e,t,r){"use strict";var n=r(21),o=r.n(n),c=r(24),i=r.n(c),a=r(22),s=r.n(a),l=r(23),u=r.n(l),b=r(12),d=r.n(b),p=r(0),w=r(1),g=r(9),f=(r(2),r(6)),m=r(4),v=r(5),h=r(92),O=r(48),j=(r(253),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.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var y=j,_=r(151),k=(r(250),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(8),E=r.n(R),P=r(7),S=r.n(P),C=r(19),N=r.n(C),x=r(228),T=r.n(x),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=T()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=I(e,t,r);return L(e,o-n.length,n)},I=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=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function A(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 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=A(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(g.createRef)(),n.reviewContent=Object(g.createRef)(),n.getButton=n.getButton.bind(N()(n)),n.onClick=n.onClick.bind(N()(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:D(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}(g.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",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(252);var F=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,g=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:S()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||g)&&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||g||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"};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"},Object(p.createElement)("span",{style:r},Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(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(251);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){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 J=function(e){var t=e.attributes,r=e.reviews,n=(v.P||"product"===t.imageType)&&t.showReviewImage,o=v.J&&t.showReviewRating,c=z(z({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(F,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(F,{key:e.id||t,attributes:c,review:e})})))},U=r(10),W=r.n(U),G=r(15),q=r.n(G),Y=r(37),K=r.n(Y),Q=r(46),X=r.n(Q),Z=r(69),$=r(42);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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()(N()(e),"isPreview",!!e.props.attributes.previewReviews),E()(N()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(N()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(N()(e),"setError",function(){var t=K()(q.a.mark((function t(r){var n,o;return q.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,W()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(g.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;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(m.Disabled,null,t.showOrderby&&v.J&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(J,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(y,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(g.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 Date.prototype.toString.call(Reflect.construct(Date,[],(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,g=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:g,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(g.Component);t.a=oe},201:function(e,t){},202:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.compose}()},250:function(e,t){},251:function(e,t){},252:function(e,t){},253:function(e,t){},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},4:function(e,t){!function(){e.exports=this.wp.components}()},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(15),o=r.n(n),c=r(37),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.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)}}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(0),i=(r(2),r(9)),a=r(7),s=r.n(a);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 u(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}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,l=null!=r,b=null!=n;return!l&&b?(t=o||"span",a=u(u({},a),{},{className:s()(a.className,"screen-reader-text")}),Object(c.createElement)(t,a,n)):(t=o||i.Fragment,l&&b&&r!==n?Object(c.createElement)(t,a,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,a,r))};b.defaultProps={wrapperProps:{}},t.a=b},49:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(47));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,r){"use strict";r.d(t,"k",(function(){return o})),r.d(t,"J",(function(){return c})),r.d(t,"P",(function(){return i})),r.d(t,"z",(function(){return a})),r.d(t,"B",(function(){return s})),r.d(t,"l",(function(){return l})),r.d(t,"A",(function(){return u})),r.d(t,"D",(function(){return b})),r.d(t,"n",(function(){return d})),r.d(t,"C",(function(){return p})),r.d(t,"m",(function(){return w})),r.d(t,"F",(function(){return g})),r.d(t,"u",(function(){return f})),r.d(t,"x",(function(){return m})),r.d(t,"r",(function(){return v})),r.d(t,"s",(function(){return h})),r.d(t,"t",(function(){return O})),r.d(t,"j",(function(){return j})),r.d(t,"L",(function(){return y})),r.d(t,"Q",(function(){return _})),r.d(t,"p",(function(){return k})),r.d(t,"q",(function(){return R})),r.d(t,"o",(function(){return E})),r.d(t,"I",(function(){return P})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"w",(function(){return N})),r.d(t,"T",(function(){return T})),r.d(t,"U",(function(){return L})),r.d(t,"K",(function(){return D})),r.d(t,"a",(function(){return I})),r.d(t,"N",(function(){return M})),r.d(t,"b",(function(){return A})),r.d(t,"M",(function(){return B})),r.d(t,"E",(function(){return H})),r.d(t,"h",(function(){return F})),r.d(t,"O",(function(){return J})),r.d(t,"g",(function(){return U})),r.d(t,"i",(function(){return W})),r.d(t,"H",(function(){return G})),r.d(t,"G",(function(){return q})),r.d(t,"S",(function(){return Y})),r.d(t,"R",(function(){return K})),r.d(t,"d",(function(){return Q})),r.d(t,"e",(function(){return X})),r.d(t,"f",(function(){return Z})),r.d(t,"y",(function(){return $})),r.d(t,"X",(function(){return te})),r.d(t,"Y",(function(){return re})),r.d(t,"V",(function(){return ne})),r.d(t,"W",(function(){return oe}));var n=r(3),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),l=Object(n.getSetting)("default_columns",3),u=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",3),p=Object(n.getSetting)("min_height",500),w=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),f=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),m=Object(n.getSetting)("limitTags"),v=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),O=Object(n.getSetting)("homeUrl",""),j=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),k=Object(n.getSetting)("displayItemizedTaxes",!1),R=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),E=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),P=Object(n.getSetting)("productCount",0),S=Object(n.getSetting)("attributes",[]),C=Object(n.getSetting)("isShippingCalculatorEnabled",!0),N=Object(n.getSetting)("isShippingCostHidden",!1),x=Object(n.getSetting)("woocommerceBlocksPhase",1),T=Object(n.getSetting)("wcBlocksAssetUrl",""),L=Object(n.getSetting)("wcBlocksBuildUrl",""),D=Object(n.getSetting)("shippingCountries",{}),I=Object(n.getSetting)("allowedCountries",{}),M=Object(n.getSetting)("shippingStates",{}),A=Object(n.getSetting)("allowedStates",{}),B=Object(n.getSetting)("shippingMethodsExist",!1),H=Object(n.getSetting)("paymentGatewaySortOrder",[]),F=Object(n.getSetting)("checkoutShowLoginReminder",!0),V={id:0,title:"",permalink:""},z=Object(n.getSetting)("storePages",{shop:V,cart:V,checkout:V,privacy:V,terms:V}),J=z.shop.permalink,U=z.checkout.id,W=z.checkout.permalink,G=z.privacy.permalink,q=z.privacy.title,Y=z.terms.permalink,K=z.terms.title,Q=z.cart.id,X=z.cart.permalink,Z=Object(n.getSetting)("checkoutAllowsGuest",!1),$=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),ee=r(17),te=function(e,t){if(x>2)return Object(ee.registerBlockType)(e,t)},re=function(e,t){if(x>1)return Object(ee.registerBlockType)(e,t)},ne=function(){return x>2},oe=function(){return x>1}},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(27),i=r.n(c),a=r(9);r(2);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=i()(e,["srcElement","size"]);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?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))}},69: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(13),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(a.J){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}},73:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(21),i=r.n(c),a=r(24),s=r.n(a),l=r(19),u=r.n(l),b=r(22),d=r.n(b),p=r(23),w=r.n(p),g=r(12),f=r.n(g),m=r(0),v=r(6),h=r(7),O=r.n(h),j=r(4),y=r(25);r(121);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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(v.isFunction)(s)?s(c):s),Object(m.createElement)(j.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)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(m.createElement)(j.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(y.withInstanceId)(k)},820:function(e,t,r){e.exports=r(905)},9:function(e,t){!function(){e.exports=this.React}()},905:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(17),s=r(61),l=r(56),u=Object(c.createElement)(l.a,{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(201),r(14)),d=r(4),p=(r(2),r(188)),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"))},g=r(139),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(g.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(g.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(182),v=r(183),h=r(159);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 j(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:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:v.a})},92:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(61)),i=r(146),a=r(7),s=r.n(a),l=r(4),u=r(49);r(149);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,{isDefault:!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={6: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([828,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},122:function(e,t){},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},137: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 p}));var n=r(0),o=r(1),c=r(191),i=r(4),a=r(14),s=r(3),l=r(5),u=r(74),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){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&&!l.J&&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)(u.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&&!l.P&&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"})}))))},p=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}))}},14:function(e,t){!function(){e.exports=this.wp.blockEditor}()},144:function(e,t,r){"use strict";var n=r(0),o=r(58),c=Object(n.createElement)(o.a,{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},147:function(e,t){},149:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(48),a=r(192);r(201);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.a,{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)}))))}))},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},157:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(5),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.T+"img/avatar.jpg",96:o.T+"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.T+"img/avatar.jpg",96:o.T+"img/avatar.jpg"},rating:null,verified:!1}]}}},17:function(e,t){!function(){e.exports=this.wp.blocks}()},181: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}}},182:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),i=(r(200),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)))}},187:function(e,t,r){"use strict";var n=r(21),o=r.n(n),c=r(24),i=r.n(c),a=r(22),s=r.n(a),l=r(23),u=r.n(l),b=r(12),d=r.n(b),p=r(0),w=r(1),g=r(9),f=(r(2),r(6)),m=r(4),v=r(5),h=r(93),O=r(48),j=(r(257),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.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var y=j,_=r(149),k=(r(254),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(8),E=r.n(R),P=r(7),S=r.n(P),C=r(19),N=r.n(C),x=r(231),T=r.n(x),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=T()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=I(e,t,r);return L(e,o-n.length,n)},I=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=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function A(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 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=A(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(g.createRef)(),n.reviewContent=Object(g.createRef)(),n.getButton=n.getButton.bind(N()(n)),n.onClick=n.onClick.bind(N()(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:D(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}(g.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",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(256);var F=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,g=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:S()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||g)&&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||g||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"};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"},Object(p.createElement)("span",{style:r},Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(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(255);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){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 J=function(e){var t=e.attributes,r=e.reviews,n=(v.P||"product"===t.imageType)&&t.showReviewImage,o=v.J&&t.showReviewRating,c=z(z({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(F,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(F,{key:e.id||t,attributes:c,review:e})})))},U=r(10),W=r.n(U),G=r(15),q=r.n(G),Y=r(37),K=r.n(Y),Q=r(46),X=r.n(Q),Z=r(70),$=r(42);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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()(N()(e),"isPreview",!!e.props.attributes.previewReviews),E()(N()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(N()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(N()(e),"setError",function(){var t=K()(q.a.mark((function t(r){var n,o;return q.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,W()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(g.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;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(m.Disabled,null,t.showOrderby&&v.J&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(J,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(y,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(g.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 Date.prototype.toString.call(Reflect.construct(Date,[],(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,g=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:g,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(g.Component);t.a=oe},200:function(e,t){},201:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.compose}()},254:function(e,t){},255:function(e,t){},256:function(e,t){},257:function(e,t){},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},4:function(e,t){!function(){e.exports=this.wp.components}()},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(15),o=r.n(n),c=r(37),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.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)}}()},46:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(0),i=(r(2),r(9)),a=r(7),s=r.n(a);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 u(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}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,l=null!=r,b=null!=n;return!l&&b?(t=o||"span",a=u(u({},a),{},{className:s()(a.className,"screen-reader-text")}),Object(c.createElement)(t,a,n)):(t=o||i.Fragment,l&&b&&r!==n?Object(c.createElement)(t,a,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,a,r))};b.defaultProps={wrapperProps:{}},t.a=b},49:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(47));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,r){"use strict";r.d(t,"k",(function(){return o})),r.d(t,"J",(function(){return c})),r.d(t,"P",(function(){return i})),r.d(t,"z",(function(){return a})),r.d(t,"B",(function(){return s})),r.d(t,"l",(function(){return l})),r.d(t,"A",(function(){return u})),r.d(t,"D",(function(){return b})),r.d(t,"n",(function(){return d})),r.d(t,"C",(function(){return p})),r.d(t,"m",(function(){return w})),r.d(t,"F",(function(){return g})),r.d(t,"u",(function(){return f})),r.d(t,"x",(function(){return m})),r.d(t,"r",(function(){return v})),r.d(t,"s",(function(){return h})),r.d(t,"t",(function(){return O})),r.d(t,"j",(function(){return j})),r.d(t,"L",(function(){return y})),r.d(t,"Q",(function(){return _})),r.d(t,"p",(function(){return k})),r.d(t,"q",(function(){return R})),r.d(t,"o",(function(){return E})),r.d(t,"I",(function(){return P})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"w",(function(){return N})),r.d(t,"T",(function(){return T})),r.d(t,"U",(function(){return L})),r.d(t,"K",(function(){return D})),r.d(t,"a",(function(){return I})),r.d(t,"N",(function(){return M})),r.d(t,"b",(function(){return A})),r.d(t,"M",(function(){return B})),r.d(t,"E",(function(){return H})),r.d(t,"h",(function(){return F})),r.d(t,"O",(function(){return J})),r.d(t,"g",(function(){return U})),r.d(t,"i",(function(){return W})),r.d(t,"H",(function(){return G})),r.d(t,"G",(function(){return q})),r.d(t,"S",(function(){return Y})),r.d(t,"R",(function(){return K})),r.d(t,"d",(function(){return Q})),r.d(t,"e",(function(){return X})),r.d(t,"f",(function(){return Z})),r.d(t,"y",(function(){return $})),r.d(t,"X",(function(){return te})),r.d(t,"Y",(function(){return re})),r.d(t,"V",(function(){return ne})),r.d(t,"W",(function(){return oe}));var n=r(3),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),l=Object(n.getSetting)("default_columns",3),u=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",3),p=Object(n.getSetting)("min_height",500),w=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),f=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),m=Object(n.getSetting)("limitTags"),v=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),O=Object(n.getSetting)("homeUrl",""),j=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),k=Object(n.getSetting)("displayItemizedTaxes",!1),R=Object(n.getSetting)("hasDarkEditorStyleSupport",!1),E=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),P=Object(n.getSetting)("productCount",0),S=Object(n.getSetting)("attributes",[]),C=Object(n.getSetting)("isShippingCalculatorEnabled",!0),N=Object(n.getSetting)("isShippingCostHidden",!1),x=Object(n.getSetting)("woocommerceBlocksPhase",1),T=Object(n.getSetting)("wcBlocksAssetUrl",""),L=Object(n.getSetting)("wcBlocksBuildUrl",""),D=Object(n.getSetting)("shippingCountries",{}),I=Object(n.getSetting)("allowedCountries",{}),M=Object(n.getSetting)("shippingStates",{}),A=Object(n.getSetting)("allowedStates",{}),B=Object(n.getSetting)("shippingMethodsExist",!1),H=Object(n.getSetting)("paymentGatewaySortOrder",[]),F=Object(n.getSetting)("checkoutShowLoginReminder",!0),V={id:0,title:"",permalink:""},z=Object(n.getSetting)("storePages",{shop:V,cart:V,checkout:V,privacy:V,terms:V}),J=z.shop.permalink,U=z.checkout.id,W=z.checkout.permalink,G=z.privacy.permalink,q=z.privacy.title,Y=z.terms.permalink,K=z.terms.title,Q=z.cart.id,X=z.cart.permalink,Z=Object(n.getSetting)("checkoutAllowsGuest",!1),$=(Object(n.getSetting)("checkoutAllowsSignup",!1),Object(n.getSetting)("loginUrl","/wp-login.php")),ee=r(17),te=function(e,t){if(x>2)return Object(ee.registerBlockType)(e,t)},re=function(e,t){if(x>1)return Object(ee.registerBlockType)(e,t)},ne=function(){return x>2},oe=function(){return x>1}},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(27),i=r.n(c),a=r(9);r(2);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=i()(e,["srcElement","size"]);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?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))}},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(13),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(a.J){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}},74:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(21),i=r.n(c),a=r(24),s=r.n(a),l=r(19),u=r.n(l),b=r(22),d=r.n(b),p=r(23),w=r.n(p),g=r(12),f=r.n(g),m=r(0),v=r(6),h=r(7),O=r.n(h),j=r(4),y=r(25);r(122);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 Date.prototype.toString.call(Reflect.construct(Date,[],(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(v.isFunction)(s)?s(c):s),Object(m.createElement)(j.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)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(m.createElement)(j.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(y.withInstanceId)(k)},828:function(e,t,r){e.exports=r(913)},9:function(e,t){!function(){e.exports=this.React}()},913:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(17),s=r(61),l=r(58),u=Object(c.createElement)(l.a,{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(200),r(14)),d=r(4),p=(r(2),r(187)),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"))},g=r(137),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(g.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(g.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(181),v=r(182),h=r(157);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 j(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:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:v.a})},93:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(61)),i=r(144),a=r(7),s=r.n(a),l=r(4),u=r(49);r(147);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,{isDefault:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
build/atomic-block-components/add-to-cart-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{111:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(6),a=r.n(n),c=r(7);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 s(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){a()(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}var i="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:i,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,c=t.id,o=t.callback,l=t.priority,d=new Map(e[n]);switch(r){case i:return d.set(c,{priority:l,callback:o}),s(s({},e),{},a()({},n,d));case u:return d.delete(c),s(s({},e),{},a()({},n,d))}return e}},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(58),a=(r(4),r(146),function(e){var t=e.errorMessage,r=void 0===t?"":t,a=e.propertyName,c=void 0===a?"":a,o=e.elementId,s=void 0===o?"":o,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r){var d=u(c)||{};if(!d.message||d.hidden)return null;r=d.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},146:function(e,t){},147:function(e,t){},178: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}},191:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},a={SUCCESS:"success",FAIL:"failure",ERROR:"error"},c={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},o=function(e){return n(e,a.SUCCESS)},s=function(e){return n(e,a.ERROR)},i=function(e){return n(e,a.FAIL)},u=function(){return{responseTypes:a,noticeContexts:c,isSuccessResponse:o,isErrorResponse:s,isFailResponse:i}}},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(111),a=function(e,t){return function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,a);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(24),a=r.n(n),c=r(23),o=r.n(c),s=r(50),i=r.n(s);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw c}}}}function l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},f=function(){var e=i()(a.a.mark((function e(t,r,n){var c,s,i,l,f,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),s=[],i=u(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:p=e.sent,"object"===o()(p)&&s.push(p),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",!s.length||s);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=i()(a.a.mark((function e(t,r,n){var c,s,i,l,f,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),s=!0,i=u(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=24;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:if(p=e.sent,"object"!==o()(p)||void 0!==p.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(s="object"!==o()(p)||p)){e.next=16;break}return e.abrupt("return",s);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),i.e(e.t1);case 29:return e.prev=29,i.f(),e.finish(29);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},275:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o}));var n=window.Event||null,a=function(e,t){var r=t.bubbles,a=void 0!==r&&r,c=t.cancelable,o=void 0!==c&&c,s=t.element;if(s||(s=document.body),"function"==typeof n){var i=new n(e,{bubbles:a,cancelable:o});s.dispatchEvent(i)}else{var u=document.createEvent("Event");u.initEvent(e,a,o),s.dispatchEvent(u)}},c=function(){a("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){a(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},276:function(e,t,r){"use strict";var n=r(49),a=React.createElement(n.a,{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=a},280:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(178);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,a()({},r,n))}}}},287:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(9),a=r.n(n),c=r(0),o=r(13),s=r(81),i=r(15),u=r(17),l=r(80),d=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},f=function(e){var t=Object(o.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(s.a)(),n=r.cartItems,f=r.cartIsLoading,p=Object(l.a)(),b=p.addErrorNotice,m=p.removeNotice,v=Object(c.useState)(!1),h=a()(v,2),g=h[0],O=h[1],y=Object(c.useRef)(d(n,e));return Object(c.useEffect)((function(){var t=d(n,e);t!==y.current&&(y.current=t)}),[n,e]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:g,cartIsLoading:f,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;O(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){b(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){O(!1)}))}}}},293:function(e,t){},294:function(e,t){},303:function(e,t,r){"use strict";r.r(t);var n=r(26),a=r(280),c=(r(4),r(5)),o=r.n(c),s=r(58),i=r(9),u=r.n(i),l=r(0),d=r(1),f=r(37),p=r(80),b=r(191),m=function(e){return e.is_purchasable||!1},v="pristine",h="idle",g="disabled",O="processing",y="before_processing",j="after_processing",E={status:v,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},w="set_pristine",P="set_idle",k="set_disabled",_="set_processing",R="set_before_processing",C="set_after_processing",S="set_processing_response",A="set_has_error",x="set_no_error",T="set_quantity",I="set_request_params",D=w,N=P,q=k,V=_,F=R,Q=C,W=S,B=A,L=x,M=T,H=I,Y=function(){return{type:D}},J=function(){return{type:N}},K=function(){return{type:q}},U=function(){return{type:V}},z=function(){return{type:F}},G=function(){return{type:Q}},X=function(e){return{type:W,data:e}},$=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?B:L;return{type:t}},Z=function(e){return{type:M,quantity:e}},ee=function(e){return{type:H,data:e}},te=r(6),re=r.n(te);function ne(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 ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=w,oe=P,se=k,ie=_,ue=R,le=C,de=S,fe=A,pe=x,be=T,me=I,ve=v,he=h,ge=g,Oe=O,ye=y,je=j,Ee=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,a=r.type,c=r.data;switch(a){case ce:e=E;break;case oe:e=t.status!==he?ae(ae({},t),{},{status:he}):t;break;case se:e=t.status!==ge?ae(ae({},t),{},{status:ge}):t;break;case be:e=n!==t.quantity?ae(ae({},t),{},{quantity:n}):t;break;case me:e=ae(ae({},t),{},{requestParams:ae(ae({},t.requestParams),c)});break;case de:e=ae(ae({},t),{},{processingResponse:c});break;case ie:e=!1===(e=t.status!==Oe?ae(ae({},t),{},{status:Oe,hasError:!1}):t).hasError?e:ae(ae({},e),{},{hasError:!1});break;case ue:e=t.status!==ye?ae(ae({},t),{},{status:ye,hasError:!1}):t;break;case le:e=t.status!==je?ae(ae({},t),{},{status:je}):t;break;case fe:e=t.hasError?t:ae(ae({},t),{},{hasError:!0}),e=t.status===Oe||t.status===ye?ae(ae({},e),{},{status:he}):e;break;case pe:e=t.hasError?ae(ae({},t),{},{hasError:!1}):t}return e!==t&&a!==ce&&e.status===ve&&(e.status=he),e},we=r(111),Pe=r(192),ke="add_to_cart_before_processing",_e="add_to_cart_after_processing_with_success",Re="add_to_cart_after_processing_with_error",Ce=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(Pe.a)(_e,e),onAddToCartProcessingWithError:Object(Pe.a)(Re,e),onAddToCartBeforeProcessing:Object(Pe.a)(ke,e)}},Se=r(193),Ae=Object(l.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){}}}),xe=function(){return Object(l.useContext)(Ae)},Te=function(e){var t=e.children,r=e.product,n=e.showFormElements,a=Object(l.useReducer)(Ee,E),c=u()(a,2),o=c[0],i=c[1],v=Object(l.useReducer)(we.b,{}),w=u()(v,2),P=w[0],k=w[1],_=Object(f.a)(P),R=Object(p.a)(),C=R.addErrorNotice,S=R.removeNotices,A=Object(s.b)().setValidationErrors,x=Object(b.a)(),T=x.isSuccessResponse,I=x.isErrorResponse,D=x.isFailResponse,N=Object(l.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Ce(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Ce(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Ce(k).onAddToCartBeforeProcessing}}),[k]),q=Object(l.useMemo)((function(){return{resetForm:function(){i(Y())},submitForm:function(){i(z())},setQuantity:function(e){i(Z(e))},setHasError:function(e){i($(e))},setRequestParams:function(e){i(ee(e))},setAfterProcessing:function(e){i(X(e)),i(G())}}}),[]);Object(l.useEffect)((function(){var e=o.status,t=!r.id||!m(r);e!==g||t?e!==g&&t&&i(K()):i(J())}),[o.status,r,i]),Object(l.useEffect)((function(){o.status===y&&(S("error"),Object(Se.a)(_,ke,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&C(t),r&&A(r)})),i(J())):i(U())})))}),[o.status,A,C,S,i,_]),Object(l.useEffect)((function(){if(o.status===j){var e={processingResponse:o.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;C(e.message,t)}};if(o.hasError)return void Object(Se.b)(_,Re,e).then((function(r){if(I(r)||D(r))t(r);else{var n,a=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(d.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");C(a,{id:"add-to-cart"})}i(J())}));Object(Se.b)(_,_e,e).then((function(e){I(e)||D(e)?(t(e),i($(!0))):i(J())}))}}),[o.status,o.hasError,o.processingResponse,q,C,I,D,T,_]);var V=function(e){return["simple","variable"].includes(e.type||"simple")}(r),F={product:r,productType:r.type||"simple",productIsPurchasable:m(r),productHasOptions:r.has_options||!1,supportsFormElements:V,showFormElements:n&&V,quantity:o.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:o.requestParams,isIdle:o.status===h,isDisabled:o.status===g,isProcessing:o.status===O,isBeforeProcessing:o.status===y,isAfterProcessing:o.status===j,hasError:o.hasError,eventRegistration:N,dispatchActions:q};return React.createElement(Ae.Provider,{value:F},t)},Ie=r(57),De=r.n(Ie),Ne=r(81),qe=r(17),Ve=r(275);function Fe(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 Qe=function(){var e=xe(),t=e.dispatchActions,r=e.product,n=e.quantity,a=e.eventRegistration,c=e.hasError,o=e.isProcessing,i=e.requestParams,f=Object(s.b)(),b=f.hasValidationErrors,m=f.showAllValidationErrors,v=Object(p.a)(),h=v.addErrorNotice,g=v.removeNotice,O=Object(Ne.a)().receiveCart,y=Object(l.useState)(!1),j=u()(y,2),E=j[0],w=j[1],P=!c&&o,k=Object(l.useCallback)((function(){return!b||(m(),{type:"error"})}),[b,m]);Object(l.useEffect)((function(){var e=a.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[a,k]);var _=Object(l.useCallback)((function(){w(!0),g("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},i);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?h(Object(qe.decodeEntities)(r.body.message),{id:"add-to-cart"}):h(Object(d.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),w(!1),Object(Ve.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,h,g,O,t,n,i]);return Object(l.useEffect)((function(){P&&!E&&_()}),[P,_,E]),null},We=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(s.a,null,React.createElement(Te,{product:r,showFormElements:n},t,React.createElement(Qe,null)))},Be=r(69),Le=r(7),Me=r(188),He=(r(293),r(74)),Ye=r(123),Je=r(276),Ke=r(287),Ue=function(e){var t=e.className,r=e.href,n=e.text;return React.createElement(He.a,{className:t,href:r,rel:"nofollow"},n)},ze=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,a=e.isDisabled,c=e.isDone,o=e.onClick;return React.createElement(He.a,{className:t,disabled:a,showSpinner:n,onClick:o},c&&r>0?Object(d.sprintf)(Object(d._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(d.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(Ye.a,{srcElement:Je.a,alt:Object(d.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=xe(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,a=e.product,c=e.productType,o=e.isDisabled,s=e.isProcessing,i=e.eventRegistration,f=e.hasError,p=e.dispatchActions,b=Object(Ke.a)(a.id||0).cartQuantity,m=Object(l.useState)(!1),v=u()(m,2),h=v[0],g=v[1],O=a.add_to_cart||{url:"",text:""};return Object(l.useEffect)((function(){var e=i.onAddToCartAfterProcessingWithSuccess((function(){return f||g(!0),!0}),0);return function(){e()}}),[i,f]),(t||!n&&"simple"===c)&&r?React.createElement(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:b,isDisabled:o,isProcessing:s,isDone:h,onClick:function(){return p.submitForm()}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:O.url,text:O.text||Object(d.__)("View Product","woo-gutenberg-products-block")})},Xe=function(e){var t=e.disabled,r=e.min,n=e.max,a=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(d.__)("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)},Ze=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,a=e.maxQuantity,c=e.dispatchActions,o=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement($e,null):t.id&&!t.is_in_stock?React.createElement($e,{reason:Object(d.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Xe,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(Ge,null))},et=(r(294),r(51)),tt=r.n(et),rt=r(190),nt=r(3),at=r(143),ct={value:"",label:Object(d.__)("Select an option","woo-gutenberg-products-block")},ot=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,a=e.value,c=void 0===a?"":a,i=e.onChange,u=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(d.__)("Please select a value.","woo-gutenberg-products-block"):l,p=Object(s.b)(),b=p.getValidationError,m=p.setValidationErrors,v=p.clearValidationError,h=t,g=b(h)||{};return Object(nt.useEffect)((function(){c?v(h):m(re()({},h,{message:f,hidden:!0}))}),[c,h,f,v,m]),Object(nt.useEffect)((function(){return function(){v(h)}}),[h,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(rt.SelectControl,{label:Object(qe.decodeEntities)(t),value:c||"",options:[ct].concat(tt()(n)),onChange:u,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":g.message&&!g.hidden})}),React.createElement(at.a,{propertyName:h,elementId:h}))};function st(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?st(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut=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 a=Object.keys(e);return n.filter((function(e){return a.every((function(n){var a=r[n]||"",c=t["id:"+e].attributes[n];return""===a||(null===c||c===a)}))}))},lt=function(e,t,r){var n={},a=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return a.forEach((function(a){var o=e[a],s=it(it({},r),{},re()({},a,null)),i=c?ut(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[a]})):null;n[a]=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(qe.decodeEntities)(r)}:null})).filter(Boolean)}(o.terms,u)})),n};function dt(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?dt(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,a=Object(f.a)(t),c=Object(f.a)(r),o=Object(l.useState)(0),s=u()(o,2),i=s[0],d=s[1],p=Object(l.useState)({}),b=u()(p,2),m=b[0],v=b[1],h=Object(l.useMemo)((function(){return lt(a,c,m)}),[m,a,c]);return Object(l.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(a).length?d(function(e,t,r){return ut(e,t,r)[0]||0}(a,c,m)):i>0&&d(0)}),[m,i,a,c]),Object(l.useEffect)((function(){n({id:i,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[n,i,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(a).map((function(e){return React.createElement(ot,{key:e,attributeName:e,options:h[e],value:m[e],onChange:function(t){v(ft(ft({},m),{},re()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Le.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),a=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===a.length?null:React.createElement(pt,{attributes:n,variationAttributes:a,setRequestParams:r.setRequestParams})},mt=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,a=e.maxQuantity,c=e.dispatchActions,o=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement($e,null):t.id&&!t.is_in_stock?React.createElement($e,{reason:Object(d.__)("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(Xe,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(Ge,null))},vt=function(){return React.createElement(Ge,null)},ht=function(){return React.createElement(rt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},gt=function(){return React.createElement(ht,null)},Ot=function(){var e=xe(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(mt,null):"grouped"===r?React.createElement(gt,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement(Ze,null):null:React.createElement(Ge,null)},yt=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Le.isEmpty)(n)});return React.createElement(We,{product:n,showFormElements:r},React.createElement("div",{className:a},React.createElement(Ot,null)))})),jt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.compose)(Object(a.a)(jt))(yt)},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),a=r(36),c=r.n(a),o=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},50:function(e,t){function r(e,t,r,n,a,c,o){try{var s=e[c](o),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(a,c){var o=e.apply(t,n);function s(e){r(o,a,c,s,i,"next",e)}function i(e){r(o,a,c,s,i,"throw",e)}s(void 0)}))}}},51:function(e,t,r){var n=r(90),a=r(91),c=r(54),o=r(92);e.exports=function(e){return n(e)||a(e)||c(e)||o()}},58:function(e,t,r){"use strict";r.d(t,"b",(function(){return b})),r.d(t,"a",(function(){return m}));var n=r(6),a=r.n(n),c=r(9),o=r.n(c),s=r(0),i=r(7),u=r(36),l=r.n(u);function d(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?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(s.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}}),b=function(){return Object(s.useContext)(p)},m=function(e){var t=e.children,r=Object(s.useState)({}),n=o()(r,2),c=n[0],u=n[1],d=Object(s.useCallback)((function(e){return c[e]}),[c]),b=Object(s.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),m=Object(s.useCallback)((function(e){u((function(t){return t[e]?Object(i.omit)(t,[e]):t}))}),[]),v=Object(s.useCallback)((function(){u({})}),[]),h=Object(s.useCallback)((function(e){e&&u((function(t){return e=Object(i.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:f(f({},t),e)}))}),[]),g=Object(s.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=f(f({},r[e]),t);return l()(r[e],n)?r:f(f({},r),{},a()({},e,n))}))}),[]),O={getValidationError:d,setValidationErrors:h,clearValidationError:m,clearAllValidationErrors:v,hideValidationError:Object(s.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(s.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(s.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=f(f({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:f(f({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:b};return React.createElement(p.Provider,{value:O},t)}},74:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(14),o=r.n(c),s=r(76),i=(r(4),r(5)),u=r.n(i);r(147);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,c=e.children,i=o()(e,["className","showSpinner","children"]),l=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,a()({className:l},i),n&&React.createElement("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),React.createElement("span",{className:"wc-block-components-button__text"},c))}},81:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),a=r(13),c=r(115),o=r(17),s=r(7),i={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(c.a)(),r=t.isEditor,u=t.previewData,l=(null==u?void 0:u.previewCart)||{},d=e.shouldSelect,f=Object(a.useSelect)((function(e,t){var a=t.dispatch;if(!d)return i;if(r)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var c=e(n.CART_STORE_KEY),u=c.getCartData(),f=c.getCartErrors(),p=c.getCartTotals(),b=!c.hasFinishedResolution("getCartData"),m=c.areShippingRatesLoading(),v=a(n.CART_STORE_KEY).receiveCart,h=Object(s.mapValues)(u.shippingAddress,(function(e){return Object(o.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:p,cartIsLoading:b,cartErrors:f,shippingAddress:h,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!h.country,receiveCart:v}}),[d]);return f}},90:function(e,t,r){var n=r(55);e.exports=function(e){if(Array.isArray(e))return n(e)}},91:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},92: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.")}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{112:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(6),a=r.n(n),c=r(7);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 s(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){a()(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}var i="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:i,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,c=t.id,o=t.callback,l=t.priority,d=new Map(e[n]);switch(r){case i:return d.set(c,{priority:l,callback:o}),s(s({},e),{},a()({},n,d));case u:return d.delete(c),s(s({},e),{},a()({},n,d))}return e}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(58),a=(r(4),r(150),function(e){var t=e.errorMessage,r=void 0===t?"":t,a=e.propertyName,c=void 0===a?"":a,o=e.elementId,s=void 0===o?"":o,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r){var d=u(c)||{};if(!d.message||d.hidden)return null;r=d.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},150:function(e,t){},151:function(e,t){},180: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}},194:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},a={SUCCESS:"success",FAIL:"failure",ERROR:"error"},c={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},o=function(e){return n(e,a.SUCCESS)},s=function(e){return n(e,a.ERROR)},i=function(e){return n(e,a.FAIL)},u=function(){return{responseTypes:a,noticeContexts:c,isSuccessResponse:o,isErrorResponse:s,isFailResponse:i}}},195:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(112),a=function(e,t){return function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,a);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(24),a=r.n(n),c=r(23),o=r.n(c),s=r(51),i=r.n(s);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw c}}}}function l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},f=function(){var e=i()(a.a.mark((function e(t,r,n){var c,s,i,l,f,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),s=[],i=u(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:p=e.sent,"object"===o()(p)&&s.push(p),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",!s.length||s);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=i()(a.a.mark((function e(t,r,n){var c,s,i,l,f,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),s=!0,i=u(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=24;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:if(p=e.sent,"object"!==o()(p)||void 0!==p.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(s="object"!==o()(p)||p)){e.next=16;break}return e.abrupt("return",s);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),i.e(e.t1);case 29:return e.prev=29,i.f(),e.finish(29);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},277:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o}));var n=window.Event||null,a=function(e,t){var r=t.bubbles,a=void 0!==r&&r,c=t.cancelable,o=void 0!==c&&c,s=t.element;if(s||(s=document.body),"function"==typeof n){var i=new n(e,{bubbles:a,cancelable:o});s.dispatchEvent(i)}else{var u=document.createEvent("Event");u.initEvent(e,a,o),s.dispatchEvent(u)}},c=function(){a("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){a(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},278:function(e,t,r){"use strict";var n=r(50),a=React.createElement(n.a,{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=a},282:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(180);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,a()({},r,n))}}}},289:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(10),a=r.n(n),c=r(0),o=r(13),s=r(81),i=r(15),u=r(17),l=r(80),d=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},f=function(e){var t=Object(o.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(s.a)(),n=r.cartItems,f=r.cartIsLoading,p=Object(l.a)(),b=p.addErrorNotice,m=p.removeNotice,v=Object(c.useState)(!1),h=a()(v,2),g=h[0],O=h[1],y=Object(c.useRef)(d(n,e));return Object(c.useEffect)((function(){var t=d(n,e);t!==y.current&&(y.current=t)}),[n,e]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:g,cartIsLoading:f,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;O(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){b(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){O(!1)}))}}}},295:function(e,t){},296:function(e,t){},305:function(e,t,r){"use strict";r.r(t);var n=r(26),a=r(282),c=(r(4),r(5)),o=r.n(c),s=r(58),i=r(10),u=r.n(i),l=r(0),d=r(1),f=r(37),p=r(80),b=r(194),m=function(e){return e.is_purchasable||!1},v="pristine",h="idle",g="disabled",O="processing",y="before_processing",j="after_processing",E={status:v,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},w="set_pristine",P="set_idle",k="set_disabled",_="set_processing",R="set_before_processing",C="set_after_processing",S="set_processing_response",A="set_has_error",x="set_no_error",T="set_quantity",I="set_request_params",D=w,N=P,q=k,V=_,F=R,Q=C,W=S,B=A,L=x,M=T,H=I,Y=function(){return{type:D}},J=function(){return{type:N}},K=function(){return{type:q}},U=function(){return{type:V}},z=function(){return{type:F}},G=function(){return{type:Q}},X=function(e){return{type:W,data:e}},$=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?B:L;return{type:t}},Z=function(e){return{type:M,quantity:e}},ee=function(e){return{type:H,data:e}},te=r(6),re=r.n(te);function ne(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 ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=w,oe=P,se=k,ie=_,ue=R,le=C,de=S,fe=A,pe=x,be=T,me=I,ve=v,he=h,ge=g,Oe=O,ye=y,je=j,Ee=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,a=r.type,c=r.data;switch(a){case ce:e=E;break;case oe:e=t.status!==he?ae(ae({},t),{},{status:he}):t;break;case se:e=t.status!==ge?ae(ae({},t),{},{status:ge}):t;break;case be:e=n!==t.quantity?ae(ae({},t),{},{quantity:n}):t;break;case me:e=ae(ae({},t),{},{requestParams:ae(ae({},t.requestParams),c)});break;case de:e=ae(ae({},t),{},{processingResponse:c});break;case ie:e=!1===(e=t.status!==Oe?ae(ae({},t),{},{status:Oe,hasError:!1}):t).hasError?e:ae(ae({},e),{},{hasError:!1});break;case ue:e=t.status!==ye?ae(ae({},t),{},{status:ye,hasError:!1}):t;break;case le:e=t.status!==je?ae(ae({},t),{},{status:je}):t;break;case fe:e=t.hasError?t:ae(ae({},t),{},{hasError:!0}),e=t.status===Oe||t.status===ye?ae(ae({},e),{},{status:he}):e;break;case pe:e=t.hasError?ae(ae({},t),{},{hasError:!1}):t}return e!==t&&a!==ce&&e.status===ve&&(e.status=he),e},we=r(112),Pe=r(195),ke="add_to_cart_before_processing",_e="add_to_cart_after_processing_with_success",Re="add_to_cart_after_processing_with_error",Ce=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(Pe.a)(_e,e),onAddToCartProcessingWithError:Object(Pe.a)(Re,e),onAddToCartBeforeProcessing:Object(Pe.a)(ke,e)}},Se=r(196),Ae=Object(l.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){}}}),xe=function(){return Object(l.useContext)(Ae)},Te=function(e){var t=e.children,r=e.product,n=e.showFormElements,a=Object(l.useReducer)(Ee,E),c=u()(a,2),o=c[0],i=c[1],v=Object(l.useReducer)(we.b,{}),w=u()(v,2),P=w[0],k=w[1],_=Object(f.a)(P),R=Object(p.a)(),C=R.addErrorNotice,S=R.removeNotices,A=Object(s.b)().setValidationErrors,x=Object(b.a)(),T=x.isSuccessResponse,I=x.isErrorResponse,D=x.isFailResponse,N=Object(l.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Ce(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Ce(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Ce(k).onAddToCartBeforeProcessing}}),[k]),q=Object(l.useMemo)((function(){return{resetForm:function(){i(Y())},submitForm:function(){i(z())},setQuantity:function(e){i(Z(e))},setHasError:function(e){i($(e))},setRequestParams:function(e){i(ee(e))},setAfterProcessing:function(e){i(X(e)),i(G())}}}),[]);Object(l.useEffect)((function(){var e=o.status,t=!r.id||!m(r);e!==g||t?e!==g&&t&&i(K()):i(J())}),[o.status,r,i]),Object(l.useEffect)((function(){o.status===y&&(S("error"),Object(Se.a)(_,ke,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&C(t),r&&A(r)})),i(J())):i(U())})))}),[o.status,A,C,S,i,_]),Object(l.useEffect)((function(){if(o.status===j){var e={processingResponse:o.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;C(e.message,t)}};if(o.hasError)return void Object(Se.b)(_,Re,e).then((function(r){if(I(r)||D(r))t(r);else{var n,a=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(d.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");C(a,{id:"add-to-cart"})}i(J())}));Object(Se.b)(_,_e,e).then((function(e){I(e)||D(e)?(t(e),i($(!0))):i(J())}))}}),[o.status,o.hasError,o.processingResponse,q,C,I,D,T,_]);var V=function(e){return["simple","variable"].includes(e.type||"simple")}(r),F={product:r,productType:r.type||"simple",productIsPurchasable:m(r),productHasOptions:r.has_options||!1,supportsFormElements:V,showFormElements:n&&V,quantity:o.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:o.requestParams,isIdle:o.status===h,isDisabled:o.status===g,isProcessing:o.status===O,isBeforeProcessing:o.status===y,isAfterProcessing:o.status===j,hasError:o.hasError,eventRegistration:N,dispatchActions:q};return React.createElement(Ae.Provider,{value:F},t)},Ie=r(57),De=r.n(Ie),Ne=r(81),qe=r(17),Ve=r(277);function Fe(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 Qe=function(){var e=xe(),t=e.dispatchActions,r=e.product,n=e.quantity,a=e.eventRegistration,c=e.hasError,o=e.isProcessing,i=e.requestParams,f=Object(s.b)(),b=f.hasValidationErrors,m=f.showAllValidationErrors,v=Object(p.a)(),h=v.addErrorNotice,g=v.removeNotice,O=Object(Ne.a)().receiveCart,y=Object(l.useState)(!1),j=u()(y,2),E=j[0],w=j[1],P=!c&&o,k=Object(l.useCallback)((function(){return!b||(m(),{type:"error"})}),[b,m]);Object(l.useEffect)((function(){var e=a.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[a,k]);var _=Object(l.useCallback)((function(){w(!0),g("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},i);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?h(Object(qe.decodeEntities)(r.body.message),{id:"add-to-cart"}):h(Object(d.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),w(!1),Object(Ve.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,h,g,O,t,n,i]);return Object(l.useEffect)((function(){P&&!E&&_()}),[P,_,E]),null},We=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(s.a,null,React.createElement(Te,{product:r,showFormElements:n},t,React.createElement(Qe,null)))},Be=r(69),Le=r(7),Me=r(191),He=(r(295),r(74)),Ye=r(126),Je=r(278),Ke=r(289),Ue=function(e){var t=e.className,r=e.href,n=e.text;return React.createElement(He.a,{className:t,href:r,rel:"nofollow"},n)},ze=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,a=e.isDisabled,c=e.isDone,o=e.onClick;return React.createElement(He.a,{className:t,disabled:a,showSpinner:n,onClick:o},c&&r>0?Object(d.sprintf)(Object(d._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(d.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(Ye.a,{srcElement:Je.a,alt:Object(d.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=xe(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,a=e.product,c=e.productType,o=e.isDisabled,s=e.isProcessing,i=e.eventRegistration,f=e.hasError,p=e.dispatchActions,b=Object(Ke.a)(a.id||0).cartQuantity,m=Object(l.useState)(!1),v=u()(m,2),h=v[0],g=v[1],O=a.add_to_cart||{url:"",text:""};return Object(l.useEffect)((function(){var e=i.onAddToCartAfterProcessingWithSuccess((function(){return f||g(!0),!0}),0);return function(){e()}}),[i,f]),(t||!n&&"simple"===c)&&r?React.createElement(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:b,isDisabled:o,isProcessing:s,isDone:h,onClick:function(){return p.submitForm()}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:O.url,text:O.text||Object(d.__)("View Product","woo-gutenberg-products-block")})},Xe=function(e){var t=e.disabled,r=e.min,n=e.max,a=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(d.__)("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)},Ze=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,a=e.maxQuantity,c=e.dispatchActions,o=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement($e,null):t.id&&!t.is_in_stock?React.createElement($e,{reason:Object(d.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Xe,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(Ge,null))},et=(r(296),r(42)),tt=r.n(et),rt=r(193),nt=r(3),at=r(147),ct={value:"",label:Object(d.__)("Select an option","woo-gutenberg-products-block")},ot=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,a=e.value,c=void 0===a?"":a,i=e.onChange,u=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(d.__)("Please select a value.","woo-gutenberg-products-block"):l,p=Object(s.b)(),b=p.getValidationError,m=p.setValidationErrors,v=p.clearValidationError,h=t,g=b(h)||{};return Object(nt.useEffect)((function(){c?v(h):m(re()({},h,{message:f,hidden:!0}))}),[c,h,f,v,m]),Object(nt.useEffect)((function(){return function(){v(h)}}),[h,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(rt.SelectControl,{label:Object(qe.decodeEntities)(t),value:c||"",options:[ct].concat(tt()(n)),onChange:u,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":g.message&&!g.hidden})}),React.createElement(at.a,{propertyName:h,elementId:h}))};function st(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?st(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut=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 a=Object.keys(e);return n.filter((function(e){return a.every((function(n){var a=r[n]||"",c=t["id:"+e].attributes[n];return""===a||(null===c||c===a)}))}))},lt=function(e,t,r){var n={},a=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return a.forEach((function(a){var o=e[a],s=it(it({},r),{},re()({},a,null)),i=c?ut(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[a]})):null;n[a]=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(qe.decodeEntities)(r)}:null})).filter(Boolean)}(o.terms,u)})),n};function dt(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?dt(Object(r),!0).forEach((function(t){re()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,a=Object(f.a)(t),c=Object(f.a)(r),o=Object(l.useState)(0),s=u()(o,2),i=s[0],d=s[1],p=Object(l.useState)({}),b=u()(p,2),m=b[0],v=b[1],h=Object(l.useMemo)((function(){return lt(a,c,m)}),[m,a,c]);return Object(l.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(a).length?d(function(e,t,r){return ut(e,t,r)[0]||0}(a,c,m)):i>0&&d(0)}),[m,i,a,c]),Object(l.useEffect)((function(){n({id:i,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[n,i,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(a).map((function(e){return React.createElement(ot,{key:e,attributeName:e,options:h[e],value:m[e],onChange:function(t){v(ft(ft({},m),{},re()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Le.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),a=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===a.length?null:React.createElement(pt,{attributes:n,variationAttributes:a,setRequestParams:r.setRequestParams})},mt=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,a=e.maxQuantity,c=e.dispatchActions,o=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement($e,null):t.id&&!t.is_in_stock?React.createElement($e,{reason:Object(d.__)("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(Xe,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(Ge,null))},vt=function(){return React.createElement(Ge,null)},ht=function(){return React.createElement(rt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},gt=function(){return React.createElement(ht,null)},Ot=function(){var e=xe(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(mt,null):"grouped"===r?React.createElement(gt,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement(Ze,null):null:React.createElement(Ge,null)},yt=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Le.isEmpty)(n)});return React.createElement(We,{product:n,showFormElements:r},React.createElement("div",{className:a},React.createElement(Ot,null)))})),jt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.compose)(Object(a.a)(jt))(yt)},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),a=r(36),c=r.n(a),o=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},42:function(e,t,r){var n=r(91),a=r(92),c=r(54),o=r(93);e.exports=function(e){return n(e)||a(e)||c(e)||o()}},51:function(e,t){function r(e,t,r,n,a,c,o){try{var s=e[c](o),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(a,c){var o=e.apply(t,n);function s(e){r(o,a,c,s,i,"next",e)}function i(e){r(o,a,c,s,i,"throw",e)}s(void 0)}))}}},58:function(e,t,r){"use strict";r.d(t,"b",(function(){return b})),r.d(t,"a",(function(){return m}));var n=r(6),a=r.n(n),c=r(10),o=r.n(c),s=r(0),i=r(7),u=r(36),l=r.n(u);function d(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?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(s.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}}),b=function(){return Object(s.useContext)(p)},m=function(e){var t=e.children,r=Object(s.useState)({}),n=o()(r,2),c=n[0],u=n[1],d=Object(s.useCallback)((function(e){return c[e]}),[c]),b=Object(s.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),m=Object(s.useCallback)((function(e){u((function(t){return t[e]?Object(i.omit)(t,[e]):t}))}),[]),v=Object(s.useCallback)((function(){u({})}),[]),h=Object(s.useCallback)((function(e){e&&u((function(t){return e=Object(i.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:f(f({},t),e)}))}),[]),g=Object(s.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=f(f({},r[e]),t);return l()(r[e],n)?r:f(f({},r),{},a()({},e,n))}))}),[]),O={getValidationError:d,setValidationErrors:h,clearValidationError:m,clearAllValidationErrors:v,hideValidationError:Object(s.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(s.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(s.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=f(f({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:f(f({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:b};return React.createElement(p.Provider,{value:O},t)}},74:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(14),o=r.n(c),s=r(76),i=(r(4),r(5)),u=r.n(i);r(151);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,c=e.children,i=o()(e,["className","showSpinner","children"]),l=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,a()({className:l},i),n&&React.createElement("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),React.createElement("span",{className:"wc-block-components-button__text"},c))}},81:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),a=r(13),c=r(117),o=r(17),s=r(7),i={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(c.a)(),r=t.isEditor,u=t.previewData,l=(null==u?void 0:u.previewCart)||{},d=e.shouldSelect,f=Object(a.useSelect)((function(e,t){var a=t.dispatch;if(!d)return i;if(r)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var c=e(n.CART_STORE_KEY),u=c.getCartData(),f=c.getCartErrors(),p=c.getCartTotals(),b=!c.hasFinishedResolution("getCartData"),m=c.areShippingRatesLoading(),v=a(n.CART_STORE_KEY).receiveCart,h=Object(s.mapValues)(u.shippingAddress,(function(e){return Object(o.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:p,cartIsLoading:b,cartErrors:f,shippingAddress:h,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!h.country,receiveCart:v}}),[d]);return f}},91:function(e,t,r){var n=r(55);e.exports=function(e){if(Array.isArray(e))return n(e)}},92:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},93: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.")}}}]);
build/atomic-block-components/add-to-cart.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{152:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(8),c=r.n(n),o=r(6);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 s(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 i="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:i,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,o=t.id,a=t.callback,l=t.priority,b=new Map(e[n]);switch(r){case i:return b.set(o,{priority:l,callback:a}),s(s({},e),{},c()({},n,b));case u:return b.delete(o),s(s({},e),{},c()({},n,b))}return e}},229:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(85),o=(r(2),r(236),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},235:function(e,t){},236:function(e,t){},384:function(e,t){},389:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},c={SUCCESS:"success",FAIL:"failure",ERROR:"error"},o={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},a=function(e){return n(e,c.SUCCESS)},s=function(e){return n(e,c.ERROR)},i=function(e){return n(e,c.FAIL)},u=function(){return{responseTypes:c,noticeContexts:o,isSuccessResponse:a,isErrorResponse:s,isFailResponse:i}}},390:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(152),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))}}}},391:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(15),c=r.n(n),o=r(52),a=r.n(o),s=r(37),i=r.n(s);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(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,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},f=function(){var e=i()(c.a.mark((function e(t,r,n){var o,s,i,l,f,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),s=[],i=u(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===a()(d)&&s.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",!s.length||s);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)}}(),d=function(){var e=i()(c.a.mark((function e(t,r,n){var o,s,i,l,f,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),s=!0,i=u(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=24;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:if(d=e.sent,"object"!==a()(d)||void 0!==d.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(s="object"!==a()(d)||d)){e.next=16;break}return e.abrupt("return",s);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),i.e(e.t1);case 29:return e.prev=29,i.f(),e.finish(29);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},392:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},393:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(85),s=r(11),i=r.n(s),u=r(1),l=r(60),b=r(143),f=r(389),d=r(921),p="pristine",O="idle",m="disabled",j="processing",v="before_processing",h="after_processing",y={status:p,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},g="set_pristine",E="set_idle",w="set_disabled",P="set_processing",k="set_before_processing",_="set_after_processing",C="set_processing_response",A="set_has_error",S="set_no_error",x="set_quantity",D="set_request_params",q=g,N=E,R=w,T=P,V=k,F=_,I=C,B=A,Q=S,M=x,W=D,H=function(){return{type:q}},L=function(){return{type:N}},U=function(){return{type:R}},z=function(){return{type:T}},J=function(){return{type:V}},Y=function(){return{type:F}},G=function(e){return{type:I,data:e}},X=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?B:Q;return{type:t}},$=function(e){return{type:M,quantity:e}},K=function(e){return{type:W,data:e}},Z=r(8),ee=r.n(Z);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 re(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){ee()(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 ne=g,ce=E,oe=w,ae=P,se=k,ie=_,ue=C,le=A,be=S,fe=x,de=D,pe=p,Oe=O,me=m,je=j,ve=v,he=h,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,c=r.type,o=r.data;switch(c){case ne:e=y;break;case ce:e=t.status!==Oe?re(re({},t),{},{status:Oe}):t;break;case oe:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case fe:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case de:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),o)});break;case ue:e=re(re({},t),{},{processingResponse:o});break;case ae:e=!1===(e=t.status!==je?re(re({},t),{},{status:je,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case se:e=t.status!==ve?re(re({},t),{},{status:ve,hasError:!1}):t;break;case ie:e=t.status!==he?re(re({},t),{},{status:he}):t;break;case le:e=t.hasError?t:re(re({},t),{},{hasError:!0}),e=t.status===je||t.status===ve?re(re({},e),{},{status:Oe}):e;break;case be:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&c!==ne&&e.status===pe&&(e.status=Oe),e},ge=r(152),Ee=r(390),we="add_to_cart_before_processing",Pe="add_to_cart_after_processing_with_success",ke="add_to_cart_after_processing_with_error",_e=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(Ee.a)(Pe,e),onAddToCartProcessingWithError:Object(Ee.a)(ke,e),onAddToCartBeforeProcessing:Object(Ee.a)(we,e)}},Ce=r(391),Ae=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){}}}),Se=function(){return Object(n.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ye,y),s=i()(o,2),p=s[0],g=s[1],E=Object(n.useReducer)(ge.b,{}),w=i()(E,2),P=w[0],k=w[1],_=Object(l.a)(P),C=Object(b.a)(),A=C.addErrorNotice,S=C.removeNotices,x=Object(a.b)().setValidationErrors,D=Object(f.a)(),q=D.isSuccessResponse,N=D.isErrorResponse,R=D.isFailResponse,T=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:_e(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:_e(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:_e(k).onAddToCartBeforeProcessing}}),[k]),V=Object(n.useMemo)((function(){return{resetForm:function(){g(H())},submitForm:function(){g(J())},setQuantity:function(e){g($(e))},setHasError:function(e){g(X(e))},setRequestParams:function(e){g(K(e))},setAfterProcessing:function(e){g(G(e)),g(Y())}}}),[]);Object(n.useEffect)((function(){var e=p.status,t=!r.id||!Object(d.a)(r);e!==m||t?e!==m&&t&&g(U()):g(L())}),[p.status,r,g]),Object(n.useEffect)((function(){p.status===v&&(S("error"),Object(Ce.a)(_,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&x(r)})),g(L())):g(z())})))}),[p.status,x,A,S,g,_]),Object(n.useEffect)((function(){if(p.status===h){var e={processingResponse:p.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;A(e.message,t)}};if(p.hasError)return void Object(Ce.b)(_,ke,e).then((function(r){if(N(r)||R(r))t(r);else{var n,c=(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");A(c,{id:"add-to-cart"})}g(L())}));Object(Ce.b)(_,Pe,e).then((function(e){N(e)||R(e)?(t(e),g(X(!0))):g(L())}))}}),[p.status,p.hasError,p.processingResponse,V,A,N,R,q,_]);var F=Object(d.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(d.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:F,showFormElements:c&&F,quantity:p.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:p.requestParams,isIdle:p.status===O,isDisabled:p.status===m,isProcessing:p.status===j,isBeforeProcessing:p.status===v,isAfterProcessing:p.status===h,hasError:p.hasError,eventRegistration:T,dispatchActions:V};return Object(n.createElement)(Ae.Provider,{value:I},t)},De=r(13),qe=r.n(De),Ne=r(135),Re=r(33),Te=r(529);function Ve(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 Fe=function(){var e=Se(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,s=e.hasError,l=e.isProcessing,f=e.requestParams,d=Object(a.b)(),p=d.hasValidationErrors,O=d.showAllValidationErrors,m=Object(b.a)(),j=m.addErrorNotice,v=m.removeNotice,h=Object(Ne.a)().receiveCart,y=Object(n.useState)(!1),g=i()(y,2),E=g[0],w=g[1],P=!s&&l,k=Object(n.useCallback)((function(){return!p||(O(),{type:"error"})}),[p,O]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){w(!0),v("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},f);qe()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){qe.a.setNonce(e.headers),e.json().then((function(r){e.ok?h(r):(r.body&&r.body.message?j(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):j(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),w(!1),Object(Te.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,j,v,h,t,c,f]);return Object(n.useEffect)((function(){P&&!E&&_()}),[P,_,E]),null},Ie=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(a.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Fe,null)))},Be=r(44),Qe=r(6),Me=r(72),We=(r(384),r(99)),He=r(61),Le=r(556),Ue=r(834),ze=function(e){var t=e.className,r=e.href,c=e.text;return Object(n.createElement)(We.a,{className:t,href:r,rel:"nofollow"},c)},Je=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(We.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&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"),!!a&&Object(n.createElement)(He.a,{srcElement:Le.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},Ye=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,s=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(Ue.a)(o.id||0).cartQuantity,O=Object(n.useState)(!1),m=i()(O,2),j=m[0],v=m[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||v(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Je,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:s,isProcessing:l,isDone:j,onClick:function(){return d.submitForm()}}):Object(n.createElement)(ze,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ge=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)}})},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 Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ge,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},Ke=(r(555),r(58)),Ze=r.n(Ke),et=r(4),tt=r(9),rt=r(229),nt={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,s=e.value,i=void 0===s?"":s,l=e.onChange,b=void 0===l?function(){}:l,f=e.errorMessage,d=void 0===f?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):f,p=Object(a.b)(),O=p.getValidationError,m=p.setValidationErrors,j=p.clearValidationError,v=t,h=O(v)||{};return Object(tt.useEffect)((function(){i?j(v):m(ee()({},v,{message:d,hidden:!0}))}),[i,v,d,j,m]),Object(tt.useEffect)((function(){return function(){j(v)}}),[v,j]),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:b,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(rt.a,{propertyName:v,elementId:v}))};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){ee()(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 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 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)}))}))},it=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],s=at(at({},r),{},ee()({},c,null)),i=o?st(e,t,s):null,u=null!==i?i.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){ee()(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(l.a)(t),a=Object(l.a)(r),s=Object(n.useState)(0),u=i()(s,2),b=u[0],f=u[1],d=Object(n.useState)({}),p=i()(d,2),O=p[0],m=p[1],j=Object(n.useMemo)((function(){return it(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return st(e,t,r)[0]||0}(o,a,O)):b>0&&f(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),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:j[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},ee()({},e,t)))}})})))},ft=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Qe.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=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ft,{product:t,dispatchers:a}),Object(n.createElement)(Ge,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},pt=function(){return Object(n.createElement)(Ye,null)},Ot=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.")},mt=function(){return Object(n.createElement)(Ot,null)},jt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(mt,null):"external"===r?Object(n.createElement)(pt,null):"simple"===r||"variation"===r?Object(n.createElement)($e,null):null:Object(n.createElement)(Ye,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Be.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Qe.isEmpty)(c)});return Object(n.createElement)(Ie,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(jt,null)))}))},555:function(e,t){},556:function(e,t,r){"use strict";var n=r(0),c=r(56),o=Object(n.createElement)(c.a,{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},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(46),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},85:function(e,t,r){"use strict";r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return O}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),s=r(0),i=r(6),u=r(46),l=r.n(u);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 f(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=Object(s.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}}),p=function(){return Object(s.useContext)(d)},O=function(e){var t=e.children,r=Object(s.useState)({}),n=a()(r,2),o=n[0],u=n[1],b=Object(s.useCallback)((function(e){return o[e]}),[o]),p=Object(s.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),O=Object(s.useCallback)((function(e){u((function(t){return t[e]?Object(i.omit)(t,[e]):t}))}),[]),m=Object(s.useCallback)((function(){u({})}),[]),j=Object(s.useCallback)((function(e){e&&u((function(t){return e=Object(i.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:f(f({},t),e)}))}),[]),v=Object(s.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=f(f({},r[e]),t);return l()(r[e],n)?r:f(f({},r),{},c()({},e,n))}))}),[]),h={getValidationError:b,setValidationErrors:j,clearValidationError:O,clearAllValidationErrors:m,hideValidationError:Object(s.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(s.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(s.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=f(f({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:f(f({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:p};return Object(s.createElement)(d.Provider,{value:h},t)}},921: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")}},941:function(e,t,r){"use strict";r.r(t);var n=r(25),c=r(938),o=r(393),a=r(392);t.default=Object(n.compose)(Object(c.a)(a.a))(o.a)},99:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),s=r(0),i=r(276),u=(r(2),r(7)),l=r.n(u);r(235);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,["className","showSpinner","children"]),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(s.createElement)(i.a,c()({className:b},u),n&&Object(s.createElement)("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{150:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(8),c=r.n(n),o=r(6);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 s(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 i="add_event_callback",u="remove_event_callback",l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:i,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:u,eventType:e}}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.eventType,o=t.id,a=t.callback,l=t.priority,b=new Map(e[n]);switch(r){case i:return b.set(o,{priority:l,callback:a}),s(s({},e),{},c()({},n,b));case u:return b.delete(o),s(s({},e),{},c()({},n,b))}return e}},232:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(86),o=(r(2),r(239),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},238:function(e,t){},239:function(e,t){},390:function(e,t){},394:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=function(e,t){return!!e.type&&e.type===t},c={SUCCESS:"success",FAIL:"failure",ERROR:"error"},o={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},a=function(e){return n(e,c.SUCCESS)},s=function(e){return n(e,c.ERROR)},i=function(e){return n(e,c.FAIL)},u=function(){return{responseTypes:c,noticeContexts:o,isSuccessResponse:a,isErrorResponse:s,isFailResponse:i}}},395:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(150),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))}}}},396:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(15),c=r.n(n),o=r(53),a=r.n(o),s=r(37),i=r.n(s);function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(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 l(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,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function l(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(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},f=function(){var e=i()(c.a.mark((function e(t,r,n){var o,s,i,l,f,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),s=[],i=u(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===a()(d)&&s.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",!s.length||s);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)}}(),d=function(){var e=i()(c.a.mark((function e(t,r,n){var o,s,i,l,f,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),s=!0,i=u(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=24;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:if(d=e.sent,"object"!==a()(d)||void 0!==d.type){e.next=13;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 13:if(!0===(s="object"!==a()(d)||d)){e.next=16;break}return e.abrupt("return",s);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(7),console.error(e.t0),e.abrupt("return",{type:"error"});case 22:e.next=5;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(3),i.e(e.t1);case 29:return e.prev=29,i.f(),e.finish(29);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}}),e,null,[[3,26,29,32],[7,18]])})));return function(t,r,n){return e.apply(this,arguments)}}()},397:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},398:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(86),s=r(11),i=r.n(s),u=r(1),l=r(60),b=r(140),f=r(394),d=r(929),p="pristine",O="idle",m="disabled",j="processing",v="before_processing",h="after_processing",y={status:p,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},g="set_pristine",E="set_idle",w="set_disabled",P="set_processing",k="set_before_processing",_="set_after_processing",C="set_processing_response",A="set_has_error",S="set_no_error",x="set_quantity",D="set_request_params",q=g,N=E,R=w,T=P,V=k,F=_,I=C,B=A,Q=S,M=x,W=D,H=function(){return{type:q}},L=function(){return{type:N}},U=function(){return{type:R}},z=function(){return{type:T}},J=function(){return{type:V}},Y=function(){return{type:F}},G=function(e){return{type:I,data:e}},X=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?B:Q;return{type:t}},$=function(e){return{type:M,quantity:e}},K=function(e){return{type:W,data:e}},Z=r(8),ee=r.n(Z);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 re(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){ee()(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 ne=g,ce=E,oe=w,ae=P,se=k,ie=_,ue=C,le=A,be=S,fe=x,de=D,pe=p,Oe=O,me=m,je=j,ve=v,he=h,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,c=r.type,o=r.data;switch(c){case ne:e=y;break;case ce:e=t.status!==Oe?re(re({},t),{},{status:Oe}):t;break;case oe:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case fe:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case de:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),o)});break;case ue:e=re(re({},t),{},{processingResponse:o});break;case ae:e=!1===(e=t.status!==je?re(re({},t),{},{status:je,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case se:e=t.status!==ve?re(re({},t),{},{status:ve,hasError:!1}):t;break;case ie:e=t.status!==he?re(re({},t),{},{status:he}):t;break;case le:e=t.hasError?t:re(re({},t),{},{hasError:!0}),e=t.status===je||t.status===ve?re(re({},e),{},{status:Oe}):e;break;case be:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&c!==ne&&e.status===pe&&(e.status=Oe),e},ge=r(150),Ee=r(395),we="add_to_cart_before_processing",Pe="add_to_cart_after_processing_with_success",ke="add_to_cart_after_processing_with_error",_e=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(Ee.a)(Pe,e),onAddToCartProcessingWithError:Object(Ee.a)(ke,e),onAddToCartBeforeProcessing:Object(Ee.a)(we,e)}},Ce=r(396),Ae=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){}}}),Se=function(){return Object(n.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ye,y),s=i()(o,2),p=s[0],g=s[1],E=Object(n.useReducer)(ge.b,{}),w=i()(E,2),P=w[0],k=w[1],_=Object(l.a)(P),C=Object(b.a)(),A=C.addErrorNotice,S=C.removeNotices,x=Object(a.b)().setValidationErrors,D=Object(f.a)(),q=D.isSuccessResponse,N=D.isErrorResponse,R=D.isFailResponse,T=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:_e(k).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:_e(k).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:_e(k).onAddToCartBeforeProcessing}}),[k]),V=Object(n.useMemo)((function(){return{resetForm:function(){g(H())},submitForm:function(){g(J())},setQuantity:function(e){g($(e))},setHasError:function(e){g(X(e))},setRequestParams:function(e){g(K(e))},setAfterProcessing:function(e){g(G(e)),g(Y())}}}),[]);Object(n.useEffect)((function(){var e=p.status,t=!r.id||!Object(d.a)(r);e!==m||t?e!==m&&t&&g(U()):g(L())}),[p.status,r,g]),Object(n.useEffect)((function(){p.status===v&&(S("error"),Object(Ce.a)(_,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&x(r)})),g(L())):g(z())})))}),[p.status,x,A,S,g,_]),Object(n.useEffect)((function(){if(p.status===h){var e={processingResponse:p.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;A(e.message,t)}};if(p.hasError)return void Object(Ce.b)(_,ke,e).then((function(r){if(N(r)||R(r))t(r);else{var n,c=(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");A(c,{id:"add-to-cart"})}g(L())}));Object(Ce.b)(_,Pe,e).then((function(e){N(e)||R(e)?(t(e),g(X(!0))):g(L())}))}}),[p.status,p.hasError,p.processingResponse,V,A,N,R,q,_]);var F=Object(d.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(d.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:F,showFormElements:c&&F,quantity:p.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:p.requestParams,isIdle:p.status===O,isDisabled:p.status===m,isProcessing:p.status===j,isBeforeProcessing:p.status===v,isAfterProcessing:p.status===h,hasError:p.hasError,eventRegistration:T,dispatchActions:V};return Object(n.createElement)(Ae.Provider,{value:I},t)},De=r(13),qe=r.n(De),Ne=r(134),Re=r(33),Te=r(536);function Ve(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 Fe=function(){var e=Se(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,s=e.hasError,l=e.isProcessing,f=e.requestParams,d=Object(a.b)(),p=d.hasValidationErrors,O=d.showAllValidationErrors,m=Object(b.a)(),j=m.addErrorNotice,v=m.removeNotice,h=Object(Ne.a)().receiveCart,y=Object(n.useState)(!1),g=i()(y,2),E=g[0],w=g[1],P=!s&&l,k=Object(n.useCallback)((function(){return!p||(O(),{type:"error"})}),[p,O]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){w(!0),v("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},f);qe()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){qe.a.setNonce(e.headers),e.json().then((function(r){e.ok?h(r):(r.body&&r.body.message?j(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):j(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),w(!1),Object(Te.c)()}))})).catch((function(e){e.json().then((function(e){var r;(null===(r=e.data)||void 0===r?void 0:r.cart)&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,j,v,h,t,c,f]);return Object(n.useEffect)((function(){P&&!E&&_()}),[P,_,E]),null},Ie=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(a.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Fe,null)))},Be=r(44),Qe=r(6),Me=r(73),We=(r(390),r(99)),He=r(61),Le=r(563),Ue=r(842),ze=function(e){var t=e.className,r=e.href,c=e.text;return Object(n.createElement)(We.a,{className:t,href:r,rel:"nofollow"},c)},Je=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(We.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&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"),!!a&&Object(n.createElement)(He.a,{srcElement:Le.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},Ye=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,s=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(Ue.a)(o.id||0).cartQuantity,O=Object(n.useState)(!1),m=i()(O,2),j=m[0],v=m[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||v(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Je,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:s,isProcessing:l,isDone:j,onClick:function(){return d.submitForm()}}):Object(n.createElement)(ze,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ge=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)}})},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 Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ge,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},Ke=(r(562),r(51)),Ze=r.n(Ke),et=r(4),tt=r(9),rt=r(232),nt={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,s=e.value,i=void 0===s?"":s,l=e.onChange,b=void 0===l?function(){}:l,f=e.errorMessage,d=void 0===f?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):f,p=Object(a.b)(),O=p.getValidationError,m=p.setValidationErrors,j=p.clearValidationError,v=t,h=O(v)||{};return Object(tt.useEffect)((function(){i?j(v):m(ee()({},v,{message:d,hidden:!0}))}),[i,v,d,j,m]),Object(tt.useEffect)((function(){return function(){j(v)}}),[v,j]),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:b,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(rt.a,{propertyName:v,elementId:v}))};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){ee()(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 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 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)}))}))},it=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],s=at(at({},r),{},ee()({},c,null)),i=o?st(e,t,s):null,u=null!==i?i.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){ee()(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(l.a)(t),a=Object(l.a)(r),s=Object(n.useState)(0),u=i()(s,2),b=u[0],f=u[1],d=Object(n.useState)({}),p=i()(d,2),O=p[0],m=p[1],j=Object(n.useMemo)((function(){return it(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return st(e,t,r)[0]||0}(o,a,O)):b>0&&f(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),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:j[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},ee()({},e,t)))}})})))},ft=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Qe.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=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ft,{product:t,dispatchers:a}),Object(n.createElement)(Ge,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},pt=function(){return Object(n.createElement)(Ye,null)},Ot=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.")},mt=function(){return Object(n.createElement)(Ot,null)},jt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(mt,null):"external"===r?Object(n.createElement)(pt,null):"simple"===r||"variation"===r?Object(n.createElement)($e,null):null:Object(n.createElement)(Ye,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Be.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Qe.isEmpty)(c)});return Object(n.createElement)(Ie,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(jt,null)))}))},562:function(e,t){},563:function(e,t,r){"use strict";var n=r(0),c=r(58),o=Object(n.createElement)(c.a,{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},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(46),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},86:function(e,t,r){"use strict";r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return O}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),s=r(0),i=r(6),u=r(46),l=r.n(u);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 f(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=Object(s.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}}),p=function(){return Object(s.useContext)(d)},O=function(e){var t=e.children,r=Object(s.useState)({}),n=a()(r,2),o=n[0],u=n[1],b=Object(s.useCallback)((function(e){return o[e]}),[o]),p=Object(s.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),O=Object(s.useCallback)((function(e){u((function(t){return t[e]?Object(i.omit)(t,[e]):t}))}),[]),m=Object(s.useCallback)((function(){u({})}),[]),j=Object(s.useCallback)((function(e){e&&u((function(t){return e=Object(i.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!l()(t[r],e))})),0===Object.values(e).length?t:f(f({},t),e)}))}),[]),v=Object(s.useCallback)((function(e,t){u((function(r){if(!r.hasOwnProperty(e))return r;var n=f(f({},r[e]),t);return l()(r[e],n)?r:f(f({},r),{},c()({},e,n))}))}),[]),h={getValidationError:b,setValidationErrors:j,clearValidationError:O,clearAllValidationErrors:m,hideValidationError:Object(s.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(s.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(s.useCallback)((function(){u((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=f(f({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:f(f({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:p};return Object(s.createElement)(d.Provider,{value:h},t)}},929: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")}},949:function(e,t,r){"use strict";r.r(t);var n=r(25),c=r(946),o=r(398),a=r(397);t.default=Object(n.compose)(Object(c.a)(a.a))(o.a)},99:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(27),a=r.n(o),s=r(0),i=r(279),u=(r(2),r(7)),l=r.n(u);r(238);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,["className","showSpinner","children"]),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(s.createElement)(i.a,c()({className:b},u),n&&Object(s.createElement)("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}}}]);
build/atomic-block-components/add-to-cart~atomic-block-components/button.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{135:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(41),c=n(36),o=n(209),i=n(33),a=n(6),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),n=t.isEditor,u=t.previewData,d=(null==u?void 0:u.previewCart)||{},l=e.shouldSelect,f=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!l)return s;if(n)return{cartCoupons:d.coupons,cartItems:d.items,cartItemsCount:d.items_count,cartItemsWeight:d.items_weight,cartNeedsPayment:d.needs_payment,cartNeedsShipping:d.needs_shipping,cartItemErrors:[],cartTotals:d.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:d.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==d?void 0:d.receiveCart)?d.receiveCart:function(){}};var o=e(r.CART_STORE_KEY),u=o.getCartData(),f=o.getCartErrors(),p=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),v=o.areShippingRatesLoading(),m=c(r.CART_STORE_KEY).receiveCart,g=Object(a.mapValues)(u.shippingAddress,(function(e){return Object(i.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:p,cartIsLoading:b,cartErrors:f,shippingAddress:g,shippingRates:u.shippingRates||[],shippingRatesLoading:v,hasShippingAddress:!!g.country,receiveCart:m}}),[l]);return f}},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(8),c=n.n(r),o=n(272),i=n(0);function a(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?a(Object(n),!0).forEach((function(t){c()(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(o.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(i.useRef)(t);Object(i.useEffect)((function(){u.current=t}),[t]);var d=Object(i.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.map((function(t){return null!==e&&t.status!==e||r(t.id),!0}))},removeNotice:r}}),[r]),l=Object(i.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]:{};c(e,t)}}}),[n,c]);return s(s(s({notices:t},d),l),{},{setIsSuppressed:a})}},209:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(0),c=n(36),o=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),i=function(){return Object(r.useContext)(o)},a=function(e){var t=e.children,n=e.currentPostId,i=void 0===n?0:n,a=e.previewData,s=void 0===a?{}:a,u={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return i||e("core/editor").getCurrentPostId()}),[i]),previewData:s};return Object(r.createElement)(o.Provider,{value:u},t)}},234:function(e,t){},264:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(27),i=n.n(o),a=n(0),s=n(56),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=void 0===n?20:n,o=i()(e,["className","size"]);return Object(a.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},o),Object(a.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),d=n(279);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=u;break;case"no-alt":t=d.a}return t?Object(a.cloneElement)(t,{size:e.size||20,className:e.className}):null}},272:function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return N}));var r=n(8),c=n.n(r),o=n(11),i=n.n(o),a=n(0),s=(n(2),n(36)),u=n(10),d=n.n(u),l=n(7),f=n.n(l),p=n(932),b=(n(234),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,c=f()(t,"wc-block-components-notices"),o=n.filter((function(e){return"snackbar"!==e.type}));return o.length?Object(a.createElement)("div",{className:c},o.map((function(e){return Object(a.createElement)(p.a,d()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",b(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)}))):null},m=n(936),g=n(143),h=n(209),O=function(){var e=Object(h.b)().isEditor,t=Object(g.a)(),n=t.notices,r=t.removeNotice,c=n.filter((function(e){return"snackbar"===e.type}));return e?null:Object(a.createElement)(m.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:r})};function j(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 w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(a.useContext)(y)},N=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,o=void 0===c||c,u=e.context,d=void 0===u?"wc/core":u,l=Object(s.useDispatch)("core/notices"),f=l.createNotice,p=l.removeNotice,b=Object(a.useState)(!1),m=i()(b,2),g=m[0],h=m[1],j=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]:{};f(e,t,w(w({},n),{},{context:n.context||d}))}),[f,d]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;p(e,t)}),[p,d]),N=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]:{};j("default",e,w(w({},t),{},{type:"snackbar"}))}),[j]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:j,createSnackbarNotice:N,removeNotice:E,context:d,setIsSuppressed:h},S=g?null:Object(a.createElement)(v,{className:r,notices:C.notices}),I=g?null:Object(a.createElement)(O,null);return Object(a.createElement)(y.Provider,{value:C},o&&S,t,I)}},279:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(27),i=n.n(o),a=n(0),s=n(56),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return Object(a.createElement)(s.a,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=u},529:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return i}));var r=window.Event||null,c=function(e,t){var n=t.bubbles,c=void 0!==n&&n,o=t.cancelable,i=void 0!==o&&o,a=t.element;if(a||(a=document.body),"function"==typeof r){var s=new r(e,{bubbles:c,cancelable:i});a.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,i),a.dispatchEvent(u)}},o=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},834:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(11),c=n.n(r),o=n(0),i=n(36),a=n(135),s=n(41),u=n(33),d=n(143),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},f=function(e){var t=Object(i.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(a.a)(),r=n.cartItems,f=n.cartIsLoading,p=Object(d.a)(),b=p.addErrorNotice,v=p.removeNotice,m=Object(o.useState)(!1),g=c()(m,2),h=g[0],O=g[1],j=Object(o.useRef)(l(r,e));return Object(o.useEffect)((function(){var t=l(r,e);t!==j.current&&(j.current=t)}),[r,e]),{cartQuantity:Number.isFinite(j.current)?j.current:0,addingToCart:h,cartIsLoading:f,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;O(!0),t(e,n).then((function(e){!0===e&&v("add-to-cart")})).catch((function(e){b(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){O(!1)}))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{134:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(41),c=n(36),o=n(211),i=n(33),a=n(6),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),n=t.isEditor,u=t.previewData,d=(null==u?void 0:u.previewCart)||{},l=e.shouldSelect,f=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!l)return s;if(n)return{cartCoupons:d.coupons,cartItems:d.items,cartItemsCount:d.items_count,cartItemsWeight:d.items_weight,cartNeedsPayment:d.needs_payment,cartNeedsShipping:d.needs_shipping,cartItemErrors:[],cartTotals:d.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:d.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==d?void 0:d.receiveCart)?d.receiveCart:function(){}};var o=e(r.CART_STORE_KEY),u=o.getCartData(),f=o.getCartErrors(),p=o.getCartTotals(),v=!o.hasFinishedResolution("getCartData"),b=o.areShippingRatesLoading(),m=c(r.CART_STORE_KEY).receiveCart,g=Object(a.mapValues)(u.shippingAddress,(function(e){return Object(i.decodeEntities)(e)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:p,cartIsLoading:v,cartErrors:f,shippingAddress:g,shippingRates:u.shippingRates||[],shippingRatesLoading:b,hasShippingAddress:!!g.country,receiveCart:m}}),[l]);return f}},140:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(8),c=n.n(r),o=n(190),i=n(0);function a(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?a(Object(n),!0).forEach((function(t){c()(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(o.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(i.useRef)(t);Object(i.useEffect)((function(){u.current=t}),[t]);var d=Object(i.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||r(t.id)}))},removeNotice:r}}),[r]),l=Object(i.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]:{};c(e,t)}}}),[n,c]);return s(s(s({notices:t},d),l),{},{setIsSuppressed:a})}},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return h}));var r=n(8),c=n.n(r),o=n(11),i=n.n(o),a=n(0),s=(n(2),n(36)),u=n(302),d=n(944),l=n(140),f=n(211),p=function(){var e=Object(f.b)().isEditor,t=Object(l.a)(),n=t.notices,r=t.removeNotice;if(e)return null;var c=n.filter((function(e){return"snackbar"===e.type}));return Object(a.createElement)(d.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:r})};function v(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 b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),g=function(){return Object(a.useContext)(m)},h=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,o=void 0===c||c,d=e.context,l=void 0===d?"wc/core":d,f=Object(s.useDispatch)("core/notices"),v=f.createNotice,g=f.removeNotice,h=Object(a.useState)(!1),O=i()(h,2),j=O[0],w=O[1],y=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,b(b({},n),{},{context:n.context||l}))}),[v,l]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;g(e,t)}),[g,l]),N=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]:{};y("default",e,b(b({},t),{},{type:"snackbar"}))}),[y]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:y,createSnackbarNotice:N,removeNotice:E,context:l,setIsSuppressed:w},S=j?null:Object(a.createElement)(u.a,{className:r,notices:C.notices}),I=j?null:Object(a.createElement)(p,null);return Object(a.createElement)(m.Provider,{value:C},o&&S,t,I)}},211:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(0),c=n(36),o=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),i=function(){return Object(r.useContext)(o)},a=function(e){var t=e.children,n=e.currentPostId,i=void 0===n?0:n,a=e.previewData,s=void 0===a?{}:a,u={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return i||e("core/editor").getCurrentPostId()}),[i]),previewData:s};return Object(r.createElement)(o.Provider,{value:u},t)}},237:function(e,t){},268:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(27),i=n.n(o),a=n(0),s=n(58),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=void 0===n?20:n,o=i()(e,["className","size"]);return Object(a.createElement)(s.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},o),Object(a.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),d=n(283);t.a=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=u;break;case"no-alt":t=d.a}return t?Object(a.cloneElement)(t,{size:e.size||20,className:e.className}):null}},283:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(27),i=n.n(o),a=n(0),s=n(58),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return Object(a.createElement)(s.a,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=u},302:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(0),i=(n(2),n(7)),a=n.n(i),s=n(389),u=n(190),d=(n(237),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""});t.a=function(e){var t=e.className,n=e.notices,r=Object(u.b)().removeNotice,i=n.filter((function(e){return"snackbar"!==e.type}));if(!i.length)return null;var l=a()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:l},i.map((function(e){return Object(o.createElement)(s.a,c()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice","woocommerce-message",d(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))}},536:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return i}));var r=window.Event||null,c=function(e,t){var n=t.bubbles,c=void 0!==n&&n,o=t.cancelable,i=void 0!==o&&o,a=t.element;if(a||(a=document.body),"function"==typeof r){var s=new r(e,{bubbles:c,cancelable:i});a.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,i),a.dispatchEvent(u)}},o=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},842:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(11),c=n.n(r),o=n(0),i=n(36),a=n(134),s=n(41),u=n(33),d=n(140),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},f=function(e){var t=Object(i.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(a.a)(),r=n.cartItems,f=n.cartIsLoading,p=Object(d.a)(),v=p.addErrorNotice,b=p.removeNotice,m=Object(o.useState)(!1),g=c()(m,2),h=g[0],O=g[1],j=Object(o.useRef)(l(r,e));return Object(o.useEffect)((function(){var t=l(r,e);t!==j.current&&(j.current=t)}),[r,e]),{cartQuantity:Number.isFinite(j.current)?j.current:0,addingToCart:h,cartIsLoading:f,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;O(!0),t(e,n).then((function(e){!0===e&&b("add-to-cart")})).catch((function(e){v(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){O(!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([[1],{938:function(e,n,a){"use strict";var c=a(10),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))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{946:function(e,n,a){"use strict";var c=a(10),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/button-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{275:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return o}));var r=window.Event||null,c=function(t,e){var n=e.bubbles,c=void 0!==n&&n,a=e.cancelable,o=void 0!==a&&a,i=e.element;if(i||(i=document.body),"function"==typeof r){var s=new r(t,{bubbles:c,cancelable:o});i.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(t,c,o),i.dispatchEvent(u)}},a=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var a=function(){c(e,{bubbles:n,cancelable:r})};return jQuery(document).on(t,a),function(){return jQuery(document).off(t,a)}}},286:function(t,e){},287:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(9),c=n.n(r),a=n(0),o=n(13),i=n(81),s=n(15),u=n(17),d=n(80),p=function(t,e){var n=t.find((function(t){return t.id===e}));return n?n.quantity:0},l=function(t){var e=Object(o.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(i.a)(),r=n.cartItems,l=n.cartIsLoading,b=Object(d.a)(),f=b.addErrorNotice,m=b.removeNotice,g=Object(a.useState)(!1),h=c()(g,2),_=h[0],v=h[1],E=Object(a.useRef)(p(r,t));return Object(a.useEffect)((function(){var e=p(r,t);e!==E.current&&(E.current=e)}),[r,t]),{cartQuantity:Number.isFinite(E.current)?E.current:0,addingToCart:_,cartIsLoading:l,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;v(!0),e(t,n).then((function(t){!0===t&&m("add-to-cart")})).catch((function(t){f(Object(u.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},297:function(t,e,n){"use strict";n.r(e);var r=n(11),c=n.n(r),a=n(6),o=n.n(a),i=(n(4),n(5)),s=n.n(i),u=n(1),d=n(0),p=n(287),l=n(17),b=n(275),f=n(69),m=n(188),g=(n(286),function(t){var e=t.product,n=Object(d.useRef)(!0),r=e.id,a=e.permalink,o=e.add_to_cart,i=e.has_options,f=e.is_purchasable,m=e.is_in_stock,g=Object(p.a)(r),h=g.cartQuantity,_=g.addingToCart,v=g.addToCart;Object(d.useEffect)((function(){n.current?n.current=!1:Object(b.c)()}),[h]);var E=Number.isFinite(h)&&h>0,C=!i&&f&&m,j=Object(l.decodeEntities)((null==o?void 0:o.description)||""),O=E?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",h,"woo-gutenberg-products-block"),h):Object(l.decodeEntities)((null==o?void 0:o.text)||Object(u.__)("Add to cart","woo-gutenberg-products-block")),w=C?"button":"a",y={};return C?y.onClick=function(){v()}:(y.href=a,y.rel="nofollow"),React.createElement(w,c()({"aria-label":j,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:_,added:E}),disabled:_},y),O)}),h=function(){return React.createElement("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};e.default=Object(m.withProductDataContext)((function(t){var e=t.className,n=Object(f.useInnerBlockLayoutContext)().parentClassName,r=Object(f.useProductDataContext)().product;return React.createElement("div",{className:s()(e,"wp-block-button","wc-block-components-product-button",o()({},"".concat(n,"__product-add-to-cart"),n))},r.id?React.createElement(g,{product:r}):React.createElement(h,null))}))},81:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(15),c=n(13),a=n(115),o=n(17),i=n(7),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(a.a)(),n=e.isEditor,u=e.previewData,d=(null==u?void 0:u.previewCart)||{},p=t.shouldSelect,l=Object(c.useSelect)((function(t,e){var c=e.dispatch;if(!p)return s;if(n)return{cartCoupons:d.coupons,cartItems:d.items,cartItemsCount:d.items_count,cartItemsWeight:d.items_weight,cartNeedsPayment:d.needs_payment,cartNeedsShipping:d.needs_shipping,cartItemErrors:[],cartTotals:d.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:d.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==d?void 0:d.receiveCart)?d.receiveCart:function(){}};var a=t(r.CART_STORE_KEY),u=a.getCartData(),l=a.getCartErrors(),b=a.getCartTotals(),f=!a.hasFinishedResolution("getCartData"),m=a.areShippingRatesLoading(),g=c(r.CART_STORE_KEY).receiveCart,h=Object(i.mapValues)(u.shippingAddress,(function(t){return Object(o.decodeEntities)(t)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:b,cartIsLoading:f,cartErrors:l,shippingAddress:h,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!h.country,receiveCart:g}}),[p]);return l}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{277:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return o}));var r=window.Event||null,c=function(t,e){var n=e.bubbles,c=void 0!==n&&n,a=e.cancelable,o=void 0!==a&&a,i=e.element;if(i||(i=document.body),"function"==typeof r){var s=new r(t,{bubbles:c,cancelable:o});i.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(t,c,o),i.dispatchEvent(u)}},a=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var a=function(){c(e,{bubbles:n,cancelable:r})};return jQuery(document).on(t,a),function(){return jQuery(document).off(t,a)}}},288:function(t,e){},289:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(10),c=n.n(r),a=n(0),o=n(13),i=n(81),s=n(15),u=n(17),d=n(80),p=function(t,e){var n=t.find((function(t){return t.id===e}));return n?n.quantity:0},l=function(t){var e=Object(o.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(i.a)(),r=n.cartItems,l=n.cartIsLoading,b=Object(d.a)(),f=b.addErrorNotice,m=b.removeNotice,g=Object(a.useState)(!1),h=c()(g,2),_=h[0],v=h[1],E=Object(a.useRef)(p(r,t));return Object(a.useEffect)((function(){var e=p(r,t);e!==E.current&&(E.current=e)}),[r,t]),{cartQuantity:Number.isFinite(E.current)?E.current:0,addingToCart:_,cartIsLoading:l,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;v(!0),e(t,n).then((function(t){!0===t&&m("add-to-cart")})).catch((function(t){f(Object(u.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},299:function(t,e,n){"use strict";n.r(e);var r=n(11),c=n.n(r),a=n(6),o=n.n(a),i=(n(4),n(5)),s=n.n(i),u=n(1),d=n(0),p=n(289),l=n(17),b=n(277),f=n(69),m=n(191),g=(n(288),function(t){var e=t.product,n=Object(d.useRef)(!0),r=e.id,a=e.permalink,o=e.add_to_cart,i=e.has_options,f=e.is_purchasable,m=e.is_in_stock,g=Object(p.a)(r),h=g.cartQuantity,_=g.addingToCart,v=g.addToCart;Object(d.useEffect)((function(){n.current?n.current=!1:Object(b.c)()}),[h]);var E=Number.isFinite(h)&&h>0,C=!i&&f&&m,j=Object(l.decodeEntities)((null==o?void 0:o.description)||""),O=E?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",h,"woo-gutenberg-products-block"),h):Object(l.decodeEntities)((null==o?void 0:o.text)||Object(u.__)("Add to cart","woo-gutenberg-products-block")),w=C?"button":"a",y={};return C?y.onClick=function(){v()}:(y.href=a,y.rel="nofollow"),React.createElement(w,c()({"aria-label":j,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:_,added:E}),disabled:_},y),O)}),h=function(){return React.createElement("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};e.default=Object(m.withProductDataContext)((function(t){var e=t.className,n=Object(f.useInnerBlockLayoutContext)().parentClassName,r=Object(f.useProductDataContext)().product;return React.createElement("div",{className:s()(e,"wp-block-button","wc-block-components-product-button",o()({},"".concat(n,"__product-add-to-cart"),n))},r.id?React.createElement(g,{product:r}):React.createElement(h,null))}))},81:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(15),c=n(13),a=n(117),o=n(17),i=n(7),s={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(a.a)(),n=e.isEditor,u=e.previewData,d=(null==u?void 0:u.previewCart)||{},p=t.shouldSelect,l=Object(c.useSelect)((function(t,e){var c=e.dispatch;if(!p)return s;if(n)return{cartCoupons:d.coupons,cartItems:d.items,cartItemsCount:d.items_count,cartItemsWeight:d.items_weight,cartNeedsPayment:d.needs_payment,cartNeedsShipping:d.needs_shipping,cartItemErrors:[],cartTotals:d.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:d.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==d?void 0:d.receiveCart)?d.receiveCart:function(){}};var a=t(r.CART_STORE_KEY),u=a.getCartData(),l=a.getCartErrors(),b=a.getCartTotals(),f=!a.hasFinishedResolution("getCartData"),m=a.areShippingRatesLoading(),g=c(r.CART_STORE_KEY).receiveCart,h=Object(i.mapValues)(u.shippingAddress,(function(t){return Object(o.decodeEntities)(t)}));return{cartCoupons:u.coupons,cartItems:u.items||[],cartItemsCount:u.itemsCount,cartItemsWeight:u.itemsWeight,cartNeedsPayment:u.needsPayment,cartNeedsShipping:u.needsShipping,cartItemErrors:u.errors||[],cartTotals:b,cartIsLoading:f,cartErrors:l,shippingAddress:h,shippingRates:u.shippingRates||[],shippingRatesLoading:m,hasShippingAddress:!!h.country,receiveCart:g}}),[p]);return l}}}]);
build/atomic-block-components/button.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{528:function(t,c,e){"use strict";e.r(c);var o=e(10),n=e.n(o),a=e(8),r=e.n(a),u=e(0),d=(e(2),e(7)),b=e.n(d),l=e(1),i=e(834),s=e(33),p=e(529),_=e(44),k=e(72),j=(e(549),function(t){var c=t.product,e=Object(u.useRef)(!0),o=c.id,a=c.permalink,r=c.add_to_cart,d=c.has_options,_=c.is_purchasable,k=c.is_in_stock,j=Object(i.a)(o),w=j.cartQuantity,O=j.addingToCart,m=j.addToCart;Object(u.useEffect)((function(){e.current?e.current=!1:Object(p.c)()}),[w]);var f=Number.isFinite(w)&&w>0,E=!d&&_&&k,v=Object(s.decodeEntities)((null==r?void 0:r.description)||""),C=f?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",w,"woo-gutenberg-products-block"),w):Object(s.decodeEntities)((null==r?void 0:r.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),g=E?"button":"a",h={};return E?h.onClick=function(){m()}:(h.href=a,h.rel="nofollow"),Object(u.createElement)(g,n()({"aria-label":v,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:O,added:f}),disabled:O},h),C)}),w=function(){return Object(u.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};c.default=Object(k.withProductDataContext)((function(t){var c=t.className,e=Object(_.useInnerBlockLayoutContext)().parentClassName,o=Object(_.useProductDataContext)().product;return Object(u.createElement)("div",{className:b()(c,"wp-block-button","wc-block-components-product-button",r()({},"".concat(e,"__product-add-to-cart"),e))},o.id?Object(u.createElement)(j,{product:o}):Object(u.createElement)(w,null))}))},549:function(t,c){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{535:function(t,c,e){"use strict";e.r(c);var o=e(10),n=e.n(o),a=e(8),r=e.n(a),u=e(0),d=(e(2),e(7)),b=e.n(d),l=e(1),i=e(842),s=e(33),p=e(536),_=e(44),k=e(73),j=(e(556),function(t){var c=t.product,e=Object(u.useRef)(!0),o=c.id,a=c.permalink,r=c.add_to_cart,d=c.has_options,_=c.is_purchasable,k=c.is_in_stock,j=Object(i.a)(o),w=j.cartQuantity,O=j.addingToCart,m=j.addToCart;Object(u.useEffect)((function(){e.current?e.current=!1:Object(p.c)()}),[w]);var f=Number.isFinite(w)&&w>0,E=!d&&_&&k,v=Object(s.decodeEntities)((null==r?void 0:r.description)||""),C=f?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",w,"woo-gutenberg-products-block"),w):Object(s.decodeEntities)((null==r?void 0:r.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),g=E?"button":"a",h={};return E?h.onClick=function(){m()}:(h.href=a,h.rel="nofollow"),Object(u.createElement)(g,n()({"aria-label":v,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:O,added:f}),disabled:O},h),C)}),w=function(){return Object(u.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};c.default=Object(k.withProductDataContext)((function(t){var c=t.className,e=Object(_.useInnerBlockLayoutContext)().parentClassName,o=Object(_.useProductDataContext)().product;return Object(u.createElement)("div",{className:b()(c,"wp-block-button","wc-block-components-product-button",r()({},"".concat(e,"__product-add-to-cart"),e))},o.id?Object(u.createElement)(j,{product:o}):Object(u.createElement)(w,null))}))},556:function(t,c){}}]);
build/atomic-block-components/category-list-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{290:function(e,t){},300:function(e,t,c){"use strict";c.r(t);var a=c(6),n=c.n(a),o=c(1),r=(c(4),c(5)),s=c.n(r),l=c(69),u=c(7),i=c(188);c(290);t.default=Object(i.withProductDataContext)((function(e){var t=e.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,a=Object(l.useProductDataContext)().product;return Object(u.isEmpty)(a.categories)?null:React.createElement("div",{className:s()(t,"wc-block-components-product-category-list",n()({},"".concat(c,"__product-category-list"),c))},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",React.createElement("ul",null,Object.values(a.categories).map((function(e){var t=e.name,c=e.link,a=e.slug;return React.createElement("li",{key:"category-list-item-".concat(a)},React.createElement("a",{href:c},t))}))))}))}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{292:function(e,t){},302:function(e,t,c){"use strict";c.r(t);var a=c(6),n=c.n(a),o=c(1),r=(c(4),c(5)),s=c.n(r),l=c(69),u=c(7),i=c(191);c(292);t.default=Object(i.withProductDataContext)((function(e){var t=e.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,a=Object(l.useProductDataContext)().product;return Object(u.isEmpty)(a.categories)?null:React.createElement("div",{className:s()(t,"wc-block-components-product-category-list",n()({},"".concat(c,"__product-category-list"),c))},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",React.createElement("ul",null,Object.values(a.categories).map((function(e){var t=e.name,c=e.link,a=e.slug;return React.createElement("li",{key:"category-list-item-".concat(a)},React.createElement("a",{href:c},t))}))))}))}}]);
build/atomic-block-components/category-list.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{532:function(e,t,c){"use strict";c.r(t);var n=c(8),o=c.n(n),a=c(0),r=c(1),s=(c(2),c(7)),l=c.n(s),u=c(44),i=c(6),b=c(72);c(552);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(i.isEmpty)(n.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",o()({},"".concat(c,"__product-category-list"),c))},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,c=e.link,n=e.slug;return Object(a.createElement)("li",{key:"category-list-item-".concat(n)},Object(a.createElement)("a",{href:c},t))}))))}))},552:function(e,t){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{539:function(e,t,c){"use strict";c.r(t);var n=c(8),o=c.n(n),a=c(0),r=c(1),s=(c(2),c(7)),l=c.n(s),u=c(44),i=c(6),b=c(73);c(559);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(i.isEmpty)(n.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",o()({},"".concat(c,"__product-category-list"),c))},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,c=e.link,n=e.slug;return Object(a.createElement)("li",{key:"category-list-item-".concat(n)},Object(a.createElement)("a",{href:c},t))}))))}))},559:function(e,t){}}]);
build/atomic-block-components/image-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5,8],{178:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var a=function(e,t){var r=[];return Object.keys(e).forEach((function(a){if(void 0!==t[a])switch(e[a].type){case"boolean":r[a]="false"!==t[a]&&!1!==t[a];break;case"number":r[a]=parseInt(t[a],10);break;case"array":case"object":r[a]=JSON.parse(t[a]);break;default:r[a]=t[a]}else r[a]=e[a].default})),r}},280:function(e,t,r){"use strict";var a=r(11),n=r.n(a),c=r(178);t.a=function(e){return function(t){return function(r){var a=Object(c.a)(e,r);return React.createElement(t,n()({},r,a))}}}},281:function(e,t){},282:function(e,t,r){"use strict";r.r(t);var a=r(6),n=r.n(a),c=(r(4),r(1)),o=r(5),l=r.n(o),s=r(29),u=r(69),i=r(188);r(281);t.default=Object(i.withProductDataContext)((function(e){var t=e.className,r=e.align,a=Object(u.useInnerBlockLayoutContext)().parentClassName,o=Object(u.useProductDataContext)().product;if(!o.id||!o.on_sale)return null;var i="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return React.createElement("div",{className:l()("wc-block-components-product-sale-badge",t,i,n()({},"".concat(a,"__product-onsale"),a))},React.createElement(s.a,{label:Object(c.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Product on sale","woo-gutenberg-products-block")}))}))},283:function(e,t){},29:function(e,t,r){"use strict";var a=r(6),n=r.n(a),c=(r(4),r(3)),o=r(5),l=r.n(o);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}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){n()(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 i=function(e){var t,r=e.label,a=e.screenReaderLabel,n=e.wrapperElement,o=e.wrapperProps,s=null!=r,i=null!=a;return!s&&i?(t=n||"span",o=u(u({},o),{},{className:l()(o.className,"screen-reader-text")}),React.createElement(t,o,a)):(t=n||c.Fragment,s&&i&&r!==a?React.createElement(t,o,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},a)):React.createElement(t,o,r))};i.defaultProps={wrapperProps:{}},t.a=i},305:function(e,t,r){"use strict";r.r(t);var a=r(26),n=r(280),c=r(6),o=r.n(c),l=r(9),s=r.n(l),u=(r(4),r(0)),i=r(5),p=r.n(i),d=r(8),b=r(69),f=r(188),m=r(7),g=r(282);r(283);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function w(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}var j=function(){return React.createElement("img",{src:d.s,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,a=e.loaded,n=e.showFullSize,c=t||{},o=c.thumbnail,l=c.src,s=c.srcset,u=c.sizes,i={alt:c.alt,onLoad:r,hidden:!a,src:o};return n&&(i=w(w({},i),{},{src:l,srcSet:s,sizes:u})),React.createElement(React.Fragment,null,React.createElement("img",i),!a&&React.createElement(j,null))},v=Object(f.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,a=void 0===r?"full-size":r,n=e.productLink,c=void 0===n||n,l=e.showSaleBadge,i=e.saleBadgeAlign,d=void 0===i?"right":i,f=Object(b.useInnerBlockLayoutContext)().parentClassName,O=Object(b.useProductDataContext)().product,w=Object(u.useState)(!1),v=s()(w,2),h=v[0],E=v[1];if(!O.id)return React.createElement("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",o()({},"".concat(f,"__product-image"),f))},React.createElement(j,null));var R=Object(m.isEmpty)(O.images)?null:O.images[0];return React.createElement("div",{className:p()(t,"wc-block-components-product-image",o()({},"".concat(f,"__product-image"),f))},c?React.createElement("a",{href:O.permalink,rel:"nofollow"},!!l&&React.createElement(g.default,{align:d,product:O}),React.createElement(y,{image:R,onLoad:function(){return E(!0)},loaded:h,showFullSize:"cropped"!==a})):React.createElement(React.Fragment,null,!!l&&React.createElement(g.default,{align:d,product:O}),React.createElement(y,{image:R,onLoad:function(){return E(!0)},loaded:h,showFullSize:"cropped"!==a})))})),h={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}};t.default=Object(a.compose)(Object(n.a)(h))(v)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5,8],{180:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var a=function(e,t){var r=[];return Object.keys(e).forEach((function(a){if(void 0!==t[a])switch(e[a].type){case"boolean":r[a]="false"!==t[a]&&!1!==t[a];break;case"number":r[a]=parseInt(t[a],10);break;case"array":case"object":r[a]=JSON.parse(t[a]);break;default:r[a]=t[a]}else r[a]=e[a].default})),r}},282:function(e,t,r){"use strict";var a=r(11),n=r.n(a),c=r(180);t.a=function(e){return function(t){return function(r){var a=Object(c.a)(e,r);return React.createElement(t,n()({},r,a))}}}},283:function(e,t){},284:function(e,t,r){"use strict";r.r(t);var a=r(6),n=r.n(a),c=(r(4),r(1)),o=r(5),l=r.n(o),s=r(33),u=r(69),i=r(191);r(283);t.default=Object(i.withProductDataContext)((function(e){var t=e.className,r=e.align,a=Object(u.useInnerBlockLayoutContext)().parentClassName,o=Object(u.useProductDataContext)().product;if(!o.id||!o.on_sale)return null;var i="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return React.createElement("div",{className:l()("wc-block-components-product-sale-badge",t,i,n()({},"".concat(a,"__product-onsale"),a))},React.createElement(s.a,{label:Object(c.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Product on sale","woo-gutenberg-products-block")}))}))},285:function(e,t){},307:function(e,t,r){"use strict";r.r(t);var a=r(26),n=r(282),c=r(6),o=r.n(c),l=r(10),s=r.n(l),u=(r(4),r(0)),i=r(5),p=r.n(i),d=r(8),b=r(69),f=r(191),m=r(7),g=r(284);r(285);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function w(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}var j=function(){return React.createElement("img",{src:d.s,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,a=e.loaded,n=e.showFullSize,c=t||{},o=c.thumbnail,l=c.src,s=c.srcset,u=c.sizes,i={alt:c.alt,onLoad:r,hidden:!a,src:o};return n&&(i=w(w({},i),{},{src:l,srcSet:s,sizes:u})),React.createElement(React.Fragment,null,React.createElement("img",i),!a&&React.createElement(j,null))},v=Object(f.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,a=void 0===r?"full-size":r,n=e.productLink,c=void 0===n||n,l=e.showSaleBadge,i=e.saleBadgeAlign,d=void 0===i?"right":i,f=Object(b.useInnerBlockLayoutContext)().parentClassName,O=Object(b.useProductDataContext)().product,w=Object(u.useState)(!1),v=s()(w,2),h=v[0],E=v[1];if(!O.id)return React.createElement("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",o()({},"".concat(f,"__product-image"),f))},React.createElement(j,null));var R=Object(m.isEmpty)(O.images)?null:O.images[0];return React.createElement("div",{className:p()(t,"wc-block-components-product-image",o()({},"".concat(f,"__product-image"),f))},c?React.createElement("a",{href:O.permalink,rel:"nofollow"},!!l&&React.createElement(g.default,{align:d,product:O}),React.createElement(y,{image:R,onLoad:function(){return E(!0)},loaded:h,showFullSize:"cropped"!==a})):React.createElement(React.Fragment,null,!!l&&React.createElement(g.default,{align:d,product:O}),React.createElement(y,{image:R,onLoad:function(){return E(!0)},loaded:h,showFullSize:"cropped"!==a})))})),h={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}};t.default=Object(a.compose)(Object(n.a)(h))(v)},33:function(e,t,r){"use strict";var a=r(6),n=r.n(a),c=(r(4),r(3)),o=r(5),l=r.n(o);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}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){n()(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 i=function(e){var t,r=e.label,a=e.screenReaderLabel,n=e.wrapperElement,o=e.wrapperProps,s=null!=r,i=null!=a;return!s&&i?(t=n||"span",o=u(u({},o),{},{className:l()(o.className,"screen-reader-text")}),React.createElement(t,o,a)):(t=n||c.Fragment,s&&i&&r!==a?React.createElement(t,o,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},a)):React.createElement(t,o,r))};i.defaultProps={wrapperProps:{}},t.a=i}}]);
build/atomic-block-components/image.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{387:function(e,t,c){"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}}},388:function(e,t,c){"use strict";var n=c(8),r=c.n(n),a=c(11),o=c.n(a),l=c(0),i=(c(2),c(7)),u=c.n(i),s=c(5),d=c(44),p=c(72),m=c(6),b=c(262);c(547);function g(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function O(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?g(Object(c),!0).forEach((function(t){r()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):g(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var f=function(){return Object(l.createElement)("img",{src:s.F,alt:"",width:500,height:500})},j=function(e){var t=e.image,c=e.onLoad,n=e.loaded,r=e.showFullSize,a=t||{},o=a.thumbnail,i=a.src,u=a.srcset,s=a.sizes,d={alt:a.alt,onLoad:c,hidden:!n,src:o};return r&&(d=O(O({},d),{},{src:i,srcSet:u,sizes:s})),Object(l.createElement)(l.Fragment,null,Object(l.createElement)("img",d),!n&&Object(l.createElement)(f,null))};t.a=Object(p.withProductDataContext)((function(e){var t=e.className,c=e.imageSizing,n=void 0===c?"full-size":c,a=e.productLink,i=void 0===a||a,s=e.showSaleBadge,p=e.saleBadgeAlign,g=void 0===p?"right":p,O=Object(d.useInnerBlockLayoutContext)().parentClassName,w=Object(d.useProductDataContext)().product,h=Object(l.useState)(!1),y=o()(h,2),E=y[0],v=y[1];if(!w.id)return Object(l.createElement)("div",{className:u()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",r()({},"".concat(O,"__product-image"),O))},Object(l.createElement)(f,null));var k=Object(m.isEmpty)(w.images)?null:w.images[0];return Object(l.createElement)("div",{className:u()(t,"wc-block-components-product-image",r()({},"".concat(O,"__product-image"),O))},i?Object(l.createElement)("a",{href:w.permalink,rel:"nofollow"},!!s&&Object(l.createElement)(b.default,{align:g,product:w}),Object(l.createElement)(j,{image:k,onLoad:function(){return v(!0)},loaded:E,showFullSize:"cropped"!==n})):Object(l.createElement)(l.Fragment,null,!!s&&Object(l.createElement)(b.default,{align:g,product:w}),Object(l.createElement)(j,{image:k,onLoad:function(){return v(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},547:function(e,t){},939:function(e,t,c){"use strict";c.r(t);var n=c(25),r=c(938),a=c(388),o=c(387);t.default=Object(n.compose)(Object(r.a)(o.a))(a.a)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{392:function(e,t,c){"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}}},393:function(e,t,c){"use strict";var n=c(8),r=c.n(n),a=c(11),o=c.n(a),l=c(0),i=(c(2),c(7)),u=c.n(i),s=c(5),d=c(44),p=c(73),m=c(6),b=c(266);c(554);function g(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function O(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?g(Object(c),!0).forEach((function(t){r()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):g(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var f=function(){return Object(l.createElement)("img",{src:s.F,alt:"",width:500,height:500})},j=function(e){var t=e.image,c=e.onLoad,n=e.loaded,r=e.showFullSize,a=t||{},o=a.thumbnail,i=a.src,u=a.srcset,s=a.sizes,d={alt:a.alt,onLoad:c,hidden:!n,src:o};return r&&(d=O(O({},d),{},{src:i,srcSet:u,sizes:s})),Object(l.createElement)(l.Fragment,null,Object(l.createElement)("img",d),!n&&Object(l.createElement)(f,null))};t.a=Object(p.withProductDataContext)((function(e){var t=e.className,c=e.imageSizing,n=void 0===c?"full-size":c,a=e.productLink,i=void 0===a||a,s=e.showSaleBadge,p=e.saleBadgeAlign,g=void 0===p?"right":p,O=Object(d.useInnerBlockLayoutContext)().parentClassName,w=Object(d.useProductDataContext)().product,h=Object(l.useState)(!1),y=o()(h,2),E=y[0],v=y[1];if(!w.id)return Object(l.createElement)("div",{className:u()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",r()({},"".concat(O,"__product-image"),O))},Object(l.createElement)(f,null));var k=Object(m.isEmpty)(w.images)?null:w.images[0];return Object(l.createElement)("div",{className:u()(t,"wc-block-components-product-image",r()({},"".concat(O,"__product-image"),O))},i?Object(l.createElement)("a",{href:w.permalink,rel:"nofollow"},!!s&&Object(l.createElement)(b.default,{align:g,product:w}),Object(l.createElement)(j,{image:k,onLoad:function(){return v(!0)},loaded:E,showFullSize:"cropped"!==n})):Object(l.createElement)(l.Fragment,null,!!s&&Object(l.createElement)(b.default,{align:g,product:w}),Object(l.createElement)(j,{image:k,onLoad:function(){return v(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},554:function(e,t){},947:function(e,t,c){"use strict";c.r(t);var n=c(25),r=c(946),a=c(393),o=c(392);t.default=Object(n.compose)(Object(r.a)(o.a))(a.a)}}]);
build/atomic-block-components/price-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[6],{120:function(e,r){},127:function(e,r,t){"use strict";var c=t(6),a=t.n(c),n=t(1),o=t(38),i=t(5),l=t.n(i),s=(t(4),t(145),function(e){var r=e.className,t=e.currency,c=e.maxPrice,a=e.minPrice,n=e.priceClassName,i=e.priceStyle;return React.createElement("span",{className:r},React.createElement(o.a,{className:l()("wc-block-components-product-price__value",n),currency:t,value:a,style:i})," — ",React.createElement(o.a,{className:l()("wc-block-components-product-price__value",n),currency:t,value:c,style:i}))}),u=function(e){var r=e.className,t=e.currency,c=e.regularPriceClassName,a=e.regularPriceStyle,i=e.regularPrice,s=e.priceClassName,u=e.priceStyle,p=e.price;return React.createElement("span",{className:r},React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("del",{className:l()("wc-block-components-product-price__regular",c),style:a},e)},value:i}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:l()("wc-block-components-product-price__value","is-discounted",s),style:u},e)},value:p}))};r.a=function(e){var r=e.align,t=e.className,c=e.currency,n=e.maxPrice,i=void 0===n?null:n,p=e.minPrice,m=void 0===p?null:p,f=e.price,y=void 0===f?null:f,b=e.priceClassName,d=e.priceStyle,g=e.regularPrice,v=e.regularPriceClassName,_=e.regularPriceStyle,N=l()(t,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));return g&&y!==g?React.createElement(u,{className:N,currency:c,price:y,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:v,regularPriceStyle:_}):null!==m&&null!==i?React.createElement(s,{className:N,currency:c,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):null!==y?React.createElement("span",{className:N},React.createElement(o.a,{className:l()("wc-block-components-product-price__value",b),currency:c,value:y,style:d})):React.createElement("span",{className:N},React.createElement("span",{className:l()("wc-block-components-product-price__value",b)}))}},145:function(e,r){},148:function(e,r,t){"use strict";t.d(r,"c",(function(){return f})),t.d(r,"b",(function(){return y})),t.d(r,"a",(function(){return b}));var c=t(6),a=t.n(c),n=t(23),o=t.n(n),i=t(2);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){a()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var u,p,m={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(u=i.CURRENCY.symbol,p=i.CURRENCY.symbolPosition,{left:u,left_space:" "+u,right:"",right_space:""}[p]||""),suffix:function(e,r){return{left:"",left_space:"",right:e,right_space:" "+e}[r]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},f=function(e){if(!e||"object"!==o()(e))return m;var r=e.currency_code,t=e.currency_symbol,c=e.currency_thousand_separator,a=e.currency_decimal_separator,n=e.currency_minor_unit,i=e.currency_prefix,l=e.currency_suffix;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof c?c:",",decimalSeparator:"string"==typeof a?a:".",minorUnit:Number.isFinite(n)?n:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof l?l:""}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},m),e)},b=function(e,r){if(""===e||void 0===e)return"";var t=parseInt(e,10);if(!Number.isFinite(t))return"";var c=y(r),a=t/Math.pow(10,c.minorUnit),n=c.prefix+a+c.suffix,o=document.createElement("textarea");return o.innerHTML=n,o.value}},295:function(e,r,t){"use strict";t.r(r);var c=t(6),a=t.n(c),n=(t(4),t(5)),o=t.n(n),i=t(127),l=t(148),s=t(69),u=t(189),p=t(8),m=t(188);r.default=Object(m.withProductDataContext)((function(e){var r,t,c,n,m,f,y,b=e.className,d=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,N=e.customSaleFontSize,O=e.color,C=e.customColor,P=e.saleColor,j=e.customSaleColor,S=Object(s.useInnerBlockLayoutContext)().parentClassName,R=Object(s.useProductDataContext)().product,w=o()(b,a()({},"".concat(S,"__product-price"),S));if(!R.id)return React.createElement(i.a,{align:d,className:w});var E=Object(u.getColorClassName)("color",O),h=Object(u.getFontSizeClass)(g),x=Object(u.getColorClassName)("color",P),k=Object(u.getFontSizeClass)(_),U=o()((r={"has-text-color":O||C,"has-font-size":g||v},a()(r,E,E),a()(r,h,h),r)),D=o()((t={"has-text-color":P||j,"has-font-size":_||N},a()(t,x,x),a()(t,k,k),t)),F={color:C,fontSize:v},z={color:j,fontSize:N},Y=R.prices,M=Object(l.c)(Y),T=Y.price!==Y.regular_price,V=T?o()((c={},a()(c,"".concat(S,"__product-price__value"),S),a()(c,D,Object(p.F)()),c)):o()((n={},a()(n,"".concat(S,"__product-price__value"),S),a()(n,U,Object(p.F)()),n)),B=T?z:F;return React.createElement(i.a,{align:d,className:w,currency:M,price:Y.price,priceClassName:V,priceStyle:Object(p.F)()?B:{},minPrice:null==Y||null===(m=Y.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==Y||null===(f=Y.price_range)||void 0===f?void 0:f.max_amount,regularPrice:Y.regular_price,regularPriceClassName:o()((y={},a()(y,"".concat(S,"__product-price__regular"),S),a()(y,U,Object(p.F)()),y)),regularPriceStyle:Object(p.F)()?F:{}})}))},38:function(e,r,t){"use strict";var c=t(11),a=t.n(c),n=t(6),o=t.n(n),i=t(14),l=t.n(i),s=t(99),u=t(5),p=t.n(u);t(120);function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){o()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.a=function(e){var r=e.className,t=e.value,c=e.currency,n=e.onValueChange,o=l()(e,["className","value","currency","onValueChange"]);if("-"===t)return null;var i=t/Math.pow(10,c.minorUnit);if(!Number.isFinite(i))return null;var u=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),m=f(f(f({displayType:"text"},o),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),y=n?function(e){var r=e.value*Math.pow(10,c.minorUnit);n(r)}:function(){};return React.createElement(s.a,a()({className:u},m,{value:i,onValueChange:y}))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[6],{122:function(e,r){},130:function(e,r,t){"use strict";var c=t(6),a=t.n(c),n=t(1),o=t(38),i=t(5),l=t.n(i),s=(t(4),t(149),function(e){var r=e.className,t=e.currency,c=e.maxPrice,a=e.minPrice,n=e.priceClassName,i=e.priceStyle;return React.createElement("span",{className:r},React.createElement(o.a,{className:l()("wc-block-components-product-price__value",n),currency:t,value:a,style:i})," — ",React.createElement(o.a,{className:l()("wc-block-components-product-price__value",n),currency:t,value:c,style:i}))}),u=function(e){var r=e.className,t=e.currency,c=e.regularPriceClassName,a=e.regularPriceStyle,i=e.regularPrice,s=e.priceClassName,u=e.priceStyle,p=e.price;return React.createElement("span",{className:r},React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("del",{className:l()("wc-block-components-product-price__regular",c),style:a},e)},value:i}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:l()("wc-block-components-product-price__value","is-discounted",s),style:u},e)},value:p}))};r.a=function(e){var r=e.align,t=e.className,c=e.currency,n=e.maxPrice,i=void 0===n?null:n,p=e.minPrice,m=void 0===p?null:p,f=e.price,y=void 0===f?null:f,b=e.priceClassName,d=e.priceStyle,g=e.regularPrice,v=e.regularPriceClassName,_=e.regularPriceStyle,N=l()(t,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));return g&&y!==g?React.createElement(u,{className:N,currency:c,price:y,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:v,regularPriceStyle:_}):null!==m&&null!==i?React.createElement(s,{className:N,currency:c,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):null!==y?React.createElement("span",{className:N},React.createElement(o.a,{className:l()("wc-block-components-product-price__value",b),currency:c,value:y,style:d})):React.createElement("span",{className:N},React.createElement("span",{className:l()("wc-block-components-product-price__value",b)}))}},149:function(e,r){},152:function(e,r,t){"use strict";t.d(r,"c",(function(){return f})),t.d(r,"b",(function(){return y})),t.d(r,"a",(function(){return b}));var c=t(6),a=t.n(c),n=t(23),o=t.n(n),i=t(2);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){a()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var u,p,m={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(u=i.CURRENCY.symbol,p=i.CURRENCY.symbolPosition,{left:u,left_space:" "+u,right:"",right_space:""}[p]||""),suffix:function(e,r){return{left:"",left_space:"",right:e,right_space:" "+e}[r]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},f=function(e){if(!e||"object"!==o()(e))return m;var r=e.currency_code,t=e.currency_symbol,c=e.currency_thousand_separator,a=e.currency_decimal_separator,n=e.currency_minor_unit,i=e.currency_prefix,l=e.currency_suffix;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof c?c:",",decimalSeparator:"string"==typeof a?a:".",minorUnit:Number.isFinite(n)?n:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof l?l:""}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},m),e)},b=function(e,r){if(""===e||void 0===e)return"";var t=parseInt(e,10);if(!Number.isFinite(t))return"";var c=y(r),a=t/Math.pow(10,c.minorUnit),n=c.prefix+a+c.suffix,o=document.createElement("textarea");return o.innerHTML=n,o.value}},297:function(e,r,t){"use strict";t.r(r);var c=t(6),a=t.n(c),n=(t(4),t(5)),o=t.n(n),i=t(130),l=t(152),s=t(69),u=t(192),p=t(8),m=t(191);r.default=Object(m.withProductDataContext)((function(e){var r,t,c,n,m,f,y,b=e.className,d=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,N=e.customSaleFontSize,O=e.color,C=e.customColor,P=e.saleColor,j=e.customSaleColor,S=Object(s.useInnerBlockLayoutContext)().parentClassName,R=Object(s.useProductDataContext)().product,w=o()(b,a()({},"".concat(S,"__product-price"),S));if(!R.id)return React.createElement(i.a,{align:d,className:w});var E=Object(u.getColorClassName)("color",O),h=Object(u.getFontSizeClass)(g),x=Object(u.getColorClassName)("color",P),k=Object(u.getFontSizeClass)(_),U=o()((r={"has-text-color":O||C,"has-font-size":g||v},a()(r,E,E),a()(r,h,h),r)),D=o()((t={"has-text-color":P||j,"has-font-size":_||N},a()(t,x,x),a()(t,k,k),t)),F={color:C,fontSize:v},z={color:j,fontSize:N},Y=R.prices,M=Object(l.c)(Y),T=Y.price!==Y.regular_price,V=T?o()((c={},a()(c,"".concat(S,"__product-price__value"),S),a()(c,D,Object(p.F)()),c)):o()((n={},a()(n,"".concat(S,"__product-price__value"),S),a()(n,U,Object(p.F)()),n)),B=T?z:F;return React.createElement(i.a,{align:d,className:w,currency:M,price:Y.price,priceClassName:V,priceStyle:Object(p.F)()?B:{},minPrice:null==Y||null===(m=Y.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==Y||null===(f=Y.price_range)||void 0===f?void 0:f.max_amount,regularPrice:Y.regular_price,regularPriceClassName:o()((y={},a()(y,"".concat(S,"__product-price__regular"),S),a()(y,U,Object(p.F)()),y)),regularPriceStyle:Object(p.F)()?F:{}})}))},38:function(e,r,t){"use strict";var c=t(11),a=t.n(c),n=t(6),o=t.n(n),i=t(14),l=t.n(i),s=t(100),u=t(5),p=t.n(u);t(122);function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){o()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.a=function(e){var r=e.className,t=e.value,c=e.currency,n=e.onValueChange,o=l()(e,["className","value","currency","onValueChange"]);if("-"===t)return null;var i=t/Math.pow(10,c.minorUnit);if(!Number.isFinite(i))return null;var u=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),m=f(f(f({displayType:"text"},o),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),y=n?function(e){var r=e.value*Math.pow(10,c.minorUnit);n(r)}:function(){};return React.createElement(s.a,a()({className:u},m,{value:i,onValueChange:y}))}}}]);
build/atomic-block-components/price.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{166:function(e,r,t){"use strict";var c=t(8),n=t.n(c),a=t(0),o=t(1),i=t(55),l=t(7),s=t.n(l),u=(t(2),t(233),function(e){var r=e.className,t=e.currency,c=e.maxPrice,n=e.minPrice,o=e.priceClassName,l=e.priceStyle;return Object(a.createElement)("span",{className:r},Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:n,style:l})," — ",Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:c,style:l}))}),p=function(e){var r=e.className,t=e.currency,c=e.regularPriceClassName,n=e.regularPriceStyle,l=e.regularPrice,u=e.priceClassName,p=e.priceStyle,m=e.price;return Object(a.createElement)("span",{className:r},Object(a.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(a.createElement)(i.a,{currency:t,renderText:function(e){return Object(a.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:n},e)},value:l}),Object(a.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(a.createElement)(i.a,{currency:t,renderText:function(e){return Object(a.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",u),style:p},e)},value:m}))};r.a=function(e){var r=e.align,t=e.className,c=e.currency,o=e.maxPrice,l=void 0===o?null:o,m=e.minPrice,b=void 0===m?null:m,f=e.price,y=void 0===f?null:f,d=e.priceClassName,O=e.priceStyle,g=e.regularPrice,j=e.regularPriceClassName,v=e.regularPriceStyle,_=s()(t,"price","wc-block-components-product-price",n()({},"wc-block-components-product-price--align-".concat(r),r));return g&&y!==g?Object(a.createElement)(p,{className:_,currency:c,price:y,priceClassName:d,priceStyle:O,regularPrice:g,regularPriceClassName:j,regularPriceStyle:v}):null!==b&&null!==l?Object(a.createElement)(u,{className:_,currency:c,maxPrice:l,minPrice:b,priceClassName:d,priceStyle:O}):null!==y?Object(a.createElement)("span",{className:_},Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",d),currency:c,value:y,style:O})):Object(a.createElement)("span",{className:_},Object(a.createElement)("span",{className:s()("wc-block-components-product-price__value",d)}))}},193:function(e,r){},233:function(e,r){},254:function(e,r,t){"use strict";t.d(r,"c",(function(){return b})),t.d(r,"b",(function(){return f})),t.d(r,"a",(function(){return y}));var c=t(8),n=t.n(c),a=t(52),o=t.n(a),i=t(3);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){n()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var u,p,m={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(u=i.CURRENCY.symbol,p=i.CURRENCY.symbolPosition,{left:u,left_space:" "+u,right:"",right_space:""}[p]||""),suffix:function(e,r){return{left:"",left_space:"",right:e,right_space:" "+e}[r]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==o()(e))return m;var r=e.currency_code,t=e.currency_symbol,c=e.currency_thousand_separator,n=e.currency_decimal_separator,a=e.currency_minor_unit,i=e.currency_prefix,l=e.currency_suffix;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof c?c:",",decimalSeparator:"string"==typeof n?n:".",minorUnit:Number.isFinite(a)?a:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof l?l:""}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},m),e)},y=function(e,r){if(""===e||void 0===e)return"";var t=parseInt(e,10);if(!Number.isFinite(t))return"";var c=f(r),n=t/Math.pow(10,c.minorUnit),a=c.prefix+n+c.suffix,o=document.createElement("textarea");return o.innerHTML=a,o.value}},526:function(e,r,t){"use strict";t.r(r);var c=t(8),n=t.n(c),a=t(0),o=(t(2),t(7)),i=t.n(o),l=t(166),s=t(254),u=t(44),p=t(14),m=t(5),b=t(72);r.default=Object(b.withProductDataContext)((function(e){var r,t,c,o,b,f,y,d=e.className,O=e.align,g=e.fontSize,j=e.customFontSize,v=e.saleFontSize,_=e.customSaleFontSize,N=e.color,C=e.customColor,P=e.saleColor,S=e.customSaleColor,w=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,h=i()(d,n()({},"".concat(w,"__product-price"),w));if(!E.id)return Object(a.createElement)(l.a,{align:O,className:h});var x=Object(p.getColorClassName)("color",N),k=Object(p.getFontSizeClass)(g),R=Object(p.getColorClassName)("color",P),U=Object(p.getFontSizeClass)(v),D=i()((r={"has-text-color":N||C,"has-font-size":g||j},n()(r,x,x),n()(r,k,k),r)),z=i()((t={"has-text-color":P||S,"has-font-size":v||_},n()(t,R,R),n()(t,U,U),t)),Y={color:C,fontSize:j},F={color:S,fontSize:_},W=E.prices,M=Object(s.c)(W),T=W.price!==W.regular_price,V=T?i()((c={},n()(c,"".concat(w,"__product-price__value"),w),n()(c,z,Object(m.W)()),c)):i()((o={},n()(o,"".concat(w,"__product-price__value"),w),n()(o,D,Object(m.W)()),o)),B=T?F:Y;return Object(a.createElement)(l.a,{align:O,className:h,currency:M,price:W.price,priceClassName:V,priceStyle:Object(m.W)()?B:{},minPrice:null==W||null===(b=W.price_range)||void 0===b?void 0:b.min_amount,maxPrice:null==W||null===(f=W.price_range)||void 0===f?void 0:f.max_amount,regularPrice:W.regular_price,regularPriceClassName:i()((y={},n()(y,"".concat(w,"__product-price__regular"),w),n()(y,D,Object(m.W)()),y)),regularPriceStyle:Object(m.W)()?Y:{}})}))},55:function(e,r,t){"use strict";var c=t(10),n=t.n(c),a=t(8),o=t.n(a),i=t(27),l=t.n(i),s=t(0),u=t(184),p=t(7),m=t.n(p);t(193);function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){o()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.a=function(e){var r=e.className,t=e.value,c=e.currency,a=e.onValueChange,o=l()(e,["className","value","currency","onValueChange"]);if("-"===t)return null;var i=t/Math.pow(10,c.minorUnit);if(!Number.isFinite(i))return null;var p=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),b=f(f(f({displayType:"text"},o),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),y=a?function(e){var r=e.value*Math.pow(10,c.minorUnit);a(r)}:function(){};return Object(s.createElement)(u.a,n()({className:p},b,{value:i,onValueChange:y}))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{164:function(e,r,t){"use strict";var c=t(8),n=t.n(c),a=t(0),o=t(1),i=t(56),l=t(7),s=t.n(l),u=(t(2),t(236),function(e){var r=e.className,t=e.currency,c=e.maxPrice,n=e.minPrice,o=e.priceClassName,l=e.priceStyle;return Object(a.createElement)("span",{className:r},Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:n,style:l})," — ",Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:c,style:l}))}),p=function(e){var r=e.className,t=e.currency,c=e.regularPriceClassName,n=e.regularPriceStyle,l=e.regularPrice,u=e.priceClassName,p=e.priceStyle,m=e.price;return Object(a.createElement)("span",{className:r},Object(a.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(a.createElement)(i.a,{currency:t,renderText:function(e){return Object(a.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:n},e)},value:l}),Object(a.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(a.createElement)(i.a,{currency:t,renderText:function(e){return Object(a.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",u),style:p},e)},value:m}))};r.a=function(e){var r=e.align,t=e.className,c=e.currency,o=e.maxPrice,l=void 0===o?null:o,m=e.minPrice,b=void 0===m?null:m,f=e.price,y=void 0===f?null:f,d=e.priceClassName,O=e.priceStyle,g=e.regularPrice,j=e.regularPriceClassName,v=e.regularPriceStyle,_=s()(t,"price","wc-block-components-product-price",n()({},"wc-block-components-product-price--align-".concat(r),r));return g&&y!==g?Object(a.createElement)(p,{className:_,currency:c,price:y,priceClassName:d,priceStyle:O,regularPrice:g,regularPriceClassName:j,regularPriceStyle:v}):null!==b&&null!==l?Object(a.createElement)(u,{className:_,currency:c,maxPrice:l,minPrice:b,priceClassName:d,priceStyle:O}):null!==y?Object(a.createElement)("span",{className:_},Object(a.createElement)(i.a,{className:s()("wc-block-components-product-price__value",d),currency:c,value:y,style:O})):Object(a.createElement)("span",{className:_},Object(a.createElement)("span",{className:s()("wc-block-components-product-price__value",d)}))}},193:function(e,r){},236:function(e,r){},258:function(e,r,t){"use strict";t.d(r,"c",(function(){return b})),t.d(r,"b",(function(){return f})),t.d(r,"a",(function(){return y}));var c=t(8),n=t.n(c),a=t(53),o=t.n(a),i=t(3);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,c)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){n()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var u,p,m={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(u=i.CURRENCY.symbol,p=i.CURRENCY.symbolPosition,{left:u,left_space:" "+u,right:"",right_space:""}[p]||""),suffix:function(e,r){return{left:"",left_space:"",right:e,right_space:" "+e}[r]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==o()(e))return m;var r=e.currency_code,t=e.currency_symbol,c=e.currency_thousand_separator,n=e.currency_decimal_separator,a=e.currency_minor_unit,i=e.currency_prefix,l=e.currency_suffix;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof c?c:",",decimalSeparator:"string"==typeof n?n:".",minorUnit:Number.isFinite(a)?a:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof l?l:""}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},m),e)},y=function(e,r