WooCommerce Gutenberg Products Block - Version 4.7.0

Version Description

  • 2021-03-16 =

Enhancements

  • A new configuration property is available to registered payment methods for additional logic handling of saved payment method tokens. (3961)
  • Provided billing data to payment method extensions so they can decide if payment is possible. (3922)
  • Prevent errant payment methods from keeping Cart and Checkout blocks from loading. (3920)
  • Fix block elements that don't play well with dark backgrounds. (3887)

Bug Fixes

  • Remove extra padding from payment methods with no description. (3952)
  • Fix "save payment" checkbox not showing for payment methods. (3950)
  • Fix cart preview when shipping rates are set to be hidden until an address is entered. (3946)
  • Sync cart item quantity if its Implicitly changed. (3907)
  • Fix FSE not being visible when WC Blocks was enabled. (3898)
  • Ensure sale badges have a uniform height in the Cart block. (3897)
Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 4.7.0
Comparing to
See all releases

Code changes from version 4.6.0 to 4.7.0

Files changed (100) hide show
  1. assets/js/base/components/cart-checkout/order-summary/test/index.js +43 -0
  2. assets/js/base/components/cart-checkout/shipping-location/index.js +11 -9
  3. assets/js/base/components/cart-checkout/totals/footer-item/index.js +0 -1
  4. assets/js/base/components/cart-checkout/totals/shipping/{index.js → index.tsx} +99 -90
  5. assets/js/base/components/formatted-monetary-amount/{index.js → index.tsx} +33 -20
  6. assets/js/base/components/label/index.tsx +2 -2
  7. assets/js/base/components/price-slider/index.js +0 -2
  8. assets/js/base/components/price-slider/style.scss +6 -6
  9. assets/js/base/components/radio-control/{option-layout.js → option-layout.tsx} +11 -5
  10. assets/js/base/components/title/index.js +1 -1
  11. assets/js/base/context/add-to-cart-form/form-state/event-emit.js +2 -8
  12. assets/js/base/context/add-to-cart-form/form-state/index.js +8 -8
  13. assets/js/base/context/cart-checkout/checkout-state/event-emit.js +2 -8
  14. assets/js/base/context/cart-checkout/checkout-state/index.js +9 -8
  15. assets/js/base/context/cart-checkout/payment-methods/actions.js +0 -111
  16. assets/js/base/context/cart-checkout/payment-methods/actions.ts +95 -0
  17. assets/js/base/context/cart-checkout/payment-methods/{constants.js → constants.ts} +27 -35
  18. assets/js/base/context/cart-checkout/payment-methods/event-emit.js +0 -41
  19. assets/js/base/context/cart-checkout/payment-methods/event-emit.ts +49 -0
  20. assets/js/base/context/cart-checkout/payment-methods/{index.js → index.ts} +0 -0
  21. assets/js/base/context/cart-checkout/payment-methods/{payment-method-data-context.js → payment-method-data-context.tsx} +75 -113
  22. assets/js/base/context/cart-checkout/payment-methods/reducer.js +0 -131
  23. assets/js/base/context/cart-checkout/payment-methods/reducer.ts +118 -0
  24. assets/js/base/context/cart-checkout/payment-methods/types.ts +152 -0
  25. assets/js/base/context/cart-checkout/payment-methods/{use-payment-method-registration.js → use-payment-method-registration.ts} +42 -25
  26. assets/js/base/context/cart-checkout/payment-methods/utils.ts +40 -0
  27. assets/js/base/context/cart-checkout/shipping/event-emit.js +2 -2
  28. assets/js/base/context/cart-checkout/shipping/index.js +10 -9
  29. assets/js/base/context/editor/index.js +13 -1
  30. assets/js/base/context/shared/event-emit/emitter-callback.js +0 -15
  31. assets/js/base/context/shared/event-emit/emitter-callback.ts +16 -0
  32. assets/js/base/context/shared/event-emit/{emitters.js → emitters.ts} +22 -21
  33. assets/js/base/context/shared/event-emit/{index.js → index.ts} +1 -0
  34. assets/js/base/context/shared/event-emit/reducer.js +0 -61
  35. assets/js/base/context/shared/event-emit/reducer.ts +65 -0
  36. assets/js/base/context/shared/event-emit/types.ts +18 -0
  37. assets/js/base/context/shared/event-emit/utils.ts +15 -0
  38. assets/js/base/context/test/utils.js +24 -13
  39. assets/js/base/hooks/cart/{index.js → index.ts} +0 -0
  40. assets/js/base/hooks/cart/{use-store-cart-coupons.js → use-store-cart-coupons.ts} +12 -5
  41. assets/js/base/hooks/cart/{use-store-cart-item-quantity.js → use-store-cart-item-quantity.ts} +6 -10
  42. assets/js/base/hooks/cart/{use-store-cart.js → use-store-cart.ts} +53 -12
  43. assets/js/base/hooks/customer/{index.js → index.ts} +0 -0
  44. assets/js/base/hooks/customer/{use-customer-data.js → use-customer-data.ts} +18 -4
  45. assets/js/base/hooks/customer/{utils.js → utils.ts} +10 -1
  46. assets/js/base/hooks/shipping/{use-select-shipping-rate.js → use-select-shipping-rate.ts} +13 -5
  47. assets/js/base/hooks/shipping/{use-select-shipping-rates.js → use-select-shipping-rates.ts} +18 -5
  48. assets/js/base/hooks/test/use-shallow-equal.js +37 -19
  49. assets/js/base/hooks/{use-container-queries.js → use-container-queries.ts} +1 -1
  50. assets/js/base/hooks/{use-previous.js → use-previous.ts} +9 -3
  51. assets/js/base/hooks/{use-shallow-equal.js → use-shallow-equal.ts} +4 -4
  52. assets/js/base/hooks/{use-store-add-to-cart.js → use-store-add-to-cart.ts} +12 -3
  53. assets/js/base/hooks/{use-throw-error.js → use-throw-error.ts} +6 -11
  54. assets/js/base/hooks/{use-trigger-fragment-refresh.js → use-trigger-fragment-refresh.ts} +2 -2
  55. assets/js/base/utils/derive-selected-shipping-rates.js +13 -12
  56. assets/js/base/utils/from-entries-polyfill.ts +13 -0
  57. assets/js/base/utils/index.js +1 -0
  58. assets/js/blocks-registry/payment-methods/payment-method-config.js +10 -0
  59. assets/js/blocks/active-filters/style.scss +3 -13
  60. assets/js/blocks/active-filters/utils.js +36 -1
  61. assets/js/blocks/cart-checkout/cart/full-cart/style.scss +1 -1
  62. assets/js/blocks/cart-checkout/payment-methods/payment-method-options.js +1 -1
  63. assets/js/blocks/cart-checkout/payment-methods/saved-payment-method-options.js +31 -7
  64. assets/js/blocks/cart-checkout/payment-methods/style.scss +4 -0
  65. assets/js/blocks/product-categories/style.scss +1 -24
  66. assets/js/blocks/product-search/style.scss +0 -23
  67. assets/js/data/cart/actions.ts +6 -1
  68. assets/js/data/cart/index.ts +2 -1
  69. assets/js/data/default-states.ts +1 -1
  70. assets/js/icons/icon/index.js +0 -23
  71. assets/js/icons/icon/index.tsx +28 -0
  72. assets/js/mapped-types.ts +40 -0
  73. assets/js/payment-method-extensions/payment-methods/bacs/index.js +1 -1
  74. assets/js/payment-method-extensions/payment-methods/cheque/index.js +1 -1
  75. assets/js/payment-method-extensions/payment-methods/cod/index.js +1 -1
  76. assets/js/payment-method-extensions/payment-methods/paypal/index.js +1 -1
  77. assets/js/previews/{cart.js → cart.ts} +31 -2
  78. assets/js/previews/{shipping-rates.js → shipping-rates.ts} +16 -2
  79. assets/js/settings/blocks/constants.js +5 -0
  80. assets/js/type-defs/cart-response.ts +8 -4
  81. assets/js/type-defs/cart.ts +7 -5
  82. assets/js/type-defs/contexts.js +1 -64
  83. assets/js/type-defs/hooks.ts +53 -0
  84. assets/js/type-defs/index.ts +1 -0
  85. assets/js/type-defs/shipping.ts +35 -0
  86. build/active-filters-frontend.asset.php +1 -1
  87. build/active-filters-frontend.js +2 -2
  88. build/active-filters.asset.php +1 -1
  89. build/active-filters.js +1 -1
  90. build/all-products-frontend.asset.php +1 -1
  91. build/all-products-frontend.js +2 -2
  92. build/all-products.asset.php +1 -1
  93. build/all-products.js +1 -1
  94. build/all-reviews.asset.php +1 -1
  95. build/all-reviews.js +1 -1
  96. build/atomic-block-components/add-to-cart--atomic-block-components/button-frontend.js +1 -0
  97. build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
  98. build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js +1 -1
  99. build/atomic-block-components/add-to-cart-frontend.js +1 -1
  100. build/atomic-block-components/add-to-cart.js +1 -1
assets/js/base/components/cart-checkout/order-summary/test/index.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+ import { previewCart } from '@woocommerce/resource-previews';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import OrderSummary from '../index';
11
+
12
+ jest.mock( '@woocommerce/base-context', () => ( {
13
+ ...jest.requireActual( '@woocommerce/base-context' ),
14
+ useContainerWidthContext: () => ( {
15
+ isLarge: false,
16
+ hasContainerWidth: true,
17
+ } ),
18
+ } ) );
19
+
20
+ describe( 'Order Summary', () => {
21
+ it( 'renders correct cart line subtotal when currency has 0 decimals', async () => {
22
+ render(
23
+ <OrderSummary
24
+ cartItems={ [
25
+ {
26
+ ...previewCart.items[ 0 ],
27
+ totals: {
28
+ ...previewCart.items[ 0 ].totals,
29
+ // Change price format so there are no decimals.
30
+ currency_minor_unit: 0,
31
+ currency_prefix: '',
32
+ currency_suffix: '€',
33
+ line_subtotal: '16',
34
+ line_total: '18',
35
+ },
36
+ },
37
+ ] }
38
+ />
39
+ );
40
+
41
+ expect( screen.getByText( '16€' ) ).toBeTruthy();
42
+ } );
43
+ } );
assets/js/base/components/cart-checkout/shipping-location/index.js CHANGED
@@ -42,16 +42,18 @@ const ShippingLocation = ( { address } ) => {
42
 
43
  const formattedLocation = addressParts.filter( Boolean ).join( ', ' );
44
 
 
 
 
 
45
  return (
46
- formattedLocation && (
47
- <span className="wc-block-components-shipping-address">
48
- { sprintf(
49
- /* translators: %s location. */
50
- __( 'Shipping to %s', 'woo-gutenberg-products-block' ),
51
- formattedLocation
52
- ) + ' ' }
53
- </span>
54
- )
55
  );
56
  };
57
 
42
 
43
  const formattedLocation = addressParts.filter( Boolean ).join( ', ' );
44
 
45
+ if ( ! formattedLocation ) {
46
+ return null;
47
+ }
48
+
49
  return (
50
+ <span className="wc-block-components-shipping-address">
51
+ { sprintf(
52
+ /* translators: %s location. */
53
+ __( 'Shipping to %s', 'woo-gutenberg-products-block' ),
54
+ formattedLocation
55
+ ) + ' ' }
56
+ </span>
 
 
57
  );
58
  };
59
 
assets/js/base/components/cart-checkout/totals/footer-item/index.js CHANGED
@@ -53,7 +53,6 @@ const TotalsFooterItem = ( { currency, values } ) => {
53
  <FormattedMonetaryAmount
54
  className="wc-block-components-totals-footer-item-tax-value"
55
  currency={ currency }
56
- displayType="text"
57
  value={ parseInt( totalTax, 10 ) }
58
  />
59
  ),
53
  <FormattedMonetaryAmount
54
  className="wc-block-components-totals-footer-item-tax-value"
55
  currency={ currency }
 
56
  value={ parseInt( totalTax, 10 ) }
57
  />
58
  ),
assets/js/base/components/cart-checkout/totals/shipping/{index.js → index.tsx} RENAMED
@@ -4,7 +4,6 @@
4
  import classnames from 'classnames';
5
  import { __ } from '@wordpress/i18n';
6
  import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
7
- import PropTypes from 'prop-types';
8
  import { useState } from '@wordpress/element';
9
  import { useStoreCart } from '@woocommerce/base-hooks';
10
  import {
@@ -12,7 +11,8 @@ import {
12
  ShippingLocation,
13
  } from '@woocommerce/base-components/cart-checkout';
14
  import { TotalsItem } from '@woocommerce/blocks-checkout';
15
-
 
16
  /**
17
  * Internal dependencies
18
  */
@@ -20,25 +20,110 @@ import ShippingRateSelector from './shipping-rate-selector';
20
  import hasShippingRate from './has-shipping-rate';
21
  import './style.scss';
22
 
23
- /** @typedef {import('react')} React */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- /**
26
- * Renders the shipping totals row, rates, and calculator if enabled.
27
- *
28
- * @param {Object} props Incoming props for the component.
29
- * @param {Object} props.currency Currency information.
30
- * @param {Object} props.values Values in use.
31
- * @param {boolean} props.showRateSelector Whether to display the rate selector below the shipping total.
32
- * @param {boolean} props.showCalculator Whether to show shipping calculator or not.
33
- * @param {string} props.className CSS Class supplied by consumer.
34
- */
35
  const TotalsShipping = ( {
36
  currency,
37
  values,
38
  showCalculator = true,
39
  showRateSelector = true,
40
  className,
41
- } ) => {
42
  const [ isShippingCalculatorOpen, setIsShippingCalculatorOpen ] = useState(
43
  false
44
  );
@@ -109,80 +194,4 @@ const TotalsShipping = ( {
109
  );
110
  };
111
 
112
- const ShippingAddress = ( {
113
- showCalculator,
114
- isShippingCalculatorOpen,
115
- setIsShippingCalculatorOpen,
116
- shippingAddress,
117
- } ) => {
118
- return (
119
- <>
120
- <ShippingLocation address={ shippingAddress } />
121
- { showCalculator && (
122
- <CalculatorButton
123
- label={ __(
124
- '(change address)',
125
- 'woo-gutenberg-products-block'
126
- ) }
127
- isShippingCalculatorOpen={ isShippingCalculatorOpen }
128
- setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
129
- />
130
- ) }
131
- </>
132
- );
133
- };
134
-
135
- const NoShippingPlaceholder = ( {
136
- showCalculator,
137
- isShippingCalculatorOpen,
138
- setIsShippingCalculatorOpen,
139
- } ) => {
140
- if ( ! showCalculator ) {
141
- return (
142
- <em>
143
- { __(
144
- 'Calculated during checkout',
145
- 'woo-gutenberg-products-block'
146
- ) }
147
- </em>
148
- );
149
- }
150
-
151
- return (
152
- <CalculatorButton
153
- isShippingCalculatorOpen={ isShippingCalculatorOpen }
154
- setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
155
- />
156
- );
157
- };
158
-
159
- const CalculatorButton = ( {
160
- label = __( 'Calculate', 'woo-gutenberg-products-block' ),
161
- isShippingCalculatorOpen,
162
- setIsShippingCalculatorOpen,
163
- } ) => {
164
- return (
165
- <button
166
- className="wc-block-components-totals-shipping__change-address-button"
167
- onClick={ () => {
168
- setIsShippingCalculatorOpen( ! isShippingCalculatorOpen );
169
- } }
170
- aria-expanded={ isShippingCalculatorOpen }
171
- >
172
- { label }
173
- </button>
174
- );
175
- };
176
-
177
- TotalsShipping.propTypes = {
178
- currency: PropTypes.object.isRequired,
179
- values: PropTypes.shape( {
180
- total_shipping: PropTypes.string,
181
- total_shipping_tax: PropTypes.string,
182
- } ).isRequired,
183
- showRateSelector: PropTypes.bool,
184
- showCalculator: PropTypes.bool,
185
- className: PropTypes.string,
186
- };
187
-
188
  export default TotalsShipping;
4
  import classnames from 'classnames';
5
  import { __ } from '@wordpress/i18n';
6
  import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
 
7
  import { useState } from '@wordpress/element';
8
  import { useStoreCart } from '@woocommerce/base-hooks';
9
  import {
11
  ShippingLocation,
12
  } from '@woocommerce/base-components/cart-checkout';
13
  import { TotalsItem } from '@woocommerce/blocks-checkout';
14
+ import type { Currency } from '@woocommerce/price-format';
15
+ import type { ReactElement } from 'react';
16
  /**
17
  * Internal dependencies
18
  */
20
  import hasShippingRate from './has-shipping-rate';
21
  import './style.scss';
22
 
23
+ interface CalculatorButtonProps {
24
+ label?: string;
25
+ isShippingCalculatorOpen: boolean;
26
+ setIsShippingCalculatorOpen: ( isShippingCalculatorOpen: boolean ) => void;
27
+ }
28
+
29
+ const CalculatorButton = ( {
30
+ label = __( 'Calculate', 'woo-gutenberg-products-block' ),
31
+ isShippingCalculatorOpen,
32
+ setIsShippingCalculatorOpen,
33
+ }: CalculatorButtonProps ): ReactElement => {
34
+ return (
35
+ <button
36
+ className="wc-block-components-totals-shipping__change-address-button"
37
+ onClick={ () => {
38
+ setIsShippingCalculatorOpen( ! isShippingCalculatorOpen );
39
+ } }
40
+ aria-expanded={ isShippingCalculatorOpen }
41
+ >
42
+ { label }
43
+ </button>
44
+ );
45
+ };
46
+
47
+ interface ShippingAddressProps {
48
+ showCalculator: boolean;
49
+ isShippingCalculatorOpen: boolean;
50
+ setIsShippingCalculatorOpen: CalculatorButtonProps[ 'setIsShippingCalculatorOpen' ];
51
+ shippingAddress: Record< string, unknown >;
52
+ }
53
+
54
+ const ShippingAddress = ( {
55
+ showCalculator,
56
+ isShippingCalculatorOpen,
57
+ setIsShippingCalculatorOpen,
58
+ shippingAddress,
59
+ }: ShippingAddressProps ): ReactElement | null => {
60
+ return (
61
+ <>
62
+ <ShippingLocation address={ shippingAddress } />
63
+ { showCalculator && (
64
+ <CalculatorButton
65
+ label={ __(
66
+ '(change address)',
67
+ 'woo-gutenberg-products-block'
68
+ ) }
69
+ isShippingCalculatorOpen={ isShippingCalculatorOpen }
70
+ setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
71
+ />
72
+ ) }
73
+ </>
74
+ );
75
+ };
76
+
77
+ interface NoShippingPlaceholderProps {
78
+ showCalculator: boolean;
79
+ isShippingCalculatorOpen: boolean;
80
+ setIsShippingCalculatorOpen: CalculatorButtonProps[ 'setIsShippingCalculatorOpen' ];
81
+ }
82
+
83
+ const NoShippingPlaceholder = ( {
84
+ showCalculator,
85
+ isShippingCalculatorOpen,
86
+ setIsShippingCalculatorOpen,
87
+ }: NoShippingPlaceholderProps ): ReactElement => {
88
+ if ( ! showCalculator ) {
89
+ return (
90
+ <em>
91
+ { __(
92
+ 'Calculated during checkout',
93
+ 'woo-gutenberg-products-block'
94
+ ) }
95
+ </em>
96
+ );
97
+ }
98
+
99
+ return (
100
+ <CalculatorButton
101
+ isShippingCalculatorOpen={ isShippingCalculatorOpen }
102
+ setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
103
+ />
104
+ );
105
+ };
106
+
107
+ interface TotalShippingProps {
108
+ currency: Currency;
109
+ values: {
110
+ // eslint-disable-next-line camelcase
111
+ total_shipping: string;
112
+ // eslint-disable-next-line camelcase
113
+ total_shipping_tax: string;
114
+ }; // Values in use
115
+ showCalculator?: boolean; //Whether to display the rate selector below the shipping total.
116
+ showRateSelector?: boolean; // Whether to show shipping calculator or not.
117
+ className?: string;
118
+ }
119
 
 
 
 
 
 
 
 
 
 
 
120
  const TotalsShipping = ( {
121
  currency,
122
  values,
123
  showCalculator = true,
124
  showRateSelector = true,
125
  className,
126
+ }: TotalShippingProps ): ReactElement => {
127
  const [ isShippingCalculatorOpen, setIsShippingCalculatorOpen ] = useState(
128
  false
129
  );
194
  );
195
  };
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  export default TotalsShipping;
assets/js/base/components/formatted-monetary-amount/{index.js → index.tsx} RENAMED
@@ -1,21 +1,33 @@
1
  /**
2
  * External dependencies
3
  */
4
- import NumberFormat from 'react-number-format';
 
 
 
5
  import classNames from 'classnames';
 
 
6
 
7
  /**
8
  * Internal dependencies
9
  */
10
  import './style.scss';
11
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Formats currency data into the expected format for NumberFormat.
14
- *
15
- * @param {Object} currency Currency data.
16
- * @return {Object} Formatted props for NumberFormat.
17
  */
18
- const currencyToNumberFormat = ( currency ) => {
 
 
19
  return {
20
  thousandSeparator: currency.thousandSeparator,
21
  decimalSeparator: currency.decimalSeparator,
@@ -28,25 +40,22 @@ const currencyToNumberFormat = ( currency ) => {
28
  };
29
 
30
  /**
31
- * Formatted price component.
32
  *
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,
44
- value,
45
  currency,
46
  onValueChange,
 
47
  ...props
48
- } ) => {
49
- if ( value === '-' ) {
 
 
 
50
  return null;
51
  }
52
 
@@ -62,7 +71,6 @@ const FormattedMonetaryAmount = ( {
62
  className
63
  );
64
  const numberFormatProps = {
65
- displayType: 'text',
66
  ...props,
67
  ...currencyToNumberFormat( currency ),
68
  value: undefined,
@@ -72,15 +80,20 @@ const FormattedMonetaryAmount = ( {
72
 
73
  // Wrapper for NumberFormat onValueChange which handles subunit conversion.
74
  const onValueChangeWrapper = onValueChange
75
- ? ( values ) => {
76
- const minorUnitValue = values.value * 10 ** currency.minorUnit;
 
 
77
  onValueChange( minorUnitValue );
78
  }
79
- : () => {};
 
 
80
 
81
  return (
82
  <NumberFormat
83
  className={ classes }
 
84
  { ...numberFormatProps }
85
  value={ priceValue }
86
  onValueChange={ onValueChangeWrapper }
1
  /**
2
  * External dependencies
3
  */
4
+ import NumberFormat, {
5
+ NumberFormatValues,
6
+ NumberFormatProps,
7
+ } from 'react-number-format';
8
  import classNames from 'classnames';
9
+ import type { Currency } from '@woocommerce/price-format';
10
+ import type { ReactElement } from 'react';
11
 
12
  /**
13
  * Internal dependencies
14
  */
15
  import './style.scss';
16
 
17
+ interface FormattedMonetaryAmountProps {
18
+ className?: string;
19
+ displayType?: NumberFormatProps[ 'displayType' ];
20
+ value: number | string; // Value of money amount.
21
+ currency: Currency | Record< string, never >; // Currency configuration object.
22
+ onValueChange?: ( unit: number ) => void; // Function to call when value changes.
23
+ }
24
+
25
  /**
26
  * Formats currency data into the expected format for NumberFormat.
 
 
 
27
  */
28
+ const currencyToNumberFormat = (
29
+ currency: FormattedMonetaryAmountProps[ 'currency' ]
30
+ ) => {
31
  return {
32
  thousandSeparator: currency.thousandSeparator,
33
  decimalSeparator: currency.decimalSeparator,
40
  };
41
 
42
  /**
43
+ * FormattedMonetaryAmount component.
44
  *
45
  * Takes a price and returns a formatted price using the NumberFormat component.
 
 
 
 
 
 
 
46
  */
47
  const FormattedMonetaryAmount = ( {
48
  className,
49
+ value: rawValue,
50
  currency,
51
  onValueChange,
52
+ displayType = 'text',
53
  ...props
54
+ }: FormattedMonetaryAmountProps ): ReactElement | null => {
55
+ const value =
56
+ typeof rawValue === 'string' ? parseInt( rawValue, 10 ) : rawValue;
57
+
58
+ if ( ! Number.isFinite( value ) ) {
59
  return null;
60
  }
61
 
71
  className
72
  );
73
  const numberFormatProps = {
 
74
  ...props,
75
  ...currencyToNumberFormat( currency ),
76
  value: undefined,
80
 
81
  // Wrapper for NumberFormat onValueChange which handles subunit conversion.
82
  const onValueChangeWrapper = onValueChange
83
+ ? ( values: NumberFormatValues ) => {
84
+ const minorUnitValue =
85
+ ( ( values.value as unknown ) as number ) *
86
+ 10 ** currency.minorUnit;
87
  onValueChange( minorUnitValue );
88
  }
89
+ : () => {
90
+ /* not used */
91
+ };
92
 
93
  return (
94
  <NumberFormat
95
  className={ classes }
96
+ displayType={ displayType }
97
  { ...numberFormatProps }
98
  value={ priceValue }
99
  onValueChange={ onValueChangeWrapper }
assets/js/base/components/label/index.tsx CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { Fragment } from '@wordpress/element';
5
  import classNames from 'classnames';
6
- import type { HTMLAttributes } from 'react';
7
 
8
  interface LabelProps {
9
  label?: string;
@@ -23,7 +23,7 @@ const Label = ( {
23
  screenReaderLabel,
24
  wrapperElement,
25
  wrapperProps = {},
26
- }: LabelProps ): JSX.Element => {
27
  let Wrapper;
28
 
29
  const hasLabel = typeof label !== 'undefined' && label !== null;
3
  */
4
  import { Fragment } from '@wordpress/element';
5
  import classNames from 'classnames';
6
+ import type { ReactElement, HTMLAttributes } from 'react';
7
 
8
  interface LabelProps {
9
  label?: string;
23
  screenReaderLabel,
24
  wrapperElement,
25
  wrapperProps = {},
26
+ }: LabelProps ): ReactElement => {
27
  let Wrapper;
28
 
29
  const hasLabel = typeof label !== 'undefined' && label !== null;
assets/js/base/components/price-slider/index.js CHANGED
@@ -352,13 +352,11 @@ const PriceSlider = ( {
352
  : &nbsp;
353
  <FormattedMonetaryAmount
354
  currency={ currency }
355
- displayType="text"
356
  value={ minPrice }
357
  />
358
  &nbsp;&ndash;&nbsp;
359
  <FormattedMonetaryAmount
360
  currency={ currency }
361
- displayType="text"
362
  value={ maxPrice }
363
  />
364
  </div>
352
  : &nbsp;
353
  <FormattedMonetaryAmount
354
  currency={ currency }
 
355
  value={ minPrice }
356
  />
357
  &nbsp;&ndash;&nbsp;
358
  <FormattedMonetaryAmount
359
  currency={ currency }
 
360
  value={ maxPrice }
361
  />
362
  </div>
assets/js/base/components/price-slider/style.scss CHANGED
@@ -2,8 +2,8 @@
2
  @mixin thumb {
3
  background-color: transparent;
4
  background-position: 0 0;
5
- width: 26px;
6
- height: 21px;
7
  border: 0;
8
  padding: 0;
9
  margin: 0;
@@ -11,7 +11,8 @@
11
  cursor: pointer;
12
  z-index: 20;
13
  pointer-events: auto;
14
- background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='52' height='42'%3E%3Cdefs%3E%3Cpath id='a' d='M23.3176 7.9423l-8.4163-6.1432C13.1953.5706 11.2618-.0997 9.2146.0121h-.1137C4.2103.347.1159 4.368.0022 9.2827-.1115 14.644 4.2102 19 9.6696 19h.1137c1.8197 0 3.6395-.6702 5.118-1.787l8.4163-6.255c.9099-.8935.9099-2.2338 0-3.0157z'/%3E%3Cpath id='b' d='M23.3176 7.9423l-8.4163-6.1432C13.1953.5706 11.2618-.0997 9.2146.0121h-.1137C4.2103.347.1159 4.368.0022 9.2827-.1115 14.644 4.2102 19 9.6696 19h.1137c1.8197 0 3.6395-.6702 5.118-1.787l8.4163-6.255c.9099-.8935.9099-2.2338 0-3.0157z'/%3E%3C/defs%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath fill='%23FFF' fill-rule='nonzero' stroke='#{encode-color($gray-700)}' d='M24.3176 8.9423l-8.4163-6.1432c-1.706-1.2285-3.6395-1.8988-5.6867-1.787h-.1137c-4.8906.335-8.985 4.356-9.0987 9.2706C.8885 15.644 5.2102 20 10.6696 20h.1137c1.8197 0 3.6395-.6702 5.118-1.787l8.4163-6.255c.9099-.8935.9099-2.2338 0-3.0157z'/%3E%3Cpath stroke='%23B8B8B8' d='M9 6v9m3-9v9'/%3E%3Cg fill-rule='nonzero' transform='translate(1 22)'%3E%3Cuse fill='%23F8F3F7' stroke='%23FFF' stroke-opacity='.75' stroke-width='3' xlink:href='%23a'/%3E%3Cuse stroke='#{encode-color($gray-700)}' xlink:href='%23a'/%3E%3C/g%3E%3Cpath stroke='#{encode-color($gray-700)}' d='M9 27v9m3-9v9'/%3E%3Cg%3E%3Cpath fill='%23FFF' fill-rule='nonzero' stroke='#{encode-color($gray-700)}' d='M27.6824 8.9423l8.4163-6.1432c1.706-1.2285 3.6395-1.8988 5.6867-1.787h.1137c4.8906.335 8.985 4.356 9.0987 9.2706C51.1115 15.644 46.7898 20 41.3304 20h-.1137c-1.8197 0-3.6395-.6702-5.118-1.787l-8.4163-6.255c-.9099-.8935-.9099-2.2338 0-3.0157z'/%3E%3Cpath stroke='%23B8B8B8' d='M43 6v9m-3-9v9'/%3E%3C/g%3E%3Cg%3E%3Cg fill-rule='nonzero' transform='matrix(-1 0 0 1 51 22)'%3E%3Cuse fill='%23F8F3F7' stroke='%23FFF' stroke-opacity='.75' stroke-width='3' xlink:href='%23b'/%3E%3Cuse stroke='#{encode-color($gray-700)}' xlink:href='%23b'/%3E%3C/g%3E%3Cpath stroke='#{encode-color($gray-700)}' d='M43 27v9m-3-9v9'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
 
15
  transition: transform .2s ease-in-out;
16
  -webkit-appearance: none;
17
  -moz-appearance: none;
@@ -19,12 +20,11 @@
19
 
20
  &:hover {
21
  @include thumbFocus;
22
- transform: scale(1.1);
23
  }
24
  }
25
  @mixin thumbFocus {
26
- background-position-y: -21px;
27
- filter: drop-shadow(3px 0 0 rgba(255, 255, 255, .75)) drop-shadow(-3px 0 0 rgba(255, 255, 255, .75));
28
  }
29
  /* stylelint-enable */
30
  @mixin track {
2
  @mixin thumb {
3
  background-color: transparent;
4
  background-position: 0 0;
5
+ width: 28px;
6
+ height: 23px;
7
  border: 0;
8
  padding: 0;
9
  margin: 0;
11
  cursor: pointer;
12
  z-index: 20;
13
  pointer-events: auto;
14
+ background-image: url("data:image/svg+xml,%3Csvg width='56' height='46' viewBox='0 0 56 46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.3176 9.9423L16.9013 3.7991C15.1953 2.5706 13.2618 1.9003 11.2146 2.0121H11.1009C6.21029 2.3471 2.11589 6.3681 2.00219 11.2827C1.88849 16.644 6.21019 21 11.6696 21H11.7833C13.603 21 15.4228 20.3298 16.9013 19.213L25.3176 12.958C26.2275 12.0645 26.2275 10.7242 25.3176 9.9423V9.9423Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M13 7V16M10 7V16V7Z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.3176 9.94227L16.9013 3.79907C15.1953 2.57057 13.2618 1.90027 11.2146 2.01207H11.1009C6.21029 2.34707 2.11589 6.36807 2.00219 11.2827C1.88849 16.644 6.21019 21 11.6696 21H11.7833C13.603 21 15.4228 20.3298 16.9013 19.213L25.3176 12.958C26.2275 12.0645 26.2275 10.7242 25.3176 9.94227V9.94227Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M13 7V16M10 7V16V7Z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.3176 32.9423L16.9013 26.7991C15.1953 25.5706 13.2618 24.9003 11.2146 25.0121H11.1009C6.21029 25.347 2.11589 29.368 2.00219 34.2827C1.88849 39.644 6.21019 44 11.6696 44H11.7833C13.603 44 15.4228 43.3298 16.9013 42.213L25.3176 35.958C26.2275 35.0645 26.2275 33.7242 25.3176 32.9423V32.9423Z' fill='%23F8F3F7' stroke='white' stroke-opacity='0.75' stroke-width='3'/%3E%3Cpath d='M25.3176 32.9423L16.9013 26.7991C15.1953 25.5706 13.2618 24.9003 11.2146 25.0121H11.1009C6.21029 25.347 2.11589 29.368 2.00219 34.2827C1.88849 39.644 6.21019 44 11.6696 44H11.7833C13.603 44 15.4228 43.3298 16.9013 42.213L25.3176 35.958C26.2275 35.0645 26.2275 33.7242 25.3176 32.9423V32.9423Z' stroke='%23757575'/%3E%3Cpath d='M13 30V39M10 30V39V30Z' stroke='%23757575'/%3E%3Cpath d='M30.6824 9.94227L39.0987 3.79907C40.8047 2.57057 42.7382 1.90027 44.7854 2.01207H44.8991C49.7897 2.34707 53.8841 6.36807 53.9978 11.2827C54.1115 16.644 49.7898 21 44.3304 21H44.2167C42.397 21 40.5772 20.3298 39.0987 19.213L30.6824 12.958C29.7725 12.0645 29.7725 10.7242 30.6824 9.94227V9.94227Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M43 6.99997V16M46 6.99997V16V6.99997Z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.6824 32.9423L39.0987 26.7991C40.8047 25.5706 42.7382 24.9003 44.7854 25.0121H44.8991C49.7897 25.347 53.8841 29.368 53.9978 34.2827C54.1115 39.644 49.7898 44 44.3304 44H44.2167C42.397 44 40.5772 43.3298 39.0987 42.213L30.6824 35.958C29.7725 35.0645 29.7725 33.7242 30.6824 32.9423V32.9423Z' fill='%23F8F3F7' stroke='white' stroke-opacity='0.75' stroke-width='3'/%3E%3Cpath d='M30.6824 32.9423L39.0987 26.7991C40.8047 25.5706 42.7382 24.9003 44.7854 25.0121H44.8991C49.7897 25.347 53.8841 29.368 53.9978 34.2827C54.1115 39.644 49.7898 44 44.3304 44H44.2167C42.397 44 40.5772 43.3298 39.0987 42.213L30.6824 35.958C29.7725 35.0645 29.7725 33.7242 30.6824 32.9423V32.9423Z' stroke='%23757575'/%3E%3Cpath d='M43 30V39M46 30V39V30Z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Crect width='56' height='46' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
15
+
16
  transition: transform .2s ease-in-out;
17
  -webkit-appearance: none;
18
  -moz-appearance: none;
20
 
21
  &:hover {
22
  @include thumbFocus;
 
23
  }
24
  }
25
  @mixin thumbFocus {
26
+ background-position-y: -23px;
27
+ transform: scale(1.1);
28
  }
29
  /* stylelint-enable */
30
  @mixin track {
assets/js/base/components/radio-control/{option-layout.js → option-layout.tsx} RENAMED
@@ -1,16 +1,22 @@
 
 
 
 
 
 
1
  const OptionLayout = ( {
2
  label,
3
  secondaryLabel,
4
  description,
5
  secondaryDescription,
6
  id,
7
- } ) => {
8
  return (
9
  <div className="wc-block-components-radio-control__option-layout">
10
  <div className="wc-block-components-radio-control__label-group">
11
  { label && (
12
  <span
13
- id={ id ? `${ id }__label` : null }
14
  className="wc-block-components-radio-control__label"
15
  >
16
  { label }
@@ -18,7 +24,7 @@ const OptionLayout = ( {
18
  ) }
19
  { secondaryLabel && (
20
  <span
21
- id={ id ? `${ id }__secondary-label` : null }
22
  className="wc-block-components-radio-control__secondary-label"
23
  >
24
  { secondaryLabel }
@@ -28,7 +34,7 @@ const OptionLayout = ( {
28
  <div className="wc-block-components-radio-control__description-group">
29
  { description && (
30
  <span
31
- id={ id ? `${ id }__description` : null }
32
  className="wc-block-components-radio-control__description"
33
  >
34
  { description }
@@ -36,7 +42,7 @@ const OptionLayout = ( {
36
  ) }
37
  { secondaryDescription && (
38
  <span
39
- id={ id ? `${ id }__secondary-description` : null }
40
  className="wc-block-components-radio-control__secondary-description"
41
  >
42
  { secondaryDescription }
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ReactElement } from 'react';
5
+ import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
6
+
7
  const OptionLayout = ( {
8
  label,
9
  secondaryLabel,
10
  description,
11
  secondaryDescription,
12
  id,
13
+ }: Partial< PackageRateOption > ): ReactElement => {
14
  return (
15
  <div className="wc-block-components-radio-control__option-layout">
16
  <div className="wc-block-components-radio-control__label-group">
17
  { label && (
18
  <span
19
+ id={ id && `${ id }__label` }
20
  className="wc-block-components-radio-control__label"
21
  >
22
  { label }
24
  ) }
25
  { secondaryLabel && (
26
  <span
27
+ id={ id && `${ id }__secondary-label` }
28
  className="wc-block-components-radio-control__secondary-label"
29
  >
30
  { secondaryLabel }
34
  <div className="wc-block-components-radio-control__description-group">
35
  { description && (
36
  <span
37
+ id={ id && `${ id }__description` }
38
  className="wc-block-components-radio-control__description"
39
  >
40
  { description }
42
  ) }
43
  { secondaryDescription && (
44
  <span
45
+ id={ id && `${ id }__secondary-description` }
46
  className="wc-block-components-radio-control__secondary-description"
47
  >
48
  { secondaryDescription }
assets/js/base/components/title/index.js CHANGED
@@ -15,7 +15,7 @@ import './style.scss';
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.
15
  * Component that renders a block title.
16
  *
17
  * @param {Object} props Incoming props for the component.
18
+ * @param {React.ReactNode} [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.
assets/js/base/context/add-to-cart-form/form-state/event-emit.js CHANGED
@@ -28,7 +28,7 @@ const EMIT_TYPES = {
28
  *
29
  * @return {Object} An object with the add to cart form emitter registration
30
  */
31
- const emitterSubscribers = ( dispatcher ) => ( {
32
  onAddToCartAfterProcessingWithSuccess: emitterCallback(
33
  EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_SUCCESS,
34
  dispatcher
@@ -43,10 +43,4 @@ const emitterSubscribers = ( dispatcher ) => ( {
43
  ),
44
  } );
45
 
46
- export {
47
- EMIT_TYPES,
48
- emitterSubscribers,
49
- reducer,
50
- emitEvent,
51
- emitEventWithAbort,
52
- };
28
  *
29
  * @return {Object} An object with the add to cart form emitter registration
30
  */
31
+ const emitterObservers = ( dispatcher ) => ( {
32
  onAddToCartAfterProcessingWithSuccess: emitterCallback(
33
  EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_SUCCESS,
34
  dispatcher
43
  ),
44
  } );
45
 
46
+ export { EMIT_TYPES, emitterObservers, reducer, emitEvent, emitEventWithAbort };
 
 
 
 
 
 
assets/js/base/context/add-to-cart-form/form-state/index.js CHANGED
@@ -27,7 +27,7 @@ import { reducer } from './reducer';
27
  import { DEFAULT_STATE, STATUS } from './constants';
28
  import {
29
  EMIT_TYPES,
30
- emitterSubscribers,
31
  emitEvent,
32
  emitEventWithAbort,
33
  reducer as emitReducer,
@@ -99,7 +99,7 @@ export const AddToCartFormStateContextProvider = ( {
99
  reducer,
100
  DEFAULT_STATE
101
  );
102
- const [ observers, subscriber ] = useReducer( emitReducer, {} );
103
  const currentObservers = useShallowEqual( observers );
104
  const { addErrorNotice, removeNotices } = useStoreNotices();
105
  const { setValidationErrors } = useValidationContext();
@@ -114,16 +114,16 @@ export const AddToCartFormStateContextProvider = ( {
114
  */
115
  const eventRegistration = useMemo(
116
  () => ( {
117
- onAddToCartAfterProcessingWithSuccess: emitterSubscribers(
118
- subscriber
119
  ).onAddToCartAfterProcessingWithSuccess,
120
- onAddToCartAfterProcessingWithError: emitterSubscribers(
121
- subscriber
122
  ).onAddToCartAfterProcessingWithError,
123
- onAddToCartBeforeProcessing: emitterSubscribers( subscriber )
124
  .onAddToCartBeforeProcessing,
125
  } ),
126
- [ subscriber ]
127
  );
128
 
129
  /**
27
  import { DEFAULT_STATE, STATUS } from './constants';
28
  import {
29
  EMIT_TYPES,
30
+ emitterObservers,
31
  emitEvent,
32
  emitEventWithAbort,
33
  reducer as emitReducer,
99
  reducer,
100
  DEFAULT_STATE
101
  );
102
+ const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
103
  const currentObservers = useShallowEqual( observers );
104
  const { addErrorNotice, removeNotices } = useStoreNotices();
105
  const { setValidationErrors } = useValidationContext();
114
  */
115
  const eventRegistration = useMemo(
116
  () => ( {
117
+ onAddToCartAfterProcessingWithSuccess: emitterObservers(
118
+ observerDispatch
119
  ).onAddToCartAfterProcessingWithSuccess,
120
+ onAddToCartAfterProcessingWithError: emitterObservers(
121
+ observerDispatch
122
  ).onAddToCartAfterProcessingWithError,
123
+ onAddToCartBeforeProcessing: emitterObservers( observerDispatch )
124
  .onAddToCartBeforeProcessing,
125
  } ),
126
+ [ observerDispatch ]
127
  );
128
 
129
  /**
assets/js/base/context/cart-checkout/checkout-state/event-emit.js CHANGED
@@ -29,7 +29,7 @@ const EMIT_TYPES = {
29
  *
30
  * @return {Object} An object with the checkout emmitter registration
31
  */
32
- const emitterSubscribers = ( dispatcher ) => ( {
33
  onCheckoutAfterProcessingWithSuccess: emitterCallback(
34
  EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
35
  dispatcher
@@ -44,10 +44,4 @@ const emitterSubscribers = ( dispatcher ) => ( {
44
  ),
45
  } );
46
 
47
- export {
48
- EMIT_TYPES,
49
- emitterSubscribers,
50
- reducer,
51
- emitEvent,
52
- emitEventWithAbort,
53
- };
29
  *
30
  * @return {Object} An object with the checkout emmitter registration
31
  */
32
+ const emitterObservers = ( dispatcher ) => ( {
33
  onCheckoutAfterProcessingWithSuccess: emitterCallback(
34
  EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
35
  dispatcher
44
  ),
45
  } );
46
 
47
+ export { EMIT_TYPES, emitterObservers, reducer, emitEvent, emitEventWithAbort };
 
 
 
 
 
 
assets/js/base/context/cart-checkout/checkout-state/index.js CHANGED
@@ -26,7 +26,7 @@ import { reducer, prepareResponseData } from './reducer';
26
  import { DEFAULT_STATE, STATUS } from './constants';
27
  import {
28
  EMIT_TYPES,
29
- emitterSubscribers,
30
  emitEvent,
31
  emitEventWithAbort,
32
  reducer as emitReducer,
@@ -97,7 +97,7 @@ export const CheckoutStateProvider = ( {
97
  // the redirectUrl for when checkout is reset to PRISTINE state.
98
  DEFAULT_STATE.redirectUrl = redirectUrl;
99
  const [ checkoutState, dispatch ] = useReducer( reducer, DEFAULT_STATE );
100
- const [ observers, subscriber ] = useReducer( emitReducer, {} );
101
  const currentObservers = useRef( observers );
102
  const { setValidationErrors } = useValidationContext();
103
  const { addErrorNotice, removeNotices } = useStoreNotices();
@@ -120,18 +120,19 @@ export const CheckoutStateProvider = ( {
120
  }, [ observers ] );
121
  const onCheckoutAfterProcessingWithSuccess = useMemo(
122
  () =>
123
- emitterSubscribers( subscriber )
124
  .onCheckoutAfterProcessingWithSuccess,
125
- [ subscriber ]
126
  );
127
  const onCheckoutAfterProcessingWithError = useMemo(
128
  () =>
129
- emitterSubscribers( subscriber ).onCheckoutAfterProcessingWithError,
130
- [ subscriber ]
 
131
  );
132
  const onCheckoutBeforeProcessing = useMemo(
133
- () => emitterSubscribers( subscriber ).onCheckoutBeforeProcessing,
134
- [ subscriber ]
135
  );
136
 
137
  /**
26
  import { DEFAULT_STATE, STATUS } from './constants';
27
  import {
28
  EMIT_TYPES,
29
+ emitterObservers,
30
  emitEvent,
31
  emitEventWithAbort,
32
  reducer as emitReducer,
97
  // the redirectUrl for when checkout is reset to PRISTINE state.
98
  DEFAULT_STATE.redirectUrl = redirectUrl;
99
  const [ checkoutState, dispatch ] = useReducer( reducer, DEFAULT_STATE );
100
+ const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
101
  const currentObservers = useRef( observers );
102
  const { setValidationErrors } = useValidationContext();
103
  const { addErrorNotice, removeNotices } = useStoreNotices();
120
  }, [ observers ] );
121
  const onCheckoutAfterProcessingWithSuccess = useMemo(
122
  () =>
123
+ emitterObservers( observerDispatch )
124
  .onCheckoutAfterProcessingWithSuccess,
125
+ [ observerDispatch ]
126
  );
127
  const onCheckoutAfterProcessingWithError = useMemo(
128
  () =>
129
+ emitterObservers( observerDispatch )
130
+ .onCheckoutAfterProcessingWithError,
131
+ [ observerDispatch ]
132
  );
133
  const onCheckoutBeforeProcessing = useMemo(
134
+ () => emitterObservers( observerDispatch ).onCheckoutBeforeProcessing,
135
+ [ observerDispatch ]
136
  );
137
 
138
  /**
assets/js/base/context/cart-checkout/payment-methods/actions.js DELETED
@@ -1,111 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { ACTION_TYPES } from './constants';
5
-
6
- const {
7
- ERROR,
8
- FAILED,
9
- SUCCESS,
10
- SET_REGISTERED_PAYMENT_METHODS,
11
- SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
12
- SET_SHOULD_SAVE_PAYMENT_METHOD,
13
- } = ACTION_TYPES;
14
-
15
- /**
16
- * Used to dispatch a status update only for the given type.
17
- *
18
- * @param {string} type
19
- *
20
- * @return {Object} The action object.
21
- */
22
- export const statusOnly = ( type ) => ( { type } );
23
-
24
- /**
25
- * Used to dispatch an error message along with setting current payment status
26
- * to ERROR.
27
- *
28
- * @param {string} errorMessage Whatever error message accompanying the error
29
- * condition.
30
- *
31
- * @return {Object} The action object.
32
- */
33
- export const error = ( errorMessage ) => ( {
34
- type: ERROR,
35
- errorMessage,
36
- } );
37
-
38
- /**
39
- * Used to dispatch a payment failed status update.
40
- *
41
- * @param {Object} action Incoming data for the
42
- * action.
43
- * @param {string} action.errorMessage Any message accompanying
44
- * the failed payment.
45
- * @param {Object} action.paymentMethodData Arbitrary extra
46
- * information about the
47
- * payment method in use
48
- * (varies per payment
49
- * method).
50
- *
51
- * @return {Object} An action object.
52
- */
53
- export const failed = ( { errorMessage, paymentMethodData } ) => ( {
54
- type: FAILED,
55
- errorMessage,
56
- paymentMethodData,
57
- } );
58
-
59
- /**
60
- * Used to dispatch a payment success status update.
61
- *
62
- * @param {Object} action Incoming data for the
63
- * action.
64
- * @param {Object} action.paymentMethodData Arbitrary extra
65
- * information about the
66
- * payment method in use
67
- * (varies per payment
68
- * method).
69
- *
70
- * @return {Object} An action object.
71
- */
72
- export const success = ( { paymentMethodData } ) => ( {
73
- type: SUCCESS,
74
- paymentMethodData,
75
- } );
76
-
77
- /**
78
- * Used to dispatch an action for updating a registered payment method in the
79
- * state.
80
- *
81
- * @param {Object} paymentMethods Payment methods to register.
82
- * @return {Object} An action object.
83
- */
84
- export const setRegisteredPaymentMethods = ( paymentMethods ) => ( {
85
- type: SET_REGISTERED_PAYMENT_METHODS,
86
- paymentMethods,
87
- } );
88
-
89
- /**
90
- * Used to dispatch an action for updating a registered express payment
91
- * method in the state.
92
- *
93
- * @param {Object} paymentMethods Payment methods to register.
94
- * @return {Object} An action object.
95
- */
96
- export const setRegisteredExpressPaymentMethods = ( paymentMethods ) => ( {
97
- type: SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
98
- paymentMethods,
99
- } );
100
-
101
- /**
102
- * Set a flag indicating that the payment method info (e.g. a payment card)
103
- * should be saved to user account after order completion.
104
- *
105
- * @param {boolean} shouldSavePaymentMethod
106
- * @return {Object} An action object.
107
- */
108
- export const setShouldSavePaymentMethod = ( shouldSavePaymentMethod ) => ( {
109
- type: SET_SHOULD_SAVE_PAYMENT_METHOD,
110
- shouldSavePaymentMethod,
111
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/cart-checkout/payment-methods/actions.ts ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { ACTION, STATUS } from './constants';
5
+ import type { PaymentMethods } from './types';
6
+
7
+ export interface ActionType {
8
+ type: ACTION | STATUS;
9
+ errorMessage?: string;
10
+ paymentMethodData?: Record< string, unknown >;
11
+ paymentMethods?: PaymentMethods;
12
+ shouldSavePaymentMethod?: boolean;
13
+ }
14
+
15
+ /**
16
+ * Used to dispatch a status update only for the given type.
17
+ */
18
+ export const statusOnly = ( type: STATUS ): { type: STATUS } => ( { type } );
19
+
20
+ /**
21
+ * Used to dispatch an error message along with setting current payment status to ERROR.
22
+ *
23
+ * @param {string} errorMessage Whatever error message accompanying the error condition.
24
+ * @return {ActionType} The action object.
25
+ */
26
+ export const error = ( errorMessage: string ): ActionType => ( {
27
+ type: STATUS.ERROR,
28
+ errorMessage,
29
+ } );
30
+
31
+ /**
32
+ * Used to dispatch a payment failed status update.
33
+ */
34
+ export const failed = ( {
35
+ errorMessage,
36
+ paymentMethodData,
37
+ }: {
38
+ errorMessage: string;
39
+ paymentMethodData: Record< string, unknown >;
40
+ } ): ActionType => ( {
41
+ type: STATUS.FAILED,
42
+ errorMessage,
43
+ paymentMethodData,
44
+ } );
45
+
46
+ /**
47
+ * Used to dispatch a payment success status update.
48
+ */
49
+ export const success = ( {
50
+ paymentMethodData,
51
+ }: {
52
+ paymentMethodData: Record< string, unknown >;
53
+ } ): ActionType => ( {
54
+ type: STATUS.SUCCESS,
55
+ paymentMethodData,
56
+ } );
57
+
58
+ /**
59
+ * Used to dispatch an action for updating a registered payment method in the state.
60
+ *
61
+ * @param {Object} paymentMethods Payment methods to register.
62
+ * @return {Object} An action object.
63
+ */
64
+ export const setRegisteredPaymentMethods = (
65
+ paymentMethods: PaymentMethods
66
+ ): ActionType => ( {
67
+ type: ACTION.SET_REGISTERED_PAYMENT_METHODS,
68
+ paymentMethods,
69
+ } );
70
+
71
+ /**
72
+ * Used to dispatch an action for updating a registered express payment method in the state.
73
+ *
74
+ * @param {Object} paymentMethods Payment methods to register.
75
+ * @return {Object} An action object.
76
+ */
77
+ export const setRegisteredExpressPaymentMethods = (
78
+ paymentMethods: PaymentMethods
79
+ ): ActionType => ( {
80
+ type: ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
81
+ paymentMethods,
82
+ } );
83
+
84
+ /**
85
+ * Set a flag indicating that the payment method info (e.g. a payment card) should be saved to user account after order completion.
86
+ *
87
+ * @param {boolean} shouldSavePaymentMethod
88
+ * @return {Object} An action object.
89
+ */
90
+ export const setShouldSavePaymentMethod = (
91
+ shouldSavePaymentMethod: boolean
92
+ ): ActionType => ( {
93
+ type: ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD,
94
+ shouldSavePaymentMethod,
95
+ } );
assets/js/base/context/cart-checkout/payment-methods/{constants.js → constants.ts} RENAMED
@@ -1,39 +1,33 @@
1
  /**
2
- * @typedef {import('@woocommerce/type-defs/contexts').PaymentMethodDataContext} PaymentMethodDataContext
3
  */
 
 
 
 
4
 
5
- export const STATUS = {
6
- PRISTINE: 'pristine',
7
- STARTED: 'started',
8
- PROCESSING: 'processing',
9
- ERROR: 'has_error',
10
- FAILED: 'failed',
11
- SUCCESS: 'success',
12
- COMPLETE: 'complete',
13
- };
14
 
15
- export const ACTION_TYPES = {
16
- ...STATUS,
17
- SET_REGISTERED_PAYMENT_METHODS: 'set_registered_payment_methods',
18
- SET_REGISTERED_EXPRESS_PAYMENT_METHODS:
19
- 'set_registered_express_payment_methods',
20
- SET_SHOULD_SAVE_PAYMENT_METHOD: 'set_should_save_payment_method',
21
- };
22
 
23
- /**
24
- * @todo do typedefs for the payment event state.
25
- */
26
-
27
- // Note - if fields are added/shape is changed, you may want to update
28
- // PRISTINE reducer clause to preserve your new field.
29
- export const DEFAULT_PAYMENT_DATA = {
30
  currentStatus: STATUS.PRISTINE,
31
  shouldSavePaymentMethod: false,
32
  paymentMethodData: {
33
  payment_method: '',
34
- // arbitrary data the payment method
35
- // wants to pass along for payment
36
- // processing server side.
37
  },
38
  hasSavedToken: false,
39
  errorMessage: '',
@@ -41,15 +35,12 @@ export const DEFAULT_PAYMENT_DATA = {
41
  expressPaymentMethods: {},
42
  };
43
 
44
- /**
45
- * @type {PaymentMethodDataContext}
46
- */
47
- export const DEFAULT_PAYMENT_METHOD_DATA = {
48
  setPaymentStatus: () => ( {
49
  started: () => void null,
50
  processing: () => void null,
51
  completed: () => void null,
52
- error: ( errorMessage ) => void errorMessage,
53
  failed: ( errorMessage, paymentMethodData ) =>
54
  void [ errorMessage, paymentMethodData ],
55
  success: ( paymentMethodData, billingData ) =>
@@ -76,7 +67,8 @@ export const DEFAULT_PAYMENT_METHOD_DATA = {
76
  expressPaymentMethods: {},
77
  paymentMethodsInitialized: false,
78
  expressPaymentMethodsInitialized: false,
79
- onPaymentProcessing: () => void null,
80
- onPaymentSuccess: () => void null,
81
- onPaymentFail: () => void null,
 
82
  };
1
  /**
2
+ * Internal dependencies
3
  */
4
+ import type {
5
+ PaymentMethodDataContextType,
6
+ PaymentMethodDataContextState,
7
+ } from './types';
8
 
9
+ export enum STATUS {
10
+ PRISTINE = 'pristine',
11
+ STARTED = 'started',
12
+ PROCESSING = 'processing',
13
+ ERROR = 'has_error',
14
+ FAILED = 'failed',
15
+ SUCCESS = 'success',
16
+ COMPLETE = 'complete',
17
+ }
18
 
19
+ export enum ACTION {
20
+ SET_REGISTERED_PAYMENT_METHODS = 'set_registered_payment_methods',
21
+ SET_REGISTERED_EXPRESS_PAYMENT_METHODS = 'set_registered_express_payment_methods',
22
+ SET_SHOULD_SAVE_PAYMENT_METHOD = 'set_should_save_payment_method',
23
+ }
 
 
24
 
25
+ // Note - if fields are added/shape is changed, you may want to update PRISTINE reducer clause to preserve your new field.
26
+ export const DEFAULT_PAYMENT_DATA_CONTEXT_STATE: PaymentMethodDataContextState = {
 
 
 
 
 
27
  currentStatus: STATUS.PRISTINE,
28
  shouldSavePaymentMethod: false,
29
  paymentMethodData: {
30
  payment_method: '',
 
 
 
31
  },
32
  hasSavedToken: false,
33
  errorMessage: '',
35
  expressPaymentMethods: {},
36
  };
37
 
38
+ export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
 
 
 
39
  setPaymentStatus: () => ( {
40
  started: () => void null,
41
  processing: () => void null,
42
  completed: () => void null,
43
+ error: ( errorMessage: string ) => void errorMessage,
44
  failed: ( errorMessage, paymentMethodData ) =>
45
  void [ errorMessage, paymentMethodData ],
46
  success: ( paymentMethodData, billingData ) =>
67
  expressPaymentMethods: {},
68
  paymentMethodsInitialized: false,
69
  expressPaymentMethodsInitialized: false,
70
+ onPaymentProcessing: () => () => () => void null,
71
+ setExpressPaymentError: () => void null,
72
+ setShouldSavePayment: () => void null,
73
+ shouldSavePayment: false,
74
  };
assets/js/base/context/cart-checkout/payment-methods/event-emit.js DELETED
@@ -1,41 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import {
5
- reducer,
6
- emitEvent,
7
- emitEventWithAbort,
8
- emitterCallback,
9
- } from '../../shared/event-emit';
10
-
11
- const EMIT_TYPES = {
12
- PAYMENT_PROCESSING: 'payment_processing',
13
- };
14
-
15
- /**
16
- * Receives a reducer dispatcher and returns an object with the
17
- * various event emitters for the payment processing events.
18
- *
19
- * Calling the event registration function with the callback will register it
20
- * for the event emitter and will return a dispatcher for removing the
21
- * registered callback (useful for implementation in `useEffect`).
22
- *
23
- * @param {Function} dispatcher The emitter reducer dispatcher.
24
- *
25
- * @return {Object} An object with the various payment event emitter
26
- * registration functions
27
- */
28
- const emitterSubscribers = ( dispatcher ) => ( {
29
- onPaymentProcessing: emitterCallback(
30
- EMIT_TYPES.PAYMENT_PROCESSING,
31
- dispatcher
32
- ),
33
- } );
34
-
35
- export {
36
- EMIT_TYPES,
37
- emitterSubscribers,
38
- reducer,
39
- emitEvent,
40
- emitEventWithAbort,
41
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/cart-checkout/payment-methods/event-emit.ts ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useMemo } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import {
10
+ reducer,
11
+ emitEvent,
12
+ emitEventWithAbort,
13
+ emitterCallback,
14
+ ActionType,
15
+ } from '../../shared/event-emit';
16
+
17
+ const EMIT_TYPES = {
18
+ PAYMENT_PROCESSING: 'payment_processing',
19
+ };
20
+
21
+ type EventEmittersType = Record< string, ReturnType< typeof emitterCallback > >;
22
+
23
+ /**
24
+ * Receives a reducer dispatcher and returns an object with the
25
+ * various event emitters for the payment processing events.
26
+ *
27
+ * Calling the event registration function with the callback will register it
28
+ * for the event emitter and will return a dispatcher for removing the
29
+ * registered callback (useful for implementation in `useEffect`).
30
+ *
31
+ * @param {Function} observerDispatch The emitter reducer dispatcher.
32
+ * @return {Object} An object with the various payment event emitter registration functions
33
+ */
34
+ const useEventEmitters = (
35
+ observerDispatch: React.Dispatch< ActionType >
36
+ ): EventEmittersType => {
37
+ const eventEmitters = useMemo(
38
+ () => ( {
39
+ onPaymentProcessing: emitterCallback(
40
+ EMIT_TYPES.PAYMENT_PROCESSING,
41
+ observerDispatch
42
+ ),
43
+ } ),
44
+ [ observerDispatch ]
45
+ );
46
+ return eventEmitters;
47
+ };
48
+
49
+ export { EMIT_TYPES, useEventEmitters, reducer, emitEvent, emitEventWithAbort };
assets/js/base/context/cart-checkout/payment-methods/{index.js → index.ts} RENAMED
File without changes
assets/js/base/context/cart-checkout/payment-methods/{payment-method-data-context.js → payment-method-data-context.tsx} RENAMED
@@ -11,7 +11,6 @@ import {
11
  useRef,
12
  useMemo,
13
  } from '@wordpress/element';
14
- import { getSetting } from '@woocommerce/settings';
15
  import { useStoreNotices, useEmitResponse } from '@woocommerce/base-hooks';
16
 
17
  /**
@@ -19,7 +18,7 @@ import { useStoreNotices, useEmitResponse } from '@woocommerce/base-hooks';
19
  */
20
  import {
21
  STATUS,
22
- DEFAULT_PAYMENT_DATA,
23
  DEFAULT_PAYMENT_METHOD_DATA,
24
  } from './constants';
25
  import reducer from './reducer';
@@ -42,20 +41,20 @@ import { useShippingDataContext } from '../shipping';
42
  import { useEditorContext } from '../../editor';
43
  import {
44
  EMIT_TYPES,
45
- emitterSubscribers,
46
  emitEventWithAbort,
47
  reducer as emitReducer,
48
  } from './event-emit';
49
  import { useValidationContext } from '../../shared/validation';
50
 
51
- /**
52
- * @typedef {import('@woocommerce/type-defs/contexts').PaymentMethodDataContext} PaymentMethodDataContext
53
- * @typedef {import('@woocommerce/type-defs/contexts').PaymentStatusDispatch} PaymentStatusDispatch
54
- * @typedef {import('@woocommerce/type-defs/contexts').PaymentStatusDispatchers} PaymentStatusDispatchers
55
- * @typedef {import('@woocommerce/type-defs/billing').BillingData} BillingData
56
- * @typedef {import('@woocommerce/type-defs/contexts').CustomerPaymentMethod} CustomerPaymentMethod
57
- * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataResponse} ShippingDataResponse
58
- */
59
 
60
  const {
61
  STARTED,
@@ -69,43 +68,10 @@ const {
69
 
70
  const PaymentMethodDataContext = createContext( DEFAULT_PAYMENT_METHOD_DATA );
71
 
72
- /**
73
- * @return {PaymentMethodDataContext} The data and functions exposed by the
74
- * payment method context provider.
75
- */
76
- export const usePaymentMethodDataContext = () => {
77
  return useContext( PaymentMethodDataContext );
78
  };
79
 
80
- /**
81
- * Gets the payment methods saved for the current user after filtering out
82
- * disabled ones.
83
- *
84
- * @param {Object} availablePaymentMethods List of available payment methods.
85
- * @return {Object} Object containing the payment methods saved for a specific
86
- * user which are available.
87
- */
88
- const getCustomerPaymentMethods = ( availablePaymentMethods = {} ) => {
89
- const customerPaymentMethods = getSetting( 'customerPaymentMethods', {} );
90
- const paymentMethodKeys = Object.keys( customerPaymentMethods );
91
- const enabledCustomerPaymentMethods = {};
92
- paymentMethodKeys.forEach( ( type ) => {
93
- const methods = customerPaymentMethods[ type ].filter(
94
- ( { method: { gateway } } ) => {
95
- const isAvailable = gateway in availablePaymentMethods;
96
- return (
97
- isAvailable &&
98
- availablePaymentMethods[ gateway ].supports?.showSavedCards
99
- );
100
- }
101
- );
102
- if ( methods.length ) {
103
- enabledCustomerPaymentMethods[ type ] = methods;
104
- }
105
- } );
106
- return enabledCustomerPaymentMethods;
107
- };
108
-
109
  /**
110
  * PaymentMethodDataProvider is automatically included in the
111
  * CheckoutDataProvider.
@@ -113,11 +79,14 @@ const getCustomerPaymentMethods = ( availablePaymentMethods = {} ) => {
113
  * This provides the api interface (via the context hook) for payment method
114
  * status and data.
115
  *
116
- * @param {Object} props Incoming props for provider
117
- * @param {Object} props.children The wrapped components in this
118
- * provider.
119
  */
120
- export const PaymentMethodDataProvider = ( { children } ) => {
 
 
 
 
121
  const { setBillingData } = useCustomerDataContext();
122
  const {
123
  isProcessing: checkoutIsProcessing,
@@ -125,25 +94,29 @@ export const PaymentMethodDataProvider = ( { children } ) => {
125
  isCalculating: checkoutIsCalculating,
126
  hasError: checkoutHasError,
127
  } = useCheckoutContext();
 
128
  const {
129
  isSuccessResponse,
130
  isErrorResponse,
131
  isFailResponse,
132
  noticeContexts,
133
  } = useEmitResponse();
134
- // The active payment method - e.g. Stripe CC or BACS.
135
- const [ activePaymentMethod, setActive ] = useState( '' );
136
- // If a previously saved payment method is active, the token for that method.
137
- // For example, a for a Stripe CC card saved to user account.
138
- const [ activeSavedToken, setActiveSavedToken ] = useState( '' );
139
- const [ observers, subscriber ] = useReducer( emitReducer, {} );
140
- const currentObservers = useRef( observers );
141
 
142
- const { isEditor, previewData } = useEditorContext();
 
 
143
  const [ paymentData, dispatch ] = useReducer(
144
  reducer,
145
- DEFAULT_PAYMENT_DATA
146
  );
 
 
 
 
 
 
 
 
147
  const setActivePaymentMethod = useCallback(
148
  ( paymentMethodSlug ) => {
149
  setActive( paymentMethodSlug );
@@ -151,24 +124,39 @@ export const PaymentMethodDataProvider = ( { children } ) => {
151
  },
152
  [ setActive, dispatch ]
153
  );
154
- const paymentMethodsDispatcher = useCallback(
 
 
 
155
  ( paymentMethods ) => {
156
- dispatch( setRegisteredPaymentMethods( paymentMethods ) );
 
 
157
  },
158
  [ dispatch ]
159
  );
160
- const expressPaymentMethodsDispatcher = useCallback(
 
 
 
161
  ( paymentMethods ) => {
162
- dispatch( setRegisteredExpressPaymentMethods( paymentMethods ) );
 
 
 
 
163
  },
164
  [ dispatch ]
165
  );
 
166
  const paymentMethodsInitialized = usePaymentMethods(
167
  paymentMethodsDispatcher
168
  );
 
169
  const expressPaymentMethodsInitialized = useExpressPaymentMethods(
170
  expressPaymentMethodsDispatcher
171
  );
 
172
  const { setValidationErrors } = useValidationContext();
173
  const { addErrorNotice, removeNotice } = useStoreNotices();
174
  const { setShippingAddress } = useShippingDataContext();
@@ -179,9 +167,11 @@ export const PaymentMethodDataProvider = ( { children } ) => {
179
  [ dispatch ]
180
  );
181
 
182
- const customerPaymentMethods = useMemo( () => {
183
- if ( isEditor && previewData.previewSavedPaymentMethods ) {
184
- return previewData.previewSavedPaymentMethods;
 
 
185
  }
186
  if (
187
  ! paymentMethodsInitialized ||
@@ -192,7 +182,7 @@ export const PaymentMethodDataProvider = ( { children } ) => {
192
  return getCustomerPaymentMethods( paymentData.paymentMethods );
193
  }, [
194
  isEditor,
195
- previewData.previewSavedPaymentMethods,
196
  paymentMethodsInitialized,
197
  paymentData.paymentMethods,
198
  ] );
@@ -213,14 +203,6 @@ export const PaymentMethodDataProvider = ( { children } ) => {
213
  },
214
  [ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
215
  );
216
- // ensure observers are always current.
217
- useEffect( () => {
218
- currentObservers.current = observers;
219
- }, [ observers ] );
220
- const onPaymentProcessing = useMemo(
221
- () => emitterSubscribers( subscriber ).onPaymentProcessing,
222
- [ subscriber ]
223
- );
224
 
225
  const currentStatus = useMemo(
226
  () => ( {
@@ -237,53 +219,39 @@ export const PaymentMethodDataProvider = ( { children } ) => {
237
  [ paymentData.currentStatus ]
238
  );
239
 
240
- /**
241
- * @type {PaymentStatusDispatch}
242
- */
243
  const setPaymentStatus = useCallback(
244
- () => ( {
245
  started: () => dispatch( statusOnly( STARTED ) ),
246
  processing: () => dispatch( statusOnly( PROCESSING ) ),
247
  completed: () => dispatch( statusOnly( COMPLETE ) ),
248
- /**
249
- * @param {string} errorMessage An error message
250
- */
251
  error: ( errorMessage ) => dispatch( error( errorMessage ) ),
252
- /**
253
- * @param {string} errorMessage An error message
254
- * @param {Object} paymentMethodData Arbitrary payment method data to
255
- * accompany the checkout submission.
256
- * @param {BillingData|null} [billingData] The billing data accompanying the
257
- * payment method.
258
- */
259
- failed: ( errorMessage, paymentMethodData, billingData = null ) => {
260
  if ( billingData ) {
261
  setBillingData( billingData );
262
  }
263
  dispatch(
264
  failed( {
265
- errorMessage,
266
- paymentMethodData,
267
  } )
268
  );
269
  },
270
- /**
271
- * @param {Object} [paymentMethodData] Arbitrary payment method data to
272
- * accompany the checkout.
273
- * @param {BillingData|null} [billingData] The billing data accompanying the
274
- * payment method.
275
- * @param {ShippingDataResponse|null} [shippingData] The shipping data accompanying the
276
- * payment method.
277
- */
278
  success: (
279
  paymentMethodData = {},
280
- billingData = null,
281
- shippingData = null
282
  ) => {
283
  if ( billingData ) {
284
  setBillingData( billingData );
285
  }
286
- if ( shippingData !== null && shippingData?.address ) {
 
 
 
287
  setShippingAddress( shippingData.address );
288
  }
289
  dispatch(
@@ -296,8 +264,7 @@ export const PaymentMethodDataProvider = ( { children } ) => {
296
  [ dispatch, setBillingData, setShippingAddress ]
297
  );
298
 
299
- // flip payment to processing if checkout processing is complete, there are
300
- // no errors, and payment status is started.
301
  useEffect( () => {
302
  if (
303
  checkoutIsProcessing &&
@@ -315,17 +282,14 @@ export const PaymentMethodDataProvider = ( { children } ) => {
315
  setPaymentStatus,
316
  ] );
317
 
318
- // When checkout is returned to idle, set payment status to pristine
319
- // but only if payment status is already not finished.
320
  useEffect( () => {
321
  if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
322
  dispatch( statusOnly( PRISTINE ) );
323
  }
324
  }, [ checkoutIsIdle, currentStatus.isSuccessful ] );
325
 
326
- // if checkout has an error and payment is not being made with a saved token
327
- // and payment status is success, then let's sync payment status back to
328
- // pristine.
329
  useEffect( () => {
330
  if (
331
  checkoutHasError &&
@@ -438,10 +402,7 @@ export const PaymentMethodDataProvider = ( { children } ) => {
438
  addErrorNotice,
439
  ] );
440
 
441
- /**
442
- * @type {PaymentMethodDataContext}
443
- */
444
- const paymentContextData = {
445
  setPaymentStatus,
446
  currentStatus,
447
  paymentStatuses: STATUS,
@@ -461,6 +422,7 @@ export const PaymentMethodDataProvider = ( { children } ) => {
461
  shouldSavePayment: paymentData.shouldSavePaymentMethod,
462
  setShouldSavePayment,
463
  };
 
464
  return (
465
  <PaymentMethodDataContext.Provider value={ paymentContextData }>
466
  { children }
11
  useRef,
12
  useMemo,
13
  } from '@wordpress/element';
 
14
  import { useStoreNotices, useEmitResponse } from '@woocommerce/base-hooks';
15
 
16
  /**
18
  */
19
  import {
20
  STATUS,
21
+ DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
22
  DEFAULT_PAYMENT_METHOD_DATA,
23
  } from './constants';
24
  import reducer from './reducer';
41
  import { useEditorContext } from '../../editor';
42
  import {
43
  EMIT_TYPES,
44
+ useEventEmitters,
45
  emitEventWithAbort,
46
  reducer as emitReducer,
47
  } from './event-emit';
48
  import { useValidationContext } from '../../shared/validation';
49
 
50
+ import type {
51
+ PaymentStatusDispatchers,
52
+ PaymentMethods,
53
+ CustomerPaymentMethods,
54
+ PaymentMethodsDispatcherType,
55
+ PaymentMethodDataContextType,
56
+ } from './types';
57
+ import { getCustomerPaymentMethods } from './utils';
58
 
59
  const {
60
  STARTED,
68
 
69
  const PaymentMethodDataContext = createContext( DEFAULT_PAYMENT_METHOD_DATA );
70
 
71
+ export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
 
 
 
 
72
  return useContext( PaymentMethodDataContext );
73
  };
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  * PaymentMethodDataProvider is automatically included in the
77
  * CheckoutDataProvider.
79
  * This provides the api interface (via the context hook) for payment method
80
  * status and data.
81
  *
82
+ * @param {Object} props Incoming props for provider
83
+ * @param {Object} props.children The wrapped components in this provider.
 
84
  */
85
+ export const PaymentMethodDataProvider = ( {
86
+ children,
87
+ }: {
88
+ children: React.ReactChildren;
89
+ } ): JSX.Element => {
90
  const { setBillingData } = useCustomerDataContext();
91
  const {
92
  isProcessing: checkoutIsProcessing,
94
  isCalculating: checkoutIsCalculating,
95
  hasError: checkoutHasError,
96
  } = useCheckoutContext();
97
+ const { isEditor, getPreviewData } = useEditorContext();
98
  const {
99
  isSuccessResponse,
100
  isErrorResponse,
101
  isFailResponse,
102
  noticeContexts,
103
  } = useEmitResponse();
 
 
 
 
 
 
 
104
 
105
+ const [ activePaymentMethod, setActive ] = useState( '' ); // The active payment method - e.g. Stripe CC or BACS.
106
+ const [ activeSavedToken, setActiveSavedToken ] = useState( '' ); // If a previously saved payment method is active, the token for that method. For example, a for a Stripe CC card saved to user account.
107
+ const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
108
  const [ paymentData, dispatch ] = useReducer(
109
  reducer,
110
+ DEFAULT_PAYMENT_DATA_CONTEXT_STATE
111
  );
112
+ const currentObservers = useRef( observers );
113
+ const { onPaymentProcessing } = useEventEmitters( observerDispatch );
114
+
115
+ useEffect( () => {
116
+ // ensure observers are always current.
117
+ currentObservers.current = observers;
118
+ }, [ observers ] );
119
+
120
  const setActivePaymentMethod = useCallback(
121
  ( paymentMethodSlug ) => {
122
  setActive( paymentMethodSlug );
124
  },
125
  [ setActive, dispatch ]
126
  );
127
+
128
+ const paymentMethodsDispatcher = useCallback<
129
+ PaymentMethodsDispatcherType
130
+ >(
131
  ( paymentMethods ) => {
132
+ dispatch(
133
+ setRegisteredPaymentMethods( paymentMethods as PaymentMethods )
134
+ );
135
  },
136
  [ dispatch ]
137
  );
138
+
139
+ const expressPaymentMethodsDispatcher = useCallback<
140
+ PaymentMethodsDispatcherType
141
+ >(
142
  ( paymentMethods ) => {
143
+ dispatch(
144
+ setRegisteredExpressPaymentMethods(
145
+ paymentMethods as PaymentMethods
146
+ )
147
+ );
148
  },
149
  [ dispatch ]
150
  );
151
+
152
  const paymentMethodsInitialized = usePaymentMethods(
153
  paymentMethodsDispatcher
154
  );
155
+
156
  const expressPaymentMethodsInitialized = useExpressPaymentMethods(
157
  expressPaymentMethodsDispatcher
158
  );
159
+
160
  const { setValidationErrors } = useValidationContext();
161
  const { addErrorNotice, removeNotice } = useStoreNotices();
162
  const { setShippingAddress } = useShippingDataContext();
167
  [ dispatch ]
168
  );
169
 
170
+ const customerPaymentMethods = useMemo( (): CustomerPaymentMethods => {
171
+ if ( isEditor ) {
172
+ return getPreviewData(
173
+ 'previewSavedPaymentMethods'
174
+ ) as CustomerPaymentMethods;
175
  }
176
  if (
177
  ! paymentMethodsInitialized ||
182
  return getCustomerPaymentMethods( paymentData.paymentMethods );
183
  }, [
184
  isEditor,
185
+ getPreviewData,
186
  paymentMethodsInitialized,
187
  paymentData.paymentMethods,
188
  ] );
203
  },
204
  [ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
205
  );
 
 
 
 
 
 
 
 
206
 
207
  const currentStatus = useMemo(
208
  () => ( {
219
  [ paymentData.currentStatus ]
220
  );
221
 
 
 
 
222
  const setPaymentStatus = useCallback(
223
+ (): PaymentStatusDispatchers => ( {
224
  started: () => dispatch( statusOnly( STARTED ) ),
225
  processing: () => dispatch( statusOnly( PROCESSING ) ),
226
  completed: () => dispatch( statusOnly( COMPLETE ) ),
 
 
 
227
  error: ( errorMessage ) => dispatch( error( errorMessage ) ),
228
+ failed: (
229
+ errorMessage,
230
+ paymentMethodData,
231
+ billingData = undefined
232
+ ) => {
 
 
 
233
  if ( billingData ) {
234
  setBillingData( billingData );
235
  }
236
  dispatch(
237
  failed( {
238
+ errorMessage: errorMessage || '',
239
+ paymentMethodData: paymentMethodData || {},
240
  } )
241
  );
242
  },
 
 
 
 
 
 
 
 
243
  success: (
244
  paymentMethodData = {},
245
+ billingData = undefined,
246
+ shippingData = undefined
247
  ) => {
248
  if ( billingData ) {
249
  setBillingData( billingData );
250
  }
251
+ if (
252
+ typeof shippingData !== undefined &&
253
+ shippingData?.address
254
+ ) {
255
  setShippingAddress( shippingData.address );
256
  }
257
  dispatch(
264
  [ dispatch, setBillingData, setShippingAddress ]
265
  );
266
 
267
+ // flip payment to processing if checkout processing is complete, there are no errors, and payment status is started.
 
268
  useEffect( () => {
269
  if (
270
  checkoutIsProcessing &&
282
  setPaymentStatus,
283
  ] );
284
 
285
+ // When checkout is returned to idle, set payment status to pristine but only if payment status is already not finished.
 
286
  useEffect( () => {
287
  if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
288
  dispatch( statusOnly( PRISTINE ) );
289
  }
290
  }, [ checkoutIsIdle, currentStatus.isSuccessful ] );
291
 
292
+ // if checkout has an error and payment is not being made with a saved token and payment status is success, then let's sync payment status back to pristine.
 
 
293
  useEffect( () => {
294
  if (
295
  checkoutHasError &&
402
  addErrorNotice,
403
  ] );
404
 
405
+ const paymentContextData: PaymentMethodDataContextType = {
 
 
 
406
  setPaymentStatus,
407
  currentStatus,
408
  paymentStatuses: STATUS,
422
  shouldSavePayment: paymentData.shouldSavePaymentMethod,
423
  setShouldSavePayment,
424
  };
425
+
426
  return (
427
  <PaymentMethodDataContext.Provider value={ paymentContextData }>
428
  { children }
assets/js/base/context/cart-checkout/payment-methods/reducer.js DELETED
@@ -1,131 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { ACTION_TYPES, DEFAULT_PAYMENT_DATA } from './constants';
5
- const {
6
- STARTED,
7
- ERROR,
8
- FAILED,
9
- SUCCESS,
10
- PROCESSING,
11
- PRISTINE,
12
- COMPLETE,
13
- SET_REGISTERED_PAYMENT_METHODS,
14
- SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
15
- SET_SHOULD_SAVE_PAYMENT_METHOD,
16
- } = ACTION_TYPES;
17
-
18
- const hasSavedPaymentToken = ( paymentMethodData ) => {
19
- return !! (
20
- typeof paymentMethodData === 'object' && paymentMethodData.isSavedToken
21
- );
22
- };
23
-
24
- /**
25
- * Reducer for payment data state
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,
37
- {
38
- type,
39
- paymentMethodData,
40
- shouldSavePaymentMethod,
41
- errorMessage,
42
- paymentMethods,
43
- }
44
- ) => {
45
- switch ( type ) {
46
- case STARTED:
47
- return state.currentStatus !== STARTED
48
- ? {
49
- ...state,
50
- currentStatus: STARTED,
51
- }
52
- : state;
53
- case ERROR:
54
- return state.currentStatus !== ERROR
55
- ? {
56
- ...state,
57
- currentStatus: ERROR,
58
- errorMessage: errorMessage || state.errorMessage,
59
- }
60
- : state;
61
- case FAILED:
62
- return state.currentStatus !== FAILED
63
- ? {
64
- ...state,
65
- currentStatus: FAILED,
66
- paymentMethodData:
67
- paymentMethodData || state.paymentMethodData,
68
- errorMessage: errorMessage || state.errorMessage,
69
- }
70
- : state;
71
- case SUCCESS:
72
- return state.currentStatus !== SUCCESS
73
- ? {
74
- ...state,
75
- currentStatus: SUCCESS,
76
- paymentMethodData:
77
- paymentMethodData || state.paymentMethodData,
78
- hasSavedToken: hasSavedPaymentToken(
79
- paymentMethodData
80
- ),
81
- }
82
- : state;
83
- case PROCESSING:
84
- return state.currentStatus !== PROCESSING
85
- ? {
86
- ...state,
87
- currentStatus: PROCESSING,
88
- errorMessage: '',
89
- }
90
- : state;
91
- case COMPLETE:
92
- return state.currentStatus !== COMPLETE
93
- ? {
94
- ...state,
95
- currentStatus: COMPLETE,
96
- }
97
- : state;
98
-
99
- case PRISTINE:
100
- return {
101
- ...DEFAULT_PAYMENT_DATA,
102
- currentStatus: PRISTINE,
103
- // keep payment method registration state
104
- paymentMethods: {
105
- ...state.paymentMethods,
106
- },
107
- expressPaymentMethods: {
108
- ...state.expressPaymentMethods,
109
- },
110
- shouldSavePaymentMethod: state.shouldSavePaymentMethod,
111
- };
112
- case SET_REGISTERED_PAYMENT_METHODS:
113
- return {
114
- ...state,
115
- paymentMethods,
116
- };
117
- case SET_REGISTERED_EXPRESS_PAYMENT_METHODS:
118
- return {
119
- ...state,
120
- expressPaymentMethods: paymentMethods,
121
- };
122
- case SET_SHOULD_SAVE_PAYMENT_METHOD:
123
- return {
124
- ...state,
125
- shouldSavePaymentMethod,
126
- };
127
- }
128
- return state;
129
- };
130
-
131
- export default reducer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/cart-checkout/payment-methods/reducer.ts ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import {
5
+ ACTION,
6
+ STATUS,
7
+ DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
8
+ } from './constants';
9
+ import type { PaymentMethodDataContextState } from './types';
10
+ import type { ActionType } from './actions';
11
+
12
+ const hasSavedPaymentToken = (
13
+ paymentMethodData: Record< string, unknown >
14
+ ): boolean => {
15
+ return !! (
16
+ typeof paymentMethodData === 'object' && paymentMethodData.isSavedToken
17
+ );
18
+ };
19
+
20
+ /**
21
+ * Reducer for payment data state
22
+ */
23
+ const reducer = (
24
+ state = DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
25
+ {
26
+ type,
27
+ paymentMethodData = {},
28
+ shouldSavePaymentMethod = false,
29
+ errorMessage = '',
30
+ paymentMethods = {},
31
+ }: ActionType
32
+ ): PaymentMethodDataContextState => {
33
+ switch ( type ) {
34
+ case STATUS.STARTED:
35
+ return state.currentStatus !== STATUS.STARTED
36
+ ? {
37
+ ...state,
38
+ currentStatus: STATUS.STARTED,
39
+ }
40
+ : state;
41
+ case STATUS.ERROR:
42
+ return state.currentStatus !== STATUS.ERROR
43
+ ? {
44
+ ...state,
45
+ currentStatus: STATUS.ERROR,
46
+ errorMessage: errorMessage || state.errorMessage,
47
+ }
48
+ : state;
49
+ case STATUS.FAILED:
50
+ return state.currentStatus !== STATUS.FAILED
51
+ ? {
52
+ ...state,
53
+ currentStatus: STATUS.FAILED,
54
+ paymentMethodData:
55
+ paymentMethodData || state.paymentMethodData,
56
+ errorMessage: errorMessage || state.errorMessage,
57
+ }
58
+ : state;
59
+ case STATUS.SUCCESS:
60
+ return state.currentStatus !== STATUS.SUCCESS
61
+ ? {
62
+ ...state,
63
+ currentStatus: STATUS.SUCCESS,
64
+ paymentMethodData:
65
+ paymentMethodData || state.paymentMethodData,
66
+ hasSavedToken: hasSavedPaymentToken(
67
+ paymentMethodData
68
+ ),
69
+ }
70
+ : state;
71
+ case STATUS.PROCESSING:
72
+ return state.currentStatus !== STATUS.PROCESSING
73
+ ? {
74
+ ...state,
75
+ currentStatus: STATUS.PROCESSING,
76
+ errorMessage: '',
77
+ }
78
+ : state;
79
+ case STATUS.COMPLETE:
80
+ return state.currentStatus !== STATUS.COMPLETE
81
+ ? {
82
+ ...state,
83
+ currentStatus: STATUS.COMPLETE,
84
+ }
85
+ : state;
86
+
87
+ case STATUS.PRISTINE:
88
+ return {
89
+ ...DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
90
+ currentStatus: STATUS.PRISTINE,
91
+ // keep payment method registration state
92
+ paymentMethods: {
93
+ ...state.paymentMethods,
94
+ },
95
+ expressPaymentMethods: {
96
+ ...state.expressPaymentMethods,
97
+ },
98
+ shouldSavePaymentMethod: state.shouldSavePaymentMethod,
99
+ };
100
+ case ACTION.SET_REGISTERED_PAYMENT_METHODS:
101
+ return {
102
+ ...state,
103
+ paymentMethods,
104
+ };
105
+ case ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:
106
+ return {
107
+ ...state,
108
+ expressPaymentMethods: paymentMethods,
109
+ };
110
+ case ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD:
111
+ return {
112
+ ...state,
113
+ shouldSavePaymentMethod,
114
+ };
115
+ }
116
+ };
117
+
118
+ export default reducer;
assets/js/base/context/cart-checkout/payment-methods/types.ts ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ReactNode } from 'react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import type { emitterCallback } from '../../shared/event-emit';
10
+ import { STATUS } from './constants';
11
+
12
+ type ObjectType = Record< string, unknown >;
13
+ type EmptyObjectType = Record< string, never >;
14
+
15
+ export interface PaymentMethodConfig {
16
+ // A unique string to identify the payment method client side.
17
+ name: string;
18
+ // A react node for your payment method UI.
19
+ content: ReactNode;
20
+ // A react node to display a preview of your payment method in the editor.
21
+ edit: ReactNode;
22
+ // A callback to determine whether the payment method should be shown in the checkout.
23
+ canMakePayment: (
24
+ cartData: ObjectType
25
+ ) => Promise< boolean | { error: { message: string } } >;
26
+ // A unique string to represent the payment method server side. If not provided, defaults to name.
27
+ paymentMethodId?: string;
28
+ // Object that describes various features provided by the payment method.
29
+ supports: ObjectType;
30
+ // Array of card types (brands) supported by the payment method. (See stripe/credit-card for example.)
31
+ icons: ObjectType;
32
+ // A react node that will be used as a label for the payment method in the checkout.
33
+ label: ReactNode;
34
+ // An accessibility label. Screen readers will output this label when the payment method is selected.
35
+ ariaLabel: string;
36
+ // Optionally customize the label text for the checkout submit (`Place Order`) button.
37
+ placeOrderButtonLabel?: string;
38
+ }
39
+
40
+ export type ExpressPaymentMethodConfig = Omit<
41
+ PaymentMethodConfig,
42
+ 'icons' | 'label' | 'ariaLabel' | 'placeOrderButtonLabel'
43
+ >;
44
+
45
+ export type PaymentMethods =
46
+ | Record< string, PaymentMethodConfig >
47
+ | EmptyObjectType;
48
+
49
+ export type ExpressPaymentMethods =
50
+ | Record< string, ExpressPaymentMethodConfig >
51
+ | EmptyObjectType;
52
+
53
+ export interface CustomerPaymentMethod {
54
+ method: PaymentMethodConfig;
55
+ expires: string;
56
+ // eslint-disable-next-line camelcase
57
+ is_default: boolean;
58
+ tokenId: number;
59
+ actions: ObjectType;
60
+ }
61
+ export type CustomerPaymentMethods =
62
+ | Record< string, CustomerPaymentMethod >
63
+ | EmptyObjectType;
64
+
65
+ export type PaymentMethodsDispatcherType = (
66
+ paymentMethods: PaymentMethods | ExpressPaymentMethods
67
+ ) => void;
68
+
69
+ export interface PaymentStatusDispatchers {
70
+ started: () => void;
71
+ processing: () => void;
72
+ completed: () => void;
73
+ error: ( error: string ) => void;
74
+ failed: (
75
+ error?: string,
76
+ paymentMethodData?: ObjectType | EmptyObjectType,
77
+ billingData?: ObjectType | EmptyObjectType
78
+ ) => void;
79
+ success: (
80
+ paymentMethodData?: ObjectType | EmptyObjectType,
81
+ billingData?: ObjectType | EmptyObjectType,
82
+ shippingData?: ObjectType | EmptyObjectType
83
+ ) => void;
84
+ }
85
+
86
+ export interface PaymentMethodDataContextState {
87
+ currentStatus: STATUS;
88
+ shouldSavePaymentMethod: boolean;
89
+ paymentMethodData: ObjectType | EmptyObjectType;
90
+ hasSavedToken: boolean;
91
+ errorMessage: string;
92
+ paymentMethods: PaymentMethods;
93
+ expressPaymentMethods: ExpressPaymentMethods;
94
+ }
95
+
96
+ export type PaymentMethodCurrentStatusType = {
97
+ // If true then the payment method state in checkout is pristine.
98
+ isPristine: boolean;
99
+ // If true then the payment method has been initialized and has started.
100
+ isStarted: boolean;
101
+ // If true then the payment method is processing payment.
102
+ isProcessing: boolean;
103
+ // If true then the payment method is in a finished state (which may mean it's status is either error, failed, or success).
104
+ isFinished: boolean;
105
+ // If true then the payment method is in an error state.
106
+ hasError: boolean;
107
+ // If true then the payment method has failed (usually indicates a problem with the payment method used, not logic error).
108
+ hasFailed: boolean;
109
+ // If true then the payment method has completed it's processing successfully.
110
+ isSuccessful: boolean;
111
+ };
112
+
113
+ export type PaymentMethodDataContextType = {
114
+ // Sets the payment status for the payment method.
115
+ setPaymentStatus: () => PaymentStatusDispatchers;
116
+ // The current payment status.
117
+ currentStatus: PaymentMethodCurrentStatusType;
118
+ // An object of payment status constants.
119
+ paymentStatuses: ObjectType;
120
+ // Arbitrary data to be passed along for processing by the payment method on the server.
121
+ paymentMethodData: ObjectType | EmptyObjectType;
122
+ // An error message provided by the payment method if there is an error.
123
+ errorMessage: string;
124
+ // The active payment method slug.
125
+ activePaymentMethod: string;
126
+ // A function for setting the active payment method.
127
+ setActivePaymentMethod: ( paymentMethod: string ) => void;
128
+ // Current active token.
129
+ activeSavedToken: string;
130
+ // A function for setting the active payment method token.
131
+ setActiveSavedToken: ( activeSavedToken: string ) => void;
132
+ // Returns the customer payment for the customer if it exists.
133
+ customerPaymentMethods:
134
+ | Record< string, CustomerPaymentMethod >
135
+ | EmptyObjectType;
136
+ // Registered payment methods.
137
+ paymentMethods: PaymentMethods;
138
+ // Registered express payment methods.
139
+ expressPaymentMethods: ExpressPaymentMethods;
140
+ // True when all registered payment methods have been initialized.
141
+ paymentMethodsInitialized: boolean;
142
+ // True when all registered express payment methods have been initialized.
143
+ expressPaymentMethodsInitialized: boolean;
144
+ // Event registration callback for registering observers for the payment processing event.
145
+ onPaymentProcessing: ReturnType< typeof emitterCallback >;
146
+ // A function used by express payment methods to indicate an error for checkout to handle. It receives an error message string. Does not change payment status.
147
+ setExpressPaymentError: ( error: string ) => void;
148
+ // A function used to set the shouldSavePayment value.
149
+ setShouldSavePayment: ( shouldSavePayment: boolean ) => void;
150
+ // True means that the configured payment method option is saved for the customer.
151
+ shouldSavePayment: boolean;
152
+ };
assets/js/base/context/cart-checkout/payment-methods/{use-payment-method-registration.js → use-payment-method-registration.ts} RENAMED
@@ -23,35 +23,37 @@ import {
23
  */
24
  import { useEditorContext } from '../../editor';
25
  import { useShippingDataContext } from '../shipping';
 
 
 
 
 
 
 
 
26
 
27
  /**
28
  * This hook handles initializing registered payment methods and exposing all
29
  * registered payment methods that can be used in the current environment (via
30
  * the payment method's `canMakePayment` property).
31
  *
32
- * @param {function(Object):undefined} dispatcher A dispatcher for setting registered
33
- * payment methods to an external
34
- * state.
35
- * @param {Object} registeredPaymentMethods Registered payment methods to
36
- * process.
37
- * @param {Array} paymentMethodsSortOrder Array of payment method names to
38
- * sort by. This should match keys of
39
- * registeredPaymentMethods.
40
- * @param {string} noticeContext Id of the context to append
41
- * notices to.
42
  *
43
- * @return {boolean} Whether the payment methods have been initialized or not. True when all payment
44
- * methods have been initialized.
45
  */
46
  const usePaymentMethodRegistration = (
47
- dispatcher,
48
- registeredPaymentMethods,
49
- paymentMethodsSortOrder,
50
- noticeContext
51
  ) => {
52
  const [ isInitialized, setIsInitialized ] = useState( false );
53
  const { isEditor } = useEditorContext();
54
- const { selectedRates, shippingAddress } = useShippingDataContext();
 
55
  const selectedShippingMethods = useShallowEqual( selectedRates );
56
  const paymentMethodsOrder = useShallowEqual( paymentMethodsSortOrder );
57
  const {
@@ -62,6 +64,7 @@ const usePaymentMethodRegistration = (
62
  const canPayArgument = useRef( {
63
  cartTotals,
64
  cartNeedsShipping,
 
65
  shippingAddress,
66
  selectedShippingMethods,
67
  paymentRequirements,
@@ -72,6 +75,7 @@ const usePaymentMethodRegistration = (
72
  canPayArgument.current = {
73
  cartTotals,
74
  cartNeedsShipping,
 
75
  shippingAddress,
76
  selectedShippingMethods,
77
  paymentRequirements,
@@ -79,6 +83,7 @@ const usePaymentMethodRegistration = (
79
  }, [
80
  cartTotals,
81
  cartNeedsShipping,
 
82
  shippingAddress,
83
  selectedShippingMethods,
84
  paymentRequirements,
@@ -87,7 +92,9 @@ const usePaymentMethodRegistration = (
87
  const refreshCanMakePayments = useCallback( async () => {
88
  let availablePaymentMethods = {};
89
 
90
- const addAvailablePaymentMethod = ( paymentMethod ) => {
 
 
91
  availablePaymentMethods = {
92
  ...availablePaymentMethods,
93
  [ paymentMethod.name ]: paymentMethod,
@@ -106,10 +113,16 @@ const usePaymentMethodRegistration = (
106
  const canPay = await Promise.resolve(
107
  paymentMethod.canMakePayment( canPayArgument.current )
108
  );
109
- if ( canPay ) {
110
- if ( canPay.error ) {
 
 
 
 
 
111
  throw new Error( canPay.error.message );
112
  }
 
113
  addAvailablePaymentMethod( paymentMethod );
114
  }
115
  } catch ( e ) {
@@ -135,7 +148,7 @@ const usePaymentMethodRegistration = (
135
 
136
  // Note: some payment methods use the `canMakePayment` callback to initialize / setup.
137
  // Example: Stripe CC, Stripe Payment Request.
138
- // That's why we track "is initialised" state here.
139
  setIsInitialized( true );
140
  }, [
141
  addErrorNotice,
@@ -168,8 +181,10 @@ const usePaymentMethodRegistration = (
168
  *
169
  * @return {boolean} True when standard payment methods have been initialized.
170
  */
171
- export const usePaymentMethods = ( dispatcher ) => {
172
- const standardMethods = getPaymentMethods();
 
 
173
  const { noticeContexts } = useEmitResponse();
174
  // Ensure all methods are present in order.
175
  // Some payment methods may not be present in PAYMENT_GATEWAY_SORT_ORDER if they
@@ -193,8 +208,10 @@ export const usePaymentMethods = ( dispatcher ) => {
193
  *
194
  * @return {boolean} True when express payment methods have been initialized.
195
  */
196
- export const useExpressPaymentMethods = ( dispatcher ) => {
197
- const expressMethods = getExpressPaymentMethods();
 
 
198
  const { noticeContexts } = useEmitResponse();
199
  return usePaymentMethodRegistration(
200
  dispatcher,
23
  */
24
  import { useEditorContext } from '../../editor';
25
  import { useShippingDataContext } from '../shipping';
26
+ import { useCustomerDataContext } from '../customer';
27
+ import type {
28
+ PaymentMethodsDispatcherType,
29
+ PaymentMethods,
30
+ ExpressPaymentMethods,
31
+ PaymentMethodConfig,
32
+ ExpressPaymentMethodConfig,
33
+ } from './types';
34
 
35
  /**
36
  * This hook handles initializing registered payment methods and exposing all
37
  * registered payment methods that can be used in the current environment (via
38
  * the payment method's `canMakePayment` property).
39
  *
40
+ * @param {function(Object):undefined} dispatcher A dispatcher for setting registered payment methods to an external state.
41
+ * @param {Object} registeredPaymentMethods Registered payment methods to process.
42
+ * @param {Array} paymentMethodsSortOrder Array of payment method names to sort by. This should match keys of registeredPaymentMethods.
43
+ * @param {string} noticeContext Id of the context to append notices to.
 
 
 
 
 
 
44
  *
45
+ * @return {boolean} Whether the payment methods have been initialized or not. True when all payment methods have been initialized.
 
46
  */
47
  const usePaymentMethodRegistration = (
48
+ dispatcher: PaymentMethodsDispatcherType,
49
+ registeredPaymentMethods: PaymentMethods | ExpressPaymentMethods,
50
+ paymentMethodsSortOrder: string[],
51
+ noticeContext: string
52
  ) => {
53
  const [ isInitialized, setIsInitialized ] = useState( false );
54
  const { isEditor } = useEditorContext();
55
+ const { selectedRates } = useShippingDataContext();
56
+ const { billingData, shippingAddress } = useCustomerDataContext();
57
  const selectedShippingMethods = useShallowEqual( selectedRates );
58
  const paymentMethodsOrder = useShallowEqual( paymentMethodsSortOrder );
59
  const {
64
  const canPayArgument = useRef( {
65
  cartTotals,
66
  cartNeedsShipping,
67
+ billingData,
68
  shippingAddress,
69
  selectedShippingMethods,
70
  paymentRequirements,
75
  canPayArgument.current = {
76
  cartTotals,
77
  cartNeedsShipping,
78
+ billingData,
79
  shippingAddress,
80
  selectedShippingMethods,
81
  paymentRequirements,
83
  }, [
84
  cartTotals,
85
  cartNeedsShipping,
86
+ billingData,
87
  shippingAddress,
88
  selectedShippingMethods,
89
  paymentRequirements,
92
  const refreshCanMakePayments = useCallback( async () => {
93
  let availablePaymentMethods = {};
94
 
95
+ const addAvailablePaymentMethod = (
96
+ paymentMethod: PaymentMethodConfig | ExpressPaymentMethodConfig
97
+ ) => {
98
  availablePaymentMethods = {
99
  ...availablePaymentMethods,
100
  [ paymentMethod.name ]: paymentMethod,
113
  const canPay = await Promise.resolve(
114
  paymentMethod.canMakePayment( canPayArgument.current )
115
  );
116
+
117
+ if ( !! canPay ) {
118
+ if (
119
+ typeof canPay === 'object' &&
120
+ canPay !== null &&
121
+ canPay.error
122
+ ) {
123
  throw new Error( canPay.error.message );
124
  }
125
+
126
  addAvailablePaymentMethod( paymentMethod );
127
  }
128
  } catch ( e ) {
148
 
149
  // Note: some payment methods use the `canMakePayment` callback to initialize / setup.
150
  // Example: Stripe CC, Stripe Payment Request.
151
+ // That's why we track "is initialized" state here.
152
  setIsInitialized( true );
153
  }, [
154
  addErrorNotice,
181
  *
182
  * @return {boolean} True when standard payment methods have been initialized.
183
  */
184
+ export const usePaymentMethods = (
185
+ dispatcher: PaymentMethodsDispatcherType
186
+ ): boolean => {
187
+ const standardMethods: PaymentMethods = getPaymentMethods() as PaymentMethods;
188
  const { noticeContexts } = useEmitResponse();
189
  // Ensure all methods are present in order.
190
  // Some payment methods may not be present in PAYMENT_GATEWAY_SORT_ORDER if they
208
  *
209
  * @return {boolean} True when express payment methods have been initialized.
210
  */
211
+ export const useExpressPaymentMethods = (
212
+ dispatcher: PaymentMethodsDispatcherType
213
+ ): boolean => {
214
+ const expressMethods: ExpressPaymentMethods = getExpressPaymentMethods() as ExpressPaymentMethods;
215
  const { noticeContexts } = useEmitResponse();
216
  return usePaymentMethodRegistration(
217
  dispatcher,
assets/js/base/context/cart-checkout/payment-methods/utils.ts ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { getSetting } from '@woocommerce/settings';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import type { PaymentMethods, CustomerPaymentMethod } from './types';
10
+
11
+ /**
12
+ * Gets the payment methods saved for the current user after filtering out disabled ones.
13
+ */
14
+ export const getCustomerPaymentMethods = (
15
+ availablePaymentMethods: PaymentMethods = {}
16
+ ): Record< string, CustomerPaymentMethod > => {
17
+ const customerPaymentMethods = getSetting( 'customerPaymentMethods', {} );
18
+ const paymentMethodKeys = Object.keys( customerPaymentMethods );
19
+ const enabledCustomerPaymentMethods = {} as Record<
20
+ string,
21
+ CustomerPaymentMethod
22
+ >;
23
+ paymentMethodKeys.forEach( ( type ) => {
24
+ const methods = customerPaymentMethods[ type ].filter(
25
+ ( {
26
+ method: { gateway },
27
+ }: {
28
+ method: {
29
+ gateway: string;
30
+ };
31
+ } ) =>
32
+ gateway in availablePaymentMethods &&
33
+ availablePaymentMethods[ gateway ].supports?.showSavedCards
34
+ );
35
+ if ( methods.length ) {
36
+ enabledCustomerPaymentMethods[ type ] = methods;
37
+ }
38
+ } );
39
+ return enabledCustomerPaymentMethods;
40
+ };
assets/js/base/context/cart-checkout/shipping/event-emit.js CHANGED
@@ -21,7 +21,7 @@ const EMIT_TYPES = {
21
  * @param {Function} dispatcher A reducer dispatcher
22
  * @return {Object} An object with `onSuccess` and `onFail` emitter registration.
23
  */
24
- const emitterSubscribers = ( dispatcher ) => ( {
25
  onSuccess: emitterCallback( EMIT_TYPES.SHIPPING_RATES_SUCCESS, dispatcher ),
26
  onFail: emitterCallback( EMIT_TYPES.SHIPPING_RATES_FAIL, dispatcher ),
27
  onSelectSuccess: emitterCallback(
@@ -34,4 +34,4 @@ const emitterSubscribers = ( dispatcher ) => ( {
34
  ),
35
  } );
36
 
37
- export { EMIT_TYPES, emitterSubscribers, reducer, emitEvent };
21
  * @param {Function} dispatcher A reducer dispatcher
22
  * @return {Object} An object with `onSuccess` and `onFail` emitter registration.
23
  */
24
+ const emitterObservers = ( dispatcher ) => ( {
25
  onSuccess: emitterCallback( EMIT_TYPES.SHIPPING_RATES_SUCCESS, dispatcher ),
26
  onFail: emitterCallback( EMIT_TYPES.SHIPPING_RATES_FAIL, dispatcher ),
27
  onSelectSuccess: emitterCallback(
34
  ),
35
  } );
36
 
37
+ export { EMIT_TYPES, emitterObservers, reducer, emitEvent };
assets/js/base/context/cart-checkout/shipping/index.js CHANGED
@@ -21,7 +21,7 @@ import { hasInvalidShippingAddress } from './utils';
21
  import { errorStatusReducer } from './reducers';
22
  import {
23
  EMIT_TYPES,
24
- emitterSubscribers,
25
  reducer as emitReducer,
26
  emitEvent,
27
  } from './event-emit';
@@ -64,18 +64,19 @@ export const ShippingDataProvider = ( { children } ) => {
64
  errorStatusReducer,
65
  NONE
66
  );
67
- const [ observers, subscriber ] = useReducer( emitReducer, {} );
68
  const currentObservers = useRef( observers );
69
- const eventSubscribers = useMemo(
70
  () => ( {
71
- onShippingRateSuccess: emitterSubscribers( subscriber ).onSuccess,
72
- onShippingRateFail: emitterSubscribers( subscriber ).onFail,
73
- onShippingRateSelectSuccess: emitterSubscribers( subscriber )
 
74
  .onSelectSuccess,
75
- onShippingRateSelectFail: emitterSubscribers( subscriber )
76
  .onSelectFail,
77
  } ),
78
- [ subscriber ]
79
  );
80
 
81
  // set observers on ref so it's always current.
@@ -217,7 +218,7 @@ export const ShippingDataProvider = ( { children } ) => {
217
  setShippingAddress,
218
  needsShipping,
219
  hasCalculatedShipping,
220
- ...eventSubscribers,
221
  };
222
 
223
  return (
21
  import { errorStatusReducer } from './reducers';
22
  import {
23
  EMIT_TYPES,
24
+ emitterObservers,
25
  reducer as emitReducer,
26
  emitEvent,
27
  } from './event-emit';
64
  errorStatusReducer,
65
  NONE
66
  );
67
+ const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
68
  const currentObservers = useRef( observers );
69
+ const eventObservers = useMemo(
70
  () => ( {
71
+ onShippingRateSuccess: emitterObservers( observerDispatch )
72
+ .onSuccess,
73
+ onShippingRateFail: emitterObservers( observerDispatch ).onFail,
74
+ onShippingRateSelectSuccess: emitterObservers( observerDispatch )
75
  .onSelectSuccess,
76
+ onShippingRateSelectFail: emitterObservers( observerDispatch )
77
  .onSelectFail,
78
  } ),
79
+ [ observerDispatch ]
80
  );
81
 
82
  // set observers on ref so it's always current.
218
  setShippingAddress,
219
  needsShipping,
220
  hasCalculatedShipping,
221
+ ...eventObservers,
222
  };
223
 
224
  return (
assets/js/base/context/editor/index.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { createContext, useContext } from '@wordpress/element';
5
  import { useSelect } from '@wordpress/data';
6
 
7
  /**
@@ -13,6 +13,7 @@ const EditorContext = createContext( {
13
  isEditor: false,
14
  currentPostId: 0,
15
  previewData: {},
 
16
  } );
17
 
18
  /**
@@ -49,6 +50,16 @@ export const EditorProvider = ( {
49
  [ currentPostId ]
50
  );
51
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * @type {EditorDataContext}
54
  */
@@ -56,6 +67,7 @@ export const EditorProvider = ( {
56
  isEditor: true,
57
  currentPostId: editingPostId,
58
  previewData,
 
59
  };
60
 
61
  return (
1
  /**
2
  * External dependencies
3
  */
4
+ import { createContext, useContext, useCallback } from '@wordpress/element';
5
  import { useSelect } from '@wordpress/data';
6
 
7
  /**
13
  isEditor: false,
14
  currentPostId: 0,
15
  previewData: {},
16
+ getPreviewData: () => void null,
17
  } );
18
 
19
  /**
50
  [ currentPostId ]
51
  );
52
 
53
+ const getPreviewData = useCallback(
54
+ ( name ) => {
55
+ if ( name in previewData ) {
56
+ return previewData[ name ];
57
+ }
58
+ return {};
59
+ },
60
+ [ previewData ]
61
+ );
62
+
63
  /**
64
  * @type {EditorDataContext}
65
  */
67
  isEditor: true,
68
  currentPostId: editingPostId,
69
  previewData,
70
+ getPreviewData,
71
  };
72
 
73
  return (
assets/js/base/context/shared/event-emit/emitter-callback.js DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { actions } from './reducer';
5
-
6
- export const emitterCallback = ( type, dispatcher ) => (
7
- callback,
8
- priority = 10
9
- ) => {
10
- const action = actions.addEventCallback( type, callback, priority );
11
- dispatcher( action );
12
- return () => {
13
- dispatcher( actions.removeEventCallback( type, action.id ) );
14
- };
15
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/shared/event-emit/emitter-callback.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { actions } from './reducer';
5
+ import type { ActionType, ActionCallbackType } from './types';
6
+
7
+ export const emitterCallback = (
8
+ type: string,
9
+ observerDispatch: React.Dispatch< ActionType >
10
+ ) => ( callback: ActionCallbackType, priority = 10 ): ( () => void ) => {
11
+ const action = actions.addEventCallback( type, callback, priority );
12
+ observerDispatch( action );
13
+ return () => {
14
+ observerDispatch( actions.removeEventCallback( type, action.id ) );
15
+ };
16
+ };
assets/js/base/context/shared/event-emit/{emitters.js → emitters.ts} RENAMED
@@ -1,10 +1,8 @@
1
- const getObserversByPriority = ( observers, eventType ) => {
2
- return observers[ eventType ]
3
- ? Array.from( observers[ eventType ].values() ).sort( ( a, b ) => {
4
- return a.priority - b.priority;
5
- } )
6
- : [];
7
- };
8
 
9
  /**
10
  * Emits events on registered observers for the provided type and passes along
@@ -16,13 +14,15 @@ const getObserversByPriority = ( observers, eventType ) => {
16
  *
17
  * @param {Object} observers The registered observers to omit to.
18
  * @param {string} eventType The event type being emitted.
19
- * @param {*} data Data passed along to the observer when it is
20
- * invoked.
21
  *
22
- * @return {Promise} A promise that resolves to true after all observers have
23
- * executed.
24
  */
25
- export const emitEvent = async ( observers, eventType, data ) => {
 
 
 
 
26
  const observersByType = getObserversByPriority( observers, eventType );
27
  const observerResponses = [];
28
  for ( const observer of observersByType ) {
@@ -34,8 +34,7 @@ export const emitEvent = async ( observers, eventType, data ) => {
34
  observerResponses.push( observerResponse );
35
  }
36
  } catch ( e ) {
37
- // we don't care about errors blocking execution, but will
38
- // console.error for troubleshooting.
39
  // eslint-disable-next-line no-console
40
  console.error( e );
41
  }
@@ -50,21 +49,23 @@ export const emitEvent = async ( observers, eventType, data ) => {
50
  *
51
  * @param {Object} observers The registered observers to omit to.
52
  * @param {string} eventType The event type being emitted.
53
- * @param {*} data Data passed along to the observer when it is
54
- * invoked.
55
  *
56
- * @return {Promise} Returns a promise that resolves to either boolean or the
57
- * return value of the aborted observer.
58
  */
59
- export const emitEventWithAbort = async ( observers, eventType, data ) => {
 
 
 
 
60
  const observersByType = getObserversByPriority( observers, eventType );
61
  for ( const observer of observersByType ) {
62
  try {
63
  const response = await Promise.resolve( observer.callback( data ) );
64
- if ( typeof response !== 'object' ) {
65
  continue;
66
  }
67
- if ( typeof response.type === 'undefined' ) {
68
  throw new Error(
69
  'If you want to abort event emitter processing, your observer must return an object with a type property'
70
  );
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { getObserversByPriority } from './utils';
5
+ import type { EventObserversType } from './types';
 
 
6
 
7
  /**
8
  * Emits events on registered observers for the provided type and passes along
14
  *
15
  * @param {Object} observers The registered observers to omit to.
16
  * @param {string} eventType The event type being emitted.
17
+ * @param {*} data Data passed along to the observer when it is invoked.
 
18
  *
19
+ * @return {Promise} A promise that resolves to true after all observers have executed.
 
20
  */
21
+ export const emitEvent = async (
22
+ observers: EventObserversType,
23
+ eventType: string,
24
+ data: unknown
25
+ ): Promise< unknown > => {
26
  const observersByType = getObserversByPriority( observers, eventType );
27
  const observerResponses = [];
28
  for ( const observer of observersByType ) {
34
  observerResponses.push( observerResponse );
35
  }
36
  } catch ( e ) {
37
+ // we don't care about errors blocking execution, but will console.error for troubleshooting.
 
38
  // eslint-disable-next-line no-console
39
  console.error( e );
40
  }
49
  *
50
  * @param {Object} observers The registered observers to omit to.
51
  * @param {string} eventType The event type being emitted.
52
+ * @param {*} data Data passed along to the observer when it is invoked.
 
53
  *
54
+ * @return {Promise} Returns a promise that resolves to either boolean or the return value of the aborted observer.
 
55
  */
56
+ export const emitEventWithAbort = async (
57
+ observers: EventObserversType,
58
+ eventType: string,
59
+ data: unknown
60
+ ): Promise< unknown > => {
61
  const observersByType = getObserversByPriority( observers, eventType );
62
  for ( const observer of observersByType ) {
63
  try {
64
  const response = await Promise.resolve( observer.callback( data ) );
65
+ if ( typeof response !== 'object' || response === null ) {
66
  continue;
67
  }
68
+ if ( ! response.hasOwnProperty( 'type' ) ) {
69
  throw new Error(
70
  'If you want to abort event emitter processing, your observer must return an object with a type property'
71
  );
assets/js/base/context/shared/event-emit/{index.js → index.ts} RENAMED
@@ -1,3 +1,4 @@
1
  export * from './reducer';
2
  export * from './emitters';
3
  export * from './emitter-callback';
 
1
  export * from './reducer';
2
  export * from './emitters';
3
  export * from './emitter-callback';
4
+ export * from './types';
assets/js/base/context/shared/event-emit/reducer.js DELETED
@@ -1,61 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { uniqueId } from 'lodash';
5
-
6
- export const TYPES = {
7
- ADD_EVENT_CALLBACK: 'add_event_callback',
8
- REMOVE_EVENT_CALLBACK: 'remove_event_callback',
9
- };
10
-
11
- export const actions = {
12
- addEventCallback: ( eventType, callback, priority = 10 ) => {
13
- return {
14
- id: uniqueId(),
15
- type: TYPES.ADD_EVENT_CALLBACK,
16
- eventType,
17
- callback,
18
- priority,
19
- };
20
- },
21
- removeEventCallback: ( eventType, id ) => {
22
- return {
23
- id,
24
- type: TYPES.REMOVE_EVENT_CALLBACK,
25
- eventType,
26
- };
27
- },
28
- };
29
-
30
- /**
31
- * Handles actions for emmitters
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 = {},
43
- { type, eventType, id, callback, priority }
44
- ) => {
45
- const newEvents = new Map( state[ eventType ] );
46
- switch ( type ) {
47
- case TYPES.ADD_EVENT_CALLBACK:
48
- newEvents.set( id, { priority, callback } );
49
- return {
50
- ...state,
51
- [ eventType ]: newEvents,
52
- };
53
- case TYPES.REMOVE_EVENT_CALLBACK:
54
- newEvents.delete( id );
55
- return {
56
- ...state,
57
- [ eventType ]: newEvents,
58
- };
59
- }
60
- return state;
61
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/shared/event-emit/reducer.ts ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { uniqueId } from 'lodash';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import {
10
+ ACTION,
11
+ ActionType,
12
+ ActionCallbackType,
13
+ EventObserversType,
14
+ } from './types';
15
+
16
+ export const actions = {
17
+ addEventCallback: (
18
+ eventType: string,
19
+ callback: ActionCallbackType,
20
+ priority = 10
21
+ ): ActionType => {
22
+ return {
23
+ id: uniqueId(),
24
+ type: ACTION.ADD_EVENT_CALLBACK,
25
+ eventType,
26
+ callback,
27
+ priority,
28
+ };
29
+ },
30
+ removeEventCallback: ( eventType: string, id: string ): ActionType => {
31
+ return {
32
+ id,
33
+ type: ACTION.REMOVE_EVENT_CALLBACK,
34
+ eventType,
35
+ };
36
+ },
37
+ };
38
+
39
+ const initialState = {} as EventObserversType;
40
+
41
+ /**
42
+ * Handles actions for emitters
43
+ */
44
+ export const reducer = (
45
+ state = initialState,
46
+ { type, eventType, id, callback, priority }: ActionType
47
+ ): typeof initialState => {
48
+ const newEvents = state.hasOwnProperty( eventType )
49
+ ? new Map( state[ eventType ] )
50
+ : new Map();
51
+ switch ( type ) {
52
+ case ACTION.ADD_EVENT_CALLBACK:
53
+ newEvents.set( id, { priority, callback } );
54
+ return {
55
+ ...state,
56
+ [ eventType ]: newEvents,
57
+ };
58
+ case ACTION.REMOVE_EVENT_CALLBACK:
59
+ newEvents.delete( id );
60
+ return {
61
+ ...state,
62
+ [ eventType ]: newEvents,
63
+ };
64
+ }
65
+ };
assets/js/base/context/shared/event-emit/types.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export enum ACTION {
2
+ ADD_EVENT_CALLBACK = 'add_event_callback',
3
+ REMOVE_EVENT_CALLBACK = 'remove_event_callback',
4
+ }
5
+
6
+ export type ActionCallbackType = ( ...args: unknown[] ) => unknown;
7
+
8
+ export type ActionType = {
9
+ type: ACTION;
10
+ eventType: string;
11
+ id: string;
12
+ callback?: ActionCallbackType;
13
+ priority?: number;
14
+ };
15
+
16
+ export type ObserverType = { priority: number; callback: ActionCallbackType };
17
+ export type ObserversType = Map< string, ObserverType >;
18
+ export type EventObserversType = Record< string, ObserversType >;
assets/js/base/context/shared/event-emit/utils.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { EventObserversType, ObserverType } from './types';
5
+
6
+ export const getObserversByPriority = (
7
+ observers: EventObserversType,
8
+ eventType: string
9
+ ): ObserverType[] => {
10
+ return observers[ eventType ]
11
+ ? Array.from( observers[ eventType ].values() ).sort( ( a, b ) => {
12
+ return a.priority - b.priority;
13
+ } )
14
+ : [];
15
+ };
assets/js/base/context/test/utils.js CHANGED
@@ -16,15 +16,13 @@ describe( 'assertValidContextValue', () => {
16
  },
17
  };
18
  it.each`
19
- testValue | expectedMessage | expectError
20
- ${ {} } | ${ 'expected' } | ${ true }
21
- ${ 10 } | ${ 'expected' } | ${ true }
22
- ${ { amountKetchup: 20 } } | ${ 'not expected' } | ${ false }
23
- ${ { amountKetchup: '10' } } | ${ 'expected' } | ${ true }
24
- ${ { cheeseburger: 'fries', amountKetchup: 20 } } | ${ 'not expected' } | ${ false }
25
  `(
26
- 'The value of $testValue is $expectedMessage to trigger an Error',
27
- ( { testValue, expectError } ) => {
28
  const invokeTest = () => {
29
  assertValidContextValue(
30
  contextName,
@@ -32,11 +30,24 @@ describe( 'assertValidContextValue', () => {
32
  testValue
33
  );
34
  };
35
- if ( expectError ) {
36
- expect( invokeTest ).toThrow();
37
- } else {
38
- expect( invokeTest ).not.toThrow();
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
  );
42
  } );
16
  },
17
  };
18
  it.each`
19
+ testValue
20
+ ${ {} }
21
+ ${ 10 }
22
+ ${ { amountKetchup: '10' } }
 
 
23
  `(
24
+ 'The value of $testValue is expected to trigger an Error',
25
+ ( { testValue } ) => {
26
  const invokeTest = () => {
27
  assertValidContextValue(
28
  contextName,
30
  testValue
31
  );
32
  };
33
+ expect( invokeTest ).toThrow();
34
+ }
35
+ );
36
+ it.each`
37
+ testValue
38
+ ${ { amountKetchup: 20 } }
39
+ ${ { cheeseburger: 'fries', amountKetchup: 20 } }
40
+ `(
41
+ 'The value of $testValue is not expected to trigger an Error',
42
+ ( { testValue } ) => {
43
+ const invokeTest = () => {
44
+ assertValidContextValue(
45
+ contextName,
46
+ validationMap,
47
+ testValue
48
+ );
49
+ };
50
+ expect( invokeTest ).not.toThrow();
51
  }
52
  );
53
  } );
assets/js/base/hooks/cart/{index.js → index.ts} RENAMED
File without changes
assets/js/base/hooks/cart/{use-store-cart-coupons.js → use-store-cart-coupons.ts} RENAMED
@@ -8,7 +8,7 @@ import { useSelect } from '@wordpress/data';
8
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
9
  import { useValidationContext } from '@woocommerce/base-context';
10
  import { decodeEntities } from '@wordpress/html-entities';
11
-
12
  /**
13
  * Internal dependencies
14
  */
@@ -23,12 +23,15 @@ import { useStoreNotices } from '../use-store-notices';
23
  * @return {StoreCartCoupon} An object exposing data and actions from/for the
24
  * store api /cart/coupons endpoint.
25
  */
26
- export const useStoreCartCoupons = () => {
27
  const { cartCoupons, cartIsLoading } = useStoreCart();
28
  const { addErrorNotice, addSnackbarNotice } = useStoreNotices();
29
  const { setValidationErrors } = useValidationContext();
30
 
31
- const results = useSelect(
 
 
 
32
  ( select, { dispatch } ) => {
33
  const store = select( storeKey );
34
  const isApplyingCoupon = store.isApplyingCoupon();
@@ -37,9 +40,13 @@ export const useStoreCartCoupons = () => {
37
  applyCoupon,
38
  removeCoupon,
39
  receiveApplyingCoupon,
 
 
 
 
40
  } = dispatch( storeKey );
41
 
42
- const applyCouponWithNotices = ( couponCode ) => {
43
  applyCoupon( couponCode )
44
  .then( ( result ) => {
45
  if ( result === true ) {
@@ -70,7 +77,7 @@ export const useStoreCartCoupons = () => {
70
  } );
71
  };
72
 
73
- const removeCouponWithNotices = ( couponCode ) => {
74
  removeCoupon( couponCode )
75
  .then( ( result ) => {
76
  if ( result === true ) {
8
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
9
  import { useValidationContext } from '@woocommerce/base-context';
10
  import { decodeEntities } from '@wordpress/html-entities';
11
+ import type { StoreCartCoupon } from '@woocommerce/types';
12
  /**
13
  * Internal dependencies
14
  */
23
  * @return {StoreCartCoupon} An object exposing data and actions from/for the
24
  * store api /cart/coupons endpoint.
25
  */
26
+ export const useStoreCartCoupons = (): StoreCartCoupon => {
27
  const { cartCoupons, cartIsLoading } = useStoreCart();
28
  const { addErrorNotice, addSnackbarNotice } = useStoreNotices();
29
  const { setValidationErrors } = useValidationContext();
30
 
31
+ const results: Pick<
32
+ StoreCartCoupon,
33
+ 'applyCoupon' | 'removeCoupon' | 'isApplyingCoupon' | 'isRemovingCoupon'
34
+ > = useSelect(
35
  ( select, { dispatch } ) => {
36
  const store = select( storeKey );
37
  const isApplyingCoupon = store.isApplyingCoupon();
40
  applyCoupon,
41
  removeCoupon,
42
  receiveApplyingCoupon,
43
+ }: {
44
+ applyCoupon: ( coupon: string ) => Promise< boolean >;
45
+ removeCoupon: ( coupon: string ) => Promise< boolean >;
46
+ receiveApplyingCoupon: ( coupon: string ) => void;
47
  } = dispatch( storeKey );
48
 
49
+ const applyCouponWithNotices = ( couponCode: string ) => {
50
  applyCoupon( couponCode )
51
  .then( ( result ) => {
52
  if ( result === true ) {
77
  } );
78
  };
79
 
80
+ const removeCouponWithNotices = ( couponCode: string ) => {
81
  removeCoupon( couponCode )
82
  .then( ( result ) => {
83
  if ( result === true ) {
assets/js/base/hooks/cart/{use-store-cart-item-quantity.js → use-store-cart-item-quantity.ts} RENAMED
@@ -7,18 +7,12 @@ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { useDebounce } from 'use-debounce';
8
  import { useCheckoutContext } from '@woocommerce/base-context';
9
  import { triggerFragmentRefresh } from '@woocommerce/base-utils';
10
-
11
  /**
12
  * Internal dependencies
13
  */
14
  import { useStoreCart } from './use-store-cart';
15
  import { usePrevious } from '../use-previous';
16
-
17
- /**
18
- * @typedef {import('@woocommerce/type-defs/hooks').StoreCartItemQuantity} StoreCartItemQuantity
19
- * @typedef {import('@woocommerce/type-defs/cart').CartItem} CartItem
20
- */
21
-
22
  /**
23
  * This is a custom hook for loading the Store API /cart/ endpoint and
24
  * actions for removing or changing item quantity.
@@ -30,15 +24,17 @@ import { usePrevious } from '../use-previous';
30
  * @return {StoreCartItemQuantity} An object exposing data and actions relating
31
  * to cart items.
32
  */
33
- export const useStoreCartItemQuantity = ( cartItem ) => {
 
 
34
  const { key: cartItemKey = '', quantity: cartItemQuantity = 1 } = cartItem;
35
  const { cartErrors } = useStoreCart();
36
  const { dispatchActions } = useCheckoutContext();
37
 
38
  // Store quantity in hook state. This is used to keep the UI
39
  // updated while server request is updated.
40
- const [ quantity, changeQuantity ] = useState( cartItemQuantity );
41
- const [ debouncedQuantity ] = useDebounce( quantity, 400 );
42
  const previousDebouncedQuantity = usePrevious( debouncedQuantity );
43
  const { removeItemFromCart, changeCartItemQuantity } = useDispatch(
44
  storeKey
7
  import { useDebounce } from 'use-debounce';
8
  import { useCheckoutContext } from '@woocommerce/base-context';
9
  import { triggerFragmentRefresh } from '@woocommerce/base-utils';
10
+ import type { CartItem, StoreCartItemQuantity } from '@woocommerce/types';
11
  /**
12
  * Internal dependencies
13
  */
14
  import { useStoreCart } from './use-store-cart';
15
  import { usePrevious } from '../use-previous';
 
 
 
 
 
 
16
  /**
17
  * This is a custom hook for loading the Store API /cart/ endpoint and
18
  * actions for removing or changing item quantity.
24
  * @return {StoreCartItemQuantity} An object exposing data and actions relating
25
  * to cart items.
26
  */
27
+ export const useStoreCartItemQuantity = (
28
+ cartItem: CartItem
29
+ ): StoreCartItemQuantity => {
30
  const { key: cartItemKey = '', quantity: cartItemQuantity = 1 } = cartItem;
31
  const { cartErrors } = useStoreCart();
32
  const { dispatchActions } = useCheckoutContext();
33
 
34
  // Store quantity in hook state. This is used to keep the UI
35
  // updated while server request is updated.
36
+ const [ quantity, changeQuantity ] = useState< number >( cartItemQuantity );
37
+ const [ debouncedQuantity ] = useDebounce< number >( quantity, 400 );
38
  const previousDebouncedQuantity = usePrevious( debouncedQuantity );
39
  const { removeItemFromCart, changeCartItemQuantity } = useDispatch(
40
  storeKey
assets/js/base/hooks/cart/{use-store-cart.js → use-store-cart.ts} RENAMED
@@ -7,9 +7,20 @@ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { useSelect } from '@wordpress/data';
8
  import { useEditorContext } from '@woocommerce/base-context';
9
  import { decodeEntities } from '@wordpress/html-entities';
10
- import { mapValues } from 'lodash';
 
 
 
 
 
 
 
11
 
12
- const defaultShippingAddress = {
 
 
 
 
13
  first_name: '',
14
  last_name: '',
15
  company: '',
@@ -21,20 +32,48 @@ const defaultShippingAddress = {
21
  country: '',
22
  };
23
 
24
- const defaultBillingAddress = {
25
  ...defaultShippingAddress,
26
  email: '',
27
  phone: '',
28
  };
29
 
30
- const decodeValues = ( object ) =>
31
- mapValues( object, ( value ) => decodeEntities( value ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  /**
34
  * @constant
35
  * @type {StoreCart} Object containing cart data.
36
  */
37
- export const defaultCartData = {
38
  cartCoupons: [],
39
  cartItems: [],
40
  cartFees: [],
@@ -43,7 +82,7 @@ export const defaultCartData = {
43
  cartNeedsPayment: true,
44
  cartNeedsShipping: true,
45
  cartItemErrors: [],
46
- cartTotals: {},
47
  cartIsLoading: true,
48
  cartErrors: [],
49
  billingAddress: defaultBillingAddress,
@@ -52,7 +91,7 @@ export const defaultCartData = {
52
  shippingRatesLoading: false,
53
  cartHasCalculatedShipping: false,
54
  paymentRequirements: [],
55
- receiveCart: () => {},
56
  extensions: {},
57
  };
58
 
@@ -68,12 +107,14 @@ export const defaultCartData = {
68
  *
69
  * @return {StoreCart} Object containing cart data.
70
  */
71
- export const useStoreCart = ( options = { shouldSelect: true } ) => {
 
 
72
  const { isEditor, previewData } = useEditorContext();
73
  const previewCart = previewData?.previewCart || {};
74
  const { shouldSelect } = options;
75
 
76
- const results = useSelect(
77
  ( select, { dispatch } ) => {
78
  if ( ! shouldSelect ) {
79
  return defaultCartData;
@@ -103,7 +144,7 @@ export const useStoreCart = ( options = { shouldSelect: true } ) => {
103
  receiveCart:
104
  typeof previewCart?.receiveCart === 'function'
105
  ? previewCart.receiveCart
106
- : () => {},
107
  };
108
  }
109
 
@@ -120,7 +161,7 @@ export const useStoreCart = ( options = { shouldSelect: true } ) => {
120
  const shippingAddress = cartData.needsShipping
121
  ? decodeValues( cartData.shippingAddress )
122
  : billingAddress;
123
- const cartFees = cartData.fees.map( ( fee ) =>
124
  decodeValues( fee )
125
  );
126
  return {
7
  import { useSelect } from '@wordpress/data';
8
  import { useEditorContext } from '@woocommerce/base-context';
9
  import { decodeEntities } from '@wordpress/html-entities';
10
+ import type {
11
+ StoreCart,
12
+ CartResponseTotals,
13
+ CartResponseFeeItem,
14
+ CartResponseBillingAddress,
15
+ CartResponseShippingAddress,
16
+ } from '@woocommerce/types';
17
+ import { fromEntriesPolyfill } from '@woocommerce/base-utils';
18
 
19
+ declare module '@wordpress/html-entities' {
20
+ // eslint-disable-next-line @typescript-eslint/no-shadow
21
+ export function decodeEntities< T >( coupon: T ): T;
22
+ }
23
+ const defaultShippingAddress: CartResponseShippingAddress = {
24
  first_name: '',
25
  last_name: '',
26
  company: '',
32
  country: '',
33
  };
34
 
35
+ const defaultBillingAddress: CartResponseBillingAddress = {
36
  ...defaultShippingAddress,
37
  email: '',
38
  phone: '',
39
  };
40
 
41
+ const defaultCartTotals: CartResponseTotals = {
42
+ total_items: '',
43
+ total_items_tax: '',
44
+ total_fees: '',
45
+ total_fees_tax: '',
46
+ total_discount: '',
47
+ total_discount_tax: '',
48
+ total_shipping: '',
49
+ total_shipping_tax: '',
50
+ total_price: '',
51
+ total_tax: '',
52
+ tax_lines: [],
53
+ currency_code: '',
54
+ currency_symbol: '',
55
+ currency_minor_unit: 2,
56
+ currency_decimal_separator: '',
57
+ currency_thousand_separator: '',
58
+ currency_prefix: '',
59
+ currency_suffix: '',
60
+ };
61
+
62
+ const decodeValues = (
63
+ object: Record< string, unknown >
64
+ ): Record< string, unknown > =>
65
+ fromEntriesPolyfill(
66
+ Object.entries( object ).map( ( [ key, value ] ) => [
67
+ key,
68
+ decodeEntities( value ),
69
+ ] )
70
+ );
71
 
72
  /**
73
  * @constant
74
  * @type {StoreCart} Object containing cart data.
75
  */
76
+ export const defaultCartData: StoreCart = {
77
  cartCoupons: [],
78
  cartItems: [],
79
  cartFees: [],
82
  cartNeedsPayment: true,
83
  cartNeedsShipping: true,
84
  cartItemErrors: [],
85
+ cartTotals: defaultCartTotals,
86
  cartIsLoading: true,
87
  cartErrors: [],
88
  billingAddress: defaultBillingAddress,
91
  shippingRatesLoading: false,
92
  cartHasCalculatedShipping: false,
93
  paymentRequirements: [],
94
+ receiveCart: () => undefined,
95
  extensions: {},
96
  };
97
 
107
  *
108
  * @return {StoreCart} Object containing cart data.
109
  */
110
+ export const useStoreCart = (
111
+ options: { shouldSelect: boolean } = { shouldSelect: true }
112
+ ): StoreCart => {
113
  const { isEditor, previewData } = useEditorContext();
114
  const previewCart = previewData?.previewCart || {};
115
  const { shouldSelect } = options;
116
 
117
+ const results: StoreCart = useSelect(
118
  ( select, { dispatch } ) => {
119
  if ( ! shouldSelect ) {
120
  return defaultCartData;
144
  receiveCart:
145
  typeof previewCart?.receiveCart === 'function'
146
  ? previewCart.receiveCart
147
+ : () => undefined,
148
  };
149
  }
150
 
161
  const shippingAddress = cartData.needsShipping
162
  ? decodeValues( cartData.shippingAddress )
163
  : billingAddress;
164
+ const cartFees = cartData.fees.map( ( fee: CartResponseFeeItem ) =>
165
  decodeValues( fee )
166
  );
167
  return {
assets/js/base/hooks/customer/{index.js → index.ts} RENAMED
File without changes
assets/js/base/hooks/customer/{use-customer-data.js → use-customer-data.ts} RENAMED
@@ -7,7 +7,15 @@ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { useDebounce } from 'use-debounce';
8
  import isShallowEqual from '@wordpress/is-shallow-equal';
9
  import { formatStoreApiErrorMessage } from '@woocommerce/base-utils';
 
 
 
 
10
 
 
 
 
 
11
  /**
12
  * Internal dependencies
13
  */
@@ -18,7 +26,12 @@ import { useStoreCart } from '../cart';
18
  /**
19
  * This is a custom hook for syncing customer address data (billing and shipping) with the server.
20
  */
21
- export const useCustomerData = () => {
 
 
 
 
 
22
  const { updateCustomerData } = useDispatch( storeKey );
23
  const { addErrorNotice, removeNotice } = useStoreNotices();
24
 
@@ -26,16 +39,18 @@ export const useCustomerData = () => {
26
  const {
27
  billingAddress: initialBillingAddress,
28
  shippingAddress: initialShippingAddress,
 
 
29
  } = useStoreCart();
30
 
31
  // State of customer data is tracked here from this point, using the initial values from the useStoreCart hook.
32
- const [ customerData, setCustomerData ] = useState( {
33
  billingData: initialBillingAddress,
34
  shippingAddress: initialShippingAddress,
35
  } );
36
 
37
  // Store values last sent to the server in a ref to avoid requests unless important fields are changed.
38
- const previousCustomerData = useRef( customerData );
39
 
40
  // Debounce updates to the customerData state so it's not triggered excessively.
41
  const [ debouncedCustomerData ] = useDebounce( customerData, 1000, {
@@ -114,7 +129,6 @@ export const useCustomerData = () => {
114
  removeNotice,
115
  updateCustomerData,
116
  ] );
117
-
118
  return {
119
  billingData: customerData.billingData,
120
  shippingAddress: customerData.shippingAddress,
7
  import { useDebounce } from 'use-debounce';
8
  import isShallowEqual from '@wordpress/is-shallow-equal';
9
  import { formatStoreApiErrorMessage } from '@woocommerce/base-utils';
10
+ import type {
11
+ CartResponseBillingAddress,
12
+ CartResponseShippingAddress,
13
+ } from '@woocommerce/types';
14
 
15
+ declare type CustomerData = {
16
+ billingData: CartResponseBillingAddress;
17
+ shippingAddress: CartResponseShippingAddress;
18
+ };
19
  /**
20
  * Internal dependencies
21
  */
26
  /**
27
  * This is a custom hook for syncing customer address data (billing and shipping) with the server.
28
  */
29
+ export const useCustomerData = (): {
30
+ billingData: CartResponseBillingAddress;
31
+ shippingAddress: CartResponseShippingAddress;
32
+ setBillingData: ( data: CartResponseBillingAddress ) => void;
33
+ setShippingAddress: ( data: CartResponseBillingAddress ) => void;
34
+ } => {
35
  const { updateCustomerData } = useDispatch( storeKey );
36
  const { addErrorNotice, removeNotice } = useStoreNotices();
37
 
39
  const {
40
  billingAddress: initialBillingAddress,
41
  shippingAddress: initialShippingAddress,
42
+ }: Omit< CustomerData, 'billingData' > & {
43
+ billingAddress: CartResponseBillingAddress;
44
  } = useStoreCart();
45
 
46
  // State of customer data is tracked here from this point, using the initial values from the useStoreCart hook.
47
+ const [ customerData, setCustomerData ] = useState< CustomerData >( {
48
  billingData: initialBillingAddress,
49
  shippingAddress: initialShippingAddress,
50
  } );
51
 
52
  // Store values last sent to the server in a ref to avoid requests unless important fields are changed.
53
+ const previousCustomerData = useRef< CustomerData >( customerData );
54
 
55
  // Debounce updates to the customerData state so it's not triggered excessively.
56
  const [ debouncedCustomerData ] = useDebounce( customerData, 1000, {
129
  removeNotice,
130
  updateCustomerData,
131
  ] );
 
132
  return {
133
  billingData: customerData.billingData,
134
  shippingAddress: customerData.shippingAddress,
assets/js/base/hooks/customer/{utils.js → utils.ts} RENAMED
@@ -3,6 +3,10 @@
3
  */
4
  import isShallowEqual from '@wordpress/is-shallow-equal';
5
  import { pluckAddress } from '@woocommerce/base-utils';
 
 
 
 
6
 
7
  /**
8
  * Does a shallow compare of important address data to determine if the cart needs updating.
@@ -12,7 +16,12 @@ import { pluckAddress } from '@woocommerce/base-utils';
12
  *
13
  * @return {boolean} True if the store needs updating due to changed data.
14
  */
15
- export const shouldUpdateAddressStore = ( previousAddress, address ) => {
 
 
 
 
 
16
  if ( ! address.country ) {
17
  return false;
18
  }
3
  */
4
  import isShallowEqual from '@wordpress/is-shallow-equal';
5
  import { pluckAddress } from '@woocommerce/base-utils';
6
+ import type {
7
+ CartResponseBillingAddress,
8
+ CartResponseShippingAddress,
9
+ } from '@woocommerce/types';
10
 
11
  /**
12
  * Does a shallow compare of important address data to determine if the cart needs updating.
16
  *
17
  * @return {boolean} True if the store needs updating due to changed data.
18
  */
19
+ export const shouldUpdateAddressStore = <
20
+ T extends CartResponseBillingAddress | CartResponseShippingAddress
21
+ >(
22
+ previousAddress: T,
23
+ address: T
24
+ ): boolean => {
25
  if ( ! address.country ) {
26
  return false;
27
  }
assets/js/base/hooks/shipping/{use-select-shipping-rate.js → use-select-shipping-rate.ts} RENAMED
@@ -3,6 +3,7 @@
3
  */
4
  import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
5
  import isShallowEqual from '@wordpress/is-shallow-equal';
 
6
 
7
  /**
8
  * Internal dependencies
@@ -16,7 +17,7 @@ import { useSelectShippingRates } from './use-select-shipping-rates';
16
  * @return {string} Selected rate id.
17
  */
18
  // This will find the selected rate ID in an array of shipping rates.
19
- const deriveSelectedRateId = ( shippingRates ) =>
20
  shippingRates.find( ( rate ) => rate.selected )?.rate_id;
21
 
22
  /**
@@ -30,7 +31,14 @@ const deriveSelectedRateId = ( shippingRates ) =>
30
  * - selectedShippingRate: The selected rate id.
31
  * - isSelectingRate: True when rates are being resolved to the API.
32
  */
33
- export const useSelectShippingRate = ( packageId, shippingRates ) => {
 
 
 
 
 
 
 
34
  // Rates are selected via the shipping data context provider.
35
  const { selectShippingRate, isSelectingRate } = useSelectShippingRates();
36
 
@@ -51,9 +59,9 @@ export const useSelectShippingRate = ( packageId, shippingRates ) => {
51
 
52
  // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
53
  const setPackageRateId = useCallback(
54
- ( newShippingRate ) => {
55
- setSelectedShippingRate( newShippingRate );
56
- selectShippingRate( newShippingRate, packageId );
57
  },
58
  [ packageId, selectShippingRate ]
59
  );
3
  */
4
  import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
5
  import isShallowEqual from '@wordpress/is-shallow-equal';
6
+ import { Rate } from '@woocommerce/type-defs/shipping';
7
 
8
  /**
9
  * Internal dependencies
17
  * @return {string} Selected rate id.
18
  */
19
  // This will find the selected rate ID in an array of shipping rates.
20
+ const deriveSelectedRateId = ( shippingRates: Rate[] ) =>
21
  shippingRates.find( ( rate ) => rate.selected )?.rate_id;
22
 
23
  /**
31
  * - selectedShippingRate: The selected rate id.
32
  * - isSelectingRate: True when rates are being resolved to the API.
33
  */
34
+ export const useSelectShippingRate = (
35
+ packageId: string,
36
+ shippingRates: Rate[]
37
+ ): {
38
+ selectShippingRate: ( newShippingRateId: string ) => unknown;
39
+ selectedShippingRate: string | undefined;
40
+ isSelectingRate: boolean;
41
+ } => {
42
  // Rates are selected via the shipping data context provider.
43
  const { selectShippingRate, isSelectingRate } = useSelectShippingRates();
44
 
59
 
60
  // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
61
  const setPackageRateId = useCallback(
62
+ ( newShippingRateId ) => {
63
+ setSelectedShippingRate( newShippingRateId );
64
+ selectShippingRate( newShippingRateId, packageId );
65
  },
66
  [ packageId, selectShippingRate ]
67
  );
assets/js/base/hooks/shipping/{use-select-shipping-rates.js → use-select-shipping-rates.ts} RENAMED
@@ -17,14 +17,27 @@ import { useThrowError } from '../use-throw-error';
17
  * - selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
18
  * - isSelectingRate: True when rates are being resolved to the API.
19
  */
20
- export const useSelectShippingRates = () => {
 
 
 
 
 
 
21
  const throwError = useThrowError();
22
- const { selectShippingRate } = useDispatch( storeKey );
 
 
 
 
 
 
 
23
 
24
  // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
25
  const setRate = useCallback(
26
- ( newShippingRate, packageId ) => {
27
- selectShippingRate( newShippingRate, packageId ).catch(
28
  ( error ) => {
29
  // we throw this error because an error on selecting a rate is problematic.
30
  throwError( error );
@@ -35,7 +48,7 @@ export const useSelectShippingRates = () => {
35
  );
36
 
37
  // See if rates are being selected.
38
- const isSelectingRate = useSelect( ( select ) => {
39
  return select( storeKey ).isShippingRateBeingSelected();
40
  }, [] );
41
 
17
  * - selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
18
  * - isSelectingRate: True when rates are being resolved to the API.
19
  */
20
+ export const useSelectShippingRates = (): {
21
+ selectShippingRate: (
22
+ newShippingRateId: string,
23
+ packageId: string
24
+ ) => unknown;
25
+ isSelectingRate: boolean;
26
+ } => {
27
  const throwError = useThrowError();
28
+ const { selectShippingRate } = ( useDispatch( storeKey ) as {
29
+ selectShippingRate: unknown;
30
+ } ) as {
31
+ selectShippingRate: (
32
+ newShippingRateId: string,
33
+ packageId: string
34
+ ) => Promise< unknown >;
35
+ };
36
 
37
  // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
38
  const setRate = useCallback(
39
+ ( newShippingRateId, packageId ) => {
40
+ selectShippingRate( newShippingRateId, packageId ).catch(
41
  ( error ) => {
42
  // we throw this error because an error on selecting a rate is problematic.
43
  throwError( error );
48
  );
49
 
50
  // See if rates are being selected.
51
+ const isSelectingRate = useSelect< boolean >( ( select ) => {
52
  return select( storeKey ).isShippingRateBeingSelected();
53
  }, [] );
54
 
assets/js/base/hooks/test/use-shallow-equal.js CHANGED
@@ -16,21 +16,15 @@ describe( 'useShallowEqual', () => {
16
  let renderer;
17
  beforeEach( () => ( renderer = null ) );
18
  it.each`
19
- testValueA | aType | testValueB | bType | expectEqual
20
- ${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'b' } } | ${ 'object' } | ${ true }
21
- ${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'c' } } | ${ 'object' } | ${ false }
22
- ${ [ 'b', 'bar' ] } | ${ 'array' } | ${ [ 'b', 'bar' ] } | ${ 'array' } | ${ true }
23
- ${ [ 'b', 'bar' ] } | ${ 'array' } | ${ [ 'bar', 'b' ] } | ${ 'array' } | ${ false }
24
- ${ 1 } | ${ 'number' } | ${ 1 } | ${ 'number' } | ${ true }
25
- ${ 1 } | ${ 'number' } | ${ '1' } | ${ 'string' } | ${ false }
26
- ${ '1' } | ${ 'string' } | ${ '1' } | ${ 'string' } | ${ true }
27
- ${ 1 } | ${ 'number' } | ${ 2 } | ${ 'number' } | ${ false }
28
- ${ 1 } | ${ 'number' } | ${ true } | ${ 'bool' } | ${ false }
29
- ${ 0 } | ${ 'number' } | ${ false } | ${ 'bool' } | ${ false }
30
- ${ true } | ${ 'bool' } | ${ true } | ${ 'bool' } | ${ true }
31
  `(
32
- '$testValueA ($aType) and $testValueB ($bType) are expected to be equal ($expectEqual)',
33
- ( { testValueA, testValueB, expectEqual } ) => {
34
  let testPropValue;
35
  act( () => {
36
  renderer = TestRenderer.create(
@@ -44,11 +38,35 @@ describe( 'useShallowEqual', () => {
44
  renderer.update( <TestComponent testValue={ testValueB } /> );
45
  } );
46
  testPropValue = renderer.root.findByType( 'div' ).props.newValue;
47
- if ( expectEqual ) {
48
- expect( testPropValue ).toBe( testValueA );
49
- } else {
50
- expect( testPropValue ).toBe( testValueB );
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
  );
54
  } );
16
  let renderer;
17
  beforeEach( () => ( renderer = null ) );
18
  it.each`
19
+ testValueA | aType | testValueB | bType
20
+ ${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'b' } } | ${ 'object' }
21
+ ${ [ 'b', 'bar' ] } | ${ 'array' } | ${ [ 'b', 'bar' ] } | ${ 'array' }
22
+ ${ 1 } | ${ 'number' } | ${ 1 } | ${ 'number' }
23
+ ${ '1' } | ${ 'string' } | ${ '1' } | ${ 'string' }
24
+ ${ true } | ${ 'bool' } | ${ true } | ${ 'bool' }
 
 
 
 
 
 
25
  `(
26
+ '$testValueA ($aType) and $testValueB ($bType) are expected to be equal',
27
+ ( { testValueA, testValueB } ) => {
28
  let testPropValue;
29
  act( () => {
30
  renderer = TestRenderer.create(
38
  renderer.update( <TestComponent testValue={ testValueB } /> );
39
  } );
40
  testPropValue = renderer.root.findByType( 'div' ).props.newValue;
41
+ expect( testPropValue ).toBe( testValueA );
42
+ }
43
+ );
44
+
45
+ it.each`
46
+ testValueA | aType | testValueB | bType
47
+ ${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'c' } } | ${ 'object' }
48
+ ${ [ 'b', 'bar' ] } | ${ 'array' } | ${ [ 'bar', 'b' ] } | ${ 'array' }
49
+ ${ 1 } | ${ 'number' } | ${ '1' } | ${ 'string' }
50
+ ${ 1 } | ${ 'number' } | ${ 2 } | ${ 'number' }
51
+ ${ 1 } | ${ 'number' } | ${ true } | ${ 'bool' }
52
+ ${ 0 } | ${ 'number' } | ${ false } | ${ 'bool' }
53
+ `(
54
+ '$testValueA ($aType) and $testValueB ($bType) are expected to not be equal',
55
+ ( { testValueA, testValueB } ) => {
56
+ let testPropValue;
57
+ act( () => {
58
+ renderer = TestRenderer.create(
59
+ <TestComponent testValue={ testValueA } />
60
+ );
61
+ } );
62
+ testPropValue = renderer.root.findByType( 'div' ).props.newValue;
63
+ expect( testPropValue ).toBe( testValueA );
64
+ // do update
65
+ act( () => {
66
+ renderer.update( <TestComponent testValue={ testValueB } /> );
67
+ } );
68
+ testPropValue = renderer.root.findByType( 'div' ).props.newValue;
69
+ expect( testPropValue ).toBe( testValueB );
70
  }
71
  );
72
  } );
assets/js/base/hooks/{use-container-queries.js → use-container-queries.ts} RENAMED
@@ -29,7 +29,7 @@ import { useResizeObserver } from 'wordpress-compose';
29
  * };
30
  * ```
31
  */
32
- export const useContainerQueries = () => {
33
  const [ resizeListener, { width } ] = useResizeObserver();
34
 
35
  let className = '';
29
  * };
30
  * ```
31
  */
32
+ export const useContainerQueries = (): [ React.ReactElement, string ] => {
33
  const [ resizeListener, { width } ] = useResizeObserver();
34
 
35
  let className = '';
assets/js/base/hooks/{use-previous.js → use-previous.ts} RENAMED
@@ -3,6 +3,9 @@
3
  */
4
  import { useRef, useEffect } from 'react';
5
 
 
 
 
6
  /**
7
  * Use Previous based on https://usehooks.com/usePrevious/.
8
  *
@@ -10,8 +13,11 @@ import { useRef, useEffect } from 'react';
10
  * @param {Function} [validation] Function that needs to validate for the value
11
  * to be updated.
12
  */
13
- export const usePrevious = ( value, validation ) => {
14
- const ref = useRef();
 
 
 
15
 
16
  useEffect( () => {
17
  if (
@@ -23,4 +29,4 @@ export const usePrevious = ( value, validation ) => {
23
  }, [ value, validation ] );
24
 
25
  return ref.current;
26
- };
3
  */
4
  import { useRef, useEffect } from 'react';
5
 
6
+ interface Validation< T > {
7
+ ( value: T, previousValue: T | undefined ): boolean;
8
+ }
9
  /**
10
  * Use Previous based on https://usehooks.com/usePrevious/.
11
  *
13
  * @param {Function} [validation] Function that needs to validate for the value
14
  * to be updated.
15
  */
16
+ export function usePrevious< T >(
17
+ value: T,
18
+ validation?: Validation< T >
19
+ ): T | undefined {
20
+ const ref = useRef< T >();
21
 
22
  useEffect( () => {
23
  if (
29
  }, [ value, validation ] );
30
 
31
  return ref.current;
32
+ }
assets/js/base/hooks/{use-shallow-equal.js → use-shallow-equal.ts} RENAMED
@@ -16,10 +16,10 @@ import isShallowEqual from '@wordpress/is-shallow-equal';
16
  * @return {*} The previous cached instance of the value if the current has
17
  * shallow equality with it.
18
  */
19
- export const useShallowEqual = ( value ) => {
20
- const ref = useRef();
21
- if ( ! isShallowEqual( value, ref.current ) ) {
22
  ref.current = value;
23
  }
24
  return ref.current;
25
- };
16
  * @return {*} The previous cached instance of the value if the current has
17
  * shallow equality with it.
18
  */
19
+ export function useShallowEqual< T >( value: T ): T | undefined {
20
+ const ref = useRef< T >();
21
+ if ( ref.current === undefined || ! isShallowEqual( value, ref.current ) ) {
22
  ref.current = value;
23
  }
24
  return ref.current;
25
+ }
assets/js/base/hooks/{use-store-add-to-cart.js → use-store-add-to-cart.ts} RENAMED
@@ -5,7 +5,7 @@ import { useState, useEffect, useRef } from '@wordpress/element';
5
  import { useDispatch } from '@wordpress/data';
6
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { decodeEntities } from '@wordpress/html-entities';
8
-
9
  /**
10
  * Internal dependencies
11
  */
@@ -16,6 +16,12 @@ import { useStoreCart } from './cart';
16
  * @typedef {import('@woocommerce/type-defs/hooks').StoreCartItemAddToCart} StoreCartItemAddToCart
17
  */
18
 
 
 
 
 
 
 
19
  /**
20
  * Get the quantity of a product in the cart.
21
  *
@@ -23,7 +29,10 @@ import { useStoreCart } from './cart';
23
  * @param {number} productId The product id to look for.
24
  * @return {number} Quantity in the cart.
25
  */
26
- const getQuantityFromCartItems = ( cartItems, productId ) => {
 
 
 
27
  const productItem = cartItems.find( ( { id } ) => id === productId );
28
 
29
  return productItem ? productItem.quantity : 0;
@@ -39,7 +48,7 @@ const getQuantityFromCartItems = ( cartItems, productId ) => {
39
  * @return {StoreCartItemAddToCart} An object exposing data and actions relating
40
  * to add to cart functionality.
41
  */
42
- export const useStoreAddToCart = ( productId ) => {
43
  const { addItemToCart } = useDispatch( storeKey );
44
  const { cartItems, cartIsLoading } = useStoreCart();
45
  const { addErrorNotice, removeNotice } = useStoreNotices();
5
  import { useDispatch } from '@wordpress/data';
6
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { decodeEntities } from '@wordpress/html-entities';
8
+ import type { CartItem } from '@woocommerce/types';
9
  /**
10
  * Internal dependencies
11
  */
16
  * @typedef {import('@woocommerce/type-defs/hooks').StoreCartItemAddToCart} StoreCartItemAddToCart
17
  */
18
 
19
+ interface StoreAddToCart {
20
+ cartQuantity: number;
21
+ addingToCart: boolean;
22
+ cartIsLoading: boolean;
23
+ addToCart: ( quantity: number ) => void;
24
+ }
25
  /**
26
  * Get the quantity of a product in the cart.
27
  *
29
  * @param {number} productId The product id to look for.
30
  * @return {number} Quantity in the cart.
31
  */
32
+ const getQuantityFromCartItems = (
33
+ cartItems: Array< CartItem >,
34
+ productId: number
35
+ ): number => {
36
  const productItem = cartItems.find( ( { id } ) => id === productId );
37
 
38
  return productItem ? productItem.quantity : 0;
48
  * @return {StoreCartItemAddToCart} An object exposing data and actions relating
49
  * to add to cart functionality.
50
  */
51
+ export const useStoreAddToCart = ( productId: number ): StoreAddToCart => {
52
  const { addItemToCart } = useDispatch( storeKey );
53
  const { cartItems, cartIsLoading } = useStoreCart();
54
  const { addErrorNotice, removeNotice } = useStoreNotices();
assets/js/base/hooks/{use-throw-error.js → use-throw-error.ts} RENAMED
@@ -10,16 +10,11 @@ import { useState, useCallback } from '@wordpress/element';
10
  *
11
  * @return {function(Object)} A function receiving the error that will be thrown.
12
  */
13
- export const useThrowError = () => {
14
  const [ , setState ] = useState();
15
-
16
- const throwError = useCallback(
17
- ( error ) =>
18
- setState( () => {
19
- throw error;
20
- } ),
21
- []
22
- );
23
-
24
- return throwError;
25
  };
10
  *
11
  * @return {function(Object)} A function receiving the error that will be thrown.
12
  */
13
+ export const useThrowError = (): ( ( error: Error ) => void ) => {
14
  const [ , setState ] = useState();
15
+ return useCallback( ( error: Error ): void => {
16
+ setState( () => {
17
+ throw error;
18
+ } );
19
+ }, [] );
 
 
 
 
 
20
  };
assets/js/base/hooks/{use-trigger-fragment-refresh.js → use-trigger-fragment-refresh.ts} RENAMED
@@ -9,8 +9,8 @@ import { triggerFragmentRefresh } from '@woocommerce/base-utils';
9
  *
10
  * @param {number} quantityInCart Quantity of the item in the cart.
11
  */
12
- export const useTriggerFragmentRefresh = ( quantityInCart ) => {
13
- const firstMount = useRef( true );
14
 
15
  useEffect( () => {
16
  if ( firstMount.current ) {
9
  *
10
  * @param {number} quantityInCart Quantity of the item in the cart.
11
  */
12
+ export const useTriggerFragmentRefresh = ( quantityInCart: number ): void => {
13
+ const firstMount = useRef< boolean >( true );
14
 
15
  useEffect( () => {
16
  if ( firstMount.current ) {
assets/js/base/utils/derive-selected-shipping-rates.js CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  /**
2
  * Get an array of selected shipping rates keyed by Package ID.
3
  *
@@ -5,15 +10,11 @@
5
  * @return {Object} Object containing the package IDs and selected rates in the format: { [packageId:string]: rateId:string }
6
  */
7
  export const deriveSelectedShippingRates = ( shippingRates ) =>
8
- shippingRates
9
- .map( ( { package_id: packageId, shipping_rates: packageRates } ) => [
10
- packageId,
11
- packageRates.find( ( rate ) => rate.selected )?.rate_id,
12
- ] )
13
- // A fromEntries polyfill, creates an object from an array of arrays.
14
- .reduce( ( obj, [ key, val ] ) => {
15
- if ( val ) {
16
- obj[ key ] = val;
17
- }
18
- return obj;
19
- }, {} );
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { fromEntriesPolyfill } from '@woocommerce/base-utils';
5
+
6
  /**
7
  * Get an array of selected shipping rates keyed by Package ID.
8
  *
10
  * @return {Object} Object containing the package IDs and selected rates in the format: { [packageId:string]: rateId:string }
11
  */
12
  export const deriveSelectedShippingRates = ( shippingRates ) =>
13
+ fromEntriesPolyfill(
14
+ shippingRates.map(
15
+ ( { package_id: packageId, shipping_rates: packageRates } ) => [
16
+ packageId,
17
+ packageRates.find( ( rate ) => rate.selected )?.rate_id,
18
+ ]
19
+ )
20
+ );
 
 
 
 
assets/js/base/utils/from-entries-polyfill.ts ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * A polyfill for Object.fromEntries function.
3
+ *
4
+ * @param {Array<[string, unknown]>} array Array to be turned back to object
5
+ * @return {Record< string, unknown >} the newly created object
6
+ */
7
+ export const fromEntriesPolyfill = (
8
+ array: Array< [ string, unknown ] >
9
+ ): Record< string, unknown > =>
10
+ array.reduce< Record< string, unknown > >( ( obj, [ key, val ] ) => {
11
+ obj[ key ] = val;
12
+ return obj;
13
+ }, {} );
assets/js/base/utils/index.js CHANGED
@@ -7,3 +7,4 @@ export * from './get-intersection-observer';
7
  export * from './get-valid-block-attributes';
8
  export * from './product-data';
9
  export * from './derive-selected-shipping-rates';
 
7
  export * from './get-valid-block-attributes';
8
  export * from './product-data';
9
  export * from './derive-selected-shipping-rates';
10
+ export * from './from-entries-polyfill';
assets/js/blocks-registry/payment-methods/payment-method-config.js CHANGED
@@ -14,6 +14,10 @@ import {
14
 
15
  import { canMakePaymentWithFeaturesCheck } from './payment-method-config-helper';
16
 
 
 
 
 
17
  export default class PaymentMethodConfig {
18
  constructor( config ) {
19
  // validate config
@@ -23,6 +27,7 @@ export default class PaymentMethodConfig {
23
  this.placeOrderButtonLabel = config.placeOrderButtonLabel;
24
  this.ariaLabel = config.ariaLabel;
25
  this.content = config.content;
 
26
  this.icons = config.icons;
27
  this.edit = config.edit;
28
  this.paymentMethodId = config.paymentMethodId || this.name;
@@ -41,6 +46,10 @@ export default class PaymentMethodConfig {
41
  }
42
 
43
  static assertValidConfig = ( config ) => {
 
 
 
 
44
  assertConfigHasProperties( config, [
45
  'name',
46
  'label',
@@ -82,6 +91,7 @@ export default class PaymentMethodConfig {
82
  assertValidElementOrString( config.label, 'label' );
83
  assertValidElement( config.content, 'content' );
84
  assertValidElement( config.edit, 'edit' );
 
85
  if ( typeof config.ariaLabel !== 'string' ) {
86
  throw new TypeError(
87
  'The ariaLabel property for the payment method must be a string'
14
 
15
  import { canMakePaymentWithFeaturesCheck } from './payment-method-config-helper';
16
 
17
+ const NullComponent = () => {
18
+ return null;
19
+ };
20
+
21
  export default class PaymentMethodConfig {
22
  constructor( config ) {
23
  // validate config
27
  this.placeOrderButtonLabel = config.placeOrderButtonLabel;
28
  this.ariaLabel = config.ariaLabel;
29
  this.content = config.content;
30
+ this.savedTokenComponent = config.savedTokenComponent;
31
  this.icons = config.icons;
32
  this.edit = config.edit;
33
  this.paymentMethodId = config.paymentMethodId || this.name;
46
  }
47
 
48
  static assertValidConfig = ( config ) => {
49
+ // set default for optional
50
+ config.savedTokenComponent = config.savedTokenComponent || (
51
+ <NullComponent />
52
+ );
53
  assertConfigHasProperties( config, [
54
  'name',
55
  'label',
91
  assertValidElementOrString( config.label, 'label' );
92
  assertValidElement( config.content, 'content' );
93
  assertValidElement( config.edit, 'edit' );
94
+ assertValidElement( config.savedTokenComponent, 'savedTokenComponent' );
95
  if ( typeof config.ariaLabel !== 'string' ) {
96
  throw new TypeError(
97
  'The ariaLabel property for the payment method must be a string'
assets/js/blocks/active-filters/style.scss CHANGED
@@ -69,24 +69,14 @@
69
  background: transparent;
70
  border: 0;
71
  appearance: none;
72
- height: 0;
73
- padding: 16px 0 0 0;
74
  width: 16px;
75
- overflow: hidden;
76
  position: absolute;
77
  right: 0;
78
  top: 50%;
79
  margin: -8px 0 0 0;
80
-
81
- &::before {
82
- width: 16px;
83
- height: 16px;
84
- background: transparent url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='9' fill='%2324292d'/%3E%3Crect x='4.5' y='6.8866' width='3.375' height='9.9466' transform='rotate(-45 4.5 6.8866)' fill='white'/%3E%3Crect x='11.5334' y='4.5' width='3.375' height='9.9466' transform='rotate(45 11.5334 4.5)' fill='white'/%3E%3C/svg%3E%0A") center center no-repeat; /* stylelint-disable-line */
85
- display: block;
86
- content: "";
87
- position: absolute;
88
- top: 0;
89
- }
90
  }
91
 
92
  .wc-block-active-filters__list--chips {
69
  background: transparent;
70
  border: 0;
71
  appearance: none;
72
+ height: 16px;
 
73
  width: 16px;
74
+ padding: 0;
75
  position: absolute;
76
  right: 0;
77
  top: 50%;
78
  margin: -8px 0 0 0;
79
+ color: currentColor;
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
  .wc-block-active-filters__list--chips {
assets/js/blocks/active-filters/utils.js CHANGED
@@ -4,6 +4,7 @@
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import { formatPrice } from '@woocommerce/price-format';
6
  import { RemovableChip } from '@woocommerce/base-components/chip';
 
7
 
8
  /**
9
  * Format a min/max price range to display.
@@ -96,7 +97,41 @@ export const renderRemovableListItem = ( {
96
  className="wc-block-active-filters__list-item-remove"
97
  onClick={ removeCallback }
98
  >
99
- { removeText }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  </button>
101
  </span>
102
  ) }
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import { formatPrice } from '@woocommerce/price-format';
6
  import { RemovableChip } from '@woocommerce/base-components/chip';
7
+ import Label from '@woocommerce/base-components/label';
8
 
9
  /**
10
  * Format a min/max price range to display.
97
  className="wc-block-active-filters__list-item-remove"
98
  onClick={ removeCallback }
99
  >
100
+ <svg
101
+ width="16"
102
+ height="16"
103
+ viewBox="0 0 16 16"
104
+ fill="none"
105
+ xmlns="http://www.w3.org/2000/svg"
106
+ >
107
+ <ellipse
108
+ cx="8"
109
+ cy="8"
110
+ rx="8"
111
+ ry="8"
112
+ transform="rotate(-180 8 8)"
113
+ fill="currentColor"
114
+ fillOpacity="0.7"
115
+ />
116
+ <rect
117
+ x="10.636"
118
+ y="3.94983"
119
+ width="2"
120
+ height="9.9466"
121
+ transform="rotate(45 10.636 3.94983)"
122
+ fill="white"
123
+ />
124
+ <rect
125
+ x="12.0503"
126
+ y="11.0209"
127
+ width="2"
128
+ height="9.9466"
129
+ transform="rotate(135 12.0503 11.0209)"
130
+ fill="white"
131
+ />
132
+ </svg>
133
+
134
+ <Label screenReaderLabel={ removeText } />
135
  </button>
136
  </span>
137
  ) }
assets/js/blocks/cart-checkout/cart/full-cart/style.scss CHANGED
@@ -64,7 +64,7 @@ table.wc-block-cart-items {
64
  .wc-block-cart-item__total {
65
  @include font-size(regular);
66
  text-align: right;
67
- line-height: 1.25;
68
  }
69
  .wc-block-components-product-metadata {
70
  margin-bottom: 0.75em;
64
  .wc-block-cart-item__total {
65
  @include font-size(regular);
66
  text-align: right;
67
+ line-height: inherit;
68
  }
69
  .wc-block-components-product-metadata {
70
  margin-bottom: 0.75em;
assets/js/blocks/cart-checkout/payment-methods/payment-method-options.js CHANGED
@@ -58,7 +58,7 @@ const PaymentMethodOptions = () => {
58
  } ),
59
  name: `wc-saved-payment-method-token-${ name }`,
60
  content: (
61
- <PaymentMethodCard allowsSaving={ supports.savePaymentInfo }>
62
  { cloneElement( component, {
63
  activePaymentMethod,
64
  ...paymentMethodInterface,
58
  } ),
59
  name: `wc-saved-payment-method-token-${ name }`,
60
  content: (
61
+ <PaymentMethodCard showSaveOption={ supports.showSaveOption }>
62
  { cloneElement( component, {
63
  activePaymentMethod,
64
  ...paymentMethodInterface,
assets/js/blocks/cart-checkout/payment-methods/saved-payment-method-options.js CHANGED
@@ -1,10 +1,19 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { useEffect, useRef, useCallback } from '@wordpress/element';
 
 
 
 
 
5
  import { __, sprintf } from '@wordpress/i18n';
6
  import { usePaymentMethodDataContext } from '@woocommerce/base-context';
7
  import RadioControl from '@woocommerce/base-components/radio-control';
 
 
 
 
8
  import { getPaymentMethods } from '@woocommerce/blocks-registry';
9
 
10
  /**
@@ -94,6 +103,8 @@ const SavedPaymentMethodOptions = () => {
94
  setActiveSavedToken,
95
  } = usePaymentMethodDataContext();
96
  const standardMethods = getPaymentMethods();
 
 
97
 
98
  /**
99
  * @type {Object} Options
@@ -152,13 +163,26 @@ const SavedPaymentMethodOptions = () => {
152
  standardMethods,
153
  ] );
154
 
 
 
 
 
 
 
 
 
 
 
155
  return currentOptions.current.length > 0 ? (
156
- <RadioControl
157
- id={ 'wc-payment-method-saved-tokens' }
158
- selected={ activeSavedToken }
159
- onChange={ updateToken }
160
- options={ currentOptions.current }
161
- />
 
 
 
162
  ) : null;
163
  };
164
 
1
  /**
2
  * External dependencies
3
  */
4
+ import {
5
+ useEffect,
6
+ useRef,
7
+ useCallback,
8
+ cloneElement,
9
+ } from '@wordpress/element';
10
  import { __, sprintf } from '@wordpress/i18n';
11
  import { usePaymentMethodDataContext } from '@woocommerce/base-context';
12
  import RadioControl from '@woocommerce/base-components/radio-control';
13
+ import {
14
+ usePaymentMethodInterface,
15
+ usePaymentMethods,
16
+ } from '@woocommerce/base-hooks';
17
  import { getPaymentMethods } from '@woocommerce/blocks-registry';
18
 
19
  /**
103
  setActiveSavedToken,
104
  } = usePaymentMethodDataContext();
105
  const standardMethods = getPaymentMethods();
106
+ const { paymentMethods } = usePaymentMethods();
107
+ const paymentMethodInterface = usePaymentMethodInterface();
108
 
109
  /**
110
  * @type {Object} Options
163
  standardMethods,
164
  ] );
165
 
166
+ const savedPaymentMethodHandler =
167
+ !! activeSavedToken &&
168
+ paymentMethods[ activePaymentMethod ] &&
169
+ paymentMethods[ activePaymentMethod ]?.savedTokenComponent
170
+ ? cloneElement(
171
+ paymentMethods[ activePaymentMethod ]?.savedTokenComponent,
172
+ { token: activeSavedToken, ...paymentMethodInterface }
173
+ )
174
+ : null;
175
+
176
  return currentOptions.current.length > 0 ? (
177
+ <>
178
+ <RadioControl
179
+ id={ 'wc-payment-method-saved-tokens' }
180
+ selected={ activeSavedToken }
181
+ onChange={ updateToken }
182
+ options={ currentOptions.current }
183
+ />
184
+ { savedPaymentMethodHandler }
185
+ </>
186
  ) : null;
187
  };
188
 
assets/js/blocks/cart-checkout/payment-methods/style.scss CHANGED
@@ -235,6 +235,10 @@
235
 
236
  .wc-block-components-radio-control-accordion-content {
237
  padding: 0 $gap em($gap) $gap;
 
 
 
 
238
  }
239
 
240
  .wc-block-checkout__order-notes {
235
 
236
  .wc-block-components-radio-control-accordion-content {
237
  padding: 0 $gap em($gap) $gap;
238
+
239
+ &:empty {
240
+ display: none;
241
+ }
242
  }
243
 
244
  .wc-block-checkout__order-notes {
assets/js/blocks/product-categories/style.scss CHANGED
@@ -62,16 +62,11 @@
62
  .wc-block-product-categories__button {
63
  display: flex;
64
  align-items: center;
65
- text-decoration: none;
66
  margin: 0;
67
- border: none;
68
- cursor: pointer;
69
- background: none;
70
  padding: 0 0.5em;
71
- color: $gray-700;
72
  position: relative;
73
  overflow: hidden;
74
- border-radius: 0.25em;
75
  svg {
76
  fill: currentColor;
77
  outline: none;
@@ -87,24 +82,6 @@
87
  cursor: default;
88
  opacity: 0.3;
89
  }
90
- &:focus:enabled {
91
- background-color: #fff;
92
- color: $gray-900;
93
- box-shadow: inset 0 0 0 1px $gray-400, inset 0 0 0 2px #fff;
94
- outline: 2px solid transparent;
95
- outline-offset: -2px;
96
- }
97
- &:not(:disabled):not([aria-disabled="true"]):hover {
98
- background-color: #fff;
99
- color: $gray-900;
100
- box-shadow: inset 0 0 0 1px $gray-200, inset 0 0 0 2px #fff, 0 1px 1px rgba(25, 30, 35, 0.2);
101
- }
102
- &:not(:disabled):not([aria-disabled="true"]):active {
103
- outline: none;
104
- background-color: #fff;
105
- color: $gray-900;
106
- box-shadow: inset 0 0 0 1px $gray-400, inset 0 0 0 2px #fff;
107
- }
108
  &[aria-disabled="true"]:focus,
109
  &:disabled:focus {
110
  box-shadow: none;
62
  .wc-block-product-categories__button {
63
  display: flex;
64
  align-items: center;
 
65
  margin: 0;
 
 
 
66
  padding: 0 0.5em;
 
67
  position: relative;
68
  overflow: hidden;
69
+
70
  svg {
71
  fill: currentColor;
72
  outline: none;
82
  cursor: default;
83
  opacity: 0.3;
84
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  &[aria-disabled="true"]:focus,
86
  &:disabled:focus {
87
  box-shadow: none;
assets/js/blocks/product-search/style.scss CHANGED
@@ -10,16 +10,11 @@
10
  .wc-block-product-search__button {
11
  display: flex;
12
  align-items: center;
13
- text-decoration: none;
14
  margin: 0 0 0 6px;
15
- border: none;
16
  cursor: pointer;
17
- background: none;
18
  padding: 0 0.5em;
19
- color: $gray-700;
20
  position: relative;
21
  overflow: hidden;
22
- border-radius: 0.25em;
23
  svg {
24
  fill: currentColor;
25
  outline: none;
@@ -35,24 +30,6 @@
35
  cursor: default;
36
  opacity: 0.3;
37
  }
38
- &:focus:enabled {
39
- background-color: #fff;
40
- color: $gray-900;
41
- box-shadow: inset 0 0 0 1px $gray-700, inset 0 0 0 2px #fff;
42
- outline: 2px solid transparent;
43
- outline-offset: -2px;
44
- }
45
- &:not(:disabled):not([aria-disabled="true"]):hover {
46
- background-color: #fff;
47
- color: $gray-900;
48
- box-shadow: inset 0 0 0 1px $gray-200, inset 0 0 0 2px #fff, 0 1px 1px rgba(25, 30, 35, 0.2);
49
- }
50
- &:not(:disabled):not([aria-disabled="true"]):active {
51
- outline: none;
52
- background-color: #fff;
53
- color: $gray-900;
54
- box-shadow: inset 0 0 0 1px $gray-900, inset 0 0 0 2px #fff;
55
- }
56
  &[aria-disabled="true"]:focus,
57
  &:disabled:focus {
58
  box-shadow: none;
10
  .wc-block-product-search__button {
11
  display: flex;
12
  align-items: center;
 
13
  margin: 0 0 0 6px;
 
14
  cursor: pointer;
 
15
  padding: 0 0.5em;
 
16
  position: relative;
17
  overflow: hidden;
 
18
  svg {
19
  fill: currentColor;
20
  outline: none;
30
  cursor: default;
31
  opacity: 0.3;
32
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  &[aria-disabled="true"]:focus,
34
  &:disabled:focus {
35
  box-shadow: none;
assets/js/data/cart/actions.ts CHANGED
@@ -18,6 +18,7 @@ import { ACTION_TYPES as types } from './action-types';
18
  import { STORE_KEY as CART_STORE_KEY } from './constants';
19
  import { apiFetchWithHeaders } from '../shared-controls';
20
  import type { ResponseError } from '../types';
 
21
 
22
  /**
23
  * Returns an action object used in updating the store with the provided items
@@ -424,7 +425,7 @@ export function* updateCustomerData(
424
  return true;
425
  }
426
 
427
- export type CartAction = ReturnType<
428
  | typeof receiveCart
429
  | typeof receiveError
430
  | typeof receiveApplyingCoupon
@@ -434,4 +435,8 @@ export type CartAction = ReturnType<
434
  | typeof itemIsPendingDelete
435
  | typeof updatingCustomerData
436
  | typeof shippingRatesBeingSelected
 
 
 
 
437
  >;
18
  import { STORE_KEY as CART_STORE_KEY } from './constants';
19
  import { apiFetchWithHeaders } from '../shared-controls';
20
  import type { ResponseError } from '../types';
21
+ import { ReturnOrGeneratorYieldUnion } from '../../mapped-types';
22
 
23
  /**
24
  * Returns an action object used in updating the store with the provided items
425
  return true;
426
  }
427
 
428
+ export type CartAction = ReturnOrGeneratorYieldUnion<
429
  | typeof receiveCart
430
  | typeof receiveError
431
  | typeof receiveApplyingCoupon
435
  | typeof itemIsPendingDelete
436
  | typeof updatingCustomerData
437
  | typeof shippingRatesBeingSelected
438
+ | typeof updateCustomerData
439
+ | typeof removeItemFromCart
440
+ | typeof changeCartItemQuantity
441
+ | typeof addItemToCart
442
  >;
assets/js/data/cart/index.ts CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { registerStore } from '@wordpress/data';
5
  import { controls as dataControls } from '@wordpress/data-controls';
6
- import type { DispatchFromMap, SelectFromMap } from '@automattic/data-stores';
7
 
8
  /**
9
  * Internal dependencies
@@ -14,6 +14,7 @@ import * as actions from './actions';
14
  import * as resolvers from './resolvers';
15
  import reducer, { State } from './reducers';
16
  import { controls } from '../shared-controls';
 
17
 
18
  registerStore< State >( STORE_KEY, {
19
  reducer,
3
  */
4
  import { registerStore } from '@wordpress/data';
5
  import { controls as dataControls } from '@wordpress/data-controls';
6
+ import type { SelectFromMap } from '@automattic/data-stores';
7
 
8
  /**
9
  * Internal dependencies
14
  import * as resolvers from './resolvers';
15
  import reducer, { State } from './reducers';
16
  import { controls } from '../shared-controls';
17
+ import { DispatchFromMap } from '../../mapped-types';
18
 
19
  registerStore< State >( STORE_KEY, {
20
  reducer,
assets/js/data/default-states.ts CHANGED
@@ -75,7 +75,7 @@ export const defaultCartState: CartState = {
75
  },
76
  errors: [],
77
  paymentRequirements: [],
78
- extensions: [],
79
  },
80
  metaData: {
81
  updatingCustomerData: false,
75
  },
76
  errors: [],
77
  paymentRequirements: [],
78
+ extensions: {},
79
  },
80
  metaData: {
81
  updatingCustomerData: false,
assets/js/icons/icon/index.js DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { cloneElement, isValidElement } from 'wordpress-element';
5
- import PropTypes from 'prop-types';
6
-
7
- function Icon( { srcElement, size = 24, ...props } ) {
8
- return (
9
- isValidElement( srcElement ) &&
10
- cloneElement( srcElement, {
11
- width: size,
12
- height: size,
13
- ...props,
14
- } )
15
- );
16
- }
17
-
18
- Icon.propTypes = {
19
- srcElement: PropTypes.element,
20
- size: PropTypes.number,
21
- };
22
-
23
- export default Icon;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/icon/index.tsx ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { cloneElement, isValidElement } from 'wordpress-element';
5
+ import type { ReactElement } from 'react';
6
+
7
+ interface IconProps {
8
+ srcElement?: ReactElement;
9
+ size?: number;
10
+ className?: string;
11
+ }
12
+
13
+ function Icon( {
14
+ srcElement,
15
+ size = 24,
16
+ ...props
17
+ }: IconProps ): ReactElement | null {
18
+ if ( ! isValidElement( srcElement ) ) {
19
+ return null;
20
+ }
21
+ return cloneElement( srcElement, {
22
+ width: size,
23
+ height: size,
24
+ ...props,
25
+ } );
26
+ }
27
+
28
+ export default Icon;
assets/js/mapped-types.ts ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Usually we use ReturnType of all the action creators to deduce all the actions.
3
+ * This works until one of the action creators is a generator and doesn't actually "Return" an action.
4
+ * This type helper allows for actions to be both functions and generators
5
+ */
6
+ export type ReturnOrGeneratorYieldUnion<
7
+ T extends ( ...args: any ) => any
8
+ > = T extends ( ...args: any ) => infer Return
9
+ ? Return extends Generator< infer T, infer U, any >
10
+ ? T | U
11
+ : Return
12
+ : never;
13
+
14
+ /**
15
+ * Maps a "raw" actionCreators object to the actions available when registered on the @wordpress/data store.
16
+ *
17
+ * @template A Selector map, usually from `import * as actions from './my-store/actions';`
18
+ */
19
+ // Todo: This is a temporary implementation of what exists in @automattic/data-stores
20
+ // already: https://github.com/Automattic/wp-calypso/blob/0ba7f5a91571b3ba6a84be7db021c7eab247e434/packages/data-stores/src/mapped-types.ts
21
+ // We will need to remove this when @automattic/data-stores is updated on NPM.
22
+ export type DispatchFromMap<
23
+ A extends Record< string, ( ...args: any[] ) => any >
24
+ > = {
25
+ [ actionCreator in keyof A ]: (
26
+ ...args: Parameters< A[ actionCreator ] >
27
+ ) => A[ actionCreator ] extends ( ...args: any[] ) => Generator
28
+ ? Promise< GeneratorReturnType< A[ actionCreator ] > >
29
+ : void;
30
+ };
31
+
32
+ /**
33
+ * Obtain the type finally returned by the generator when it's done iterating.
34
+ */
35
+ // Todo: This is a temporary implementation of what exists in @automattic/data-stores
36
+ // already: https://github.com/Automattic/wp-calypso/blob/0ba7f5a91571b3ba6a84be7db021c7eab247e434/packages/data-stores/src/mapped-types.ts
37
+ // We will need to remove this when @automattic/data-stores is updated on NPM.
38
+ export type GeneratorReturnType<
39
+ T extends ( ...args: any[] ) => Generator
40
+ > = T extends ( ...args: any ) => Generator< any, infer R, any > ? R : never;
assets/js/payment-method-extensions/payment-methods/bacs/index.js CHANGED
@@ -26,7 +26,7 @@ const label = decodeEntities( settings.title ) || defaultLabel;
26
  * Content component
27
  */
28
  const Content = () => {
29
- return <div>{ decodeEntities( settings.description || '' ) }</div>;
30
  };
31
 
32
  /**
26
  * Content component
27
  */
28
  const Content = () => {
29
+ return decodeEntities( settings.description || '' );
30
  };
31
 
32
  /**
assets/js/payment-method-extensions/payment-methods/cheque/index.js CHANGED
@@ -23,7 +23,7 @@ const label = decodeEntities( settings.title ) || defaultLabel;
23
  * Content component
24
  */
25
  const Content = () => {
26
- return <div>{ decodeEntities( settings.description || '' ) }</div>;
27
  };
28
 
29
  /**
23
  * Content component
24
  */
25
  const Content = () => {
26
+ return decodeEntities( settings.description || '' );
27
  };
28
 
29
  /**
assets/js/payment-method-extensions/payment-methods/cod/index.js CHANGED
@@ -23,7 +23,7 @@ const label = decodeEntities( settings.title ) || defaultLabel;
23
  * Content component
24
  */
25
  const Content = () => {
26
- return <div>{ decodeEntities( settings.description || '' ) }</div>;
27
  };
28
 
29
  /**
23
  * Content component
24
  */
25
  const Content = () => {
26
+ return decodeEntities( settings.description || '' );
27
  };
28
 
29
  /**
assets/js/payment-method-extensions/payment-methods/paypal/index.js CHANGED
@@ -21,7 +21,7 @@ const settings = getSetting( 'paypal_data', {} );
21
  * Content component
22
  */
23
  const Content = () => {
24
- return <div>{ decodeEntities( settings.description || '' ) }</div>;
25
  };
26
 
27
  const paypalPaymentMethod = {
21
  * Content component
22
  */
23
  const Content = () => {
24
+ return decodeEntities( settings.description || '' );
25
  };
26
 
27
  const paypalPaymentMethod = {
assets/js/previews/{cart.js → cart.ts} RENAMED
@@ -3,10 +3,12 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import {
 
6
  SHIPPING_METHODS_EXIST,
7
  WC_BLOCKS_ASSET_URL,
8
  SHIPPING_ENABLED,
9
  } from '@woocommerce/block-settings';
 
10
 
11
  /**
12
  * Internal dependencies
@@ -16,7 +18,7 @@ import { previewShippingRates } from './shipping-rates';
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 : [],
22
  items: [
@@ -89,6 +91,7 @@ export const previewCart = {
89
  line_total: '1600',
90
  line_total_tax: '0',
91
  },
 
92
  },
93
  {
94
  key: '2',
@@ -154,6 +157,7 @@ export const previewCart = {
154
  line_total: '1400',
155
  line_total_tax: '0',
156
  },
 
157
  },
158
  ],
159
  fees: [],
@@ -161,7 +165,32 @@ export const previewCart = {
161
  items_weight: 0,
162
  needs_payment: true,
163
  needs_shipping: SHIPPING_ENABLED,
164
- has_calculated_shipping: true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  totals: {
166
  currency_code: 'USD',
167
  currency_symbol: '$',
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import {
6
+ SHIPPING_COST_REQUIRES_ADDRESS,
7
  SHIPPING_METHODS_EXIST,
8
  WC_BLOCKS_ASSET_URL,
9
  SHIPPING_ENABLED,
10
  } from '@woocommerce/block-settings';
11
+ import { CartResponse } from '@woocommerce/types';
12
 
13
  /**
14
  * Internal dependencies
18
  // Sample data for cart block.
19
  // This closely resembles the data returned from the Store API /cart endpoint.
20
  // https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi#cart-api
21
+ export const previewCart: CartResponse = {
22
  coupons: [],
23
  shipping_rates: SHIPPING_METHODS_EXIST ? previewShippingRates : [],
24
  items: [
91
  line_total: '1600',
92
  line_total_tax: '0',
93
  },
94
+ extensions: {},
95
  },
96
  {
97
  key: '2',
157
  line_total: '1400',
158
  line_total_tax: '0',
159
  },
160
+ extensions: {},
161
  },
162
  ],
163
  fees: [],
165
  items_weight: 0,
166
  needs_payment: true,
167
  needs_shipping: SHIPPING_ENABLED,
168
+ has_calculated_shipping: ! SHIPPING_COST_REQUIRES_ADDRESS,
169
+ extensions: {},
170
+ shipping_address: {
171
+ first_name: '',
172
+ last_name: '',
173
+ company: '',
174
+ address_1: '',
175
+ address_2: '',
176
+ city: '',
177
+ state: '',
178
+ postcode: '',
179
+ country: '',
180
+ },
181
+ billing_address: {
182
+ first_name: '',
183
+ last_name: '',
184
+ company: '',
185
+ address_1: '',
186
+ address_2: '',
187
+ city: '',
188
+ state: '',
189
+ postcode: '',
190
+ country: '',
191
+ email: '',
192
+ phone: '',
193
+ },
194
  totals: {
195
  currency_code: 'USD',
196
  currency_symbol: '$',
assets/js/previews/{shipping-rates.js → shipping-rates.ts} RENAMED
@@ -2,10 +2,18 @@
2
  * External dependencies
3
  */
4
  import { __, _x } from '@wordpress/i18n';
 
5
 
6
- export const previewShippingRates = [
7
  {
8
- destination: {},
 
 
 
 
 
 
 
9
  package_id: 0,
10
  name: __( 'Shipping', 'woo-gutenberg-products-block' ),
11
  items: [
@@ -41,7 +49,10 @@ export const previewShippingRates = [
41
  description: '',
42
  delivery_time: '',
43
  price: '000',
 
44
  rate_id: 'free_shipping:1',
 
 
45
  method_id: 'flat_rate',
46
  selected: true,
47
  },
@@ -57,7 +68,10 @@ export const previewShippingRates = [
57
  description: '',
58
  delivery_time: '',
59
  price: '200',
 
60
  rate_id: 'local_pickup:1',
 
 
61
  method_id: 'local_pickup',
62
  selected: false,
63
  },
2
  * External dependencies
3
  */
4
  import { __, _x } from '@wordpress/i18n';
5
+ import type { CartResponseShippingRateItem } from '@woocommerce/types';
6
 
7
+ export const previewShippingRates: CartResponseShippingRateItem[] = [
8
  {
9
+ destination: {
10
+ address_1: '',
11
+ address_2: '',
12
+ city: '',
13
+ state: '',
14
+ postcode: '',
15
+ country: '',
16
+ },
17
  package_id: 0,
18
  name: __( 'Shipping', 'woo-gutenberg-products-block' ),
19
  items: [
49
  description: '',
50
  delivery_time: '',
51
  price: '000',
52
+ taxes: '0',
53
  rate_id: 'free_shipping:1',
54
+ instance_id: 0,
55
+ meta_data: [],
56
  method_id: 'flat_rate',
57
  selected: true,
58
  },
68
  description: '',
69
  delivery_time: '',
70
  price: '200',
71
+ taxes: '0',
72
  rate_id: 'local_pickup:1',
73
+ instance_id: 1,
74
+ meta_data: [],
75
  method_id: 'local_pickup',
76
  selected: false,
77
  },
assets/js/settings/blocks/constants.js CHANGED
@@ -49,6 +49,11 @@ export const IS_SHIPPING_CALCULATOR_ENABLED = getSetting(
49
  'isShippingCalculatorEnabled',
50
  true
51
  );
 
 
 
 
 
52
  export const IS_SHIPPING_COST_HIDDEN = getSetting(
53
  'isShippingCostHidden',
54
  false
49
  'isShippingCalculatorEnabled',
50
  true
51
  );
52
+ // used for the editor logic as an extra check
53
+ export const SHIPPING_COST_REQUIRES_ADDRESS = getSetting(
54
+ 'shippingCostRequiresAddress',
55
+ false
56
+ );
57
  export const IS_SHIPPING_COST_HIDDEN = getSetting(
58
  'isShippingCostHidden',
59
  false
assets/js/type-defs/cart-response.ts CHANGED
@@ -45,6 +45,10 @@ export interface MetaKeyValue {
45
  value: string;
46
  }
47
 
 
 
 
 
48
  export interface CartResponseShippingRateItemShippingRate
49
  extends CurrencyResponseInfo {
50
  rate_id: string;
@@ -145,11 +149,11 @@ export interface CartResponseFeeItemTotals extends CurrencyResponseInfo {
145
  total_tax: string;
146
  }
147
 
148
- export interface CartResponseFeeItem {
149
  id: string;
150
  name: string;
151
  totals: CartResponseFeeItemTotals;
152
- }
153
 
154
  export interface CartResponseTotals extends CurrencyResponseInfo {
155
  total_items: string;
@@ -186,8 +190,8 @@ export interface CartResponse {
186
  needs_shipping: boolean;
187
  has_calculated_shipping: boolean;
188
  fees: Array< CartResponseFeeItem >;
189
- totals: CartResponseTotalsItem;
190
  errors: Array< CartResponseErrorItem >;
191
  payment_requirements: Array< unknown >;
192
- extensions: Array< CartResponseExtensionItem >;
193
  }
45
  value: string;
46
  }
47
 
48
+ export type ExtensionsData =
49
+ | Record< string, unknown >
50
+ | Record< string, never >;
51
+
52
  export interface CartResponseShippingRateItemShippingRate
53
  extends CurrencyResponseInfo {
54
  rate_id: string;
149
  total_tax: string;
150
  }
151
 
152
+ export type CartResponseFeeItem = {
153
  id: string;
154
  name: string;
155
  totals: CartResponseFeeItemTotals;
156
+ };
157
 
158
  export interface CartResponseTotals extends CurrencyResponseInfo {
159
  total_items: string;
190
  needs_shipping: boolean;
191
  has_calculated_shipping: boolean;
192
  fees: Array< CartResponseFeeItem >;
193
+ totals: CartResponseTotals;
194
  errors: Array< CartResponseErrorItem >;
195
  payment_requirements: Array< unknown >;
196
+ extensions: ExtensionsData;
197
  }
assets/js/type-defs/cart.ts CHANGED
@@ -3,7 +3,11 @@
3
  /**
4
  * Internal dependencies
5
  */
6
- import { MetaKeyValue, ShippingRateItemItem } from './cart-response';
 
 
 
 
7
  export interface CurrencyInfo {
8
  currency_code: string;
9
  currency_symbol: string;
@@ -123,6 +127,7 @@ export interface CartItem {
123
  variation: Array< CartVariationItem >;
124
  prices: CartItemPrices;
125
  totals: CartItemTotals;
 
126
  }
127
 
128
  export interface CartTotalsTaxLineItem {
@@ -160,9 +165,6 @@ export interface CartErrorItem {
160
  message: string;
161
  }
162
 
163
- export interface CartExtensionItem {
164
- [ key: string ]: unknown;
165
- }
166
  export interface Cart {
167
  coupons: Array< CartCouponItem >;
168
  shippingRates: Array< CartShippingRateItem >;
@@ -178,7 +180,7 @@ export interface Cart {
178
  totals: CartTotals;
179
  errors: Array< CartErrorItem >;
180
  paymentRequirements: Array< unknown >;
181
- extensions: Array< CartExtensionItem >;
182
  }
183
  export interface CartMeta {
184
  updatingCustomerData: boolean;
3
  /**
4
  * Internal dependencies
5
  */
6
+ import {
7
+ MetaKeyValue,
8
+ ShippingRateItemItem,
9
+ ExtensionsData,
10
+ } from './cart-response';
11
  export interface CurrencyInfo {
12
  currency_code: string;
13
  currency_symbol: string;
127
  variation: Array< CartVariationItem >;
128
  prices: CartItemPrices;
129
  totals: CartItemTotals;
130
+ extensions: ExtensionsData;
131
  }
132
 
133
  export interface CartTotalsTaxLineItem {
165
  message: string;
166
  }
167
 
 
 
 
168
  export interface Cart {
169
  coupons: Array< CartCouponItem >;
170
  shippingRates: Array< CartShippingRateItem >;
180
  totals: CartTotals;
181
  errors: Array< CartErrorItem >;
182
  paymentRequirements: Array< unknown >;
183
+ extensions: ExtensionsData;
184
  }
185
  export interface CartMeta {
186
  updatingCustomerData: boolean;
assets/js/type-defs/contexts.js CHANGED
@@ -60,22 +60,6 @@
60
  * @property {string} UNKNOWN When an unknown error has occurred in calculating/retrieving shipping rates.
61
  */
62
 
63
- /**
64
- * @typedef {Object} PaymentMethodCurrentStatus
65
- *
66
- * This contains status information for the current active payment method in the checkout.
67
- *
68
- * @property {boolean} isPristine If true then the payment method state in checkout is pristine.
69
- * @property {boolean} isStarted If true then the payment method has been initialized and has started.
70
- * @property {boolean} isProcessing If true then the payment method is processing payment.
71
- * @property {boolean} isFinished If true then the payment method is in a finished state (which may mean it's status
72
- * is either error, failed, or success).
73
- * @property {boolean} hasError If true then the payment method is in an error state.
74
- * @property {boolean} hasFailed If true then the payment method has failed (usually indicates a problem with the
75
- * payment method used, not logic error)
76
- * @property {boolean} isSuccessful If true then the payment method has completed it's processing successfully.
77
- */
78
-
79
  /**
80
  * A saved customer payment method object (if exists)
81
  *
@@ -94,16 +78,6 @@
94
  * @property {CartShippingAddress} address The address selected for shipping.
95
  */
96
 
97
- /**
98
- * A Saved Customer Payment methods object
99
- *
100
- * This is an object where the keys are payment gateway slugs and the values are an array of CustomerPaymentMethod
101
- * objects.
102
- *
103
- * @typedef {Object} SavedCustomerPaymentMethods
104
- * @property {any} any Various payment methods
105
- */
106
-
107
  /**
108
  * @typedef {Object} PaymentStatusDispatchers
109
  *
@@ -119,44 +93,6 @@
119
  * @typedef {function():PaymentStatusDispatchers} PaymentStatusDispatch
120
  */
121
 
122
- /**
123
- * @typedef {Object} PaymentMethodDataContext
124
- *
125
- * @property {PaymentStatusDispatch} setPaymentStatus Sets the payment status for the payment
126
- * method.
127
- * @property {PaymentMethodCurrentStatus} currentStatus The current payment status.
128
- * @property {Object} paymentStatuses An object of payment status constants.
129
- * @property {Object} paymentMethodData Arbitrary data to be passed along for
130
- * processing by the payment method on the
131
- * server.
132
- * @property {string} errorMessage An error message provided by the payment
133
- * method if there is an error.
134
- * @property {string} activePaymentMethod The active payment method slug.
135
- * @property {function(string)} setActivePaymentMethod A function for setting the active payment
136
- * method.
137
- * @property {string} activeSavedToken Current active token.
138
- * @property {function(string):undefined} setActiveSavedToken A function for setting the active payment
139
- * method token.
140
- * @property {SavedCustomerPaymentMethods} customerPaymentMethods Returns the customer payment for the
141
- * customer if it exists.
142
- * @property {Object} paymentMethods Registered payment methods.
143
- * @property {Object} expressPaymentMethods Registered express payment methods.
144
- * @property {boolean} paymentMethodsInitialized True when all registered payment methods
145
- * have been initialized.
146
- * @property {boolean} expressPaymentMethodsInitialized True when all registered express payment
147
- * methods have been initialized.
148
- * @property {function(function())} onPaymentProcessing Event registration callback for registering
149
- * observers for the payment processing event.
150
- * @property {function(string)} setExpressPaymentError A function used by express payment methods
151
- * to indicate an error for checkout to handle.
152
- * It receives an error message string.
153
- * Does not change payment status.
154
- * @property {function(boolean):void} setShouldSavePayment A function used to set the shouldSavePayment
155
- * value.
156
- * @property {boolean} shouldSavePayment True means that the configured payment
157
- * method option is saved for the customer.
158
- */
159
-
160
  /**
161
  * @typedef {Object} CheckoutDataContext
162
  *
@@ -217,6 +153,7 @@
217
  * @property {boolean} isEditor Indicates whether in the editor context.
218
  * @property {number} currentPostId The post ID being edited.
219
  * @property {Object} previewData Object containing preview data for the editor.
 
220
  */
221
 
222
  /**
60
  * @property {string} UNKNOWN When an unknown error has occurred in calculating/retrieving shipping rates.
61
  */
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * A saved customer payment method object (if exists)
65
  *
78
  * @property {CartShippingAddress} address The address selected for shipping.
79
  */
80
 
 
 
 
 
 
 
 
 
 
 
81
  /**
82
  * @typedef {Object} PaymentStatusDispatchers
83
  *
93
  * @typedef {function():PaymentStatusDispatchers} PaymentStatusDispatch
94
  */
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * @typedef {Object} CheckoutDataContext
98
  *
153
  * @property {boolean} isEditor Indicates whether in the editor context.
154
  * @property {number} currentPostId The post ID being edited.
155
  * @property {Object} previewData Object containing preview data for the editor.
156
+ * @property {function(string):Object} getPreviewData Get data by name.
157
  */
158
 
159
  /**
assets/js/type-defs/hooks.ts ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type {
5
+ CartResponseErrorItem,
6
+ CartResponseCouponItem,
7
+ CartResponseItem,
8
+ CartResponseFeeItem,
9
+ CartResponseTotals,
10
+ CartResponseShippingAddress,
11
+ CartResponseBillingAddress,
12
+ CartResponseShippingRateItem,
13
+ CartResponse,
14
+ } from './cart-response';
15
+ import type { ResponseError } from '../data/types';
16
+ export interface StoreCartItemQuantity {
17
+ isPendingDelete: boolean;
18
+ quantity: number;
19
+ changeQuantity: ( quantity: number ) => void;
20
+ removeItem: () => Promise< void > | false;
21
+ cartItemQuantityErrors: Array< CartResponseErrorItem >;
22
+ }
23
+
24
+ export interface StoreCartCoupon {
25
+ appliedCoupons: Array< CartResponseCouponItem >;
26
+ isLoading: boolean;
27
+ applyCoupon: ( coupon: string ) => void;
28
+ removeCoupon: ( coupon: string ) => void;
29
+ isApplyingCoupon: boolean;
30
+ isRemovingCoupon: boolean;
31
+ }
32
+
33
+ export interface StoreCart {
34
+ cartCoupons: Array< CartResponseCouponItem >;
35
+ cartItems: Array< CartResponseItem >;
36
+ cartFees: Array< CartResponseFeeItem >;
37
+ cartItemsCount: number;
38
+ cartItemsWeight: number;
39
+ cartNeedsPayment: boolean;
40
+ cartNeedsShipping: boolean;
41
+ cartItemErrors: Array< CartResponseErrorItem >;
42
+ cartTotals: CartResponseTotals;
43
+ cartIsLoading: boolean;
44
+ cartErrors: Array< ResponseError >;
45
+ billingAddress: CartResponseBillingAddress;
46
+ shippingAddress: CartResponseShippingAddress;
47
+ shippingRates: Array< CartResponseShippingRateItem >;
48
+ extensions: Record< string, unknown >;
49
+ shippingRatesLoading: boolean;
50
+ cartHasCalculatedShipping: boolean;
51
+ paymentRequirements: Array< string >;
52
+ receiveCart: ( cart: CartResponse ) => void;
53
+ }
assets/js/type-defs/index.ts CHANGED
@@ -1,2 +1,3 @@
1
  export * from './cart-response';
2
  export * from './cart';
 
1
  export * from './cart-response';
2
  export * from './cart';
3
+ export * from './hooks';
assets/js/type-defs/shipping.ts ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable camelcase*/
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import type { ReactElement } from 'react';
7
+
8
+ export interface Rate {
9
+ currency_code: string;
10
+ currency_decimal_separator: string;
11
+ currency_minor_unit: number;
12
+ currency_prefix: string;
13
+ currency_suffix: string;
14
+ currency_symbol: string;
15
+ currency_thousand_separator: string;
16
+ delivery_time: string;
17
+ description: string;
18
+ id: number;
19
+ meta_data: [ { key: 'Items'; value: 'Beanie &times; 2' } ];
20
+ method_id: string;
21
+ name: string;
22
+ price: string;
23
+ rate_id: string;
24
+ selected: boolean;
25
+ taxes: string;
26
+ }
27
+
28
+ export interface PackageRateOption {
29
+ label: string;
30
+ value: string;
31
+ description?: string | ReactElement;
32
+ secondaryLabel?: string | ReactElement;
33
+ secondaryDescription?: string;
34
+ id?: string;
35
+ }
build/active-filters-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '57dacfe3ce024c2712bfac31f69dee85');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'd14cf2312d62a5b77473b42b374de26d');
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=226)}({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(55),o=r(56),c=r(40),i=r(57);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},110:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(11),o=r.n(n),c=r(7),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 p=[".wp-block-woocommerce-cart"],f=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),p=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:p})))),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)})),f({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,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),f({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},113:function(e,t){},12:function(e,t){!function(){e.exports=this.wp.data}()},128:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(13),i=r.n(c),a=r(29),u=function(e){var t=e.className,r=e.size,n=i()(e,["className","size"]);return React.createElement(a.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},s=React.createElement(u,null);t.a=s},129:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(13),i=r.n(c),a=r(2);r(3);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))}},13:function(e,t,r){var n=r(49);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},e.exports.default=e.exports,e.exports.__esModule=!0},131:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r(15),i=r(12);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)}}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(9),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}))}},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),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")))}},148:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(13),i=r.n(c),a=(r(3),r(5)),u=r.n(a),s=r(1),l=r(129),p=r(128),f=(r(113),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,p=e.radius,f=void 0===p?"small":p,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-"+f),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 x=h&&"string"==typeof h?h:O;r="string"!=typeof x?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),x)}var w={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},S=y?w:{},E=y?{"aria-hidden":!0}:w;return React.createElement(f,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"},E),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},17:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},2:function(e,t){!function(){e.exports=this.React}()},21:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},226:function(e,t,r){e.exports=r(275)},227:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},25:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},275:function(e,t,r){"use strict";r.r(t);var n=r(131),o=r(110),c=r(10),i=r.n(c),a=r(1),u=r(95),s=r(0),l=r(5),p=r.n(l),f=(r(3),r(38)),b=(r(227),r(142)),d=r(45),g=r(148),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.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(a.sprintf)(Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,u=void 0===i||i,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=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:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},p)))},O=r(98),v=r(23),h=r(143),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,p=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.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=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(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"),x=i()(_,2),w=x[0],S=x[1],E=Object(s.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(w)?y({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:m(v,w),removeCallback:function(){h(void 0),S(void 0)},displayStyle:t.displayStyle}):null}),[v,w,t.displayStyle,h,S]),k=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,t.displayStyle]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(w)||n))return null;var R="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(R,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(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(React.Fragment,null,E,k)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){h(void 0),S(void 0),d([])}},React.createElement(f.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){!function(){e.exports=this.wp.primitives}()},3:function(e,t,r){e.exports=r(75)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(41);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(25).default,o=r(17);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},38:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(0),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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,u,r))}},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(22),c=r.n(o),i=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t,r){var n=r(60);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t){!function(){e.exports=this.wp.blocks}()},44:function(e,t,r){"use strict";var n=r(32),o=r.n(n),c=r(33),i=r.n(c),a=r(17),u=r.n(a),s=r(34),l=r.n(s),p=r(35),f=r.n(p),b=r(21),d=r.n(b),g=r(7),m=r.n(g),y=(r(3),r(2)),O=r(1),v=r(9),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.C,"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(77);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var _=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=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(h,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);_.defaultProps={showErrorMessage:!0};t.a=_},45:function(e,t){!function(){e.exports=this.wc.priceFormat}()},49:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},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)}()},55:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},56: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}},e.exports.default=e.exports,e.exports.__esModule=!0},57:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},60:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},67: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 Object(c.useCallback)((function(e){return t((function(){throw e}))}),[])}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),o=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,t]),r.current}},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},72:function(e,t,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},75:function(e,t,r){"use strict";var n=r(76);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}},76:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},77:function(e,t){},8:function(e,t){!function(){e.exports=this.lodash}()},9:function(e,t,r){"use strict";r.d(t,"j",(function(){return o})),r.d(t,"u",(function(){return c})),r.d(t,"y",(function(){return i})),r.d(t,"r",(function(){return a})),r.d(t,"m",(function(){return u})),r.d(t,"o",(function(){return s})),r.d(t,"i",(function(){return l})),r.d(t,"z",(function(){return p})),r.d(t,"l",(function(){return f})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return d})),r.d(t,"n",(function(){return g})),r.d(t,"C",(function(){return y})),r.d(t,"D",(function(){return O})),r.d(t,"v",(function(){return v})),r.d(t,"a",(function(){return h})),r.d(t,"w",(function(){return j})),r.d(t,"b",(function(){return _})),r.d(t,"q",(function(){return x})),r.d(t,"g",(function(){return w})),r.d(t,"x",(function(){return k})),r.d(t,"h",(function(){return R})),r.d(t,"t",(function(){return P})),r.d(t,"s",(function(){return M})),r.d(t,"B",(function(){return T})),r.d(t,"A",(function(){return N})),r.d(t,"d",(function(){return C})),r.d(t,"e",(function(){return A})),r.d(t,"f",(function(){return B})),r.d(t,"p",(function(){return L})),r.d(t,"E",(function(){return F}));var n=r(4),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)),p=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),f=(Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),b=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),d=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),g=Object(n.getSetting)("isShippingCalculatorEnabled",!0),m=(Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1)),y=Object(n.getSetting)("wcBlocksAssetUrl",""),O=Object(n.getSetting)("wcBlocksBuildUrl",""),v=Object(n.getSetting)("shippingCountries",{}),h=Object(n.getSetting)("allowedCountries",{}),j=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{}),x=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("paymentGatewaySortOrder",[])),w=Object(n.getSetting)("checkoutShowLoginReminder",!0),S={id:0,title:"",permalink:""},E=Object(n.getSetting)("storePages",{myaccount:S,shop:S,cart:S,checkout:S,privacy:S,terms:S}),k=E.shop.permalink,R=(E.checkout.id,E.checkout.permalink),P=E.privacy.permalink,M=E.privacy.title,T=E.terms.permalink,N=E.terms.title,C=(E.cart.id,E.cart.permalink),A=Object(n.getSetting)("checkoutAllowsGuest",!1),B=Object(n.getSetting)("checkoutAllowsSignup",!1),L=E.myaccount.permalink?E.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),F=(r(42),function(){return m>1})},95: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 g}));var n=r(10),o=r.n(n),c=r(15),i=r(12),a=r(0),u=r(72),s=r(22),l=r.n(s),p=r(39),f=r(68),b=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,n])]},d=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,s])]},g=function(e,t){var r=Object(u.a)(),n=b(t=t||r),c=o()(n,2),i=c[0],s=c[1],d=Object(p.a)(i),g=Object(p.a)(e),m=Object(f.a)(g),y=Object(a.useRef)(!1);return Object(a.useEffect)((function(){l()(m,g)||(s(Object.assign({},d,g)),y.current=!0)}),[d,g,m,s]),y.current?[i,s]:[e,s]}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(12),c=r(0),i=r(39),a=r(67),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),g=Object(i.a)(p),m=Object(i.a)(s),y=Object(a.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}}});
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=229)}({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(83),o=r(84),c=r(61),i=r(85);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(15),o=r(12),c=r(0),i=r(39),a=r(65),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),g=Object(i.a)(p),m=Object(i.a)(u),y=Object(a.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}},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},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(11),o=r.n(n),c=r(7),i=r.n(c),a=r(0),s=r(42);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){i()(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 p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,i=e.getErrorBoundaryProps,u=void 0===i?function(){}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=u(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(s.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,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)})),f({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,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),f({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},115:function(e,t){},12:function(e,t){!function(){e.exports=this.wp.data}()},130:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=r(30),s=function(e){var t=e.className,r=e.size,n=i()(e,["className","size"]);return React.createElement(a.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},u=React.createElement(s,null);t.a=u},131:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(14),i=r.n(c),a=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)):null}},133:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r(15),i=r(12);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),s=a.receiveRoutes,u=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},14:function(e,t,r){var n=r(64);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},e.exports.default=e.exports,e.exports.__esModule=!0},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(9),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}))}},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),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})),s=e.filter((function(e){return e.attribute!==r.taxonomy}));a.length>0&&(i.slug=a.sort(),s.push(i)),t(Object(n.sortBy)(s,"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")))}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},150:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=(r(3),r(5)),s=r.n(a),u=r(1),l=r(131),p=r(130),f=(r(115),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,a=void 0===c?"li":c,u=e.className,l=void 0===u?"":u,p=e.radius,f=void 0===p?"small":p,b=e.children,d=void 0===b?null:b,g=i()(e,["text","screenReaderText","element","className","radius","children"]),m=a,y=s()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),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 x=h&&"string"==typeof h?h:O;r="string"!=typeof x?Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),x)}var w={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},E=y?w:{},S=y?{"aria-hidden":!0}:w;return React.createElement(f,o()({},j,E,{className:s()(c,"is-removable"),element:y?"button":j.element,screenReaderText:h,text:O}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},2:function(e,t){!function(){e.exports=this.React}()},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},21:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},229:function(e,t,r){e.exports=r(278)},23:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},230:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},278:function(e,t,r){"use strict";r.r(t);var n=r(133),o=r(112),c=r(10),i=r.n(c),a=r(1),s=r(94),u=r(0),l=r(5),p=r.n(l),f=(r(3),r(36)),b=(r(230),r(144)),d=r(43),g=r(150),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.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(a.sprintf)(Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,s=void 0===i||i,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=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},s&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?React.createElement(g.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.a,{screenReaderLabel:p}))))},O=r(100),v=r(23),h=r(145),j=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,u=void 0===c?"in":c,l=e.displayStyle,p=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(s.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=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===u&&(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(s.b)("attributes",[]),c=i()(o,2),l=c[0],d=c[1],g=Object(s.b)("min_price"),O=i()(g,2),v=O[0],h=O[1],_=Object(s.b)("max_price"),x=i()(_,2),w=x[0],E=x[1],S=Object(u.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(w)?y({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:m(v,w),removeCallback:function(){h(void 0),E(void 0)},displayStyle:t.displayStyle}):null}),[v,w,t.displayStyle,h,E]),R=Object(u.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,t.displayStyle]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(w)||n))return null;var k="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(k,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(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(React.Fragment,null,S,R)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){h(void 0),E(void 0),d([])}},React.createElement(f.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}}}})},3:function(e,t,r){e.exports=r(72)()},30:function(e,t){!function(){e.exports=this.wp.primitives}()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(56);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(20).default,o=r(21);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},36:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(0),i=r(5),a=r.n(i);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){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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,s=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",s=u(u({},s),{},{className:a()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(22),c=r.n(o);function i(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t){!function(){e.exports=this.wp.blocks}()},42:function(e,t,r){"use strict";var n=r(32),o=r.n(n),c=r(33),i=r.n(c),a=r(21),s=r.n(a),u=r(34),l=r.n(u),p=r(35),f=r.n(p),b=r(25),d=r.n(b),g=r(7),m=r.n(g),y=(r(3),r(2)),O=r(1),v=r(9),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.C,"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,s=e.errorMessagePrefix,u=void 0===s?Object(O.__)("Error:","woo-gutenberg-products-block"):s;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"},u?u+" ":"",a)))};r(74);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var _=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()(s()(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=e.renderError,a=this.state,s=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(h,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);_.defaultProps={showErrorMessage:!0};t.a=_},43:function(e,t){!function(){e.exports=this.wc.priceFormat}()},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)}()},56:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},61:function(e,t,r){var n=r(62);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},62:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},64:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},65: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 Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},66:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},69: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},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},72:function(e,t,r){"use strict";var n=r(73);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}},73:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},74:function(e,t){},8:function(e,t){!function(){e.exports=this.lodash}()},83:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},84: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}},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t,r){"use strict";r.d(t,"j",(function(){return o})),r.d(t,"u",(function(){return c})),r.d(t,"y",(function(){return i})),r.d(t,"r",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"o",(function(){return u})),r.d(t,"i",(function(){return l})),r.d(t,"z",(function(){return p})),r.d(t,"l",(function(){return f})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return d})),r.d(t,"n",(function(){return g})),r.d(t,"C",(function(){return y})),r.d(t,"D",(function(){return O})),r.d(t,"v",(function(){return v})),r.d(t,"a",(function(){return h})),r.d(t,"w",(function(){return j})),r.d(t,"b",(function(){return _})),r.d(t,"q",(function(){return x})),r.d(t,"g",(function(){return w})),r.d(t,"x",(function(){return R})),r.d(t,"h",(function(){return k})),r.d(t,"t",(function(){return P})),r.d(t,"s",(function(){return M})),r.d(t,"B",(function(){return T})),r.d(t,"A",(function(){return N})),r.d(t,"d",(function(){return C})),r.d(t,"e",(function(){return A})),r.d(t,"f",(function(){return B})),r.d(t,"p",(function(){return L})),r.d(t,"E",(function(){return F}));var n=r(4),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","")),s=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),u=Object(n.getSetting)("limitTags"),l=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0),Object(n.getSetting)("homeUrl",""),Object(n.getSetting)("couponsEnabled",!0)),p=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),f=(Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),b=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),d=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),g=Object(n.getSetting)("isShippingCalculatorEnabled",!0),m=(Object(n.getSetting)("shippingCostRequiresAddress",!1),Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1)),y=Object(n.getSetting)("wcBlocksAssetUrl",""),O=Object(n.getSetting)("wcBlocksBuildUrl",""),v=Object(n.getSetting)("shippingCountries",{}),h=Object(n.getSetting)("allowedCountries",{}),j=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{}),x=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("paymentGatewaySortOrder",[])),w=Object(n.getSetting)("checkoutShowLoginReminder",!0),E={id:0,title:"",permalink:""},S=Object(n.getSetting)("storePages",{myaccount:E,shop:E,cart:E,checkout:E,privacy:E,terms:E}),R=S.shop.permalink,k=(S.checkout.id,S.checkout.permalink),P=S.privacy.permalink,M=S.privacy.title,T=S.terms.permalink,N=S.terms.title,C=(S.cart.id,S.cart.permalink),A=Object(n.getSetting)("checkoutAllowsGuest",!1),B=Object(n.getSetting)("checkoutAllowsSignup",!1),L=S.myaccount.permalink?S.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),F=(r(40),function(){return m>1})},94: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 g}));var n=r(10),o=r.n(n),c=r(15),i=r(12),a=r(0),s=r(69),u=r(22),l=r.n(u),p=r(39),f=r(66),b=function(e){var t=Object(s.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,n])]},d=function(e,t,r){var n=Object(s.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},g=function(e,t){var r=Object(s.a)(),n=b(t=t||r),c=o()(n,2),i=c[0],u=c[1],d=Object(p.a)(i),g=Object(p.a)(e),m=Object(f.a)(g),y=Object(a.useRef)(!1);return Object(a.useEffect)((function(){l()(m,g)||(u(Object.assign({},d,g)),y.current=!0)}),[d,g,m,u]),y.current?[i,u]:[e,u]}}});
build/active-filters.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'e266687e25e2ae9b2c8c10e8956ff623');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'fc3bc6f22b39c932d1cef15563623fff');
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([853,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},119:function(e,t){},144:function(e,t,n){"use strict";var r=n(14),c=n.n(r),i=n(15),o=n.n(i),a=n(16),u=n.n(a),l=n(17),s=n.n(l),b=n(10),f=n.n(b),d=n(0),p=n(7),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(d.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var 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(d.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(d.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(d.createElement)(v,{level:o}),controls:Object(p.range)(c,i).map((function(t){return e.createLevelControl(t,o,a)}))})}}]),n}(d.Component);t.a=h},147:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return g}));var r=n(18),c=n.n(r),i=n(37),o=n(21),a=n(0),u=n(100),l=n(33),s=n.n(l),b=n(53),f=n(96),d=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,r])]},p=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,l])]},g=function(e,t){var n=Object(u.a)(),r=d(t=t||n),i=c()(r,2),o=i[0],l=i[1],p=Object(b.a)(o),g=Object(b.a)(e),m=Object(f.a)(g),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(m,g)||(l(Object.assign({},p,g)),v.current=!0)}),[p,g,m,l]),v.current?[o,l]:[e,l]}},157:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(37),c=n(21),i=n(0),o=n(53),a=n(95),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,d=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 p=Object(i.useRef)({results:[],isLoading:!0}),g=Object(o.a)(b),m=Object(o.a)(l),v=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!d)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,d]);return null!==O&&(p.current=O),p.current}},175:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(22)),i=n(8),o=n.n(i);n(243);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}))}},189:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.data}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},243:function(e,t){},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(6),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}))}},251:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));var r=n(7),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")))}},257:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),u=(n(2),n(8)),l=n.n(u),s=n(1),b=n(55),f=n(262),d=(n(189),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,d=void 0===f?"small":f,p=e.children,g=void 0===p?null:p,m=o()(e,["text","screenReaderText","element","className","radius","children"]),v=u,O=l()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),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,p=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 S=y&&"string"==typeof y?y:h;n="string"!=typeof S?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),S)}var k={"aria-label":n,disabled:p,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},E=O?k:{},x=O?{"aria-hidden":!0}:k;return Object(a.createElement)(d,c()({},w,E,{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})))}},262:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),u=n(31),l=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(u.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=l},28:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},37:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,n){"use strict";var r=n(5),c=n.n(r),i=n(0),o=n(8),a=n.n(o);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}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,o=e.wrapperProps,u=void 0===o?{}:o,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",u=l(l({},u),{},{className:a()(u.className,"screen-reader-text")}),Object(i.createElement)(t,u,r)):(t=c||i.Fragment,s&&b&&n!==r?Object(i.createElement)(t,u,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,u,n))}},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(33),i=n.n(c),o=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},55:function(e,t,n){"use strict";var r=n(5),c=n.n(r),i=n(24),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))}},6:function(e,t,n){"use strict";n.d(t,"l",(function(){return c})),n.d(t,"I",(function(){return i})),n.d(t,"O",(function(){return o})),n.d(t,"y",(function(){return a})),n.d(t,"A",(function(){return u})),n.d(t,"m",(function(){return l})),n.d(t,"z",(function(){return s})),n.d(t,"C",(function(){return b})),n.d(t,"o",(function(){return f})),n.d(t,"B",(function(){return d})),n.d(t,"n",(function(){return p})),n.d(t,"E",(function(){return g})),n.d(t,"u",(function(){return m})),n.d(t,"w",(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,"k",(function(){return y})),n.d(t,"K",(function(){return w})),n.d(t,"P",(function(){return _})),n.d(t,"q",(function(){return S})),n.d(t,"p",(function(){return k})),n.d(t,"H",(function(){return E})),n.d(t,"c",(function(){return x})),n.d(t,"v",(function(){return C})),n.d(t,"S",(function(){return P})),n.d(t,"T",(function(){return R})),n.d(t,"J",(function(){return L})),n.d(t,"a",(function(){return T})),n.d(t,"M",(function(){return B})),n.d(t,"b",(function(){return z})),n.d(t,"L",(function(){return H})),n.d(t,"D",(function(){return V})),n.d(t,"i",(function(){return F})),n.d(t,"N",(function(){return D})),n.d(t,"h",(function(){return U})),n.d(t,"j",(function(){return I})),n.d(t,"G",(function(){return G})),n.d(t,"F",(function(){return Q})),n.d(t,"R",(function(){return Y})),n.d(t,"Q",(function(){return K})),n.d(t,"d",(function(){return W})),n.d(t,"e",(function(){return q})),n.d(t,"f",(function(){return J})),n.d(t,"g",(function(){return $})),n.d(t,"x",(function(){return X})),n.d(t,"W",(function(){return ee})),n.d(t,"X",(function(){return te})),n.d(t,"U",(function(){return ne})),n.d(t,"V",(function(){return re}));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),d=Object(r.getSetting)("min_height",500),p=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),S=(Object(r.getSetting)("displayItemizedTaxes",!1),Object(r.getSetting)("hasDarkEditorStyleSupport",!1)),k=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),E=Object(r.getSetting)("productCount",0),x=Object(r.getSetting)("attributes",[]),C=Object(r.getSetting)("isShippingCalculatorEnabled",!0),N=(Object(r.getSetting)("isShippingCostHidden",!1),Object(r.getSetting)("woocommerceBlocksPhase",1)),P=Object(r.getSetting)("wcBlocksAssetUrl",""),R=Object(r.getSetting)("wcBlocksBuildUrl",""),L=Object(r.getSetting)("shippingCountries",{}),T=Object(r.getSetting)("allowedCountries",{}),B=Object(r.getSetting)("shippingStates",{}),z=Object(r.getSetting)("allowedStates",{}),H=Object(r.getSetting)("shippingMethodsExist",!1),V=Object(r.getSetting)("paymentGatewaySortOrder",[]),F=Object(r.getSetting)("checkoutShowLoginReminder",!0),A={id:0,title:"",permalink:""},M=Object(r.getSetting)("storePages",{myaccount:A,shop:A,cart:A,checkout:A,privacy:A,terms:A}),D=M.shop.permalink,U=M.checkout.id,I=M.checkout.permalink,G=M.privacy.permalink,Q=M.privacy.title,Y=M.terms.permalink,K=M.terms.title,W=M.cart.id,q=M.cart.permalink,J=Object(r.getSetting)("checkoutAllowsGuest",!1),$=Object(r.getSetting)("checkoutAllowsSignup",!1),X=M.myaccount.permalink?M.myaccount.permalink:Object(r.getSetting)("loginUrl","/wp-login.php"),Z=n(23),ee=function(e,t){if(N>2)return Object(Z.registerBlockType)(e,t)},te=function(e,t){if(N>1)return Object(Z.registerBlockType)(e,t)},ne=function(){return N>2},re=function(){return N>1}},62:function(e,t){!function(){e.exports=this.wc.priceFormat}()},68:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(14),o=n.n(i),a=n(15),u=n.n(a),l=n(12),s=n.n(l),b=n(16),f=n.n(b),d=n(17),p=n.n(d),g=n(10),m=n.n(g),v=n(0),O=n(7),h=n(8),j=n.n(h),y=n(4),w=n(179);n(119);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return p()(this,n)}}var S=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.isSecondary=!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.a)(S)},7:function(e,t){!function(){e.exports=this.lodash}()},853:function(e,t,n){e.exports=n(893)},854:function(e,t){},893:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),i=n(0),o=n(1),a=n(23),u=n(55),l=n(31),s=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(8),f=n.n(b),d=n(22),p=n(4),g=n(144),m=n(175),v=n(68),O=n(18),h=n.n(O),j=n(147),y=(n(2),n(44)),w=(n(854),n(250)),_=n(62),S=n(257),k=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(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},E=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)(S.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(157),C=n(28),N=n(251),P=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,d=Object(j.b)("attributes",[]),p=h()(d,2),g=p[0],m=p[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"))),E({type:v,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(g,m,n,e)},showLabel:!1,displayStyle:l})}))))},R=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),d=b[0],p=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(d)||Number.isFinite(v)?E({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:k(d,v),removeCallback:function(){p(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[d,v,t.displayStyle,p,O]),S=Object(i.useMemo)((function(){return u.map((function(e){var n=Object(w.b)(e.attribute);return Object(i.createElement)(P,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[u,t.displayStyle]);if(!(u.length>0||Number.isFinite(d)||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,E({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),E({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,_,S)),Object(i.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){p(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(p.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)(d.InspectorControls,{key:"inspector"},Object(i.createElement)(p.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)(p.Disabled,null,Object(i.createElement)(R,{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}()},95:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(18),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return Object(i.useCallback)((function(e){return t((function(){throw e}))}),[])}},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),c=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,t]),n.current}}});
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],l=t[1],u=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 l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,u||[]),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 l=n[a];0!==c[l]&&(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||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return i.push([856,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},119:function(e,t){},143:function(e,t,n){"use strict";var r=n(15),c=n.n(r),i=n(16),o=n.n(i),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(10),f=n.n(b),d=n(0),p=n(8),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(d.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var h=function(e){l()(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(d.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(d.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(d.createElement)(v,{level:o}),controls:Object(p.range)(c,i).map((function(t){return e.createLevelControl(t,o,a)}))})}}]),n}(d.Component);t.a=h},147:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return g}));var r=n(14),c=n.n(r),i=n(37),o=n(21),a=n(0),l=n(100),u=n(33),s=n.n(u),b=n(53),f=n(97),d=function(e){var t=Object(l.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,r])]},p=function(e,t,n){var r=Object(l.a)();n=n||r;var c=Object(o.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},g=function(e,t){var n=Object(l.a)(),r=d(t=t||n),i=c()(r,2),o=i[0],u=i[1],p=Object(b.a)(o),g=Object(b.a)(e),m=Object(f.a)(g),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(m,g)||(u(Object.assign({},p,g)),v.current=!0)}),[p,g,m,u]),v.current?[o,u]:[e,u]}},157:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(37),c=n(21),i=n(0),o=n(53),a=n(96),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,d=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 p=Object(i.useRef)({results:[],isLoading:!0}),g=Object(o.a)(b),m=Object(o.a)(u),v=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!d)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,d]);return null!==O&&(p.current=O),p.current}},175:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(22)),i=n(7),o=n.n(i);n(241);t.a=function(e){var t=e.className,n=e.headingLevel,i=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:o()("wc-block-editor-components-title",t),value:a,onChange:i}))}},189:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.data}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},241:function(e,t){},249:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(6),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}))}},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));var r=n(8),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})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(o.slug=a.sort(),l.push(o)),t(Object(r.sortBy)(l,"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")))}},256:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),l=(n(2),n(7)),u=n.n(l),s=n(1),b=n(55),f=n(262),d=(n(189),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,l=void 0===i?"li":i,s=e.className,b=void 0===s?"":s,f=e.radius,d=void 0===f?"small":f,p=e.children,g=void 0===p?null:p,m=o()(e,["text","screenReaderText","element","className","radius","children"]),v=l,O=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),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,l=e.disabled,p=void 0!==l&&l,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:p,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)(d,c()({},w,k,{className:u()(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})))}},262:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),l=n(31),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},28:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},37:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,n){"use strict";var r=n(5),c=n.n(r),i=n(0),o=n(7),a=n.n(o);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 u(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}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,o=e.wrapperProps,l=void 0===o?{}:o,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",l=u(u({},l),{},{className:a()(l.className,"screen-reader-text")}),Object(i.createElement)(t,l,r)):(t=c||i.Fragment,s&&b&&n!==r?Object(i.createElement)(t,l,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,l,n))}},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(33),i=n.n(c);function o(e){var t=Object(r.useRef)();return void 0!==t.current&&i()(e,t.current)||(t.current=e),t.current}},55:function(e,t,n){"use strict";var r=n(5),c=n.n(r),i=n(24),o=n.n(i),a=n(9);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}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?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}({width:r,height:r},i)):null}},6:function(e,t,n){"use strict";n.d(t,"l",(function(){return c})),n.d(t,"I",(function(){return i})),n.d(t,"P",(function(){return o})),n.d(t,"y",(function(){return a})),n.d(t,"A",(function(){return l})),n.d(t,"m",(function(){return u})),n.d(t,"z",(function(){return s})),n.d(t,"C",(function(){return b})),n.d(t,"o",(function(){return f})),n.d(t,"B",(function(){return d})),n.d(t,"n",(function(){return p})),n.d(t,"E",(function(){return g})),n.d(t,"u",(function(){return m})),n.d(t,"w",(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,"k",(function(){return y})),n.d(t,"L",(function(){return w})),n.d(t,"Q",(function(){return _})),n.d(t,"q",(function(){return E})),n.d(t,"p",(function(){return S})),n.d(t,"H",(function(){return k})),n.d(t,"c",(function(){return x})),n.d(t,"v",(function(){return C})),n.d(t,"J",(function(){return N})),n.d(t,"T",(function(){return R})),n.d(t,"U",(function(){return L})),n.d(t,"K",(function(){return T})),n.d(t,"a",(function(){return B})),n.d(t,"N",(function(){return z})),n.d(t,"b",(function(){return H})),n.d(t,"M",(function(){return V})),n.d(t,"D",(function(){return F})),n.d(t,"i",(function(){return A})),n.d(t,"O",(function(){return U})),n.d(t,"h",(function(){return I})),n.d(t,"j",(function(){return Y})),n.d(t,"G",(function(){return G})),n.d(t,"F",(function(){return Q})),n.d(t,"S",(function(){return K})),n.d(t,"R",(function(){return W})),n.d(t,"d",(function(){return q})),n.d(t,"e",(function(){return J})),n.d(t,"f",(function(){return $})),n.d(t,"g",(function(){return X})),n.d(t,"x",(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),l=Object(r.getSetting)("min_columns",1),u=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),d=Object(r.getSetting)("min_height",500),p=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),Object(r.getSetting)("hasDarkEditorStyleSupport",!1)),S=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),k=Object(r.getSetting)("productCount",0),x=Object(r.getSetting)("attributes",[]),C=Object(r.getSetting)("isShippingCalculatorEnabled",!0),N=Object(r.getSetting)("shippingCostRequiresAddress",!1),P=(Object(r.getSetting)("isShippingCostHidden",!1),Object(r.getSetting)("woocommerceBlocksPhase",1)),R=Object(r.getSetting)("wcBlocksAssetUrl",""),L=Object(r.getSetting)("wcBlocksBuildUrl",""),T=Object(r.getSetting)("shippingCountries",{}),B=Object(r.getSetting)("allowedCountries",{}),z=Object(r.getSetting)("shippingStates",{}),H=Object(r.getSetting)("allowedStates",{}),V=Object(r.getSetting)("shippingMethodsExist",!1),F=Object(r.getSetting)("paymentGatewaySortOrder",[]),A=Object(r.getSetting)("checkoutShowLoginReminder",!0),M={id:0,title:"",permalink:""},D=Object(r.getSetting)("storePages",{myaccount:M,shop:M,cart:M,checkout:M,privacy:M,terms:M}),U=D.shop.permalink,I=D.checkout.id,Y=D.checkout.permalink,G=D.privacy.permalink,Q=D.privacy.title,K=D.terms.permalink,W=D.terms.title,q=D.cart.id,J=D.cart.permalink,$=Object(r.getSetting)("checkoutAllowsGuest",!1),X=Object(r.getSetting)("checkoutAllowsSignup",!1),Z=D.myaccount.permalink?D.myaccount.permalink:Object(r.getSetting)("loginUrl","/wp-login.php"),ee=n(23),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}},61:function(e,t){!function(){e.exports=this.wc.priceFormat}()},68:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(15),o=n.n(i),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),d=n(18),p=n.n(d),g=n(10),m=n.n(g),v=n(0),O=n(8),h=n(7),j=n.n(h),y=n(4),w=n(179);n(119);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return p()(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 l()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,i=n.checked,o=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(o);return l&&(e=Object(O.isFunction)(l)?l(i):l),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"},u.map((function(e,n){var i={};return s===e.value?(i.isPrimary=!0,i["aria-pressed"]=!0):(i.isSecondary=!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.a)(E)},8:function(e,t){!function(){e.exports=this.lodash}()},856:function(e,t,n){e.exports=n(896)},857:function(e,t){},896:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),i=n(0),o=n(1),a=n(23),l=n(55),u=n(31),s=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 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),d=n(22),p=n(4),g=n(143),m=n(175),v=n(68),O=n(14),h=n.n(O),j=n(147),y=(n(2),n(44)),w=(n(857),n(249)),_=n(61),E=n(256),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(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},k=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(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},u&&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},Object(i.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(i.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(i.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(i.createElement)(y.a,{screenReaderLabel:f}))))},x=n(157),C=n(28),N=n(250),P=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(x.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,d=Object(j.b)("attributes",[]),p=h()(d,2),g=p[0],m=p[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"===l&&(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(N.a)(g,m,n,e)},showLabel:!1,displayStyle:u})}))))},R=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=h()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=h()(s,2),d=b[0],p=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(d)||Number.isFinite(v)?k({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:S(d,v),removeCallback:function(){p(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[d,v,t.displayStyle,p,O]),E=Object(i.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(i.createElement)(P,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(d)||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(){p(void 0),O(void 0),u([])}},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(p.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(i.createElement)("div",{className:r},Object(i.createElement)(d.InspectorControls,{key:"inspector"},Object(i.createElement)(p.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:l,onChange:function(e){return n({headingLevel:e})}}))),Object(i.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(i.createElement)(p.Disabled,null,Object(i.createElement)(R,{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)(l.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}()},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(14),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},97:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}}});
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-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning', 'wp-wordcount'), 'version' => '4a4ea7f237bf4ba77e8a09a1e2a9ee01');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning', 'wp-wordcount'), 'version' => '3bb850b3f21092e1a08d5e7cc320f3df');
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=214)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(75)()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"j",(function(){return o})),n.d(t,"u",(function(){return c})),n.d(t,"y",(function(){return i})),n.d(t,"r",(function(){return a})),n.d(t,"m",(function(){return u})),n.d(t,"o",(function(){return s})),n.d(t,"i",(function(){return l})),n.d(t,"z",(function(){return f})),n.d(t,"l",(function(){return p})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return b})),n.d(t,"n",(function(){return m})),n.d(t,"C",(function(){return v})),n.d(t,"D",(function(){return g})),n.d(t,"v",(function(){return y})),n.d(t,"a",(function(){return O})),n.d(t,"w",(function(){return j})),n.d(t,"b",(function(){return w})),n.d(t,"q",(function(){return k})),n.d(t,"g",(function(){return E})),n.d(t,"x",(function(){return S})),n.d(t,"h",(function(){return P})),n.d(t,"t",(function(){return R})),n.d(t,"s",(function(){return C})),n.d(t,"B",(function(){return N})),n.d(t,"A",(function(){return T})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return A})),n.d(t,"f",(function(){return D})),n.d(t,"p",(function(){return F})),n.d(t,"E",(function(){return I}));var r=n(4),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),Object(r.getSetting)("hasDarkEditorStyleSupport",!1)),d=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),b=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),m=Object(r.getSetting)("isShippingCalculatorEnabled",!0),h=(Object(r.getSetting)("isShippingCostHidden",!1),Object(r.getSetting)("woocommerceBlocksPhase",1)),v=Object(r.getSetting)("wcBlocksAssetUrl",""),g=Object(r.getSetting)("wcBlocksBuildUrl",""),y=Object(r.getSetting)("shippingCountries",{}),O=Object(r.getSetting)("allowedCountries",{}),j=Object(r.getSetting)("shippingStates",{}),w=Object(r.getSetting)("allowedStates",{}),k=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("paymentGatewaySortOrder",[])),E=Object(r.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},_=Object(r.getSetting)("storePages",{myaccount:x,shop:x,cart:x,checkout:x,privacy:x,terms:x}),S=_.shop.permalink,P=(_.checkout.id,_.checkout.permalink),R=_.privacy.permalink,C=_.privacy.title,N=_.terms.permalink,T=_.terms.title,M=(_.cart.id,_.cart.permalink),A=Object(r.getSetting)("checkoutAllowsGuest",!1),D=Object(r.getSetting)("checkoutAllowsSignup",!1),F=_.myaccount.permalink?_.myaccount.permalink:Object(r.getSetting)("loginUrl","/wp-login.php"),I=(n(42),function(){return h>1})},function(e,t,n){var r=n(55),o=n(56),c=n(40),i=n(57);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){var r=n(49);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(55),o=n(56),c=n(40),i=n(57);function a(e,t){return r(e)||o(e,t)||c(e,t)||i()}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(49);function o(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,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 n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},,function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},,,function(e,t){!function(){e.exports=this.wp.primitives}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(64),o=n(65),c=n(40),i=n(66);function a(e){return r(e)||o(e)||c(e)||i()}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(41);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(25).default,o=n(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(0),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}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=n,f=null!=r;return!l&&f?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,r)):(t=o||c.Fragment,l&&f&&n!==r?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,u,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),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,n){var r=n(60);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(17),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(21),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(9),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.C,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(77);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(63),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(78))},,,function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){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.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.deprecated}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(16),o=n(0);function c(e){var t=Object(o.useState)((function(){return!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)})),n=Object(r.a)(t,2),c=n[0],i=n[1];return Object(o.useEffect)((function(){if(e){var t=function(){return i(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&c}},function(e,t){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(60);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},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 Object(c.useCallback)((function(e){return t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),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,t]),n.current}},,,,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,n){"use strict";var r=n(6),o=n(18),c=n(0),i=n(5),a=n.n(i),u=n(8),s=n(61),l=n.n(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var b=n(41);function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}var h=n(25),v=n(17);function g(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?v(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=n(16),j=n(43),w=n(54),k=n(62),E={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},x={">=":"min-width","<":"max-width"},_={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},S=Object(c.createContext)(null),P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(c.useContext)(S),r=!n&&"(".concat(x[t],": ").concat(E[e],"px)"),o=Object(k.a)(r);return n?_[t](E[e],n):o};P.__experimentalWidthProvider=S.Provider;var R=P,C=n(159),N=n(119),T=n(20);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){Object(T.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function F(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(j.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var I=n(31);var B=function(e,t){return function(n){var r=e(n),o=n.displayName,c=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(u.upperFirst)(Object(u.camelCase)(t)),"(").concat(c,")"),r}},L=n(14);function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var z=Object(c.createContext)({focusHistory:[]}),q=z.Provider,W=z.Consumer;q.displayName="FocusReturnProvider",W.displayName="FocusReturnConsumer";c.Component;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 n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var U=B((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=H(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(I.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(I.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(W,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");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 n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var Q=B((function(e){return function(t){m(r,t);var n=K(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(L.a)(e)),e}return d(r,[{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(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");function G(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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var Y=["button","submit"];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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var J=B((function(e){return function(t){m(o,t);var n=G(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(L.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(L.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(L.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(L.a)(e)),e}return d(o,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(Y,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=$(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=Z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function ee(e){e.stopPropagation()}var te=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:ee}),n)})),ne=n(46);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(T.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t=Object(c.useContext)(ne.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return oe(oe({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}var ie=n(91);function ae(e,t,n){return(ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=ie(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var ue=n(52),se=n(22),le=n.n(se);function fe(e){var t=function(e,t){if("object"!==Object(ue.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(ue.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(ue.a)(t)?t:String(t)}function pe(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 de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(n),!0).forEach((function(t){Object(T.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function be(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(O.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(O.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return de(de({},r),{},Object(T.a)({},e,de(de({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(fe));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!le()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return de(de({},n),{},Object(T.a)({},e,[].concat(Object(I.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?de(de({},n),{},Object(T.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(ne.a.Provider,{value:v},h)}function me(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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var he=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ve=he.Provider,ge=he.Consumer;c.Component;function ye(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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var Oe=function(e){m(n,e);var t=ye(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(L.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||ae(y(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),je=function(e){return Object(c.createElement)(ge,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(Oe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},we=0;function ke(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(he),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(O.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++we),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var Ee=function(e){return Object(c.createElement)(ge,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(ke,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function xe(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(ne.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function _e(e){var t,n,r=e.name,o=e.children,i=ce(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(O.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function Se(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(xe,n):Object(c.createElement)(je,n)}function Pe(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(Ee,e),Object(c.createElement)(_e,e))}function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){Object(T.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ne(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(O.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(T.a)(o,"is-from-"+l,"center"!==l),Object(T.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function Te(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:Ne(Ce({type:t},r))})}var Me=Q(U((function(e){return e.children})));function Ae(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function De(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Fe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Ie(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Be=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,k=e.anchorRect,E=e.getAnchorRect,x=e.expandOnMobile,_=e.animate,S=void 0===_||_,P=e.onClickOutside,T=e.onFocusOutside,M=e.__unstableSticky,I=e.__unstableSlotName,B=void 0===I?"Popover":I,L=e.__unstableObserveElement,V=e.__unstableBoundaryParent,z=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),W=Object(c.useRef)(null),H=Object(c.useRef)(),U=R("medium","<"),K=Object(c.useState)(),Q=Object(O.a)(K,2),G=Q[0],Y=Q[1],$=ce(B),Z=x&&U,ee=Object(C.a)(),ne=Object(O.a)(ee,2),re=ne[0],oe=ne[1];p=Z||p,Object(c.useLayoutEffect)((function(){if(Z)return Ie(H.current,"is-without-arrow",p),Ie(H.current,"is-alternate",d),De(H.current,"data-x-axis"),De(H.current,"data-y-axis"),Fe(H.current,"top"),Fe(H.current,"left"),Fe(W.current,"maxHeight"),void Fe(W.current,"maxWidth");var e=function(){if(H.current&&W.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(j.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:Ae(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:Ae(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:Ae(p,f)}}(q,k,E,g,y);if(e){var t,n,r=H.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(V)t=null===(n=H.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(O.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=F(e,t,s,p,r,o,c),b=D(e,t,f,p,r,d.yAxis,i);return A(A({},b),d)}(e,oe.height?oe:W.current.getBoundingClientRect(),m,M,H.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Fe(H.current,"top",s+"px"),Fe(H.current,"left",l+"px")),Ie(H.current,"is-without-arrow",p||"center"===f&&"middle"===b),Ie(H.current,"is-alternate",d),De(H.current,"data-x-axis",f),De(H.current,"data-y-axis",b),Fe(W.current,"maxHeight","number"==typeof h?h+"px":""),Fe(W.current,"maxWidth","number"==typeof v?v+"px":"");Y(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[Z,k,E,g,y,m,oe,M,L,V]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=j.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,W);var ie=function(e){e.keyCode===w.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ae=Object(c.createElement)(J,{onFocusOutside:function(e){if(T)T(e);else if(P){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),P(t)}else n&&n()}},Object(c.createElement)(Te,{type:S&&G?"appear":null,options:{origin:G}},(function(e){var o=e.className;return Object(c.createElement)(te,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":Z,"is-without-arrow":p,"is-alternate":d})},z,{onKeyDown:ie,ref:H}),Z&&Object(c.createElement)(X,null),Z&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Qe,{className:"components-popover__close",icon:N.a,onClick:n})),Object(c.createElement)("div",{ref:W,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ae=Object(c.createElement)(Me,null,ae)),$.ref&&(ae=Object(c.createElement)(Pe,{name:B},ae)),g||k?ae:Object(c.createElement)("span",{ref:q},ae)};Be.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(Se,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Le=Be;var Ve=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};function ze(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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var qe=function(e){m(n,e);var t=ze(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Le,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Ve,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),We=n(87);function He(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ke=["onMouseDown","onClick"];var Qe=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,x=e.shortcut,_=e.label,S=e.children,P=e.__experimentalIsFocusable,R=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!S,"has-icon":!!j}),N=O&&!P,T=void 0===n||N?"button":"a",M="a"===T?{href:n,target:i}:{type:"button",disabled:N,"aria-pressed":d};if(O&&P){M["aria-disabled"]=!0;var A,D=He(Ke);try{for(D.s();!(A=D.n()).done;){R[A.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var F=!N&&(k&&_||x||!!_&&(!S||Object(u.isArray)(S)&&!S.length)&&!1!==k),I=Object(c.createElement)(T,Object(r.a)({},M,R,{className:C,"aria-label":R["aria-label"]||_,ref:t}),j&&Object(c.createElement)(We.a,{icon:j,size:w}),S);return F?Object(c.createElement)(qe,{text:_,shortcut:x,position:E},I):I}))},,function(e,t,n){"use strict";var r=n(76);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){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r=n(2),o={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},c=function(e){var t=e.onResize,n=r.useRef();return function(e,t){var n=function(){return e.current&&e.current.contentDocument&&e.current.contentDocument.defaultView};function o(){t();var e=n();e&&e.addEventListener("resize",t)}r.useEffect((function(){return n()?o():e.current&&e.current.addEventListener&&e.current.addEventListener("load",o),function(){var e=n();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(n,(function(){return t(n)})),r.createElement("iframe",{style:o,src:"about:blank",ref:n,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},i=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};e.exports=function(e){void 0===e&&(e=i);var t=r.useState(e(null)),n=t[0],o=t[1],a=r.useCallback((function(t){return o(e(t.current))}),[e]);return[r.useMemo((function(){return r.createElement(c,{onResize:a})}),[a]),n]}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}})),c=function(){return Object(r.useContext)(o)}},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(49)),i=n(2),a=r(i),u=r(n(112)),s=r(n(17)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},x=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function _(e){k=e}var S,P=function(){return Date.now()};function R(e){S=e}var C,N,T=function(e){return e.current};function M(e){C=e}var A=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return x},injectFrame:function(e,t){E=e,x=t},get interpolation(){return k},injectStringInterpolator:_,get now(){return P},injectNow:function(e){P=e},get defaultElement(){return S},injectDefaultElement:R,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:M,get manualFrameloop(){return N},injectManualFrameloop:function(e){N=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),F=!1,I=new Set,B=function e(){if(!F)return!1;var t=P(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,x=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&x,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?N?N():E(e):F=!1,F};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}(g),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),W=0,H=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=W++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,c=e.to,i=void 0===c?{}:c;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var a=t.delay,u=c(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),F||(F=!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,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var x,_=a.parent,S=a.interpolation,R=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var N,T=S&&S.getValue(),M=!l.und(_)&&a.animatedValues.some((function(e){return!e.done})),A=!l.equ(C,T),D=!l.equ(C,a.previous),F=!l.equ(E,a.config);if(h||D&&A||F){var I;if(u||f)_=S=a.parent||new z(j);else if(m)_=S=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?(S=a.interpolation,a.interpolation.updateConfig(L)):S=_.interpolate(L)}return R=d(O?w.getPayload():w),x=d(_.getPayload()),h&&!y&&_.setValue(j,!1),t.hasChanged=!0,x.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=P(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&_.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:_,interpolation:S,animatedValues:x,toValues:R,previous:C,config:E,fromValues:d(_.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return A?e:(y&&(_.setValue(1,!1),S.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 H,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},K=0,Q=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},G=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 Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};M((function(e){return new $(e)})),R("div"),_((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return L(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return T(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),xe=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=xe,t.a=xe,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=A,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=G(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=G(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=G(r),k=w.keys,E=w.items,x=o({},i.current),_=[].concat(i.deleted),S=Object.keys(x),P=new Set(S),R=new Set(s),C=s.filter((function(e){return!P.has(e)})),N=i.transitions.filter((function(e){return!e.destroyed&&!R.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return P.has(e)})),M=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&_.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";x[e]={slot:c,originalKey:e,key:g?String(e):K++,item:o,trail:M+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":N.forEach((function(e){var t=k.indexOf(e),n=E[t];_.unshift(o({},x[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:M+=v,config:b(y,n,"leave"),to:b(d,n)})),delete x[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];x[e]=o({},x[e],{item:n,slot:"update",trail:M+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var A=s.map((function(e){return x[e]}));return _.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=A.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),A=[].concat(A.slice(0,t),[r],A.slice(t))})),o({},i,{changed:C.length||N.length||T.length,first:n&&0===C.length,transitions:A,current:x,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 H);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=U},,function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,,function(e,t,n){"use strict";var r=n(20),o=n(6),c=n(18),i=n(0),a=n(29),u=n(11),s=n.n(u),l=n(13),f=n.n(l),p=function(e){var t=e.className,n=e.size,r=void 0===n?20:n,o=f()(e,["className","size"]);return React.createElement(a.SVG,s()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},o),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},d=React.createElement(p,null),b=n(128),m=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=d;break;case"no-alt":t=b.a}return t?Object(i.cloneElement)(t,{size:e.size||20,className:e.className}):null};function h(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,u=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(m,Object(o.a)({icon:n},u));if(n&&m===n.type)return Object(i.cloneElement)(n,v({},u));var s=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,v({size:s},u)):n(v({size:s},u));if(n&&("svg"===n.type||n.type===a.SVG)){var l=v(v({width:s,height:s},n.props),u);return Object(i.createElement)(a.SVG,l)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,v({size:s},u)):n}},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(7),o=n.n(r),c=n(96),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,n){var r=n(21);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(5),i=n.n(c),a=n(36),u=n(1),s=(n(63),n(73));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(78))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(10),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(72),s=n(22),l=n.n(s),f=n(39),p=n(68),d=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,r])]},b=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,s])]},m=function(e,t){var n=Object(u.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],s=c[1],b=Object(f.a)(i),m=Object(f.a)(e),h=Object(p.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){l()(h,m)||(s(Object.assign({},b,m)),v.current=!0)}),[b,m,h,s]),v.current?[i,s]:[e,s]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return R})),n.d(t,"a",(function(){return C}));var r=n(7),o=n.n(r),c=n(10),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(139),l=n(6),f=n(26),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 b(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 m=n(16),h=n(5),v=n.n(h),g=n(8),y=n(82),O=n(160),j=n(92);var w=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?g.noop:o,i=Object(O.a)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(m.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=b(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=b(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=v()("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)(j.a,Object(l.a)({},Object(g.omit)(t,["content"]),{onRemove:d(t)}),t.content)))})))},k=n(90),E=n(81),x=function(){var e=Object(E.a)().isEditor,t=Object(k.a)(),n=t.notices,r=t.removeNotice;if(e)return null;var o=n.filter((function(e){return"snackbar"===e.type}));return React.createElement(w,{notices:o,className:"wc-block-components-notices__snackbar",onRemove:r})};function _(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?_(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),R=function(){return Object(a.useContext)(P)},C=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,b=p.removeNotice,m=Object(a.useState)(!1),h=i()(m,2),v=h[0],g=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,S(S({},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;b(e,t)}),[b,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,S(S({},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:g},k=v?null:React.createElement(s.a,{className:r,notices:w.notices}),E=v?null:React.createElement(x,null);return React.createElement(P.Provider,{value:w},c&&k,t,E)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(39),a=n(67),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,function(e,t){!function(){e.exports=this.wp.wordcount}()},,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(17),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(21),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(130);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(11),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(41);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(5),i=n.n(c),a=n(1),u=n(36),s=n(119),l=n(73);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},function(e,t,n){"use strict";var r=n(0),o=n(29),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(13),i=n.n(c),a=n(29),u=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return React.createElement(a.SVG,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(7),o=n.n(r),c=n(13),i=n.n(c),a=n(2);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}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(4),c=n(15),i=n(12);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(3);var r=n(5),o=n.n(r),c=n(38),i=n(121);n(158);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(3),n(5)),i=n.n(c),a=n(118),u=n(96),s=(n(111),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(37),o=n(0),c=n(9);n.p=c.D,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,299))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,300))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,301))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,302))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,286))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,303))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,304))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,305))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,306))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,307))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(79),o=n.n(r);t.a=o.a},function(e,t,n){"use strict";(function(e){var r=n(62),o="undefined"!=typeof window&&window.navigator.userAgent.indexOf("Trident")>=0,c=e.env.FORCE_REDUCED_MOTION||o?function(){return!0}:function(){return Object(r.a)("(prefers-reduced-motion: reduce)")};t.a=c}).call(this,n(78))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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(268)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(131),o=n(96),c=n(110),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(21),m=n.n(b),h=n(2),v=(n(3),n(10)),g=n.n(v),y=n(0),O=n(13),j=n.n(O),w=n(7),k=n.n(w),E=n(1),x=n(8),_=n(5),S=n.n(_),P=n(38),R=(n(217),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(P.a,{screenReaderLabel:Object(E.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(P.a,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:S()("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(P.a,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:S()("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(P.a,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:S()("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(P.a,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(P.a,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});R.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=R,N=n(95),T=n(98),M=n(15),A=n(12),D=n(39);function F(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(T.a)(I(I({},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(D.a)(a),s=Object(D.a)(c),l=Object(A.useSelect)((function(t){var o=t(M.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",I(I({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},L=n(68),V=n(105),z=n(84),q=n(36),W=n(4),H=n(129),U=n(29),K=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),Q=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(H.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:K,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(H.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(138),J=(n(216),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(121),X=n(11),ee=n.n(X),te=n(147),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=S()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))}));n(215);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=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)},ie=Object(V.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,c=r.rows,i=Object(W.getSetting)("hideOutOfStockItems",!1);return oe(oe({},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},i&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n})),u=g()(a,1)[0],s=B(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(z.useInnerBlockLayoutContext)().parentClassName,b=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,["order","orderby","page","per_page"])||{}}(u),m=Object(N.b)("attributes",[]),h=g()(m,2),v=h[0],O=h[1],w=Object(N.b)("min_price"),k=g()(w,2),_=k[0],P=k[1],R=Object(N.b)("max_price"),T=g()(R,2),M=T[0],A=T[1],D=Object(L.a)({totalQuery:b,totalProducts:f},ce);Object(y.useEffect)((function(){Object(x.isEqual)(b,null==D?void 0:D.totalQuery)||(r(1),null!=D&&D.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(q.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(q.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[null==D?void 0:D.totalQuery,f,r,b]);var F,I,V,H,U,K=t.contentVisibility,G=t.columns*t.rows,$=!Number.isFinite(f)&&Number.isFinite(null==D?void 0:D.totalProducts)&&Object(x.isEqual)(b,null==D?void 0:D.totalQuery)?Math.ceil(D.totalProducts/G):Math.ceil(f/G),Z=l.length?l:Array.from({length:G}),X=0!==l.length||p,ee=v.length>0||Number.isFinite(_)||Number.isFinite(M);return React.createElement("div",{className:(F=t.columns,I=t.rows,V=t.alignButtons,H=t.align,U=void 0!==H?"align"+H:"",S()(d,U,"has-"+F+"-columns",{"has-multiple-rows":I>1,"has-aligned-buttons":V}))},K.orderBy&&X&&React.createElement(J,{onChange:o,value:c}),!X&&ee&&React.createElement(Y,{resetCallback:function(){O([]),P(null),A(null)}}),!X&&!ee&&React.createElement(Q,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(ne,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(C,{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=g()(n,2),o=r[0],c=r[1],i=Object(y.useState)(t.orderby),a=g()(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(9),se=React.createElement("img",{src:ue.C+"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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var 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(z.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={2: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+""+({0:"atomic-block-components/add-to-cart--atomic-block-components/button",3:"atomic-block-components/add-to-cart",4:"atomic-block-components/button",5:"atomic-block-components/category-list",6:"atomic-block-components/image",7:"atomic-block-components/price",8:"atomic-block-components/rating",9:"atomic-block-components/sale-badge",10:"atomic-block-components/sku",11:"atomic-block-components/stock-indicator",12:"atomic-block-components/summary",13:"atomic-block-components/tag-list",14:"atomic-block-components/title",21:"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=217)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(72)()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"j",(function(){return o})),n.d(t,"u",(function(){return c})),n.d(t,"y",(function(){return i})),n.d(t,"r",(function(){return a})),n.d(t,"m",(function(){return u})),n.d(t,"o",(function(){return s})),n.d(t,"i",(function(){return l})),n.d(t,"z",(function(){return f})),n.d(t,"l",(function(){return p})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return b})),n.d(t,"n",(function(){return m})),n.d(t,"C",(function(){return v})),n.d(t,"D",(function(){return g})),n.d(t,"v",(function(){return y})),n.d(t,"a",(function(){return O})),n.d(t,"w",(function(){return j})),n.d(t,"b",(function(){return w})),n.d(t,"q",(function(){return k})),n.d(t,"g",(function(){return E})),n.d(t,"x",(function(){return _})),n.d(t,"h",(function(){return P})),n.d(t,"t",(function(){return R})),n.d(t,"s",(function(){return C})),n.d(t,"B",(function(){return N})),n.d(t,"A",(function(){return T})),n.d(t,"d",(function(){return A})),n.d(t,"e",(function(){return M})),n.d(t,"f",(function(){return D})),n.d(t,"p",(function(){return F})),n.d(t,"E",(function(){return I}));var r=n(4),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),Object(r.getSetting)("hasDarkEditorStyleSupport",!1)),d=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),b=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),m=Object(r.getSetting)("isShippingCalculatorEnabled",!0),h=(Object(r.getSetting)("shippingCostRequiresAddress",!1),Object(r.getSetting)("isShippingCostHidden",!1),Object(r.getSetting)("woocommerceBlocksPhase",1)),v=Object(r.getSetting)("wcBlocksAssetUrl",""),g=Object(r.getSetting)("wcBlocksBuildUrl",""),y=Object(r.getSetting)("shippingCountries",{}),O=Object(r.getSetting)("allowedCountries",{}),j=Object(r.getSetting)("shippingStates",{}),w=Object(r.getSetting)("allowedStates",{}),k=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("paymentGatewaySortOrder",[])),E=Object(r.getSetting)("checkoutShowLoginReminder",!0),x={id:0,title:"",permalink:""},S=Object(r.getSetting)("storePages",{myaccount:x,shop:x,cart:x,checkout:x,privacy:x,terms:x}),_=S.shop.permalink,P=(S.checkout.id,S.checkout.permalink),R=S.privacy.permalink,C=S.privacy.title,N=S.terms.permalink,T=S.terms.title,A=(S.cart.id,S.cart.permalink),M=Object(r.getSetting)("checkoutAllowsGuest",!1),D=Object(r.getSetting)("checkoutAllowsSignup",!1),F=S.myaccount.permalink?S.myaccount.permalink:Object(r.getSetting)("loginUrl","/wp-login.php"),I=(n(40),function(){return h>1})},function(e,t,n){var r=n(83),o=n(84),c=n(61),i=n(85);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){var r=n(64);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);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,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},,function(e,t,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 n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){!function(){e.exports=this.regeneratorRuntime}()},,,function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(49);var o=n(58);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){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(56);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(21);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(0),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}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=n,f=null!=r;return!l&&f?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,r)):(t=o||c.Fragment,l&&f&&n!==r?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,u,n))}},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(21),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(9),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.C,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(74);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},function(e,t){!function(){e.exports=this.wc.priceFormat}()},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(60),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(75))},,,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},,,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.deprecated}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(49);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){"use strict";n.d(t,"a",(function(){return c}));var r=n(16),o=n(0);function c(e){var t=Object(o.useState)((function(){return!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)})),n=Object(r.a)(t,2),c=n[0],i=n[1];return Object(o.useEffect)((function(){if(e){var t=function(){return i(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&c}},function(e,t){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(62);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return 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 Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,function(e,t,n){"use strict";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,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(5),a=n.n(i),u=n(8),s=n(57),l=n.n(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var b=n(63);function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(b.a)(e,t)}var h=n(20),v=n.n(h),g=n(13);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(16),w=n(41),k=n(52),E=n(59),x={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},S={">=":"min-width","<":"max-width"},_={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},P=Object(c.createContext)(null),R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(c.useContext)(P),r=!n&&"(".concat(S[t],": ").concat(x[e],"px)"),o=Object(E.a)(r);return n?_[t](x[e],n):o};R.__experimentalWidthProvider=P.Provider;var C=R,N=n(161),T=n(121),A=n(19);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){Object(A.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function I(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var B=n(31);var L=function(e,t){return function(n){var r=e(n),o=n.displayName,c=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(u.upperFirst)(Object(u.camelCase)(t)),"(").concat(c,")"),r}};function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var z=Object(c.createContext)({focusHistory:[]}),q=z.Provider,W=z.Consumer;q.displayName="FocusReturnProvider",W.displayName="FocusReturnConsumer";c.Component;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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=L((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=H(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(B.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(B.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(W,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Q=L((function(e){return function(t){m(r,t);var n=K(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Y=["button","submit"];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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var J=L((function(e){return function(t){m(o,t);var n=G(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(Y,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=$(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=Z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function ee(e){e.stopPropagation()}var te=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:ee}),n)})),ne=n(45);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(A.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t=Object(c.useContext)(ne.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return oe(oe({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function ie(e,t,n){return(ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var ae=n(50),ue=n(22),se=n.n(ue);function le(e){var t=function(e,t){if("object"!==Object(ae.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(ae.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(ae.a)(t)?t:String(t)}function fe(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 pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){Object(A.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function de(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return pe(pe({},r),{},Object(A.a)({},e,pe(pe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(le));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!se()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return pe(pe({},n),{},Object(A.a)({},e,[].concat(Object(B.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?pe(pe({},n),{},Object(A.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(ne.a.Provider,{value:v},h)}function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var me=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),he=me.Provider,ve=me.Consumer;c.Component;function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ye=function(e){m(n,e);var t=ge(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||ie(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),Oe=function(e){return Object(c.createElement)(ve,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(ye,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},je=0;function we(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(me),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++je),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var ke=function(e){return Object(c.createElement)(ve,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(we,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function Ee(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(ne.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function xe(e){var t,n,r=e.name,o=e.children,i=ce(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function Se(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(Ee,n):Object(c.createElement)(Oe,n)}function _e(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(ke,e),Object(c.createElement)(xe,e))}function Pe(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 Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){Object(A.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ce(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(A.a)(o,"is-from-"+l,"center"!==l),Object(A.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function Ne(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:Ce(Re({type:t},r))})}var Te=Q(U((function(e){return e.children})));function Ae(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function Me(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function De(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Fe(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Ie=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,E=e.getAnchorRect,x=e.expandOnMobile,S=e.animate,_=void 0===S||S,P=e.onClickOutside,R=e.onFocusOutside,A=e.__unstableSticky,M=e.__unstableSlotName,B=void 0===M?"Popover":M,L=e.__unstableObserveElement,V=e.__unstableBoundaryParent,z=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),W=Object(c.useRef)(null),H=Object(c.useRef)(),U=C("medium","<"),K=Object(c.useState)(),Q=Object(j.a)(K,2),G=Q[0],Y=Q[1],$=ce(B),Z=x&&U,ee=Object(N.a)(),ne=Object(j.a)(ee,2),re=ne[0],oe=ne[1];p=Z||p,Object(c.useLayoutEffect)((function(){if(Z)return Fe(H.current,"is-without-arrow",p),Fe(H.current,"is-alternate",d),Me(H.current,"data-x-axis"),Me(H.current,"data-y-axis"),De(H.current,"top"),De(H.current,"left"),De(W.current,"maxHeight"),void De(W.current,"maxWidth");var e=function(){if(H.current&&W.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:Ae(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:Ae(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:Ae(p,f)}}(q,O,E,g,y);if(e){var t,n,r=H.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(V)t=null===(n=H.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=I(e,t,s,p,r,o,c),b=F(e,t,f,p,r,d.yAxis,i);return D(D({},b),d)}(e,oe.height?oe:W.current.getBoundingClientRect(),m,A,H.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(De(H.current,"top",s+"px"),De(H.current,"left",l+"px")),Fe(H.current,"is-without-arrow",p||"center"===f&&"middle"===b),Fe(H.current,"is-alternate",d),Me(H.current,"data-x-axis",f),Me(H.current,"data-y-axis",b),De(W.current,"maxHeight","number"==typeof h?h+"px":""),De(W.current,"maxWidth","number"==typeof v?v+"px":"");Y(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[Z,O,E,g,y,m,oe,A,L,V]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,W);var ie=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ae=Object(c.createElement)(J,{onFocusOutside:function(e){if(R)R(e);else if(P){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),P(t)}else n&&n()}},Object(c.createElement)(Ne,{type:_&&G?"appear":null,options:{origin:G}},(function(e){var o=e.className;return Object(c.createElement)(te,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":Z,"is-without-arrow":p,"is-alternate":d})},z,{onKeyDown:ie,ref:H}),Z&&Object(c.createElement)(X,null),Z&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Ke,{className:"components-popover__close",icon:T.a,onClick:n})),Object(c.createElement)("div",{ref:W,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ae=Object(c.createElement)(Te,null,ae)),$.ref&&(ae=Object(c.createElement)(_e,{name:B},ae)),g||O?ae:Object(c.createElement)("span",{ref:q},ae)};Ie.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(Se,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Be=Ie;var Le=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ze=function(e){m(n,e);var t=Ve(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Be,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Le,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),qe=n(87);function We(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return He(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return He(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ue=["onMouseDown","onClick"];var Ke=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,x=e.shortcut,S=e.label,_=e.children,P=e.__experimentalIsFocusable,R=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!_,"has-icon":!!j}),N=O&&!P,T=void 0===n||N?"button":"a",A="a"===T?{href:n,target:i}:{type:"button",disabled:N,"aria-pressed":d};if(O&&P){A["aria-disabled"]=!0;var M,D=We(Ue);try{for(D.s();!(M=D.n()).done;){R[M.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var F=!N&&(k&&S||x||!!S&&(!_||Object(u.isArray)(_)&&!_.length)&&!1!==k),I=Object(c.createElement)(T,Object(r.a)({},A,R,{className:C,"aria-label":R["aria-label"]||S,ref:t}),j&&Object(c.createElement)(qe.a,{icon:j,size:w}),_);return F?Object(c.createElement)(ze,{text:S,shortcut:x,position:E},I):I}))},,function(e,t,n){"use strict";var r=n(73);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){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r=n(2),o={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},c=function(e){var t=e.onResize,n=r.useRef();return function(e,t){var n=function(){return e.current&&e.current.contentDocument&&e.current.contentDocument.defaultView};function o(){t();var e=n();e&&e.addEventListener("resize",t)}r.useEffect((function(){return n()?o():e.current&&e.current.addEventListener&&e.current.addEventListener("load",o),function(){var e=n();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(n,(function(){return t(n)})),r.createElement("iframe",{style:o,src:"about:blank",ref:n,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},i=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};e.exports=function(e){void 0===e&&(e=i);var t=r.useState(e(null)),n=t[0],o=t[1],a=r.useCallback((function(t){return o(e(t.current))}),[e]);return[r.useMemo((function(){return r.createElement(c,{onResize:a})}),[a]),n]}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},function(e,t,n){"use strict";function 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(64)),i=n(2),a=r(i),u=r(n(114)),s=r(n(21)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},x=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function S(e){k=e}var _,P=function(){return Date.now()};function R(e){_=e}var C,N,T=function(e){return e.current};function A(e){C=e}var M=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return x},injectFrame:function(e,t){E=e,x=t},get interpolation(){return k},injectStringInterpolator:S,get now(){return P},injectNow:function(e){P=e},get defaultElement(){return _},injectDefaultElement:R,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return N},injectManualFrameloop:function(e){N=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),F=!1,I=new Set,B=function e(){if(!F)return!1;var t=P(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,x=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&x,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?N?N():E(e):F=!1,F};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}(g),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),W=0,H=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=W++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,c=e.to,i=void 0===c?{}:c;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var a=t.delay,u=c(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),F||(F=!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,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var x,S=a.parent,_=a.interpolation,R=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var N,T=_&&_.getValue(),A=!l.und(S)&&a.animatedValues.some((function(e){return!e.done})),M=!l.equ(C,T),D=!l.equ(C,a.previous),F=!l.equ(E,a.config);if(h||D&&M||F){var I;if(u||f)S=_=a.parent||new z(j);else if(m)S=_=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?(S=a.parent).setValue(0,!1):S=new z(0);var L={output:[B,i]};a.interpolation?(_=a.interpolation,a.interpolation.updateConfig(L)):_=S.interpolate(L)}return R=d(O?w.getPayload():w),x=d(S.getPayload()),h&&!y&&S.setValue(j,!1),t.hasChanged=!0,x.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=P(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&S.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:S,interpolation:_,animatedValues:x,toValues:R,previous:C,config:E,fromValues:d(S.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return M?e:(y&&(S.setValue(1,!1),_.updateConfig({output:[C,C]})),S.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 H,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},K=0,Q=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},G=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 Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};A((function(e){return new $(e)})),R("div"),S((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return L(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return T(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),xe=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=xe,t.a=xe,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=M,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=G(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=G(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=G(r),k=w.keys,E=w.items,x=o({},i.current),S=[].concat(i.deleted),_=Object.keys(x),P=new Set(_),R=new Set(s),C=s.filter((function(e){return!P.has(e)})),N=i.transitions.filter((function(e){return!e.destroyed&&!R.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return P.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&S.find((function(t){return t.originalKey===e}))&&(S=S.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";x[e]={slot:c,originalKey:e,key:g?String(e):K++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":N.forEach((function(e){var t=k.indexOf(e),n=E[t];S.unshift(o({},x[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete x[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];x[e]=o({},x[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var M=s.map((function(e){return x[e]}));return S.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=M.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),M=[].concat(M.slice(0,t),[r],M.slice(t))})),o({},i,{changed:C.length||N.length||T.length,first:n&&0===C.length,transitions:M,current:x,deleted:S,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 H);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=U},,function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){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.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(19),o=n(6),c=n(17),i=n(0),a=n(30),u=n(11),s=n.n(u),l=n(14),f=n.n(l),p=function(e){var t=e.className,n=e.size,r=void 0===n?20:n,o=f()(e,["className","size"]);return React.createElement(a.SVG,s()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},o),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},d=React.createElement(p,null),b=n(130),m=function(e){let t;switch(e.icon){case"arrow-down-alt2":t=d;break;case"no-alt":t=b.a}return t?Object(i.cloneElement)(t,{size:e.size||20,className:e.className}):null};function h(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,u=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(m,Object(o.a)({icon:n},u));if(n&&m===n.type)return Object(i.cloneElement)(n,v({},u));var s=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,v({size:s},u)):n(v({size:s},u));if(n&&("svg"===n.type||n.type===a.SVG)){var l=v(v({width:s,height:s},n.props),u);return Object(i.createElement)(a.SVG,l)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,v({size:s},u)):n}},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(7),o=n.n(r),c=n(95),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,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(5),i=n.n(c),a=n(37),u=n(1),s=(n(60),n(70));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(75))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(10),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(69),s=n(22),l=n.n(s),f=n(39),p=n(66),d=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,r])]},b=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,s])]},m=function(e,t){var n=Object(u.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],s=c[1],b=Object(f.a)(i),m=Object(f.a)(e),h=Object(p.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){l()(h,m)||(s(Object.assign({},b,m)),v.current=!0)}),[b,m,h,s]),v.current?[i,s]:[e,s]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return R})),n.d(t,"a",(function(){return C}));var r=n(7),o=n.n(r),c=n(10),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(141),l=n(6),f=n(27),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 b(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 m=n(16),h=n(5),v=n.n(h),g=n(8),y=n(79),O=n(162),j=n(91);var w=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?g.noop:o,i=Object(O.a)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(m.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=b(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=b(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=v()("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)(j.a,Object(l.a)({},Object(g.omit)(t,["content"]),{onRemove:d(t)}),t.content)))})))},k=n(90),E=n(78),x=function(){var e=Object(E.a)().isEditor,t=Object(k.a)(),n=t.notices,r=t.removeNotice;if(e)return null;var o=n.filter((function(e){return"snackbar"===e.type}));return React.createElement(w,{notices:o,className:"wc-block-components-notices__snackbar",onRemove:r})};function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),R=function(){return Object(a.useContext)(P)},C=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,b=p.removeNotice,m=Object(a.useState)(!1),h=i()(m,2),v=h[0],g=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,_(_({},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;b(e,t)}),[b,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,_(_({},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:g},k=v?null:React.createElement(s.a,{className:r,notices:w.notices}),E=v?null:React.createElement(x,null);return React.createElement(P.Provider,{value:w},c&&k,t,E)}},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(39),a=n(65),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},function(e,t){!function(){e.exports=this.wp.wordcount}()},,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(21),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(132);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(11),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(42);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(56);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(5),i=n.n(c),a=n(1),u=n(37),s=n(121),l=n(70);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},function(e,t,n){"use strict";var r=n(0),o=n(30),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(14),i=n.n(c),a=n(30),u=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return React.createElement(a.SVG,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(7),o=n.n(r),c=n(14),i=n.n(c),a=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,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)):null}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(4),c=n(15),i=n(12);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(3);var r=n(5),o=n.n(r),c=n(36),i=n(123);n(160);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(3),n(5)),i=n.n(c),a=n(120),u=n(95),s=(n(113),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(38),o=n(0),c=n(9);n.p=c.D,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(21),n.e(7)]).then(n.bind(null,301))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(6).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(14).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,302))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return Promise.all([n.e(0),n.e(4)]).then(n.bind(null,303))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,305))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,289))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,306))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([n.e(0),n.e(3)]).then(n.bind(null,310))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(76),o=n.n(r);t.a=o.a},function(e,t,n){"use strict";(function(e){var r=n(59),o="undefined"!=typeof window&&window.navigator.userAgent.indexOf("Trident")>=0,c=e.env.FORCE_REDUCED_MOTION||o?function(){return!0}:function(){return Object(r.a)("(prefers-reduced-motion: reduce)")};t.a=c}).call(this,n(75))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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(271)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(133),o=n(95),c=n(112),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(10)),g=n.n(v),y=n(0),O=n(14),j=n.n(O),w=n(7),k=n.n(w),E=n(1),x=n(8),S=n(5),_=n.n(S),P=n(36),R=(n(220),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(P.a,{screenReaderLabel:Object(E.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(P.a,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:_()("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(P.a,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:_()("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(P.a,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:_()("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(P.a,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(P.a,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});R.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=R,N=n(94),T=n(100),A=n(15),M=n(12),D=n(39);function F(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(T.a)(I(I({},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(D.a)(a),s=Object(D.a)(c),l=Object(M.useSelect)((function(t){var o=t(A.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",I(I({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},L=n(66),V=n(107),z=n(81),q=n(37),W=n(4),H=n(131),U=n(30),K=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),Q=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(H.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:K,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(H.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(140),J=(n(219),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(123),X=n(11),ee=n.n(X),te=n(149),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=_()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))}));n(218);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=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)},ie=Object(V.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,c=r.rows,i=Object(W.getSetting)("hideOutOfStockItems",!1);return oe(oe({},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},i&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n})),u=g()(a,1)[0],s=B(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(z.useInnerBlockLayoutContext)().parentClassName,b=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,["order","orderby","page","per_page"])||{}}(u),m=Object(N.b)("attributes",[]),h=g()(m,2),v=h[0],O=h[1],w=Object(N.b)("min_price"),k=g()(w,2),S=k[0],P=k[1],R=Object(N.b)("max_price"),T=g()(R,2),A=T[0],M=T[1],D=Object(L.a)({totalQuery:b,totalProducts:f},ce);Object(y.useEffect)((function(){Object(x.isEqual)(b,null==D?void 0:D.totalQuery)||(r(1),null!=D&&D.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(q.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(q.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[null==D?void 0:D.totalQuery,f,r,b]);var F,I,V,H,U,K=t.contentVisibility,G=t.columns*t.rows,$=!Number.isFinite(f)&&Number.isFinite(null==D?void 0:D.totalProducts)&&Object(x.isEqual)(b,null==D?void 0:D.totalQuery)?Math.ceil(D.totalProducts/G):Math.ceil(f/G),Z=l.length?l:Array.from({length:G}),X=0!==l.length||p,ee=v.length>0||Number.isFinite(S)||Number.isFinite(A);return React.createElement("div",{className:(F=t.columns,I=t.rows,V=t.alignButtons,H=t.align,U=void 0!==H?"align"+H:"",_()(d,U,"has-"+F+"-columns",{"has-multiple-rows":I>1,"has-aligned-buttons":V}))},K.orderBy&&X&&React.createElement(J,{onChange:o,value:c}),!X&&ee&&React.createElement(Y,{resetCallback:function(){O([]),P(null),M(null)}}),!X&&!ee&&React.createElement(Q,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(ne,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(C,{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=g()(n,2),o=r[0],c=r[1],i=Object(y.useState)(t.orderby),a=g()(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(9),se=React.createElement("img",{src:ue.C+"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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var 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(z.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-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '2a819da8cf4cc04ec7de7f8f945dd40d');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'dafbc21354c5c00a0363120cb7694145');
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",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([833,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},106:function(e,t){},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){},121: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(21),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)}},127:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(55),a=r(158),i=r(3),s=r(22),u=r(39);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}},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(177),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})}},135:function(e,t){!function(){e.exports=this.wp.wordcount}()},136:function(e,t,r){"use strict";var n=r(30),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(7),l=(r(2),r(46)),b=r(4),p=r(8),d=r.n(p),f=r(14),m=r.n(f),O=r(15),g=r.n(O),j=r(16),v=r.n(j),h=r(17),y=r.n(h),w=r(10),k=r.n(w),E=r(139);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Object(E.a)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(i.createElement)(e,a()({},this.props,{selected:r?[]:[t]}))}}]),n}(i.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),S=r(278),C=r(27),N=r.n(C),x=r(12),D=r.n(x),B=r(5),z=r.n(B),V=r(13),R=r.n(V),T=r(33),I=r.n(T),A=r(36),L=r(38);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){z()(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var q=Object(E.a)((function(e){var t=function(t){v()(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)),z()(D()(e),"state",{error:null,loading:!1,variations:{}}),z()(D()(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),{},z()({},o,r)),loading:!1,error:null})})).catch(function(){var t=N()(R.a.mark((function t(r){var n;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(L.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},z()({},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),{},z()({},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&&(!I()(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 z()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),Q=r(55),G=r(31),W=Object(i.createElement)(G.SVG,{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"})),U=Object(i.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#757575",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"})),Y=r(43);r(186);function K(e,t){if(!t)return e;var r=new RegExp(Object(u.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var J=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(i.createElement)(Q.a,{srcElement:W}):Object(i.createElement)(Q.a,{srcElement:U})},$={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")},X=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,v=e.variationsLoading,h=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"},J(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&&v&&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)(Y.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?h:null),onSearch:p,messages:$,isHierarchical:!0})};X.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=P(Object(S.a)(q(X)))},138:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},141:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(44),i=r(215);r(188);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)}))))}))},142:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(56),s=r(8),u=r.n(s),l=(r(2),r(149)),b=(r(217),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,E=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var _=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return _?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:E},Object(l.a)(s,{price:P}))}},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(5),c=r.n(n),o=r(7);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}},144:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(17),l=r.n(u),b=r(10),p=r.n(b),d=r(0),f=r(7),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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(5),c=r.n(n),o=r(37),a=r(21),i=r(121),s=r(28),u=r(7);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={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},d=b(b({},p),{},{email:"",phone:""}),f=function(e){return Object(u.mapValues)(e,(function(e){return Object(s.decodeEntities)(e)}))},m={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],billingAddress:d,shippingAddress:p,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(i.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},s=e.shouldSelect,u=Object(a.useSelect)((function(e,t){var n=t.dispatch;if(!s)return m;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:d,shippingAddress:p,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(o.CART_STORE_KEY),i=a.getCartData(),u=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),O=a.isCustomerDataUpdating(),g=n(o.CART_STORE_KEY).receiveCart,j=f(i.billingAddress),v=i.needsShipping?f(i.shippingAddress):j,h=i.fees.map((function(e){return f(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:h,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:u,billingAddress:j,shippingAddress:v,extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:O,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:g}}),[s]);return u}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(18),c=r.n(n),o=r(37),a=r(21),i=r(0),s=r(100),u=r(33),l=r.n(u),b=r(53),p=r(96),d=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,n])]},f=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,u])]},m=function(e,t){var r=Object(s.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],u=o[1],f=Object(b.a)(a),m=Object(b.a)(e),O=Object(p.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){l()(O,m)||(u(Object.assign({},f,m)),g.current=!0)}),[f,m,O,u]),g.current?[a,u]:[e,u]}},157:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(37),c=r(21),o=r(0),a=r(53),i=r(95),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},158:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},168:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(6),o=Object(n.createElement)("img",{src:c.S+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},169:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=(r(2),r(28)),u=r(8),l=r.n(u);r(216);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,b=e.permalink,p=void 0===b?"":b,d=a()(e,["className","disabled","name","permalink"]),f=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:f},d),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:f,href:p},d),Object(s.decodeEntities)(u))}},170:function(e,t,r){"use strict";var n=r(0),c=r(135),o=r(89),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)}},174:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(14),a=r.n(o),i=r(15),s=r.n(i),u=r(12),l=r.n(u),b=r(16),p=r.n(b),d=r(17),f=r.n(d),m=r(10),O=r.n(m),g=r(5),j=r.n(g),v=r(0),h=r(9);r(242);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=y(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},177:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(18),a=r.n(o),i=r(0),s=(r(2),r(21)),u=r(281),l=r(930),b=r(134),p=r(121),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),v=a()(j,2),h=v[0],y=v[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]),k=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;g(e,t)}),[g,b]),E=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]),_={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(b)}}),[b]).notices,createNotice:w,createSnackbarNotice:E,removeNotice:k,context:b,setIsSuppressed:y},P=h?null:Object(i.createElement)(u.a,{className:n,notices:_.notices}),S=h?null:Object(i.createElement)(d,null);return Object(i.createElement)(O.Provider,{value:_},o&&P,t,S)}},180:function(e,t){},186:function(e,t){},188:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},190:function(e,t){!function(){e.exports=this.wp.warning}()},20:function(e,t){!function(){e.exports=this.wp.url}()},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));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(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:c,noticeContexts:o,shouldRetry:u,isSuccessResponse:a,isErrorResponse:i,isFailResponse:s}}},21:function(e,t){!function(){e.exports=this.wp.data}()},216:function(e,t){},217:function(e,t){},218:function(e,t){},219:function(e,t){},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},220:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.blocks}()},242:function(e,t){},248:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(31),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.SVG,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(262);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}},26:function(e,t){!function(){e.exports=this.moment}()},262:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(31),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return Object(i.createElement)(s.SVG,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},278:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(27),a=r.n(o),i=r(14),s=r.n(i),u=r(15),l=r.n(u),b=r(12),p=r.n(b),d=r(16),f=r.n(d),m=r(17),O=r.n(m),g=r(10),j=r.n(g),v=r(0),h=r(13),y=r.n(h),w=r(7),k=r(139),E=(r(2),r(6)),_=r(36),P=r(38);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var C=Object(k.a)((function(e){var t=function(t){f()(o,t);var r,n=S(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(_.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(_.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:E.u?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=C},279:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(44),l=r(39),b=r(66);r(545);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")}))}))},28:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},281:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(382),u=r(177),l=(r(218),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)})))}},282:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(88),o=(r(2),r(220),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))})},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},346:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},36: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 v})),r.d(t,"a",(function(){return h}));var n=r(5),c=r.n(n),o=r(20),a=r(19),i=r.n(a),s=r(7),u=r(6);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.w?100:0,orderby:u.w?"count":"name",order:u.w?"desc":"asc",search:n})];return u.w&&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)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},h=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))}},37:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(27),c=r.n(n),o=r(13),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},383:function(e,t){},385:function(e,t,r){"use strict";var n=r(5),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={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.V)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},386: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}}},387:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(18),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(8),p=r.n(b),d=r(6),f=r(39),m=r(66),O=r(279);r(546);function g(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?g(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=function(){return Object(u.createElement)("img",{src:d.E,alt:"",width:500,height:500})},h=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=j({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(v,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,g=Object(f.useProductDataContext)().product,y=Object(u.useState)(!1),w=s()(y,2),k=w[0],E=w[1];if(!g.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(v,null));var _=!!g.images.length,P=_?g.images[0]:null,S=o?"a":u.Fragment,C=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),g.name),N=j({href:g.permalink,rel:"nofollow"},!_&&{"aria-label":C});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(S,o&&N,!!i&&Object(u.createElement)(O.default,{align:d,product:g}),Object(u.createElement)(h,{fallbackAlt:g.name,image:P,onLoad:function(){return E(!0)},loaded:k,showFullSize:"cropped"!==n})))}))},388:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(143),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))}}}},389:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(45),c=r.n(n),o=r(27),a=r.n(o),i=r(13),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=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),a=[],i=u(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),a=u(o),e.prev=2,a.s();case 4:if((i=a.n()).done){e.next=23;break}return l=i.value,e.prev=6,e.next=9,Promise.resolve(l.callback(n));case 9:if(p=e.sent,"object"===c()(p)){e.next=12;break}return e.abrupt("continue",21);case 12:if(void 0!==p.type){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",p);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));return function(t,r,n){return e.apply(this,arguments)}}()},39:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},390:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},391:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(18),i=r.n(a),s=r(1),u=r(53),l=r(134),b=r(207),p=r(915),d="pristine",f="idle",m="disabled",O="processing",g="before_processing",j="after_processing",v={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",y="set_idle",w="set_disabled",k="set_processing",E="set_before_processing",_="set_after_processing",P="set_processing_response",S="set_has_error",C="set_no_error",N="set_quantity",x="set_request_params",D=h,B=y,z=w,V=k,R=E,T=_,I=P,A=S,L=C,F=N,M=x,H=function(){return{type:D}},q=function(){return{type:B}},Q=function(){return{type:z}},G=function(){return{type:V}},W=function(){return{type:R}},U=function(){return{type:T}},Y=function(e){return{type:I,data:e}},K=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?A:L;return{type:t}},J=function(e){return{type:F,quantity:e}},$=function(e){return{type:M,data:e}},X=r(5),Z=r.n(X);function ee(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 te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re=h,ne=y,ce=w,oe=k,ae=E,ie=_,se=P,ue=S,le=C,be=N,pe=x,de=d,fe=f,me=m,Oe=O,ge=g,je=j,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 re:e=v;break;case ne:e=t.status!==fe?te(te({},t),{},{status:fe}):t;break;case ce:e=t.status!==me?te(te({},t),{},{status:me}):t;break;case be:e=n!==t.quantity?te(te({},t),{},{quantity:n}):t;break;case pe:e=te(te({},t),{},{requestParams:te(te({},t.requestParams),o)});break;case se:e=te(te({},t),{},{processingResponse:o});break;case oe:e=!1===(e=t.status!==Oe?te(te({},t),{},{status:Oe,hasError:!1}):t).hasError?e:te(te({},e),{},{hasError:!1});break;case ae:e=t.status!==ge?te(te({},t),{},{status:ge,hasError:!1}):t;break;case ie:e=t.status!==je?te(te({},t),{},{status:je}):t;break;case ue:e=t.hasError?t:te(te({},t),{},{hasError:!0}),e=t.status===Oe||t.status===ge?te(te({},e),{},{status:fe}):e;break;case le:e=t.hasError?te(te({},t),{},{hasError:!1}):t}return e!==t&&c!==re&&e.status===de&&(e.status=fe),e},he=r(143),ye=r(388),we="add_to_cart_before_processing",ke="add_to_cart_after_processing_with_success",Ee="add_to_cart_after_processing_with_error",_e=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ye.a)(ke,e),onAddToCartProcessingWithError:Object(ye.a)(Ee,e),onAddToCartBeforeProcessing:Object(ye.a)(we,e)}},Pe=r(389),Se=r(88),Ce=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)(Ce)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ve,v),a=i()(o,2),d=a[0],h=a[1],y=Object(n.useReducer)(he.b,{}),w=i()(y,2),k=w[0],E=w[1],_=Object(u.a)(k),P=Object(l.a)(),S=P.addErrorNotice,C=P.removeNotices,N=Object(Se.b)().setValidationErrors,x=Object(b.a)(),D=x.isSuccessResponse,B=x.isErrorResponse,z=x.isFailResponse,V=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:_e(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:_e(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:_e(E).onAddToCartBeforeProcessing}}),[E]),R=Object(n.useMemo)((function(){return{resetForm:function(){h(H())},submitForm:function(){h(W())},setQuantity:function(e){h(J(e))},setHasError:function(e){h(K(e))},setRequestParams:function(e){h($(e))},setAfterProcessing:function(e){h(Y(e)),h(U())}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(p.a)(r);e!==m||t?e!==m&&t&&h(Q()):h(q())}),[d.status,r,h]),Object(n.useEffect)((function(){d.status===g&&(C("error"),Object(Pe.a)(_,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&N(r)})),h(q())):h(G())})))}),[d.status,N,S,C,h,_]),Object(n.useEffect)((function(){if(d.status===j){var e={processingResponse:d.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;S(e.message,t)}};if(d.hasError)return void Object(Pe.b)(_,Ee,e).then((function(r){if(B(r)||z(r))t(r);else{var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");S(c,{id:"add-to-cart"})}h(q())}));Object(Pe.b)(_,ke,e).then((function(e){B(e)||z(e)?(t(e),h(K(!0))):h(q())}))}}),[d.status,d.hasError,d.processingResponse,R,S,B,z,D,_]);var T=Object(p.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(p.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:c&&T,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:d.status===f,isDisabled:d.status===m,isProcessing:d.status===O,isBeforeProcessing:d.status===g,isAfterProcessing:d.status===j,hasError:d.hasError,eventRegistration:V,dispatchActions:R};return Object(n.createElement)(Ce.Provider,{value:I},t)},De=r(19),Be=r.n(De),ze=r(145),Ve=r(28),Re=r(528);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}var Ie=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,b=e.requestParams,p=Object(Se.b)(),d=p.hasValidationErrors,f=p.showAllValidationErrors,m=Object(l.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(ze.a)().receiveCart,v=Object(n.useState)(!1),h=i()(v,2),y=h[0],w=h[1],k=!a&&u,E=Object(n.useCallback)((function(){return!d||(f(),{type:"error"})}),[d,f]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(E,0);return function(){e()}}),[o,E]);var _=Object(n.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?Te(Object(r),!0).forEach((function(t){Z()(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}({id:r.id||0,quantity:c},b);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?j(r):(r.body&&r.body.message?O(Object(Ve.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(s.__)("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(Re.c)()}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,O,g,j,t,c,b]);return Object(n.useEffect)((function(){k&&!y&&_()}),[k,_,y]),null},Ae=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Se.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Ie,null)))},Le=r(39),Fe=r(7),Me=r(66),He=(r(383),r(94)),qe=r(55),Qe=r(555),Ge=r(836),We=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)},Ue=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(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(qe.a,{srcElement:Qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ye=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ge.a)(o.id||0).cartQuantity,m=Object(n.useState)(!1),O=i()(m,2),g=O[0],j=O[1],v=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)(Ue,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:f,isDisabled:u,isProcessing:l,isDone:g,onClick:function(){return d.submitForm()}}):Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",href:v.url,text:v.text||Object(s.__)("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)}})},Je=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$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)(Je,null):t.id&&!t.is_in_stock?Object(n.createElement)(Je,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},Xe=(r(554),r(30)),Ze=r.n(Xe),et=r(4),tt=r(9),rt=r(282),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Se.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(Z()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Ve.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){Z()(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),{},Z()({},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(Ve.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){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},Z()({},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)(Je,null):t.id&&!t.is_in_stock?Object(n.createElement)(Je,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ke,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ye,null))},ft=function(){return Object(n.createElement)(Ye,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)(Ye,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Le.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)))}))},392:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(39),u=r(22),l=r(6),b=function(e){var t=e.color,r=e.fontSize;return Object(l.V)()?{color:t,fontSize:r}:{}},p=r(66),d=r(169);r(544),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,f=void 0===p?2:p,m=e.productLink,O=void 0===m||m,g=e.align,j=e.color,v=e.customColor,h=e.fontSize,y=e.customFontSize,w=Object(s.useInnerBlockLayoutContext)().parentClassName,k=Object(s.useProductDataContext)().product,E="h".concat(f),_=Object(u.getColorClassName)("color",j),P=Object(u.getFontSizeClass)(h),S=i()((t={"has-text-color":j||v,"has-font-size":h||y},c()(t,_,_),c()(t,P,P),t));return k.id?Object(o.createElement)(E,{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(l.V)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},S,Object(l.V)())),disabled:!O,name:k.name,permalink:k.permalink,rel:O?"nofollow":null,style:b({color:v,fontSize:y})})):Object(o.createElement)(E,{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(l.V)()),c()(n,S,Object(l.V)()),n)),style:b({color:v,fontSize:y})})}))},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},43:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(41));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")))}},44:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(8),i=r.n(a);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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,b=null!=n;return!l&&b?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&b&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},49:function(e,t){!function(){e.exports=this.wp.keycodes}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},525:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(142),u=r(62),l=r(39),b=r(22),p=r(6),d=r(66);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,E=e.saleColor,_=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,S=Object(l.useProductDataContext)().product,C=i()(O,c()({},"".concat(P,"__product-price"),P));if(!S.id)return Object(o.createElement)(s.a,{align:g,className:C});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",E),B=Object(b.getFontSizeClass)(h),z=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),V=i()((r={"has-text-color":E||_,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),R={color:k,fontSize:v},T={color:_,fontSize:y},I=S.prices,A=Object(u.getCurrencyFromPriceResponse)(I),L=I.price!==I.regular_price,F=L?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,V,Object(p.V)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,z,Object(p.V)()),a)),M=L?T:R;return Object(o.createElement)(s.a,{align:g,className:C,currency:A,price:I.price,priceClassName:F,priceStyle:Object(p.V)()?M:{},minPrice:null==I||null===(d=I.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==I||null===(f=I.price_range)||void 0===f?void 0:f.max_amount,regularPrice:I.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,z,Object(p.V)()),m)),regularPriceStyle:Object(p.V)()?R:{}})}))},526:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(39),l=r(66),b=(r(547),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},527:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(8)),u=r.n(s),l=r(1),b=r(836),p=r(28),d=r(528),f=r(39),m=r(66),O=(r(548),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,v=O.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(d.c)()}),[g]);var h=Number.isFinite(g)&&g>0,y=!s&&f&&m,w=Object(p.decodeEntities)((null==a?void 0:a.description)||""),k=h?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")),E=y?"button":"a",_={};return y?_.onClick=function(){v()}:(_.href=o,_.rel="nofollow"),Object(i.createElement)(E,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},_),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},528: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)}}},529:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(170),u=r(3),l=r(39),b=r(66);r(549);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})}))},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(33),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},530:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(39),l=r(66);r(550);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}))},531:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(39),l=r(7),b=r(66);r(551);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))}))))}))},532:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(39),l=r(7),b=r(66);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.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))}))))}))},533:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(39),l=r(66),b=(r(553),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))}))},544:function(e,t){},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(5),c=r.n(n),o=r(24),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))}},550:function(e,t){},551:function(e,t){},552:function(e,t){},553:function(e,t){},554:function(e,t){},555:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},56:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(24),s=r.n(i),u=r(0),l=r(173),b=r(8),p=r.n(b);r(180);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}))}},6:function(e,t,r){"use strict";r.d(t,"l",(function(){return c})),r.d(t,"I",(function(){return o})),r.d(t,"O",(function(){return a})),r.d(t,"y",(function(){return i})),r.d(t,"A",(function(){return s})),r.d(t,"m",(function(){return u})),r.d(t,"z",(function(){return l})),r.d(t,"C",(function(){return b})),r.d(t,"o",(function(){return p})),r.d(t,"B",(function(){return d})),r.d(t,"n",(function(){return f})),r.d(t,"E",(function(){return m})),r.d(t,"u",(function(){return O})),r.d(t,"w",(function(){return g})),r.d(t,"r",(function(){return j})),r.d(t,"s",(function(){return v})),r.d(t,"t",(function(){return h})),r.d(t,"k",(function(){return y})),r.d(t,"K",(function(){return w})),r.d(t,"P",(function(){return k})),r.d(t,"q",(function(){return E})),r.d(t,"p",(function(){return _})),r.d(t,"H",(function(){return P})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"S",(function(){return x})),r.d(t,"T",(function(){return D})),r.d(t,"J",(function(){return B})),r.d(t,"a",(function(){return z})),r.d(t,"M",(function(){return V})),r.d(t,"b",(function(){return R})),r.d(t,"L",(function(){return T})),r.d(t,"D",(function(){return I})),r.d(t,"i",(function(){return A})),r.d(t,"N",(function(){return M})),r.d(t,"h",(function(){return H})),r.d(t,"j",(function(){return q})),r.d(t,"G",(function(){return Q})),r.d(t,"F",(function(){return G})),r.d(t,"R",(function(){return W})),r.d(t,"Q",(function(){return U})),r.d(t,"d",(function(){return Y})),r.d(t,"e",(function(){return K})),r.d(t,"f",(function(){return J})),r.d(t,"g",(function(){return $})),r.d(t,"x",(function(){return X})),r.d(t,"W",(function(){return ee})),r.d(t,"X",(function(){return te})),r.d(t,"U",(function(){return re})),r.d(t,"V",(function(){return ne}));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),v=Object(n.getSetting)("hasTags",!0),h=Object(n.getSetting)("homeUrl",""),y=Object(n.getSetting)("couponsEnabled",!0),w=Object(n.getSetting)("shippingEnabled",!0),k=Object(n.getSetting)("taxesEnabled",!0),E=(Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),_=(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),Object(n.getSetting)("woocommerceBlocksPhase",1)),x=Object(n.getSetting)("wcBlocksAssetUrl",""),D=Object(n.getSetting)("wcBlocksBuildUrl",""),B=Object(n.getSetting)("shippingCountries",{}),z=Object(n.getSetting)("allowedCountries",{}),V=Object(n.getSetting)("shippingStates",{}),R=Object(n.getSetting)("allowedStates",{}),T=Object(n.getSetting)("shippingMethodsExist",!1),I=Object(n.getSetting)("paymentGatewaySortOrder",[]),A=Object(n.getSetting)("checkoutShowLoginReminder",!0),L={id:0,title:"",permalink:""},F=Object(n.getSetting)("storePages",{myaccount:L,shop:L,cart:L,checkout:L,privacy:L,terms:L}),M=F.shop.permalink,H=F.checkout.id,q=F.checkout.permalink,Q=F.privacy.permalink,G=F.privacy.title,W=F.terms.permalink,U=F.terms.title,Y=F.cart.id,K=F.cart.permalink,J=Object(n.getSetting)("checkoutAllowsGuest",!1),$=Object(n.getSetting)("checkoutAllowsSignup",!1),X=F.myaccount.permalink?F.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),Z=r(23),ee=function(e,t){if(N>2)return Object(Z.registerBlockType)(e,t)},te=function(e,t){if(N>1)return Object(Z.registerBlockType)(e,t)},re=function(){return N>2},ne=function(){return N>1}},62:function(e,t){!function(){e.exports=this.wc.priceFormat}()},63:function(e,t){!function(){e.exports=this.wp.hooks}()},66:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},67:function(e,t){!function(){e.exports=this.wp.dom}()},68:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(14),a=r.n(o),i=r(15),s=r.n(i),u=r(12),l=r.n(u),b=r(16),p=r.n(b),d=r(17),f=r.n(d),m=r(10),O=r.n(m),g=r(0),j=r(7),v=r(8),h=r.n(v),y=r(4),w=r(179);r(119);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var E=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(g.Component);t.a=Object(w.a)(E)},7:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t){!function(){e.exports=this.wp.deprecated}()},71:function(e,t){!function(){e.exports=this.wp.a11y}()},73:function(e,t){!function(){e.exports=this.ReactDOM}()},75:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(4)),i=r(6);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.A,i.y);s({columns:Number.isNaN(t)?"":t})},min:i.A,max:i.y}),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.C,i.z);s({rows:Number.isNaN(t)?"":t})},min:i.C,max:i.z}),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})}}))}},76:function(e,t){!function(){e.exports=this.wp.viewport}()},77:function(e,t){!function(){e.exports=this.wp.date}()},805:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},812:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},820:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},821:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(6),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.S+"img/pennant.jpg",thumbnail:c.S+"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}]},826:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},833:function(e,t,r){e.exports=r(885)},834:function(e,t){},835:function(e,t){},836:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(18),c=r.n(n),o=r(0),a=r(21),i=r(37),s=r(28),u=r(134),l=r(145),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(l.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(u.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;v(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},838:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},839:function(e,t){},840:function(e,t){},841:function(e,t){},842:function(e,t){},88:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(45),c=r.n(n),o=r(5),a=r.n(o),i=r(24),s=r.n(i),u=r(18),l=r.n(u),b=r(0),p=r(7),d=r(33),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},885:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(22),l=r(23),b=r(55),p=r(31),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(6),m=r(8),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.U)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(385),h=r(4),y=r(924),w=r(144),k=r(392),E=r(18),_=r.n(E),P=r(136),S=r(24),C=r.n(S);r(835);var N=function(e){var t=e.className,r=void 0===t?"":t,n=C()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},x=r(39),D=(r(834),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=_()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(N,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),z=Object(s.__)("Product Title","woo-gutenberg-products-block"),V=Object(i.createElement)(b.a,{srcElement:B}),R=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),T=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.V)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.V)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},I=Object(f.V)()?Object(y.a)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:V,label:z,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(T):T;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 L(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:R,icon:{src:V,foreground:"#874FB9"},attributes:v.a,edit:I};Object(l.registerBlockType)("woocommerce/product-title",L(L({},j),F));var M=r(525),H=r(346),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),Q=Object(i.createElement)(b.a,{srcElement:H.a}),G=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),W=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},U=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.V)()&&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.V)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},Y=Object(f.V)()?Object(y.a)([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:Q,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(U):U;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 J(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 X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.V)()&&($=J(J({},$),{},{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:G,icon:{src:Q,foreground:"#874FB9"},attributes:$,edit:Y};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(386),re=r(149),ne=r(68),ce=r(3),oe=r(387),ae=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),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)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(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)(h.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(526),Oe=r(820),ge=Object(s.__)("Product Rating","woo-gutenberg-products-block"),je=Object(i.createElement)(b.a,{srcElement:Oe.a});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}function he(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){c()(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}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",he(he({},j),ye));var we={productId:{type:"number",default:0}},ke=r(527),Ee=r(838),_e=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:Ee.a});function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:_e,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:_e,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ke.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Ce(Ce({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(529),Be=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),ze=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ve=Object(i.createElement)(b.a,{srcElement:Be});function Re(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 Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ie={title:ze,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ve,foreground:"#874FB9"},attributes:xe,edit:D({icon:Ve,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",Te(Te({},j),Ie));var Ae={productId:{type:"number",default:0}},Le=r(279),Fe=r(812),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 Qe(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 Ge={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)(Le.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Qe(Qe({},j),Ge));var We={productId:{type:"number",default:0}},Ue=r(127),Ye=r(530),Ke=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Je=Object(s.__)("Product SKU","woo-gutenberg-products-block"),$e=Object(i.createElement)(b.a,{srcElement:Ke});function Xe(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?Xe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var et={title:Je,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:$e,foreground:"#874FB9"},attributes:We,edit:D({icon:$e,label:Je,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ue.a,null),Object(i.createElement)(Ye.default,t))}))};Object(f.W)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(531),nt=r(805),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)(Ue.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.W)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(532),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)(Ue.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.W)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(533),jt=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),vt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),ht=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 kt={title:vt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:ht,foreground:"#874FB9"},attributes:Ot,edit:D({icon:ht,label:vt,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)(Ue.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.W)("woocommerce/product-stock-indicator",wt(wt({},j),kt));var Et=r(915),_t=(r(383),r(391)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),St=Object(i.createElement)(b.a,{srcElement:Ee.a});function Ct(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?Ct(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ct(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:St,foreground:"#874FB9"},edit:D({icon:St,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)(Ue.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(Et.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(_t.a,t)))})),attributes:r(390).a};Object(f.W)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(14),Bt=r.n(Dt),zt=r(12),Vt=r.n(zt),Rt=r(16),Tt=r.n(Rt),It=r(17),At=r.n(It),Lt=r(10),Ft=r.n(Lt),Mt=r(21),Ht=(r(2),r(75)),qt=r(911),Qt=r(821),Gt=r(158),Wt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},Ut=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ce.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Gt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Yt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function 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 Jt(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"]],Xt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Jt(Jt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function 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)(h.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)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},nr=r(15),cr=r.n(nr),or=r(9),ar=r(7),ir=r(44),sr=(r(842),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)(ir.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)(ir.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)(ir.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)(ir.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)(ir.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)(ir.a,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});sr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var ur=sr,lr=r(147),br=r(157),pr=r(37),dr=r(53);function fr(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 mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Or=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(br.a)(mr(mr({},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(dr.a)(i),u=Object(dr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(pr.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",mr(mr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},gr=r(96),jr=r(174),vr=r(71),hr=r(138),yr=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:hr.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")))},wr=r(826),kr=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:wr.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")))},Er=r(141),_r=(r(841),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Er.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})}),Pr=r(215),Sr=Object(Pr.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=_()(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))}));r(840);function Cr(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 Nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ar.isEqual)(t,c)&&Number.isFinite(r)},Dr=Object(jr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=Object(lr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows,a=Object(ce.getSetting)("hideOutOfStockItems",!1);return Nr(Nr({},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},a&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r})),l=_()(u,1)[0],b=Or(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 C()(e,["order","orderby","page","per_page"])||{}}(l),j=Object(lr.b)("attributes",[]),v=_()(j,2),h=v[0],y=v[1],w=Object(lr.b)("min_price"),k=_()(w,2),E=k[0],P=k[1],S=Object(lr.b)("max_price"),N=_()(S,2),D=N[0],B=N[1],z=Object(gr.a)({totalQuery:g,totalProducts:d},xr);Object(i.useEffect)((function(){Object(ar.isEqual)(g,null==z?void 0:z.totalQuery)||(n(1),null!=z&&z.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(vr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(vr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==z?void 0:z.totalQuery,d,n,g]);var V,R,T,I,A,L=t.contentVisibility,F=t.columns*t.rows,M=!Number.isFinite(d)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(ar.isEqual)(g,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/F):Math.ceil(d/F),H=p.length?p:Array.from({length:F}),q=0!==p.length||f,Q=h.length>0||Number.isFinite(E)||Number.isFinite(D);return Object(i.createElement)("div",{className:(V=t.columns,R=t.rows,T=t.alignButtons,I=t.align,A=void 0!==I?"align"+I:"",O()(m,A,"has-"+V+"-columns",{"has-multiple-rows":R>1,"has-aligned-buttons":T}))},L.orderBy&&q&&Object(i.createElement)(_r,{onChange:c,value:o}),!q&&Q&&Object(i.createElement)(kr,{resetCallback:function(){y([]),P(null),B(null)}}),!q&&!Q&&Object(i.createElement)(yr,null),q&&Object(i.createElement)("ul",{className:"".concat(m,"__products")},H.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)(Sr,{key:e.id||r,attributes:t,product:e})}))),M>1&&Object(i.createElement)(ur,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:M}))})),Br=function(e){var t=e.attributes,r=Object(i.useState)(1),n=_()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=_()(a,2),u=s[0],l=s[1];Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]);return Object(i.createElement)(Dr,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},zr=r(168);function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=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 Rr=function(e){Tt()(r,e);var t=Vr(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?zr.a:Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Br,{attributes:t,urlParameterSuffix:r}))}}]),r}(or.Component);r(839);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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){Tt()(r,e);var t=Tr(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()(Vt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Vt()(e),"blockMap",Object(qt.a)("woocommerce/all-products")),c()(Vt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Vt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Vt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Vt()(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()(Vt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ht.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},tr(r,n),rr(r,n)))})),c()(Vt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Vt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(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:Qt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Xt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];$t.map((function(e){var t=_()(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()(Vt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Rr,{attributes:t})):Yt(c,o)})),c()(Vt()(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:Wt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):Ut(n,c)})),e}return r}(i.Component),Ar=Object(y.a)(h.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}})))(Ir),Lr={columns:f.m,rows:f.o,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:$t,isPreview:!1};function Fr(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 Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hr={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:Lr,edit:function(e){return Object(i.createElement)(Ar,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Mr(Mr({},Hr),{},{deprecated:[{attributes:Object.assign({},Hr.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Wt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},89:function(e,t){!function(){e.exports=this.wp.autop}()},9:function(e,t){!function(){e.exports=this.React}()},911:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(6);r.p=o.T,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,525))}))}),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,932))}))}),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,933))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,526))}))}),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,527))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,529))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,279))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,530))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,531))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,532))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,533))}))}),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,934))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},915: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,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(214),u=(r(2),r(8)),l=r.n(u);r(219);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))}},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(18),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){return t((function(){throw e}))}),[])}},96: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,t]),r.current}}});
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([836,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},105:function(e,t){},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){},121: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(21),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},127:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(55),a=r(158),i=r(3),s=r(22),u=r(39);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}},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(177),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})}},135:function(e,t){!function(){e.exports=this.wp.wordcount}()},136:function(e,t,r){"use strict";var n=r(30),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(8),l=(r(2),r(46)),b=r(4),p=r(7),d=r.n(p),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(10),_=r.n(w),E=r(139);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_()(e);if(t){var c=_()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Object(E.a)((function(e){var t=function(t){v()(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,r=null==t;return Object(i.createElement)(e,a()({},this.props,{selected:r?[]:[t]}))}}]),n}(i.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),S=r(279),C=r(27),N=r.n(C),x=r(12),D=r.n(x),B=r(5),z=r.n(B),A=r(13),R=r.n(A),T=r(33),V=r.n(T),L=r(36),I=r(38);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){z()(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_()(e);if(t){var c=_()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var q=Object(E.a)((function(e){var t=function(t){v()(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)),z()(D()(e),"state",{error:null,loading:!1,variations:{}}),z()(D()(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(L.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),{},z()({},o,r)),loading:!1,error:null})})).catch(function(){var t=N()(R.a.mark((function t(r){var n;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(I.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},z()({},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),{},z()({},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&&(!V()(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 z()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),W=r(55),Q=r(31),G=Object(i.createElement)(Q.SVG,{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"})),U=Object(i.createElement)(Q.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#757575",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"})),K=r(45);r(186);function Y(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:G}):Object(i.createElement)(W.a,{srcElement:U})},J={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")},$=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,v=e.variationsLoading,h=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:Y(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&&v&&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)(K.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?h:null),onSearch:p,messages:J,isHierarchical:!0})};$.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=P(Object(S.a)(q($)))},138:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},141:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(44),i=r(213);r(188);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)}))))}))},142:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(56),s=r(7),u=r.n(s),l=(r(2),r(149)),b=(r(215),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,_=e.regularPriceStyle,E=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var k=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return k?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:_}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:E},Object(l.a)(s,{price:P}))}},143:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(10),p=r.n(b),d=r(0),f=r(8),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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(8);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(14),c=r.n(n),o=r(5),a=r.n(o),i=r(37),s=r(21),u=r(121),l=r(28),b=r(247);function p(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 d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},m=d(d({},f),{},{email:"",phone:""}),O=function(e){return Object(b.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(l.decodeEntities)(n)]})))},g={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:m,shippingAddress:f,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(u.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useSelect)((function(e,t){var n=t.dispatch;if(!o)return g;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:m,shippingAddress:f,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(i.CART_STORE_KEY),s=a.getCartData(),u=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),d=n(i.CART_STORE_KEY).receiveCart,j=O(s.billingAddress),v=s.needsShipping?O(s.shippingAddress):j,h=s.fees.map((function(e){return O(e)}));return{cartCoupons:s.coupons,cartItems:s.items||[],cartFees:h,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:u,billingAddress:j,shippingAddress:v,extensions:s.extensions||{},shippingRates:s.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements||[],receiveCart:d}}),[o]);return a}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(14),c=r.n(n),o=r(37),a=r(21),i=r(0),s=r(100),u=r(33),l=r.n(u),b=r(53),p=r(97),d=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,n])]},f=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,u])]},m=function(e,t){var r=Object(s.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],u=o[1],f=Object(b.a)(a),m=Object(b.a)(e),O=Object(p.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){l()(O,m)||(u(Object.assign({},f,m)),g.current=!0)}),[f,m,O,u]),g.current?[a,u]:[e,u]}},157:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(37),c=r(21),o=r(0),a=r(53),i=r(96),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},158:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},168:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(6),o=Object(n.createElement)("img",{src:c.T+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},169:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=(r(2),r(28)),u=r(7),l=r.n(u);r(214);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,b=e.permalink,p=void 0===b?"":b,d=a()(e,["className","disabled","name","permalink"]),f=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:f},d),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:f,href:p},d),Object(s.decodeEntities)(u))}},170:function(e,t,r){"use strict";var n=r(0),c=r(135),o=r(91),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)}},174:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(10),O=r.n(m),g=r(5),j=r.n(g),v=r(0),h=r(9);r(240);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=y(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},177:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(14),a=r.n(o),i=r(0),s=(r(2),r(21)),u=r(281),l=r(933),b=r(134),p=r(121),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),v=a()(j,2),h=v[0],y=v[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]),_=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;g(e,t)}),[g,b]),E=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:E,removeNotice:_,context:b,setIsSuppressed:y},P=h?null:Object(i.createElement)(u.a,{className:n,notices:k.notices}),S=h?null:Object(i.createElement)(d,null);return Object(i.createElement)(O.Provider,{value:k},o&&P,t,S)}},180:function(e,t){},186:function(e,t){},188:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},190:function(e,t){!function(){e.exports=this.wp.warning}()},20:function(e,t){!function(){e.exports=this.wp.url}()},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));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(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:c,noticeContexts:o,shouldRetry:u,isSuccessResponse:a,isErrorResponse:i,isFailResponse:s}}},21:function(e,t){!function(){e.exports=this.wp.data}()},214:function(e,t){},215:function(e,t){},216:function(e,t){},217:function(e,t){},218:function(e,t){},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},240:function(e,t){},246:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(31),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.SVG,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(262);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}},247:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(14),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},26:function(e,t){!function(){e.exports=this.moment}()},262:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(31),u=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return Object(i.createElement)(s.SVG,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},279:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(27),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(10),j=r.n(g),v=r(0),h=r(13),y=r.n(h),w=r(8),_=r(139),E=(r(2),r(6)),k=r(36),P=r(38);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var C=Object(_.a)((function(e){var t=function(t){f()(o,t);var r,n=S(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(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=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:E.u?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=C},28:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},280:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(44),l=r(39),b=r(66);r(544);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")}))}))},281:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(378),u=r(177),l=(r(216),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)})))}},282:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(90),o=(r(2),r(218),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))})},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},348:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},36: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 v})),r.d(t,"a",(function(){return h}));var n=r(5),c=r.n(n),o=r(20),a=r(19),i=r.n(a),s=r(8),u=r(6);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.w?100:0,orderby:u.w?"count":"name",order:u.w?"desc":"asc",search:n})];return u.w&&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)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},h=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))}},37:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},379:function(e,t){},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(27),c=r.n(n),o=r(13),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},381:function(e,t,r){"use strict";var n=r(5),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={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},382: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}}},383:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(14),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(7),p=r.n(b),d=r(6),f=r(39),m=r(66),O=r(280);r(545);function g(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?g(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=function(){return Object(u.createElement)("img",{src:d.E,alt:"",width:500,height:500})},h=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=j({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(v,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,g=Object(f.useProductDataContext)().product,y=Object(u.useState)(!1),w=s()(y,2),_=w[0],E=w[1];if(!g.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(v,null));var k=!!g.images.length,P=k?g.images[0]:null,S=o?"a":u.Fragment,C=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),g.name),N=j({href:g.permalink,rel:"nofollow"},!k&&{"aria-label":C});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(S,o&&N,!!i&&Object(u.createElement)(O.default,{align:d,product:g}),Object(u.createElement)(h,{fallbackAlt:g.name,image:P,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},384:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(144),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))}}}},385:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},386:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(14),i=r.n(a),s=r(1),u=r(53),l=r(134),b=r(207),p=r(918),d="pristine",f="idle",m="disabled",O="processing",g="before_processing",j="after_processing",v={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",y="set_idle",w="set_disabled",_="set_processing",E="set_before_processing",k="set_after_processing",P="set_processing_response",S="set_has_error",C="set_no_error",N="set_quantity",x="set_request_params",D=h,B=y,z=w,A=_,R=E,T=k,V=P,L=S,I=C,F=N,M=x,H=function(){return{type:D}},q=function(){return{type:B}},W=function(){return{type:z}},Q=function(){return{type:A}},G=function(){return{type:R}},U=function(){return{type:T}},K=function(e){return{type:V,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?L:I;return{type:t}},X=function(e){return{type:F,quantity:e}},J=function(e){return{type:M,data:e}},$=r(5),Z=r.n($);function ee(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 te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re=h,ne=y,ce=w,oe=_,ae=E,ie=k,se=P,ue=S,le=C,be=N,pe=x,de=d,fe=f,me=m,Oe=O,ge=g,je=j,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 re:e=v;break;case ne:e=t.status!==fe?te(te({},t),{},{status:fe}):t;break;case ce:e=t.status!==me?te(te({},t),{},{status:me}):t;break;case be:e=n!==t.quantity?te(te({},t),{},{quantity:n}):t;break;case pe:e=te(te({},t),{},{requestParams:te(te({},t.requestParams),o)});break;case se:e=te(te({},t),{},{processingResponse:o});break;case oe:e=!1===(e=t.status!==Oe?te(te({},t),{},{status:Oe,hasError:!1}):t).hasError?e:te(te({},e),{},{hasError:!1});break;case ae:e=t.status!==ge?te(te({},t),{},{status:ge,hasError:!1}):t;break;case ie:e=t.status!==je?te(te({},t),{},{status:je}):t;break;case ue:e=t.hasError?t:te(te({},t),{},{hasError:!0}),e=t.status===Oe||t.status===ge?te(te({},e),{},{status:fe}):e;break;case le:e=t.hasError?te(te({},t),{},{hasError:!1}):t}return e!==t&&c!==re&&e.status===de&&(e.status=fe),e},he=r(144),ye=r(384),we="add_to_cart_before_processing",_e="add_to_cart_after_processing_with_success",Ee="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ye.a)(_e,e),onAddToCartProcessingWithError:Object(ye.a)(Ee,e),onAddToCartBeforeProcessing:Object(ye.a)(we,e)}},Pe=r(388),Se=r(90),Ce=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)(Ce)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ve,v),a=i()(o,2),d=a[0],h=a[1],y=Object(n.useReducer)(he.b,{}),w=i()(y,2),_=w[0],E=w[1],k=Object(u.a)(_),P=Object(l.a)(),S=P.addErrorNotice,C=P.removeNotices,N=Object(Se.b)().setValidationErrors,x=Object(b.a)(),D=x.isSuccessResponse,B=x.isErrorResponse,z=x.isFailResponse,A=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(E).onAddToCartBeforeProcessing}}),[E]),R=Object(n.useMemo)((function(){return{resetForm:function(){h(H())},submitForm:function(){h(G())},setQuantity:function(e){h(X(e))},setHasError:function(e){h(Y(e))},setRequestParams:function(e){h(J(e))},setAfterProcessing:function(e){h(K(e)),h(U())}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(p.a)(r);e!==m||t?e!==m&&t&&h(W()):h(q())}),[d.status,r,h]),Object(n.useEffect)((function(){d.status===g&&(C("error"),Object(Pe.a)(k,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&N(r)})),h(q())):h(Q())})))}),[d.status,N,S,C,h,k]),Object(n.useEffect)((function(){if(d.status===j){var e={processingResponse:d.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;S(e.message,t)}};if(d.hasError)return void Object(Pe.b)(k,Ee,e).then((function(r){if(B(r)||z(r))t(r);else{var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");S(c,{id:"add-to-cart"})}h(q())}));Object(Pe.b)(k,_e,e).then((function(e){B(e)||z(e)?(t(e),h(Y(!0))):h(q())}))}}),[d.status,d.hasError,d.processingResponse,R,S,B,z,D,k]);var T=Object(p.b)(r),V={product:r,productType:r.type||"simple",productIsPurchasable:Object(p.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:c&&T,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:d.status===f,isDisabled:d.status===m,isProcessing:d.status===O,isBeforeProcessing:d.status===g,isAfterProcessing:d.status===j,hasError:d.hasError,eventRegistration:A,dispatchActions:R};return Object(n.createElement)(Ce.Provider,{value:V},t)},De=r(19),Be=r.n(De),ze=r(145),Ae=r(28),Re=r(528);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}var Ve=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,b=e.requestParams,p=Object(Se.b)(),d=p.hasValidationErrors,f=p.showAllValidationErrors,m=Object(l.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(ze.a)().receiveCart,v=Object(n.useState)(!1),h=i()(v,2),y=h[0],w=h[1],_=!a&&u,E=Object(n.useCallback)((function(){return!d||(f(),{type:"error"})}),[d,f]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(E,0);return function(){e()}}),[o,E]);var k=Object(n.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?Te(Object(r),!0).forEach((function(t){Z()(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}({id:r.id||0,quantity:c},b);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?j(r):(r.body&&r.body.message?O(Object(Ae.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(s.__)("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(Re.c)()}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),w(!1)}))}))}),[r,O,g,j,t,c,b]);return Object(n.useEffect)((function(){_&&!y&&k()}),[_,k,y]),null},Le=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Se.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Ve,null)))},Ie=r(39),Fe=r(8),Me=r(66),He=(r(379),r(95)),qe=r(55),We=r(554),Qe=r(839),Ge=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)},Ue=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(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(qe.a,{srcElement:We.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Qe.a)(o.id||0).cartQuantity,m=Object(n.useState)(!1),O=i()(m,2),g=O[0],j=O[1],v=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)(Ue,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:f,isDisabled:u,isProcessing:l,isDone:g,onClick:function(){return d.submitForm()}}):Object(n.createElement)(Ge,{className:"wc-block-components-product-add-to-cart-button",href:v.url,text:v.text||Object(s.__)("View Product","woo-gutenberg-products-block")})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Xe,null):t.id&&!t.is_in_stock?Object(n.createElement)(Xe,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},$e=(r(553),r(30)),Ze=r.n($e),et=r(4),tt=r(9),rt=r(282),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Se.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(Z()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Ae.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){Z()(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),{},Z()({},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(Ae.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){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},Z()({},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(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ie.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)(Le,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},387:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(39),u=r(22),l=r(6),b=function(e){var t=e.color,r=e.fontSize;return Object(l.W)()?{color:t,fontSize:r}:{}},p=r(66),d=r(169);r(543),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,f=void 0===p?2:p,m=e.productLink,O=void 0===m||m,g=e.align,j=e.color,v=e.customColor,h=e.fontSize,y=e.customFontSize,w=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E="h".concat(f),k=Object(u.getColorClassName)("color",j),P=Object(u.getFontSizeClass)(h),S=i()((t={"has-text-color":j||v,"has-font-size":h||y},c()(t,k,k),c()(t,P,P),t));return _.id?Object(o.createElement)(E,{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(l.W)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},S,Object(l.W)())),disabled:!O,name:_.name,permalink:_.permalink,rel:O?"nofollow":null,style:b({color:v,fontSize:y})})):Object(o.createElement)(E,{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(l.W)()),c()(n,S,Object(l.W)()),n)),style:b({color:v,fontSize:y})})}))},388:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(41),c=r.n(n),o=r(27),a=r.n(o),i=r(13),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]};function l(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 b(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 b(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 b(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 p=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,b,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=l(o),e.prev=3,i.s();case 5:if((b=i.n()).done){e.next=19;break}return p=b.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=l(o),e.prev=2,a.s();case 4:if((i=a.n()).done){e.next=23;break}return b=i.value,e.prev=6,e.next=9,Promise.resolve(b.callback(n));case 9:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=12;break}return e.abrupt("continue",21);case 12:if(p.hasOwnProperty("type")){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",p);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));return function(t,r,n){return e.apply(this,arguments)}}()},39:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},4:function(e,t){!function(){e.exports=this.wp.components}()},42:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},44:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(7),i=r.n(a);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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,b=null!=n;return!l&&b?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&b&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},45:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(42));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")))}},49:function(e,t){!function(){e.exports=this.wp.keycodes}()},51:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},525:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(142),u=r(61),l=r(39),b=r(22),p=r(6),d=r(66);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,_=e.customColor,E=e.saleColor,k=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,S=Object(l.useProductDataContext)().product,C=i()(O,c()({},"".concat(P,"__product-price"),P));if(!S.id)return Object(o.createElement)(s.a,{align:g,className:C});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",E),B=Object(b.getFontSizeClass)(h),z=i()((t={"has-text-color":w||_,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":E||k,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),R={color:_,fontSize:v},T={color:k,fontSize:y},V=S.prices,L=Object(u.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.W)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,z,Object(p.W)()),a)),M=I?T:R;return Object(o.createElement)(s.a,{align:g,className:C,currency:L,price:V.price,priceClassName:F,priceStyle:Object(p.W)()?M:{},minPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==V||null===(f=V.price_range)||void 0===f?void 0:f.max_amount,regularPrice:V.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,z,Object(p.W)()),m)),regularPriceStyle:Object(p.W)()?R:{}})}))},526:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(39),l=r(66),b=(r(546),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},527:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(839),p=r(28),d=r(528),f=r(39),m=r(66),O=(r(547),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,v=O.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(d.c)()}),[g]);var h=Number.isFinite(g)&&g>0,y=!s&&f&&m,w=Object(p.decodeEntities)((null==a?void 0:a.description)||""),_=h?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")),E=y?"button":"a",k={};return y?k.onClick=function(){v()}:(k.href=o,k.rel="nofollow"),Object(i.createElement)(E,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},k),_)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},528: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)}}},529:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(170),u=r(3),l=r(39),b=r(66);r(548);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})}))},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(33),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},530:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(39),l=r(66);r(549);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}))},531:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(39),l=r(8),b=r(66);r(550);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))}))))}))},532:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(39),l=r(8),b=r(66);r(551);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))}))))}))},533:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(39),l=r(66),b=(r(552),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))}))},543:function(e,t){},544:function(e,t){},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(5),c=r.n(n),o=r(24),a=r.n(o),i=r(9);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)):null}},550:function(e,t){},551:function(e,t){},552:function(e,t){},553:function(e,t){},554:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},56:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(5),a=r.n(o),i=r(24),s=r.n(i),u=r(0),l=r(173),b=r(7),p=r.n(b);r(180);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=e.displayType,i=void 0===a?"text":a,b=s()(e,["className","value","currency","onValueChange","displayType"]),d="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(d))return null;var m=d/Math.pow(10,n.minorUnit);if(!Number.isFinite(m))return null;var O=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g=f(f(f({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),j=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:O,displayType:i},g,{value:m,onValueChange:j}))}},6:function(e,t,r){"use strict";r.d(t,"l",(function(){return c})),r.d(t,"I",(function(){return o})),r.d(t,"P",(function(){return a})),r.d(t,"y",(function(){return i})),r.d(t,"A",(function(){return s})),r.d(t,"m",(function(){return u})),r.d(t,"z",(function(){return l})),r.d(t,"C",(function(){return b})),r.d(t,"o",(function(){return p})),r.d(t,"B",(function(){return d})),r.d(t,"n",(function(){return f})),r.d(t,"E",(function(){return m})),r.d(t,"u",(function(){return O})),r.d(t,"w",(function(){return g})),r.d(t,"r",(function(){return j})),r.d(t,"s",(function(){return v})),r.d(t,"t",(function(){return h})),r.d(t,"k",(function(){return y})),r.d(t,"L",(function(){return w})),r.d(t,"Q",(function(){return _})),r.d(t,"q",(function(){return E})),r.d(t,"p",(function(){return k})),r.d(t,"H",(function(){return P})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"J",(function(){return N})),r.d(t,"T",(function(){return D})),r.d(t,"U",(function(){return B})),r.d(t,"K",(function(){return z})),r.d(t,"a",(function(){return A})),r.d(t,"N",(function(){return R})),r.d(t,"b",(function(){return T})),r.d(t,"M",(function(){return V})),r.d(t,"D",(function(){return L})),r.d(t,"i",(function(){return I})),r.d(t,"O",(function(){return H})),r.d(t,"h",(function(){return q})),r.d(t,"j",(function(){return W})),r.d(t,"G",(function(){return Q})),r.d(t,"F",(function(){return G})),r.d(t,"S",(function(){return U})),r.d(t,"R",(function(){return K})),r.d(t,"d",(function(){return Y})),r.d(t,"e",(function(){return X})),r.d(t,"f",(function(){return J})),r.d(t,"g",(function(){return $})),r.d(t,"x",(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),v=Object(n.getSetting)("hasTags",!0),h=Object(n.getSetting)("homeUrl",""),y=Object(n.getSetting)("couponsEnabled",!0),w=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),E=(Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),k=(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)("shippingCostRequiresAddress",!1),x=(Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1)),D=Object(n.getSetting)("wcBlocksAssetUrl",""),B=Object(n.getSetting)("wcBlocksBuildUrl",""),z=Object(n.getSetting)("shippingCountries",{}),A=Object(n.getSetting)("allowedCountries",{}),R=Object(n.getSetting)("shippingStates",{}),T=Object(n.getSetting)("allowedStates",{}),V=Object(n.getSetting)("shippingMethodsExist",!1),L=Object(n.getSetting)("paymentGatewaySortOrder",[]),I=Object(n.getSetting)("checkoutShowLoginReminder",!0),F={id:0,title:"",permalink:""},M=Object(n.getSetting)("storePages",{myaccount:F,shop:F,cart:F,checkout:F,privacy:F,terms:F}),H=M.shop.permalink,q=M.checkout.id,W=M.checkout.permalink,Q=M.privacy.permalink,G=M.privacy.title,U=M.terms.permalink,K=M.terms.title,Y=M.cart.id,X=M.cart.permalink,J=Object(n.getSetting)("checkoutAllowsGuest",!1),$=Object(n.getSetting)("checkoutAllowsSignup",!1),Z=M.myaccount.permalink?M.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),ee=r(23),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},ce=function(){return x>1}},61:function(e,t){!function(){e.exports=this.wc.priceFormat}()},63:function(e,t){!function(){e.exports=this.wp.hooks}()},66:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},67:function(e,t){!function(){e.exports=this.wp.dom}()},68:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(10),O=r.n(m),g=r(0),j=r(8),v=r(7),h=r.n(v),y=r(4),w=r(179);r(119);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=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 E=function(e){p()(r,e);var t=_(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(g.Component);t.a=Object(w.a)(E)},70:function(e,t){!function(){e.exports=this.wp.deprecated}()},71:function(e,t){!function(){e.exports=this.wp.a11y}()},73:function(e,t){!function(){e.exports=this.ReactDOM}()},75:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(8),a=(r(2),r(4)),i=r(6);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.A,i.y);s({columns:Number.isNaN(t)?"":t})},min:i.A,max:i.y}),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.C,i.z);s({rows:Number.isNaN(t)?"":t})},min:i.C,max:i.z}),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})}}))}},77:function(e,t){!function(){e.exports=this.wp.viewport}()},78:function(e,t){!function(){e.exports=this.wp.date}()},8:function(e,t){!function(){e.exports=this.lodash}()},808:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},815:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},823:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},824:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(6),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}]},829:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},836:function(e,t,r){e.exports=r(888)},837:function(e,t){},838:function(e,t){},839:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(14),c=r.n(n),o=r(0),a=r(21),i=r(37),s=r(28),u=r(134),l=r(145),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(l.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(u.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;v(!0),t(e,r).then((function(e){!0===e&&m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},841:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},842:function(e,t){},843:function(e,t){},844:function(e,t){},845:function(e,t){},888:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(22),l=r(23),b=r(55),p=r(31),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(6),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(){}}]},v=r(381),h=r(4),y=r(927),w=r(143),_=r(387),E=r(14),k=r.n(E),P=r(136),S=r(24),C=r.n(S);r(838);var N=function(e){var t=e.className,r=void 0===t?"":t,n=C()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},x=r(39),D=(r(837),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)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(N,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),z=Object(s.__)("Product Title","woo-gutenberg-products-block"),A=Object(i.createElement)(b.a,{srcElement:B}),R=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),T=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)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.W)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(_.a,o)))},V=Object(f.W)()?Object(y.a)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:A,label:z,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(T):T;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 I(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 F={title:z,description:R,icon:{src:A,foreground:"#874FB9"},attributes:v.a,edit:V};Object(l.registerBlockType)("woocommerce/product-title",I(I({},j),F));var M=r(525),H=r(348),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),W=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),G=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},U=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)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(G,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(G,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},K=Object(f.W)()?Object(y.a)([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")})])(U):U;function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J={productId:{type:"number",default:0}};function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.W)()&&(J=X(X({},J),{},{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:Q,icon:{src:W,foreground:"#874FB9"},attributes:J,edit:K};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(382),re=r(149),ne=r(68),ce=r(3),oe=r(383),ae=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),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)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(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)(h.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(526),Oe=r(823),ge=Object(s.__)("Product Rating","woo-gutenberg-products-block"),je=Object(i.createElement)(b.a,{srcElement:Oe.a});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}function he(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){c()(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}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",he(he({},j),ye));var we={productId:{type:"number",default:0}},_e=r(527),Ee=r(841),ke=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:Ee.a});function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var 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)(h.Disabled,null,Object(i.createElement)(_e.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Ce(Ce({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(529),Be=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),ze=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ae=Object(i.createElement)(b.a,{srcElement:Be});function Re(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 Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ve={title:ze,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ae,foreground:"#874FB9"},attributes:xe,edit:D({icon:Ae,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",Te(Te({},j),Ve));var Le={productId:{type:"number",default:0}},Ie=r(280),Fe=r(815),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 Qe={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:Le,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)(Ie.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",We(We({},j),Qe));var Ge={productId:{type:"number",default:0}},Ue=r(127),Ke=r(530),Ye=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Xe=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Je=Object(i.createElement)(b.a,{srcElement:Ye});function $e(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?$e(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(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:Je,foreground:"#874FB9"},attributes:Ge,edit:D({icon:Je,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)(Ue.a,null),Object(i.createElement)(Ke.default,t))}))};Object(f.X)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(531),nt=r(808),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)(Ue.a,null),Object(i.createElement)(h.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(532),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)(Ue.a,null),Object(i.createElement)(h.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(533),jt=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),vt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),ht=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 _t={title:vt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:ht,foreground:"#874FB9"},attributes:Ot,edit:D({icon:ht,label:vt,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)(Ue.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.X)("woocommerce/product-stock-indicator",wt(wt({},j),_t));var Et=r(918),kt=(r(379),r(386)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),St=Object(i.createElement)(b.a,{srcElement:Ee.a});function Ct(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?Ct(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ct(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:St,foreground:"#874FB9"},edit:D({icon:St,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)(Ue.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(Et.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(kt.a,t)))})),attributes:r(385).a};Object(f.X)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(15),Bt=r.n(Dt),zt=r(12),At=r.n(zt),Rt=r(17),Tt=r.n(Rt),Vt=r(18),Lt=r.n(Vt),It=r(10),Ft=r.n(It),Mt=r(21),Ht=(r(2),r(75)),qt=r(914),Wt=r(824),Qt=r(158),Gt=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})},Ut=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ce.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Qt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Kt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function 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 Xt(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 Jt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],$t=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):[]})]})):[]};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)(h.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)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},nr=r(16),cr=r.n(nr),or=r(9),ar=r(8),ir=r(44),sr=(r(845),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)(ir.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)(ir.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)(ir.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)(ir.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)(ir.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)(ir.a,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});sr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var ur=sr,lr=r(147),br=r(157),pr=r(37),dr=r(53);function fr(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 mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Or=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(br.a)(mr(mr({},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(dr.a)(i),u=Object(dr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(pr.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",mr(mr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},gr=r(97),jr=r(174),vr=r(71),hr=r(138),yr=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:hr.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")))},wr=r(829),_r=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:wr.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")))},Er=r(141),kr=(r(844),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Er.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})}),Pr=r(213),Sr=Object(Pr.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))}));r(843);function Cr(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 Nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ar.isEqual)(t,c)&&Number.isFinite(r)},Dr=Object(jr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=Object(lr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows,a=Object(ce.getSetting)("hideOutOfStockItems",!1);return Nr(Nr({},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},a&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r})),l=k()(u,1)[0],b=Or(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 C()(e,["order","orderby","page","per_page"])||{}}(l),j=Object(lr.b)("attributes",[]),v=k()(j,2),h=v[0],y=v[1],w=Object(lr.b)("min_price"),_=k()(w,2),E=_[0],P=_[1],S=Object(lr.b)("max_price"),N=k()(S,2),D=N[0],B=N[1],z=Object(gr.a)({totalQuery:g,totalProducts:d},xr);Object(i.useEffect)((function(){Object(ar.isEqual)(g,null==z?void 0:z.totalQuery)||(n(1),null!=z&&z.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(vr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(vr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==z?void 0:z.totalQuery,d,n,g]);var A,R,T,V,L,I=t.contentVisibility,F=t.columns*t.rows,M=!Number.isFinite(d)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(ar.isEqual)(g,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/F):Math.ceil(d/F),H=p.length?p:Array.from({length:F}),q=0!==p.length||f,W=h.length>0||Number.isFinite(E)||Number.isFinite(D);return Object(i.createElement)("div",{className:(A=t.columns,R=t.rows,T=t.alignButtons,V=t.align,L=void 0!==V?"align"+V:"",O()(m,L,"has-"+A+"-columns",{"has-multiple-rows":R>1,"has-aligned-buttons":T}))},I.orderBy&&q&&Object(i.createElement)(kr,{onChange:c,value:o}),!q&&W&&Object(i.createElement)(_r,{resetCallback:function(){y([]),P(null),B(null)}}),!q&&!W&&Object(i.createElement)(yr,null),q&&Object(i.createElement)("ul",{className:"".concat(m,"__products")},H.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)(Sr,{key:e.id||r,attributes:t,product:e})}))),M>1&&Object(i.createElement)(ur,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:M}))})),Br=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)(Dr,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},zr=r(168);function Ar(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return Lt()(this,r)}}var Rr=function(e){Tt()(r,e);var t=Ar(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?zr.a:Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Br,{attributes:t,urlParameterSuffix:r}))}}]),r}(or.Component);r(842);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 Lt()(this,r)}}var Vr=function(e){Tt()(r,e);var t=Tr(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()(At()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(At()(e),"blockMap",Object(qt.a)("woocommerce/all-products")),c()(At()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(At()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(At()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(At()(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()(At()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ht.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},tr(r,n),rr(r,n)))})),c()(At()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(At()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(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)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:$t(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Jt.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()(At()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Rr,{attributes:t})):Kt(c,o)})),c()(At()(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:Gt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):Ut(n,c)})),e}return r}(i.Component),Lr=Object(y.a)(h.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}})))(Vr),Ir={columns:f.m,rows:f.o,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Jt,isPreview:!1};function Fr(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 Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hr={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:Ir,edit:function(e){return Object(i.createElement)(Lr,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:Gt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Mr(Mr({},Hr),{},{deprecated:[{attributes:Object.assign({},Hr.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:Gt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},9:function(e,t){!function(){e.exports=this.React}()},90:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(41),c=r.n(n),o=r(5),a=r.n(o),i=r(24),s=r.n(i),u=r(14),l=r.n(u),b=r(0),p=r(8),d=r(33),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},91:function(e,t){!function(){e.exports=this.wp.autop}()},914:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(51),c=r(0),o=r(6);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,525))}))}),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,935))}))}),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,936))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,526))}))}),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,527))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,529))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,280))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,530))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,531))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,532))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,533))}))}),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,937))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},918: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")}},95:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(212),u=(r(2),r(7)),l=r.n(u);r(217);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))}},96:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(14),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(9);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});
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-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '0d7ba38f781d863e229b005def938c1f');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '57d7be8272be71b1b1764403175367fe');
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([822,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},119:function(e,t){},129: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(149),i=r(4),a=r(22),s=r(3),l=r(6),u=r(68),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},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.I&&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.O&&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}))}},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},138:function(e,t,r){"use strict";var n=r(0),o=r(31),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},140:function(e,t){},141:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(8)),c=r.n(o),i=r(44),a=r(215);r(188);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)}))))}))},148:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(6),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.S+"img/avatar.jpg",96:o.S+"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.S+"img/avatar.jpg",96:o.S+"img/avatar.jpg"},rating:null,verified:!1}]}}},171: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}}},172:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(187),r(65));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},176:function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(17),u=r.n(l),b=r(10),d=r.n(b),p=r(0),w=r(1),g=r(9),f=(r(2),r(7)),m=r(4),v=r(6),h=r(87),O=r(44),j=(r(241),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(141),k=(r(238),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(5),E=r.n(R),S=r(8),P=r.n(S),C=r(12),N=r.n(C),x=r(210),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},I=function(e,t,r,n){var o=D(e,t,r);return L(e,o-n.length,n)},D=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 B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var A=function(e){s()(r,e);var t=B(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:I(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);A.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=A;r(240);var V=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:P()("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+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(239);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 z(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){E()(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 G=function(e){var t=e.attributes,r=e.reviews,n=(v.O||"product"===t.imageType)&&t.showReviewImage,o=v.I&&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)(V,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(V,{key:e.id||t,attributes:c,review:e})})))},U=r(11),W=r.n(U),J=r(27),q=r.n(J),K=r(13),Q=r.n(K),X=r(33),Y=r.n(X),Z=r(65),$=r(38);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(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=q()(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||!Y()(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.I&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(G,{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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,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},187:function(e,t){},188:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},238:function(e,t){},239:function(e,t){},240:function(e,t){},241:function(e,t){},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(27),o=r.n(n),c=r(13),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},43:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(41));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")))}},44:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),i=r(8),a=r.n(i);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){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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,s=void 0===i?{}:i,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:a()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&b&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},55:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(24),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))}},6:function(e,t,r){"use strict";r.d(t,"l",(function(){return o})),r.d(t,"I",(function(){return c})),r.d(t,"O",(function(){return i})),r.d(t,"y",(function(){return a})),r.d(t,"A",(function(){return s})),r.d(t,"m",(function(){return l})),r.d(t,"z",(function(){return u})),r.d(t,"C",(function(){return b})),r.d(t,"o",(function(){return d})),r.d(t,"B",(function(){return p})),r.d(t,"n",(function(){return w})),r.d(t,"E",(function(){return g})),r.d(t,"u",(function(){return f})),r.d(t,"w",(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,"k",(function(){return j})),r.d(t,"K",(function(){return y})),r.d(t,"P",(function(){return _})),r.d(t,"q",(function(){return k})),r.d(t,"p",(function(){return R})),r.d(t,"H",(function(){return E})),r.d(t,"c",(function(){return S})),r.d(t,"v",(function(){return P})),r.d(t,"S",(function(){return N})),r.d(t,"T",(function(){return x})),r.d(t,"J",(function(){return T})),r.d(t,"a",(function(){return L})),r.d(t,"M",(function(){return I})),r.d(t,"b",(function(){return D})),r.d(t,"L",(function(){return M})),r.d(t,"D",(function(){return B})),r.d(t,"i",(function(){return A})),r.d(t,"N",(function(){return F})),r.d(t,"h",(function(){return z})),r.d(t,"j",(function(){return G})),r.d(t,"G",(function(){return U})),r.d(t,"F",(function(){return W})),r.d(t,"R",(function(){return J})),r.d(t,"Q",(function(){return q})),r.d(t,"d",(function(){return K})),r.d(t,"e",(function(){return Q})),r.d(t,"f",(function(){return X})),r.d(t,"g",(function(){return Y})),r.d(t,"x",(function(){return Z})),r.d(t,"W",(function(){return ee})),r.d(t,"X",(function(){return te})),r.d(t,"U",(function(){return re})),r.d(t,"V",(function(){return ne}));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),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),R=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),E=Object(n.getSetting)("productCount",0),S=Object(n.getSetting)("attributes",[]),P=Object(n.getSetting)("isShippingCalculatorEnabled",!0),C=(Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1)),N=Object(n.getSetting)("wcBlocksAssetUrl",""),x=Object(n.getSetting)("wcBlocksBuildUrl",""),T=Object(n.getSetting)("shippingCountries",{}),L=Object(n.getSetting)("allowedCountries",{}),I=Object(n.getSetting)("shippingStates",{}),D=Object(n.getSetting)("allowedStates",{}),M=Object(n.getSetting)("shippingMethodsExist",!1),B=Object(n.getSetting)("paymentGatewaySortOrder",[]),A=Object(n.getSetting)("checkoutShowLoginReminder",!0),H={id:0,title:"",permalink:""},V=Object(n.getSetting)("storePages",{myaccount:H,shop:H,cart:H,checkout:H,privacy:H,terms:H}),F=V.shop.permalink,z=V.checkout.id,G=V.checkout.permalink,U=V.privacy.permalink,W=V.privacy.title,J=V.terms.permalink,q=V.terms.title,K=V.cart.id,Q=V.cart.permalink,X=Object(n.getSetting)("checkoutAllowsGuest",!1),Y=Object(n.getSetting)("checkoutAllowsSignup",!1),Z=V.myaccount.permalink?V.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),$=r(23),ee=function(e,t){if(C>2)return Object($.registerBlockType)(e,t)},te=function(e,t){if(C>1)return Object($.registerBlockType)(e,t)},re=function(){return C>2},ne=function(){return C>1}},65:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(8),i=r.n(c),a=r(6),s=function(e){if(a.I){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}},68:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),i=r.n(c),a=r(15),s=r.n(a),l=r(12),u=r.n(l),b=r(16),d=r.n(b),p=r(17),w=r.n(p),g=r(10),f=r.n(g),m=r(0),v=r(7),h=r(8),O=r.n(h),j=r(4),y=r(179);r(119);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(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.isSecondary=!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.a)(k)},7:function(e,t){!function(){e.exports=this.lodash}()},822:function(e,t,r){e.exports=r(899)},87:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(55)),i=r(138),a=r(8),s=r.n(a),l=r(4),u=r(43);r(140);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},899:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),i=r(1),a=r(23),s=r(55),l=r(31),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(187),r(22)),d=r(4),p=(r(2),r(176)),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(129),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(171),v=r(172),h=r(148);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})},9:function(e,t){!function(){e.exports=this.React}()}});
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([825,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},119:function(e,t){},129: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(149),i=r(4),a=r(22),s=r(3),l=r(6),u=r(68),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},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.I&&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}))}},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},138:function(e,t,r){"use strict";var n=r(0),o=r(31),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},140:function(e,t){},141:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(44),a=r(213);r(188);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)}))))}))},148:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(6),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}]}}},171: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}}},172:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(187),r(65));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},176:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(10),d=r.n(b),p=r(0),w=r(1),g=r(9),f=(r(2),r(8)),m=r(4),v=r(6),h=r(89),O=r(44),j=(r(239),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(141),k=(r(236),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(5),E=r.n(R),P=r(7),S=r.n(P),C=r(12),N=r.n(C),x=r(208),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},I=function(e,t,r,n){var o=D(e,t,r);return L(e,o-n.length,n)},D=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 B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var A=function(e){s()(r,e);var t=B(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:I(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);A.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=A;r(238);var V=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+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(237);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 z(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){E()(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 G=function(e){var t=e.attributes,r=e.reviews,n=(v.P||"product"===t.imageType)&&t.showReviewImage,o=v.I&&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)(V,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(V,{key:e.id||t,attributes:c,review:e})})))},U=r(11),W=r.n(U),J=r(27),q=r.n(J),Y=r(13),K=r.n(Y),Q=r(33),X=r.n(Q),Z=r(65),$=r(38);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(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=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,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.I&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(G,{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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,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},187:function(e,t){},188:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},236:function(e,t){},237:function(e,t){},238:function(e,t){},239:function(e,t){},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(27),o=r.n(n),c=r(13),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},4:function(e,t){!function(){e.exports=this.wp.components}()},42:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},44:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),i=r(7),a=r.n(i);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){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}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,s=void 0===i?{}:i,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:a()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&b&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},45:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(42));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")))}},55:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(24),i=r.n(c),a=r(9);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)):null}},6:function(e,t,r){"use strict";r.d(t,"l",(function(){return o})),r.d(t,"I",(function(){return c})),r.d(t,"P",(function(){return i})),r.d(t,"y",(function(){return a})),r.d(t,"A",(function(){return s})),r.d(t,"m",(function(){return l})),r.d(t,"z",(function(){return u})),r.d(t,"C",(function(){return b})),r.d(t,"o",(function(){return d})),r.d(t,"B",(function(){return p})),r.d(t,"n",(function(){return w})),r.d(t,"E",(function(){return g})),r.d(t,"u",(function(){return f})),r.d(t,"w",(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,"k",(function(){return j})),r.d(t,"L",(function(){return y})),r.d(t,"Q",(function(){return _})),r.d(t,"q",(function(){return k})),r.d(t,"p",(function(){return R})),r.d(t,"H",(function(){return E})),r.d(t,"c",(function(){return P})),r.d(t,"v",(function(){return S})),r.d(t,"J",(function(){return C})),r.d(t,"T",(function(){return x})),r.d(t,"U",(function(){return T})),r.d(t,"K",(function(){return L})),r.d(t,"a",(function(){return I})),r.d(t,"N",(function(){return D})),r.d(t,"b",(function(){return M})),r.d(t,"M",(function(){return B})),r.d(t,"D",(function(){return A})),r.d(t,"i",(function(){return H})),r.d(t,"O",(function(){return z})),r.d(t,"h",(function(){return G})),r.d(t,"j",(function(){return U})),r.d(t,"G",(function(){return W})),r.d(t,"F",(function(){return J})),r.d(t,"S",(function(){return q})),r.d(t,"R",(function(){return Y})),r.d(t,"d",(function(){return K})),r.d(t,"e",(function(){return Q})),r.d(t,"f",(function(){return X})),r.d(t,"g",(function(){return Z})),r.d(t,"x",(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),Object(n.getSetting)("hasDarkEditorStyleSupport",!1)),R=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),E=Object(n.getSetting)("productCount",0),P=Object(n.getSetting)("attributes",[]),S=Object(n.getSetting)("isShippingCalculatorEnabled",!0),C=Object(n.getSetting)("shippingCostRequiresAddress",!1),N=(Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1)),x=Object(n.getSetting)("wcBlocksAssetUrl",""),T=Object(n.getSetting)("wcBlocksBuildUrl",""),L=Object(n.getSetting)("shippingCountries",{}),I=Object(n.getSetting)("allowedCountries",{}),D=Object(n.getSetting)("shippingStates",{}),M=Object(n.getSetting)("allowedStates",{}),B=Object(n.getSetting)("shippingMethodsExist",!1),A=Object(n.getSetting)("paymentGatewaySortOrder",[]),H=Object(n.getSetting)("checkoutShowLoginReminder",!0),V={id:0,title:"",permalink:""},F=Object(n.getSetting)("storePages",{myaccount:V,shop:V,cart:V,checkout:V,privacy:V,terms:V}),z=F.shop.permalink,G=F.checkout.id,U=F.checkout.permalink,W=F.privacy.permalink,J=F.privacy.title,q=F.terms.permalink,Y=F.terms.title,K=F.cart.id,Q=F.cart.permalink,X=Object(n.getSetting)("checkoutAllowsGuest",!1),Z=Object(n.getSetting)("checkoutAllowsSignup",!1),$=F.myaccount.permalink?F.myaccount.permalink:Object(n.getSetting)("loginUrl","/wp-login.php"),ee=r(23),te=function(e,t){if(N>2)return Object(ee.registerBlockType)(e,t)},re=function(e,t){if(N>1)return Object(ee.registerBlockType)(e,t)},ne=function(){return N>2},oe=function(){return N>1}},65:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(7),i=r.n(c),a=r(6),s=function(e){if(a.I){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}},68:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),g=r(10),f=r.n(g),m=r(0),v=r(8),h=r(7),O=r.n(h),j=r(4),y=r(179);r(119);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(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.isSecondary=!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.a)(k)},8:function(e,t){!function(){e.exports=this.lodash}()},825:function(e,t,r){e.exports=r(902)},89:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(55)),i=r(138),a=r(7),s=r.n(a),l=r(4),u=r(45);r(140);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},9:function(e,t){!function(){e.exports=this.React}()},902:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),i=r(1),a=r(23),s=r(55),l=r(31),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(187),r(22)),d=r(4),p=(r(2),r(176)),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(129),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(171),v=r(172),h=r(148);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})}});
build/atomic-block-components/add-to-cart--atomic-block-components/button-frontend.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[0],{102:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(10),i=n.n(r),a=n(7),c=n.n(a),s=n(15),o=n(12),u=n(78),d=n(23),p=n(180);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},m=f(f({},g),{},{email:"",phone:""}),h=function(t){return Object(p.a)(Object.entries(t).map((function(t){var e=i()(t,2),n=e[0],r=e[1];return[n,Object(d.decodeEntities)(r)]})))},b={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:m,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(u.a)(),n=e.isEditor,r=e.previewData,i=(null==r?void 0:r.previewCart)||{},a=t.shouldSelect,c=Object(o.useSelect)((function(t,e){var r=e.dispatch;if(!a)return b;if(n)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:[],cartTotals:i.totals,cartIsLoading:!1,cartErrors:[],billingAddress:m,shippingAddress:g,extensions:{},shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:function(){}};var c=t(s.CART_STORE_KEY),o=c.getCartData(),u=c.getCartErrors(),d=c.getCartTotals(),p=!c.hasFinishedResolution("getCartData"),l=c.isCustomerDataUpdating(),f=r(s.CART_STORE_KEY).receiveCart,v=h(o.billingAddress),_=o.needsShipping?h(o.shippingAddress):v,y=o.fees.map((function(t){return h(t)}));return{cartCoupons:o.coupons,cartItems:o.items||[],cartFees:y,cartItemsCount:o.itemsCount,cartItemsWeight:o.itemsWeight,cartNeedsPayment:o.needsPayment,cartNeedsShipping:o.needsShipping,cartItemErrors:o.errors||[],cartTotals:d,cartIsLoading:p,cartErrors:u,billingAddress:v,shippingAddress:_,extensions:o.extensions||{},shippingRates:o.shippingRates||[],shippingRatesLoading:l,cartHasCalculatedShipping:o.hasCalculatedShipping,paymentRequirements:o.paymentRequirements||[],receiveCart:f}}),[a]);return c}},180:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(10),i=n.n(r),a=function(t){return t.reduce((function(t,e){var n=i()(e,2),r=n[0],a=n[1];return t[r]=a,t}),{})}},280:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return c}));var r=window.Event||null,i=function(t,e){var n=e.bubbles,i=void 0!==n&&n,a=e.cancelable,c=void 0!==a&&a,s=e.element;if(s||(s=document.body),"function"==typeof r){var o=new r(t,{bubbles:i,cancelable:c});s.dispatchEvent(o)}else{var u=document.createEvent("Event");u.initEvent(t,i,c),s.dispatchEvent(u)}},a=function(){i("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},c=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(){i(e,{bubbles:n,cancelable:r})};return jQuery(document).on(t,a),function(){return jQuery(document).off(t,a)}}},304:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(10),i=n.n(r),a=n(0),c=n(12),s=n(15),o=n(23),u=n(90),d=n(102),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(c.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(d.a)(),r=n.cartItems,l=n.cartIsLoading,f=Object(u.a)(),g=f.addErrorNotice,m=f.removeNotice,h=Object(a.useState)(!1),b=i()(h,2),v=b[0],_=b[1],y=Object(a.useRef)(p(r,t));return Object(a.useEffect)((function(){var e=p(r,t);e!==y.current&&(y.current=e)}),[r,t]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:v,cartIsLoading:l,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;_(!0),e(t,n).then((function(t){!0===t&&m("add-to-cart")})).catch((function(t){g(Object(o.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){_(!1)}))}}}}}]);
build/atomic-block-components/add-to-cart--atomic-block-components/button.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{121:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(0),c=n(21),i=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),o=function(){return Object(r.useContext)(i)},a=function(e){var t=e.children,n=e.currentPostId,o=void 0===n?0:n,a=e.previewData,s=void 0===a?{}:a,u={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return o||e("core/editor").getCurrentPostId()}),[o]),previewData:s};return Object(r.createElement)(i.Provider,{value:u},t)}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),c=n.n(r),i=n(177),o=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(i.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),d=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[n,c]);return s(s(s({notices:t},l),d),{},{setIsSuppressed:a})}},145:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(5),c=n.n(r),i=n(37),o=n(21),a=n(121),s=n(28),u=n(7);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 d(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 f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},p=d(d({},f),{},{email:"",phone:""}),b=function(e){return Object(u.mapValues)(e,(function(e){return Object(s.decodeEntities)(e)}))},v={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],billingAddress:p,shippingAddress:f,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(a.b)(),n=t.isEditor,r=t.previewData,c=(null==r?void 0:r.previewCart)||{},s=e.shouldSelect,u=Object(o.useSelect)((function(e,t){var r=t.dispatch;if(!s)return v;if(n)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:p,shippingAddress:f,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var o=e(i.CART_STORE_KEY),a=o.getCartData(),u=o.getCartErrors(),l=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),g=r(i.CART_STORE_KEY).receiveCart,O=b(a.billingAddress),h=a.needsShipping?b(a.shippingAddress):O,j=a.fees.map((function(e){return b(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:d,cartErrors:u,billingAddress:O,shippingAddress:h,extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:m,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:g}}),[s]);return u}},177:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return O}));var r=n(5),c=n.n(r),i=n(18),o=n.n(i),a=n(0),s=(n(2),n(21)),u=n(281),l=n(930),d=n(134),f=n(121),p=function(){var e=Object(f.b)().isEditor,t=Object(d.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)(l.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:r})};function b(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(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)},O=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,i=void 0===c||c,l=e.context,d=void 0===l?"wc/core":l,f=Object(s.useDispatch)("core/notices"),b=f.createNotice,g=f.removeNotice,O=Object(a.useState)(!1),h=o()(O,2),j=h[0],w=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]:{};b(e,t,v(v({},n),{},{context:n.context||d}))}),[b,d]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;g(e,t)}),[g,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]:{};y("default",e,v(v({},t),{},{type:"snackbar"}))}),[y]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:y,createSnackbarNotice:N,removeNotice:E,context:d,setIsSuppressed:w},S=j?null:Object(a.createElement)(u.a,{className:r,notices:C.notices}),P=j?null:Object(a.createElement)(p,null);return Object(a.createElement)(m.Provider,{value:C},i&&S,t,P)}},218:function(e,t){},248:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),s=n(31),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=void 0===n?20:n,i=o()(e,["className","size"]);return Object(a.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},i),Object(a.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),l=n(262);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(a.cloneElement)(t,{size:e.size||20,className:e.className}):null}},262:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),s=n(31),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},281:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(0),o=(n(2),n(8)),a=n.n(o),s=n(382),u=n(177),l=(n(218),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,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var d=a()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:d},o.map((function(e){return Object(i.createElement)(s.a,c()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice","woocommerce-message",l(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))}},528:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}));var r=window.Event||null,c=function(e,t){var n=t.bubbles,c=void 0!==n&&n,i=t.cancelable,o=void 0!==i&&i,a=t.element;if(a||(a=document.body),"function"==typeof r){var s=new r(e,{bubbles:c,cancelable:o});a.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,o),a.dispatchEvent(u)}},i=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=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 i=function(){c(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,i),function(){return jQuery(document).off(e,i)}}},836:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(18),c=n.n(r),i=n(0),o=n(21),a=n(37),s=n(28),u=n(134),l=n(145),d=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},f=function(e){var t=Object(o.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(l.a)(),r=n.cartItems,f=n.cartIsLoading,p=Object(u.a)(),b=p.addErrorNotice,v=p.removeNotice,m=Object(i.useState)(!1),g=c()(m,2),O=g[0],h=g[1],j=Object(i.useRef)(d(r,e));return Object(i.useEffect)((function(){var t=d(r,e);t!==j.current&&(j.current=t)}),[r,e]),{cartQuantity:Number.isFinite(j.current)?j.current:0,addingToCart:O,cartIsLoading:f,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h(!0),t(e,n).then((function(e){!0===e&&v("add-to-cart")})).catch((function(e){b(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{121:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(0),c=n(21),i=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(r.useContext)(i)},a=function(e){var t=e.children,n=e.currentPostId,o=void 0===n?0:n,a=e.previewData,s=void 0===a?{}:a,u=Object(c.useSelect)((function(e){return o||e("core/editor").getCurrentPostId()}),[o]),l=Object(r.useCallback)((function(e){return e in s?s[e]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(r.createElement)(i.Provider,{value:d},t)}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),c=n.n(r),i=n(177),o=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(i.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),d=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[n,c]);return s(s(s({notices:t},l),d),{},{setIsSuppressed:a})}},145:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(14),c=n.n(r),i=n(5),o=n.n(i),a=n(37),s=n(21),u=n(121),l=n(28),d=n(247);function f(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?f(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},v=p(p({},b),{},{email:"",phone:""}),m=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,Object(l.decodeEntities)(r)]})))},g={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:v,shippingAddress:b,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(u.b)(),n=t.isEditor,r=t.previewData,c=(null==r?void 0:r.previewCart)||{},i=e.shouldSelect,o=Object(s.useSelect)((function(e,t){var r=t.dispatch;if(!i)return g;if(n)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:v,shippingAddress:b,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var o=e(a.CART_STORE_KEY),s=o.getCartData(),u=o.getCartErrors(),l=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),f=o.isCustomerDataUpdating(),p=r(a.CART_STORE_KEY).receiveCart,O=m(s.billingAddress),h=s.needsShipping?m(s.shippingAddress):O,j=s.fees.map((function(e){return m(e)}));return{cartCoupons:s.coupons,cartItems:s.items||[],cartFees:j,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors||[],cartTotals:l,cartIsLoading:d,cartErrors:u,billingAddress:O,shippingAddress:h,extensions:s.extensions||{},shippingRates:s.shippingRates||[],shippingRatesLoading:f,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements||[],receiveCart:p}}),[i]);return o}},177:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return O}));var r=n(5),c=n.n(r),i=n(14),o=n.n(i),a=n(0),s=(n(2),n(21)),u=n(281),l=n(933),d=n(134),f=n(121),p=function(){var e=Object(f.b)().isEditor,t=Object(d.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)(l.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:r})};function b(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(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)},O=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,i=void 0===c||c,l=e.context,d=void 0===l?"wc/core":l,f=Object(s.useDispatch)("core/notices"),b=f.createNotice,g=f.removeNotice,O=Object(a.useState)(!1),h=o()(O,2),j=h[0],y=h[1],w=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,v(v({},n),{},{context:n.context||d}))}),[b,d]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;g(e,t)}),[g,d]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w("default",e,v(v({},t),{},{type:"snackbar"}))}),[w]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:w,createSnackbarNotice:_,removeNotice:E,context:d,setIsSuppressed:y},C=j?null:Object(a.createElement)(u.a,{className:r,notices:N.notices}),P=j?null:Object(a.createElement)(p,null);return Object(a.createElement)(m.Provider,{value:N},i&&C,t,P)}},216:function(e,t){},246:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),s=n(31),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=void 0===n?20:n,i=o()(e,["className","size"]);return Object(a.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},i),Object(a.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))}),null),l=n(262);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(a.cloneElement)(t,{size:e.size||20,className:e.className}):null}},247:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(14),c=n.n(r),i=function(e){return e.reduce((function(e,t){var n=c()(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})}},262:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(24),o=n.n(i),a=n(0),s=n(31),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=o()(e,["className","size"]);return Object(a.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},281:function(e,t,n){"use strict";var r=n(11),c=n.n(r),i=n(0),o=(n(2),n(7)),a=n.n(o),s=n(378),u=n(177),l=(n(216),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,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var d=a()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:d},o.map((function(e){return Object(i.createElement)(s.a,c()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice","woocommerce-message",l(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))}},528:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}));var r=window.Event||null,c=function(e,t){var n=t.bubbles,c=void 0!==n&&n,i=t.cancelable,o=void 0!==i&&i,a=t.element;if(a||(a=document.body),"function"==typeof r){var s=new r(e,{bubbles:c,cancelable:o});a.dispatchEvent(s)}else{var u=document.createEvent("Event");u.initEvent(e,c,o),a.dispatchEvent(u)}},i=function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},o=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 i=function(){c(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,i),function(){return jQuery(document).off(e,i)}}},839:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(14),c=n.n(r),i=n(0),o=n(21),a=n(37),s=n(28),u=n(134),l=n(145),d=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},f=function(e){var t=Object(o.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(l.a)(),r=n.cartItems,f=n.cartIsLoading,p=Object(u.a)(),b=p.addErrorNotice,v=p.removeNotice,m=Object(i.useState)(!1),g=c()(m,2),O=g[0],h=g[1],j=Object(i.useRef)(d(r,e));return Object(i.useEffect)((function(){var t=d(r,e);t!==j.current&&(j.current=t)}),[r,e]),{cartQuantity:Number.isFinite(j.current)?j.current:0,addingToCart:O,cartIsLoading:f,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h(!0),t(e,n).then((function(e){!0===e&&v("add-to-cart")})).catch((function(e){b(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!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],{931:function(e,n,a){"use strict";var c=a(11),r=a.n(c),t=a(0),o=function(e,n){var a=[];return Object.keys(e).forEach((function(c){if(void 0!==n[c])switch(e[c].type){case"boolean":a[c]="false"!==n[c]&&!1!==n[c];break;case"number":a[c]=parseInt(n[c],10);break;case"array":case"object":a[c]=JSON.parse(n[c]);break;default:a[c]=n[c]}else a[c]=e[c].default})),a};n.a=function(e){return function(n){return function(a){var c=o(e,a);return Object(t.createElement)(n,r()({},a,c))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{934:function(e,n,a){"use strict";var c=a(11),r=a.n(c),t=a(0),o=function(e,n){var a=[];return Object.keys(e).forEach((function(c){if(void 0!==n[c])switch(e[c].type){case"boolean":a[c]="false"!==n[c]&&!1!==n[c];break;case"number":a[c]=parseInt(n[c],10);break;case"array":case"object":a[c]=JSON.parse(n[c]);break;default:a[c]=n[c]}else a[c]=e[c].default})),a};n.a=function(e){return function(n){return function(a){var c=o(e,a);return Object(t.createElement)(n,r()({},a,c))}}}}}]);
build/atomic-block-components/add-to-cart-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{115:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(7),a=r.n(n),c=r(8);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}},137:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));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(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:a,noticeContexts:c,shouldRetry:u,isSuccessResponse:o,isErrorResponse:s,isFailResponse:i}}},154:function(e,t){},155:function(e,t){},181:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(83),a=(r(3),r(154),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))})},189: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}},203:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(115),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))}}}},204:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(25),a=r.n(n),c=r(50),o=r.n(c),s=r(26),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=o()(i.a.mark((function e(t,r,n){var c,o,s,l,f,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),o=[],s=u(c),e.prev=3,s.s();case 5:if((l=s.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"===a()(p)&&o.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),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!o.length||o);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=o()(i.a.mark((function e(t,r,n){var c,o,s,l,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=d(t,r),o=u(c),e.prev=2,o.s();case 4:if((s=o.n()).done){e.next=23;break}return l=s.value,e.prev=6,e.next=9,Promise.resolve(l.callback(n));case 9:if(f=e.sent,"object"===a()(f)){e.next=12;break}return e.abrupt("continue",21);case 12:if(void 0!==f.type){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",f);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),o.e(e.t1);case 28:return e.prev=28,o.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));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(29),a=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=a},284:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(189);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,a()({},r,n))}}}},291: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(12),s=r(15),i=r(23),u=r(90),l=r(99),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)(s.CART_STORE_KEY).addItemToCart,r=Object(l.a)(),n=r.cartItems,f=r.cartIsLoading,p=Object(u.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(i.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){O(!1)}))}}}},297:function(e,t){},298:function(e,t){},307:function(e,t,r){"use strict";r.r(t);var n=r(284),a=(r(3),r(5)),c=r.n(a),o=r(10),s=r.n(o),i=r(0),u=r(1),l=r(39),d=r(90),f=r(137),p=function(e){return e.is_purchasable||!1},b="pristine",m="idle",v="disabled",h="processing",g="before_processing",O="after_processing",y={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",E="set_idle",w="set_disabled",P="set_processing",k="set_before_processing",_="set_after_processing",R="set_processing_response",C="set_has_error",S="set_no_error",A="set_quantity",x="set_request_params",D=j,T=E,N=w,I=P,q=k,V=_,F=R,Q=C,W=S,B=A,M=x,L=function(){return{type:D}},H=function(){return{type:T}},Y=function(){return{type:N}},U=function(){return{type:I}},J=function(){return{type:q}},K=function(){return{type:V}},z=function(e){return{type:F,data:e}},G=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?Q:W;return{type:t}},X=function(e){return{type:B,quantity:e}},$=function(e){return{type:M,data:e}},Z=r(7),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=j,ae=E,ce=w,oe=P,se=k,ie=_,ue=R,le=C,de=S,fe=A,pe=x,be=b,me=m,ve=v,he=h,ge=g,Oe=O,ye=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,a=r.type,c=r.data;switch(a){case ne:e=y;break;case ae:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case ce:e=t.status!==ve?re(re({},t),{},{status:ve}):t;break;case fe:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case pe:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),c)});break;case ue:e=re(re({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==he?re(re({},t),{},{status:he,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case se:e=t.status!==ge?re(re({},t),{},{status:ge,hasError:!1}):t;break;case ie:e=t.status!==Oe?re(re({},t),{},{status:Oe}):t;break;case le:e=t.hasError?t:re(re({},t),{},{hasError:!0}),e=t.status===he||t.status===ge?re(re({},e),{},{status:me}):e;break;case de:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&a!==ne&&e.status===be&&(e.status=me),e},je=r(115),Ee=r(203),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)}},Re=r(204),Ce=r(83),Se=Object(i.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){}}}),Ae=function(){return Object(i.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,a=Object(i.useReducer)(ye,y),c=s()(a,2),o=c[0],b=c[1],j=Object(i.useReducer)(je.b,{}),E=s()(j,2),w=E[0],P=E[1],k=Object(l.a)(w),_=Object(d.a)(),R=_.addErrorNotice,C=_.removeNotices,S=Object(Ce.b)().setValidationErrors,A=Object(f.a)(),x=A.isSuccessResponse,D=A.isErrorResponse,T=A.isFailResponse,N=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:_e(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:_e(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:_e(P).onAddToCartBeforeProcessing}}),[P]),I=Object(i.useMemo)((function(){return{resetForm:function(){b(L())},submitForm:function(){b(J())},setQuantity:function(e){b(X(e))},setHasError:function(e){b(G(e))},setRequestParams:function(e){b($(e))},setAfterProcessing:function(e){b(z(e)),b(K())}}}),[]);Object(i.useEffect)((function(){var e=o.status,t=!r.id||!p(r);e!==v||t?e!==v&&t&&b(Y()):b(H())}),[o.status,r,b]),Object(i.useEffect)((function(){o.status===g&&(C("error"),Object(Re.a)(k,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&R(t),r&&S(r)})),b(H())):b(U())})))}),[o.status,S,R,C,b,k]),Object(i.useEffect)((function(){if(o.status===O){var e={processingResponse:o.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;R(e.message,t)}};if(o.hasError)return void Object(Re.b)(k,ke,e).then((function(r){if(D(r)||T(r))t(r);else{var n,a=(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");R(a,{id:"add-to-cart"})}b(H())}));Object(Re.b)(k,Pe,e).then((function(e){D(e)||T(e)?(t(e),b(G(!0))):b(H())}))}}),[o.status,o.hasError,o.processingResponse,I,R,D,T,x,k]);var q=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:p(r),productHasOptions:r.has_options||!1,supportsFormElements:q,showFormElements:n&&q,quantity:o.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:o.requestParams,isIdle:o.status===m,isDisabled:o.status===v,isProcessing:o.status===h,isBeforeProcessing:o.status===g,isAfterProcessing:o.status===O,hasError:o.hasError,eventRegistration:N,dispatchActions:I};return React.createElement(Se.Provider,{value:V},t)},De=r(53),Te=r.n(De),Ne=r(99),Ie=r(23),qe=r(277);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=Ae(),t=e.dispatchActions,r=e.product,n=e.quantity,a=e.eventRegistration,c=e.hasError,o=e.isProcessing,l=e.requestParams,f=Object(Ce.b)(),p=f.hasValidationErrors,b=f.showAllValidationErrors,m=Object(d.a)(),v=m.addErrorNotice,h=m.removeNotice,g=Object(Ne.a)().receiveCart,O=Object(i.useState)(!1),y=s()(O,2),j=y[0],E=y[1],w=!c&&o,P=Object(i.useCallback)((function(){return!p||(b(),{type:"error"})}),[p,b]);Object(i.useEffect)((function(){var e=a.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[a,P]);var k=Object(i.useCallback)((function(){E(!0),h("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:n},l);Te()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Te.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?v(Object(Ie.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1),Object(qe.c)()}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,v,h,g,t,n,l]);return Object(i.useEffect)((function(){w&&!j&&k()}),[w,k,j]),null},Qe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(Ce.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Fe,null)))},We=r(84),Be=r(8),Me=r(198),Le=(r(297),r(86)),He=r(129),Ye=r(278),Ue=r(291),Je=function(e){var t=e.className,r=e.href,n=e.text;return React.createElement(Le.a,{className:t,href:r,rel:"nofollow"},n)},Ke=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,a=e.isDisabled,c=e.isDone,o=e.onClick;return React.createElement(Le.a,{className:t,disabled:a,showSpinner:n,onClick:o},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(He.a,{srcElement:Ye.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Ae(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,a=e.product,c=e.productType,o=e.isDisabled,l=e.isProcessing,d=e.eventRegistration,f=e.hasError,p=e.dispatchActions,b=Object(Ue.a)(a.id||0).cartQuantity,m=Object(i.useState)(!1),v=s()(m,2),h=v[0],g=v[1],O=a.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=d.onAddToCartAfterProcessingWithSuccess((function(){return f||g(!0),!0}),0);return function(){e()}}),[d,f]),(t||!n&&"simple"===c)&&r?React.createElement(Ke,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:b,isDisabled:o,isProcessing:l,isDone:h,onClick:function(){return p.submitForm()}}):React.createElement(Je,{className:"wc-block-components-product-add-to-cart-button",href:O.url,text:O.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ge=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)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Ae(),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(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(298),r(48)),et=r.n(Ze),tt=r(202),rt=r(2),nt=r(181),at={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,a=e.value,o=void 0===a?"":a,s=e.onChange,i=void 0===s?function(){}:s,l=e.errorMessage,d=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,f=Object(Ce.b)(),p=f.getValidationError,b=f.setValidationErrors,m=f.clearValidationError,v=t,h=p(v)||{};return Object(rt.useEffect)((function(){o?m(v):b(ee()({},v,{message:d,hidden:!0}))}),[o,v,d,m,b]),Object(rt.useEffect)((function(){return function(){m(v)}}),[v,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Ie.decodeEntities)(t),value:o||"",options:[at].concat(et()(n)),onChange:i,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),React.createElement(nt.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 st(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 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)}))}))},ut=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=st(st({},r),{},ee()({},a,null)),i=c?it(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(Ie.decodeEntities)(r)}:null})).filter(Boolean)}(o.terms,u)})),n};function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ft=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,a=Object(l.a)(t),c=Object(l.a)(r),o=Object(i.useState)(0),u=s()(o,2),d=u[0],f=u[1],p=Object(i.useState)({}),b=s()(p,2),m=b[0],v=b[1],h=Object(i.useMemo)((function(){return ut(a,c,m)}),[m,a,c]);return Object(i.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(a).length?f(function(e,t,r){return it(e,t,r)[0]||0}(a,c,m)):d>0&&f(0)}),[m,d,a,c]),Object(i.useEffect)((function(){n({id:d,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[n,d,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(a).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:h[e],value:m[e],onChange:function(t){v(dt(dt({},m),{},ee()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Be.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(ft,{attributes:n,variationAttributes:a,setRequestParams:r.setRequestParams})},bt=function(){var e=Ae(),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(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(pt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:a,disabled:o,onChange:c.setQuantity}),React.createElement(ze,null))},mt=function(){return React.createElement(ze,null)},vt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},ht=function(){return React.createElement(vt,null)},gt=function(){var e=Ae(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(bt,null):"grouped"===r?React.createElement(ht,null):"external"===r?React.createElement(mt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},Ot=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(We.useProductDataContext)().product,a=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Be.isEmpty)(n)});return React.createElement(Qe,{product:n,showFormElements:r},React.createElement("div",{className:a},React.createElement(gt,null)))})),yt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(yt)(Ot)},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),a=r(22),c=r.n(a),o=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},48:function(e,t,r){var n=r(64),a=r(65),c=r(40),o=r(66);e.exports=function(e){return n(e)||a(e)||c(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},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)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},83:function(e,t,r){"use strict";r.d(t,"b",(function(){return O})),r.d(t,"a",(function(){return y}));var n=r(25),a=r.n(n),c=r(7),o=r.n(c),s=r(13),i=r.n(s),u=r(10),l=r.n(u),d=r(0),f=r(8),p=r(22),b=r.n(p);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 v(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){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e){var t=function(e,t){if("object"!==a()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a()(t)?t:String(t)}var g=Object(d.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}}),O=function(){return Object(d.useContext)(g)},y=function(e){var t=e.children,r=Object(d.useState)({}),n=l()(r,2),a=n[0],c=n[1],s=Object(d.useCallback)((function(e){return a[e]}),[a]),u=Object(d.useCallback)((function(e){var t=a[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[a]),p=Object(d.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(h))}))}),[]),m=Object(d.useCallback)((function(){c({})}),[]),O=Object(d.useCallback)((function(e){e&&c((function(t){return e=Object(f.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!b()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),y=Object(d.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return b()(r[e],n)?r:v(v({},r),{},o()({},e,n))}))}),[]),j={getValidationError:s,setValidationErrors:O,clearValidationError:p,clearAllValidationErrors:m,hideValidationError:Object(d.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(d.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(d.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(a).length>0,getValidationErrorId:u};return React.createElement(g.Provider,{value:j},t)}},86:function(e,t,r){"use strict";var n=r(11),a=r.n(n),c=r(13),o=r.n(c),s=r(73),i=(r(3),r(5)),u=r.n(i);r(155);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))}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var n=r(7),a=r.n(n),c=r(15),o=r(12),s=r(81),i=r(23),u=r(8);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 d(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){a()(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 f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},p=d(d({},f),{},{email:"",phone:""}),b=function(e){return Object(u.mapValues)(e,(function(e){return Object(i.decodeEntities)(e)}))},m={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],billingAddress:p,shippingAddress:f,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(s.a)(),r=t.isEditor,n=t.previewData,a=(null==n?void 0:n.previewCart)||{},i=e.shouldSelect,u=Object(o.useSelect)((function(e,t){var n=t.dispatch;if(!i)return m;if(r)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:[],cartTotals:a.totals,cartIsLoading:!1,cartErrors:[],billingAddress:p,shippingAddress:f,extensions:{},shippingRates:a.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:function(){}};var o=e(c.CART_STORE_KEY),s=o.getCartData(),u=o.getCartErrors(),l=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),v=o.isCustomerDataUpdating(),h=n(c.CART_STORE_KEY).receiveCart,g=b(s.billingAddress),O=s.needsShipping?b(s.shippingAddress):g,y=s.fees.map((function(e){return b(e)}));return{cartCoupons:s.coupons,cartItems:s.items||[],cartFees:y,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors||[],cartTotals:l,cartIsLoading:d,cartErrors:u,billingAddress:g,shippingAddress:O,extensions:s.extensions||{},shippingRates:s.shippingRates||[],shippingRatesLoading:v,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements||[],receiveCart:h}}),[i]);return u}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{118:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(8);function 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 i(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,s=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:s}),i(i({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),i(i({},e),{},c()({},o,f))}}},139:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=function(e,t){return!!e.type&&e.type===t},o={SUCCESS:"success",FAIL:"failure",ERROR:"error"},c={PAYMENTS:"wc/payment-area",EXPRESS_PAYMENTS:"wc/express-payment-area"},a=function(e){return n(e,o.SUCCESS)},s=function(e){return n(e,o.ERROR)},i=function(e){return n(e,o.FAIL)},u=function(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:o,noticeContexts:c,shouldRetry:u,isSuccessResponse:a,isErrorResponse:s,isFailResponse:i}}},156:function(e,t){},157:function(e,t){},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(80),o=(r(3),r(156),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,s=void 0===a?"":a,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},192: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}},206:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(118),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(48),a=r.n(c),s=r(27),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]};function l(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 f(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 f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,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,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw c}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(i.a.mark((function e(t,r,n){var c,a,s,f,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],s=l(c),e.prev=3,s.s();case 5:if((f=s.n()).done){e.next=19;break}return d=f.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:p=e.sent,"object"===o()(p)&&a.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),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var c,a,s,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=l(c),e.prev=2,a.s();case 4:if((s=a.n()).done){e.next=23;break}return f=s.value,e.prev=6,e.next=9,Promise.resolve(f.callback(n));case 9:if(d=e.sent,"object"===o()(d)&&null!==d){e.next=12;break}return e.abrupt("continue",21);case 12:if(d.hasOwnProperty("type")){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",d);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));return function(t,r,n){return e.apply(this,arguments)}}()},281:function(e,t,r){"use strict";var n=r(30),o=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},287:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(192);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},299:function(e,t){},300:function(e,t){},310:function(e,t,r){"use strict";r.r(t);var n=r(287),o=(r(3),r(5)),c=r.n(o),a=r(10),s=r.n(a),i=r(0),u=r(1),l=r(39),f=r(90),d=r(139),p=function(e){return e.is_purchasable||!1},b="pristine",m="idle",v="disabled",O="processing",y="before_processing",h="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},E="set_pristine",j="set_idle",w="set_disabled",P="set_processing",k="set_before_processing",_="set_after_processing",R="set_processing_response",A="set_has_error",C="set_no_error",x="set_quantity",S="set_request_params",D=E,N=j,V=w,T=P,q=k,F=_,I=R,M=A,B=C,L=x,Q=S,W=function(){return{type:D}},H=function(){return{type:N}},K=function(){return{type:V}},J=function(){return{type:T}},U=function(){return{type:q}},z=function(){return{type:F}},G=function(e){return{type:I,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?M:B;return{type:t}},X=function(e){return{type:L,quantity:e}},$=function(e){return{type:Q,data:e}},Z=r(7),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=E,oe=j,ce=w,ae=P,se=k,ie=_,ue=R,le=A,fe=C,de=x,pe=S,be=b,me=m,ve=v,Oe=O,ye=y,he=h,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case ne:e=g;break;case oe:e=t.status!==me?re(re({},t),{},{status:me}):t;break;case ce:e=t.status!==ve?re(re({},t),{},{status:ve}):t;break;case de:e=n!==t.quantity?re(re({},t),{},{quantity:n}):t;break;case pe:e=re(re({},t),{},{requestParams:re(re({},t.requestParams),c)});break;case ue:e=re(re({},t),{},{processingResponse:c});break;case ae:e=!1===(e=t.status!==Oe?re(re({},t),{},{status:Oe,hasError:!1}):t).hasError?e:re(re({},e),{},{hasError:!1});break;case se:e=t.status!==ye?re(re({},t),{},{status:ye,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===Oe||t.status===ye?re(re({},e),{},{status:me}):e;break;case fe:e=t.hasError?re(re({},t),{},{hasError:!1}):t}return e!==t&&o!==ne&&e.status===be&&(e.status=me),e},Ee=r(118),je=r(206),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(je.a)(Pe,e),onAddToCartProcessingWithError:Object(je.a)(ke,e),onAddToCartBeforeProcessing:Object(je.a)(we,e)}},Re=r(207),Ae=r(80),Ce=Object(i.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(i.useContext)(Ce)},Se=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(i.useReducer)(ge,g),c=s()(o,2),a=c[0],b=c[1],E=Object(i.useReducer)(Ee.b,{}),j=s()(E,2),w=j[0],P=j[1],k=Object(l.a)(w),_=Object(f.a)(),R=_.addErrorNotice,A=_.removeNotices,C=Object(Ae.b)().setValidationErrors,x=Object(d.a)(),S=x.isSuccessResponse,D=x.isErrorResponse,N=x.isFailResponse,V=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:_e(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:_e(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:_e(P).onAddToCartBeforeProcessing}}),[P]),T=Object(i.useMemo)((function(){return{resetForm:function(){b(W())},submitForm:function(){b(U())},setQuantity:function(e){b(X(e))},setHasError:function(e){b(Y(e))},setRequestParams:function(e){b($(e))},setAfterProcessing:function(e){b(G(e)),b(z())}}}),[]);Object(i.useEffect)((function(){var e=a.status,t=!r.id||!p(r);e!==v||t?e!==v&&t&&b(K()):b(H())}),[a.status,r,b]),Object(i.useEffect)((function(){a.status===y&&(A("error"),Object(Re.a)(k,we,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&R(t),r&&C(r)})),b(H())):b(J())})))}),[a.status,C,R,A,b,k]),Object(i.useEffect)((function(){if(a.status===h){var e={processingResponse:a.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;R(e.message,t)}};if(a.hasError)return void Object(Re.b)(k,ke,e).then((function(r){if(D(r)||N(r))t(r);else{var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");R(o,{id:"add-to-cart"})}b(H())}));Object(Re.b)(k,Pe,e).then((function(e){D(e)||N(e)?(t(e),b(Y(!0))):b(H())}))}}),[a.status,a.hasError,a.processingResponse,T,R,D,N,S,k]);var q=function(e){return["simple","variable"].includes(e.type||"simple")}(r),F={product:r,productType:r.type||"simple",productIsPurchasable:p(r),productHasOptions:r.has_options||!1,supportsFormElements:q,showFormElements:n&&q,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===m,isDisabled:a.status===v,isProcessing:a.status===O,isBeforeProcessing:a.status===y,isAfterProcessing:a.status===h,hasError:a.hasError,eventRegistration:V,dispatchActions:T};return React.createElement(Ce.Provider,{value:F},t)},De=r(51),Ne=r.n(De),Ve=r(102),Te=r(23),qe=r(280);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 Ie=function(){var e=xe(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,d=Object(Ae.b)(),p=d.hasValidationErrors,b=d.showAllValidationErrors,m=Object(f.a)(),v=m.addErrorNotice,O=m.removeNotice,y=Object(Ve.a)().receiveCart,h=Object(i.useState)(!1),g=s()(h,2),E=g[0],j=g[1],w=!c&&a,P=Object(i.useCallback)((function(){return!p||(b(),{type:"error"})}),[p,b]);Object(i.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var k=Object(i.useCallback)((function(){j(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){ee()(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},l);Ne()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Ne.a.setNonce(e.headers),e.json().then((function(r){e.ok?y(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1),Object(qe.c)()}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&y(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,O,y,t,n,l]);return Object(i.useEffect)((function(){w&&!E&&k()}),[w,k,E]),null},Me=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(Ae.a,null,React.createElement(Se,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(81),Le=r(8),Qe=r(201),We=(r(299),r(86)),He=r(131),Ke=r(281),Je=r(304),Ue=function(e){var t=e.className,r=e.href,n=e.text;return React.createElement(We.a,{className:t,href:r,rel:"nofollow"},n)},ze=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(We.a,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(He.a,{srcElement:Ke.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=xe(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,p=e.dispatchActions,b=Object(Je.a)(o.id||0).cartQuantity,m=Object(i.useState)(!1),v=s()(m,2),O=v[0],y=v[1],h=o.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||y(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:b,isDisabled:a,isProcessing:l,isDone:O,onClick:function(){return p.submitForm()}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(u.__)("View Product","woo-gutenberg-products-block")})},Ye=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ye,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(Ge,null))},Ze=(r(300),r(47)),et=r.n(Ze),tt=r(204),rt=r(2),nt=r(184),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,s=e.onChange,i=void 0===s?function(){}:s,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(Ae.b)(),p=d.getValidationError,b=d.setValidationErrors,m=d.clearValidationError,v=t,O=p(v)||{};return Object(rt.useEffect)((function(){a?m(v):b(ee()({},v,{message:f,hidden:!0}))}),[a,v,f,m,b]),Object(rt.useEffect)((function(){return function(){m(v)}}),[v,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:i,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:v,elementId:v}))};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 st(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){ee()(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 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 o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],s=st(st({},r),{},ee()({},o,null)),i=c?it(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){ee()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(i.useState)(0),u=s()(a,2),f=u[0],d=u[1],p=Object(i.useState)({}),b=s()(p,2),m=b[0],v=b[1],O=Object(i.useMemo)((function(){return ut(o,c,m)}),[m,o,c]);return Object(i.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return it(e,t,r)[0]||0}(o,c,m)):f>0&&d(0)}),[m,f,o,c]),Object(i.useEffect)((function(){n({id:f,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[n,f,m]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:m[e],onChange:function(t){v(ft(ft({},m),{},ee()({},e,t)))}})})))},pt=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),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},bt=function(){var e=xe(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(pt,{product:t,dispatchers:c}),React.createElement(Ye,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(Ge,null))},mt=function(){return React.createElement(Ge,null)},vt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(vt,null)},yt=function(){var e=xe(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(bt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(mt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(Ge,null)},ht=Object(Qe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Le.isEmpty)(n)});return React.createElement(Me,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(yt,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(ht)},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},47:function(e,t,r){var n=r(96),o=r(97),c=r(61),a=r(98);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},48:function(e,t){function r(e,t,r,n,o,c,a){try{var s=e[c](a),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var a=e.apply(t,n);function s(e){r(a,o,c,s,i,"next",e)}function i(e){r(a,o,c,s,i,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},80:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),s=r(14),i=r.n(s),u=r(10),l=r.n(u),f=r(0),d=r(8),p=r(22),b=r.n(p);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 v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var y=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(f.useContext)(y)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],s=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),p=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(O))}))}),[]),m=Object(f.useCallback)((function(){c({})}),[]),h=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!b()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return b()(r[e],n)?r:v(v({},r),{},a()({},e,n))}))}),[]),E={getValidationError:s,setValidationErrors:h,clearValidationError:p,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(y.Provider,{value:E},t)}},86:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(14),a=r.n(c),s=r(70),i=(r(3),r(5)),u=r.n(i);r(157);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,c=e.children,i=a()(e,["className","showSpinner","children"]),l=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,o()({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))}},96:function(e,t,r){var n=r(62);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},97:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},98:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}}]);
build/atomic-block-components/add-to-cart.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{143:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(5),c=r.n(n),o=r(7);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}},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));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(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:c,noticeContexts:o,shouldRetry:u,isSuccessResponse:a,isErrorResponse:s,isFailResponse:i}}},219:function(e,t){},220:function(e,t){},282:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(88),o=(r(2),r(220),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))})},383:function(e,t){},388:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(143),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))}}}},389:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(45),c=r.n(n),o=r(27),a=r.n(o),s=r(13),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=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),a=[],s=u(o),e.prev=3,s.s();case 5:if((l=s.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"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=b(t,r),a=u(o),e.prev=2,a.s();case 4:if((s=a.n()).done){e.next=23;break}return l=s.value,e.prev=6,e.next=9,Promise.resolve(l.callback(n));case 9:if(f=e.sent,"object"===c()(f)){e.next=12;break}return e.abrupt("continue",21);case 12:if(void 0!==f.type){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",f);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));return function(t,r,n){return e.apply(this,arguments)}}()},390:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},391:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(18),s=r.n(a),i=r(1),u=r(53),l=r(134),b=r(207),f=r(915),d="pristine",p="idle",O="disabled",m="processing",v="before_processing",j="after_processing",h={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",g="set_idle",E="set_disabled",w="set_processing",P="set_before_processing",k="set_after_processing",_="set_processing_response",C="set_has_error",A="set_no_error",S="set_quantity",x="set_request_params",D=y,q=g,N=E,R=w,T=P,V=k,F=_,I=C,B=A,Q=S,M=x,W=function(){return{type:D}},H=function(){return{type:q}},L=function(){return{type:N}},U=function(){return{type:R}},z=function(){return{type:T}},G=function(){return{type:V}},J=function(e){return{type:F,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:B;return{type:t}},X=function(e){return{type:Q,quantity:e}},$=function(e){return{type:M,data:e}},K=r(5),Z=r.n(K);function ee(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 te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re=y,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,ve=v,je=j,he=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case re:e=h;break;case ne:e=t.status!==pe?te(te({},t),{},{status:pe}):t;break;case ce:e=t.status!==Oe?te(te({},t),{},{status:Oe}):t;break;case be:e=n!==t.quantity?te(te({},t),{},{quantity:n}):t;break;case fe:e=te(te({},t),{},{requestParams:te(te({},t.requestParams),o)});break;case ie:e=te(te({},t),{},{processingResponse:o});break;case oe:e=!1===(e=t.status!==me?te(te({},t),{},{status:me,hasError:!1}):t).hasError?e:te(te({},e),{},{hasError:!1});break;case ae:e=t.status!==ve?te(te({},t),{},{status:ve,hasError:!1}):t;break;case se:e=t.status!==je?te(te({},t),{},{status:je}):t;break;case ue:e=t.hasError?t:te(te({},t),{},{hasError:!0}),e=t.status===me||t.status===ve?te(te({},e),{},{status:pe}):e;break;case le:e=t.hasError?te(te({},t),{},{hasError:!1}):t}return e!==t&&c!==re&&e.status===de&&(e.status=pe),e},ye=r(143),ge=r(388),Ee="add_to_cart_before_processing",we="add_to_cart_after_processing_with_success",Pe="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(we,e),onAddToCartProcessingWithError:Object(ge.a)(Pe,e),onAddToCartBeforeProcessing:Object(ge.a)(Ee,e)}},_e=r(389),Ce=r(88),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)(he,h),a=s()(o,2),d=a[0],y=a[1],g=Object(n.useReducer)(ye.b,{}),E=s()(g,2),w=E[0],P=E[1],k=Object(u.a)(w),_=Object(l.a)(),C=_.addErrorNotice,A=_.removeNotices,S=Object(Ce.b)().setValidationErrors,x=Object(b.a)(),D=x.isSuccessResponse,q=x.isErrorResponse,N=x.isFailResponse,R=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(P).onAddToCartBeforeProcessing}}),[P]),T=Object(n.useMemo)((function(){return{resetForm:function(){y(W())},submitForm:function(){y(z())},setQuantity:function(e){y(X(e))},setHasError:function(e){y(Y(e))},setRequestParams:function(e){y($(e))},setAfterProcessing:function(e){y(J(e)),y(G())}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(f.a)(r);e!==O||t?e!==O&&t&&y(L()):y(H())}),[d.status,r,y]),Object(n.useEffect)((function(){d.status===v&&(A("error"),Object(_e.a)(k,Ee,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&C(t),r&&S(r)})),y(H())):y(U())})))}),[d.status,S,C,A,y,k]),Object(n.useEffect)((function(){if(d.status===j){var e={processingResponse:d.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;C(e.message,t)}};if(d.hasError)return void Object(_e.b)(k,Pe,e).then((function(r){if(q(r)||N(r))t(r);else{var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");C(c,{id:"add-to-cart"})}y(H())}));Object(_e.b)(k,we,e).then((function(e){q(e)||N(e)?(t(e),y(Y(!0))):y(H())}))}}),[d.status,d.hasError,d.processingResponse,T,C,q,N,D,k]);var V=Object(f.b)(r),F={product:r,productType:r.type||"simple",productIsPurchasable:Object(f.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:V,showFormElements:c&&V,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:d.status===p,isDisabled:d.status===O,isProcessing:d.status===m,isBeforeProcessing:d.status===v,isAfterProcessing:d.status===j,hasError:d.hasError,eventRegistration:R,dispatchActions:T};return Object(n.createElement)(Ae.Provider,{value:F},t)},De=r(19),qe=r.n(De),Ne=r(145),Re=r(28),Te=r(528);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,a=e.hasError,u=e.isProcessing,b=e.requestParams,f=Object(Ce.b)(),d=f.hasValidationErrors,p=f.showAllValidationErrors,O=Object(l.a)(),m=O.addErrorNotice,v=O.removeNotice,j=Object(Ne.a)().receiveCart,h=Object(n.useState)(!1),y=s()(h,2),g=y[0],E=y[1],w=!a&&u,P=Object(n.useCallback)((function(){return!d||(p(),{type:"error"})}),[d,p]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var k=Object(n.useCallback)((function(){E(!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){Z()(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},b);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?j(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(i.__)("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&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,m,v,j,t,c,b]);return Object(n.useEffect)((function(){w&&!g&&k()}),[w,k,g]),null},Ie=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ce.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Fe,null)))},Be=r(39),Qe=r(7),Me=r(66),We=(r(383),r(94)),He=r(55),Le=r(555),Ue=r(836),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)},Ge=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(i.sprintf)(Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:Le.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},Je=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=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=s()(O,2),v=m[0],j=m[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||j(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Ge,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:u,isProcessing:l,isDone:v,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(i.__)("View Product","woo-gutenberg-products-block")})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(i.__)("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(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Je,null))},Ke=(r(554),r(30)),Ze=r.n(Ke),et=r(4),tt=r(9),rt=r(282),nt={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ce.b)(),p=d.getValidationError,O=d.setValidationErrors,m=d.clearValidationError,v=t,j=p(v)||{};return Object(tt.useEffect)((function(){s?m(v):O(Z()({},v,{message:f,hidden:!0}))}),[s,v,f,m,O]),Object(tt.useEffect)((function(){return function(){m(v)}}),[v,m]),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:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName: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){Z()(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),{},Z()({},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){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),p=s()(d,2),O=p[0],m=p[1],v=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:v[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},Z()({},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(i.__)("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)(Ye,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Je,null))},pt=function(){return Object(n.createElement)(Je,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)},vt=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)(Je,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)(vt,null)))}))},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(33),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},554:function(e,t){},555:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},88:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(45),c=r.n(n),o=r(5),a=r.n(o),s=r(24),i=r.n(s),u=r(18),l=r.n(u),b=r(0),f=r(7),d=r(33),p=r.n(d);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 m(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}function v(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},y=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(v))}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),y=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),g={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:g},t)}},915: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")}},934:function(e,t,r){"use strict";r.r(t);var n=r(931),c=r(391),o=r(390);t.default=Object(n.a)(o.a)(c.a)},94:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(24),a=r.n(o),s=r(0),i=r(214),u=(r(2),r(8)),l=r.n(u);r(219);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],{144:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(8);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 i(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));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(e){return void 0===e.retry||!0===e.retry},l=function(){return{responseTypes:c,noticeContexts:o,shouldRetry:u,isSuccessResponse:a,isErrorResponse:s,isFailResponse:i}}},217:function(e,t){},218:function(e,t){},282:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(90),o=(r(2),r(218),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))})},379:function(e,t){},384:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(144),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))}}}},385:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},386:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(14),s=r.n(a),i=r(1),u=r(53),l=r(134),b=r(207),f=r(918),d="pristine",p="idle",O="disabled",m="processing",v="before_processing",j="after_processing",h={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",g="set_idle",E="set_disabled",w="set_processing",P="set_before_processing",k="set_after_processing",_="set_processing_response",A="set_has_error",C="set_no_error",S="set_quantity",D="set_request_params",x=y,N=g,V=E,T=w,R=P,q=k,F=_,B=A,I=C,L=S,M=D,Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:V}},K=function(){return{type:T}},U=function(){return{type:R}},z=function(){return{type:q}},G=function(e){return{type:F,data:e}},J=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?B:I;return{type:t}},Y=function(e){return{type:L,quantity:e}},X=function(e){return{type:M,data:e}},$=r(5),Z=r.n($);function ee(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 te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re=y,ne=g,ce=E,oe=w,ae=P,se=k,ie=_,ue=A,le=C,be=S,fe=D,de=d,pe=p,Oe=O,me=m,ve=v,je=j,he=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case re:e=h;break;case ne:e=t.status!==pe?te(te({},t),{},{status:pe}):t;break;case ce:e=t.status!==Oe?te(te({},t),{},{status:Oe}):t;break;case be:e=n!==t.quantity?te(te({},t),{},{quantity:n}):t;break;case fe:e=te(te({},t),{},{requestParams:te(te({},t.requestParams),o)});break;case ie:e=te(te({},t),{},{processingResponse:o});break;case oe:e=!1===(e=t.status!==me?te(te({},t),{},{status:me,hasError:!1}):t).hasError?e:te(te({},e),{},{hasError:!1});break;case ae:e=t.status!==ve?te(te({},t),{},{status:ve,hasError:!1}):t;break;case se:e=t.status!==je?te(te({},t),{},{status:je}):t;break;case ue:e=t.hasError?t:te(te({},t),{},{hasError:!0}),e=t.status===me||t.status===ve?te(te({},e),{},{status:pe}):e;break;case le:e=t.hasError?te(te({},t),{},{hasError:!1}):t}return e!==t&&c!==re&&e.status===de&&(e.status=pe),e},ye=r(144),ge=r(384),Ee="add_to_cart_before_processing",we="add_to_cart_after_processing_with_success",Pe="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(we,e),onAddToCartProcessingWithError:Object(ge.a)(Pe,e),onAddToCartBeforeProcessing:Object(ge.a)(Ee,e)}},_e=r(388),Ae=r(90),Ce=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)(Ce)},De=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(he,h),a=s()(o,2),d=a[0],y=a[1],g=Object(n.useReducer)(ye.b,{}),E=s()(g,2),w=E[0],P=E[1],k=Object(u.a)(w),_=Object(l.a)(),A=_.addErrorNotice,C=_.removeNotices,S=Object(Ae.b)().setValidationErrors,D=Object(b.a)(),x=D.isSuccessResponse,N=D.isErrorResponse,V=D.isFailResponse,T=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(P).onAddToCartBeforeProcessing}}),[P]),R=Object(n.useMemo)((function(){return{resetForm:function(){y(Q())},submitForm:function(){y(U())},setQuantity:function(e){y(Y(e))},setHasError:function(e){y(J(e))},setRequestParams:function(e){y(X(e))},setAfterProcessing:function(e){y(G(e)),y(z())}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(f.a)(r);e!==O||t?e!==O&&t&&y(H()):y(W())}),[d.status,r,y]),Object(n.useEffect)((function(){d.status===v&&(C("error"),Object(_e.a)(k,Ee,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&S(r)})),y(W())):y(K())})))}),[d.status,S,A,C,y,k]),Object(n.useEffect)((function(){if(d.status===j){var e={processingResponse:d.processingResponse},t=function(e){if(e.message){var t=e.messageContext?{context:e.messageContext}:void 0;A(e.message,t)}};if(d.hasError)return void Object(_e.b)(k,Pe,e).then((function(r){if(N(r)||V(r))t(r);else{var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(c,{id:"add-to-cart"})}y(W())}));Object(_e.b)(k,we,e).then((function(e){N(e)||V(e)?(t(e),y(J(!0))):y(W())}))}}),[d.status,d.hasError,d.processingResponse,R,A,N,V,x,k]);var q=Object(f.b)(r),F={product:r,productType:r.type||"simple",productIsPurchasable:Object(f.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:q,showFormElements:c&&q,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:d.status===p,isDisabled:d.status===O,isProcessing:d.status===m,isBeforeProcessing:d.status===v,isAfterProcessing:d.status===j,hasError:d.hasError,eventRegistration:T,dispatchActions:R};return Object(n.createElement)(Ce.Provider,{value:F},t)},xe=r(19),Ne=r.n(xe),Ve=r(145),Te=r(28),Re=r(528);function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Fe=function(){var e=Se(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,b=e.requestParams,f=Object(Ae.b)(),d=f.hasValidationErrors,p=f.showAllValidationErrors,O=Object(l.a)(),m=O.addErrorNotice,v=O.removeNotice,j=Object(Ve.a)().receiveCart,h=Object(n.useState)(!1),y=s()(h,2),g=y[0],E=y[1],w=!a&&u,P=Object(n.useCallback)((function(){return!d||(p(),{type:"error"})}),[d,p]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var k=Object(n.useCallback)((function(){E(!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?qe(Object(r),!0).forEach((function(t){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},b);Ne()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Ne.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?m(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(i.__)("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(Re.c)()}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,m,v,j,t,c,b]);return Object(n.useEffect)((function(){w&&!g&&k()}),[w,k,g]),null},Be=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ae.a,null,Object(n.createElement)(De,{product:r,showFormElements:c},t,Object(n.createElement)(Fe,null)))},Ie=r(39),Le=r(8),Me=r(66),Qe=(r(379),r(95)),We=r(55),He=r(554),Ke=r(839),Ue=function(e){var t=e.className,r=e.href,c=e.text;return Object(n.createElement)(Qe.a,{className:t,href:r,rel:"nofollow"},c)},ze=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)(Qe.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(We.a,{srcElement:He.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(Ke.a)(o.id||0).cartQuantity,O=Object(n.useState)(!1),m=s()(O,2),v=m[0],j=m[1],h=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||j(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){return d.submitForm()}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(i.__)("View Product","woo-gutenberg-products-block")})},Je=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)}})},Ye=function(e){var t=e.reason,r=void 0===t?Object(i.__)("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)},Xe=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)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},$e=(r(553),r(30)),Ze=r.n($e),et=r(4),tt=r(9),rt=r(282),nt={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ae.b)(),p=d.getValidationError,O=d.setValidationErrors,m=d.clearValidationError,v=t,j=p(v)||{};return Object(tt.useEffect)((function(){s?m(v):O(Z()({},v,{message:f,hidden:!0}))}),[s,v,f,m,O]),Object(tt.useEffect)((function(){return function(){m(v)}}),[v,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Te.decodeEntities)(t),value:s||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName: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){Z()(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),{},Z()({},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(Te.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){Z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),p=s()(d,2),O=p[0],m=p[1],v=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:v[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},Z()({},e,t)))}})})))},ft=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Le.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)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("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)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},pt=function(){return Object(n.createElement)(Ge,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)},vt=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)(Xe,null):null:Object(n.createElement)(Ge,null)};t.a=Object(Me.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ie.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Le.isEmpty)(c)});return Object(n.createElement)(Be,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(vt,null)))}))},388:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(41),c=r.n(n),o=r(27),a=r.n(o),s=r(13),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]};function l(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 b(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 b(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 b(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 f=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,b,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=l(o),e.prev=3,s.s();case 5:if((b=s.n()).done){e.next=19;break}return f=b.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,b,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=l(o),e.prev=2,a.s();case 4:if((s=a.n()).done){e.next=23;break}return b=s.value,e.prev=6,e.next=9,Promise.resolve(b.callback(n));case 9:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=12;break}return e.abrupt("continue",21);case 12:if(f.hasOwnProperty("type")){e.next=14;break}throw new Error("If you want to abort event emitter processing, your observer must return an object with a type property");case 14:return e.abrupt("return",f);case 17:return e.prev=17,e.t0=e.catch(6),console.error(e.t0),e.abrupt("return",{type:"error"});case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}}),e,null,[[2,25,28,31],[6,17]])})));return function(t,r,n){return e.apply(this,arguments)}}()},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(33),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},553:function(e,t){},554:function(e,t,r){"use strict";var n=r(0),c=r(31),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},90:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(41),c=r.n(n),o=r(5),a=r.n(o),s=r(24),i=r.n(s),u=r(14),l=r.n(u),b=r(0),f=r(8),d=r(33),p=r.n(d);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 m(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}function v(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},y=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(v))}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),y=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),g={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.k